2 * Copyright (c) 2001-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/sig/uni.h,v 1.5 2004/07/08 08:22:24 brandt Exp $
31 * Public UNI interface
33 #ifndef _NETNATM_SIG_UNI_H_
34 #define _NETNATM_SIG_UNI_H_
36 #include <netnatm/sig/unidef.h>
40 /* functions to be supplied by the user */
42 /* output to the upper layer */
43 void (*uni_output)(struct uni *, void *, enum uni_sig,
44 uint32_t, struct uni_msg *);
46 /* output to the SAAL */
47 void (*saal_output)(struct uni *, void *, enum saal_sig,
51 void (*verbose)(struct uni *, void *, enum uni_verb,
52 const char *, ...) __printflike(4, 5);
54 /* function to 'print' status */
55 void (*status)(struct uni *, void *, void *,
56 const char *, ...) __printflike(4, 5);
60 void *(*start_timer)(struct uni *, void *, u_int,
61 void (*)(void *), void *);
64 void (*stop_timer)(struct uni *, void *, void *);
68 /* create a UNI instance */
69 struct uni *uni_create(void *, const struct uni_funcs *);
71 /* destroy a UNI instance, free all resources */
72 void uni_destroy(struct uni *);
74 /* generate a status report */
75 void uni_status(struct uni *, void *);
77 /* get current instance configuration */
78 void uni_get_config(const struct uni *, struct uni_config *);
80 /* set new instance configuration */
81 void uni_set_config(struct uni *, const struct uni_config *,
82 uint32_t *, uint32_t *, uint32_t *);
84 /* input from the SAAL to the instance */
85 void uni_saal_input(struct uni *, enum saal_sig, struct uni_msg *);
87 /* input from the upper layer to the instance */
88 void uni_uni_input(struct uni *, enum uni_sig, uint32_t, struct uni_msg *);
90 /* do work on pending signals */
91 void uni_work(struct uni *);
93 /* set debuging level */
94 void uni_set_debug(struct uni *, enum uni_verb, u_int level);
95 u_int uni_get_debug(const struct uni *, enum uni_verb);
97 /* reset a UNI instance */
98 void uni_reset(struct uni *);
101 u_int uni_getcustate(const struct uni *);
103 /* return a reference to the coding/decoding context */
104 struct unicx *uni_context(struct uni *);