2 * Copyright (c) 2003-2004
6 * Author: Harti Brandt <harti@freebsd.org>
8 * Redistribution of this software and documentation and use in source and
9 * binary forms, with or without modification, are permitted provided that
10 * the following conditions are met:
12 * 1. Redistributions of source code or documentation must retain the above
13 * copyright notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
18 * THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE AUTHOR
19 * AND ITS CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
20 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
21 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
22 * THE AUTHOR OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
25 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
26 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
28 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 * $Begemot: libunimsg/netnatm/api/ccatm.h,v 1.1 2004/07/08 08:21:58 brandt Exp $
32 * ATM API as defined per af-saa-0108
34 * Interface to the supporting code.
46 /* send signal to API user */
47 void (*send_user)(struct ccuser *, void *, u_int, void *, size_t);
49 /* respond API user */
50 void (*respond_user)(struct ccuser *, void *, int, u_int,
53 /* send signal to uni for connection */
54 void (*send_uni)(struct ccconn *, void *, u_int, u_int,
57 /* send global signal to uni */
58 void (*send_uni_glob)(struct ccport *, void *, u_int, u_int,
62 void (*log)(const char *, ...);
66 CCLOG_USER_STATE = 0x00000001,
67 CCLOG_USER_INST = 0x00000002,
68 CCLOG_USER_SIG = 0x00000004,
69 CCLOG_CONN_STATE = 0x00000010,
70 CCLOG_CONN_INST = 0x00000020,
71 CCLOG_CONN_SIG = 0x00000040,
72 CCLOG_PARTY_STATE = 0x00000100,
73 CCLOG_PARTY_INST = 0x00000200,
74 CCLOG_PARTY_SIG = 0x00000400,
75 CCLOG_SIGS = 0x00001000,
78 /* instance handling */
79 struct ccdata *cc_create(const struct cc_funcs *);
80 void cc_destroy(struct ccdata *);
81 void cc_reset(struct ccdata *);
83 /* input a response from the UNI layer to CC */
84 int cc_uni_response(struct ccport *, u_int cookie, u_int reason, u_int state);
86 /* Signal from UNI on this port */
87 int cc_uni_signal(struct ccport *, u_int cookie, u_int sig, struct uni_msg *);
89 /* retrieve addresses */
90 int cc_get_addrs(struct ccdata *, u_int, struct uni_addr **, u_int **, u_int *);
93 typedef int (*cc_dump_f)(struct ccdata *, void *, const char *);
94 int cc_dump(struct ccdata *, size_t, cc_dump_f, void *);
97 int cc_port_stop(struct ccdata *, u_int);
98 int cc_port_start(struct ccdata *, u_int);
100 /* is port running? */
101 int cc_port_isrunning(struct ccdata *, u_int, int *);
103 /* return port number */
104 u_int cc_port_no(struct ccport *);
106 /* Clear address and prefix information from the named port. */
107 int cc_port_clear(struct ccdata *, u_int);
109 /* Address registered. */
110 int cc_addr_register(struct ccdata *, u_int, const struct uni_addr *);
112 /* Address unregistered. */
113 int cc_addr_unregister(struct ccdata *, u_int, const struct uni_addr *);
116 int cc_port_get_param(struct ccdata *, u_int, struct atm_port_info *);
119 int cc_port_set_param(struct ccdata *, const struct atm_port_info *);
122 int cc_port_getlist(struct ccdata *, u_int *, u_int **);
125 struct ccport *cc_port_create(struct ccdata *, void *, u_int);
128 void cc_port_destroy(struct ccport *, int);
130 /* New endpoint created */
131 struct ccuser *cc_user_create(struct ccdata *, void *, const char *);
133 /* destroy user endpoint */
134 void cc_user_destroy(struct ccuser *);
136 /* signal from user */
137 int cc_user_signal(struct ccuser *, u_int, struct uni_msg *);
139 /* Management is given up on this node. */
140 void cc_unmanage(struct ccdata *);
142 /* handle all queued signals */
143 void cc_work(struct ccdata *);
145 /* set/get logging flags */
146 void cc_set_log(struct ccdata *, u_int);
147 u_int cc_get_log(const struct ccdata *);
149 /* get extended status */
150 int cc_get_extended_status(const struct ccdata *, struct atm_exstatus *,
151 struct atm_exstatus_ep **, struct atm_exstatus_port **,
152 struct atm_exstatus_conn **, struct atm_exstatus_party **);