2 * Copyright (c) 1996-2003
3 * Fraunhofer Institute for Open Communication Systems (FhG Fokus).
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * Author: Hartmut Brandt <harti@freebsd.org>
29 * $Begemot: libunimsg/netnatm/saal/sscop.h,v 1.4 2004/07/08 08:22:16 brandt Exp $
31 * External interface to sscop.
33 #ifndef _NETNATM_SAAL_SSCOP_H_
34 #define _NETNATM_SAAL_SSCOP_H_
36 #include <netnatm/saal/sscopdef.h>
39 * Define how a buffer looks like.
43 #define SSCOP_MBUF_T mbuf
46 #define SSCOP_MBUF_T uni_msg
53 * Vector for user functions
56 /* management signal from SSCOP */
57 void (*send_manage)(struct sscop *, void *, enum sscop_maasig,
58 struct SSCOP_MBUF_T *, u_int, u_int);
60 /* AAL signal from SSCOP */
61 void (*send_upper)(struct sscop *, void *, enum sscop_aasig,
62 struct SSCOP_MBUF_T *, u_int);
64 /* send a PDU to the wire */
65 void (*send_lower)(struct sscop *, void *,
66 struct SSCOP_MBUF_T *);
69 void (*verbose)(struct sscop *, void *, const char *, ...)
74 void *(*start_timer)(struct sscop *, void *, u_int,
78 void (*stop_timer)(struct sscop *, void *, void *);
82 /* Function defined by the SSCOP code */
84 /* create a new SSCOP instance and initialize to default values */
85 struct sscop *sscop_create(void *, const struct sscop_funcs *);
87 /* destroy an SSCOP instance */
88 void sscop_destroy(struct sscop *);
90 /* get the current parameters of an SSCOP */
91 void sscop_getparam(const struct sscop *, struct sscop_param *);
93 /* set new parameters in an SSCOP */
94 int sscop_setparam(struct sscop *, struct sscop_param *, u_int *);
96 /* deliver an signal to the SSCOP */
97 int sscop_aasig(struct sscop *, enum sscop_aasig, struct SSCOP_MBUF_T *, u_int);
99 /* deliver an management signal to the SSCOP */
100 int sscop_maasig(struct sscop *, enum sscop_maasig, struct SSCOP_MBUF_T *);
102 /* SSCOP input function */
103 void sscop_input(struct sscop *, struct SSCOP_MBUF_T *);
105 /* Move the window by a given number of messages. Return the new window */
106 u_int sscop_window(struct sscop *, u_int);
108 /* declare the lower layer busy or not busy */
109 u_int sscop_setbusy(struct sscop *, int);
111 /* retrieve the state */
112 enum sscop_state sscop_getstate(const struct sscop *);
114 /* map signals to strings */
115 const char *sscop_msigname(enum sscop_maasig);
116 const char *sscop_signame(enum sscop_aasig);
117 const char *sscop_statename(enum sscop_state);
119 /* set/get debugging state */
120 void sscop_setdebug(struct sscop *, u_int);
121 u_int sscop_getdebug(const struct sscop *);
123 /* reset the instance */
124 void sscop_reset(struct sscop *);