2 * Copyright (c) 2003-2004
6 * Copyright (c) 2001-2002
7 * Fraunhofer Institute for Open Communication Systems (FhG Fokus).
10 * Author: Harti Brandt <harti@freebsd.org>
12 * Redistribution of this software and documentation and use in source and
13 * binary forms, with or without modification, are permitted provided that
14 * the following conditions are met:
16 * 1. Redistributions of source code or documentation must retain the above
17 * copyright notice, this list of conditions and the following disclaimer.
18 * 2. Redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in the
20 * documentation and/or other materials provided with the distribution.
22 * THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE AUTHORS
23 * AND ITS CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
24 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
25 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
26 * THE AUTHORS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
29 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
30 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
32 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 * $Begemot: libunimsg/netnatm/api/atmapi.h,v 1.1 2004/07/08 08:21:48 brandt Exp $
36 * ATM API as defined per af-saa-0108
38 #ifndef _NETNATM_API_ATMAPI_H_
39 #define _NETNATM_API_ATMAPI_H_
41 #include <sys/types.h>
43 /* size of an endpointlen including trailing \0 */
44 #define ATM_EPNAMSIZ 65
47 ATM_A0, /* non existent */
49 ATM_A2, /* outgoing call preparation */
50 ATM_A3, /* outgoing call requested */
51 ATM_A4, /* incoming call preparation */
52 ATM_A5, /* wait incoming call */
53 ATM_A6, /* incoming call present */
54 ATM_A7, /* incoming call requested */
55 ATM_A8, /* p2p data transfer */
56 ATM_A9, /* p2mp root data transfer */
57 ATM_A10, /* p2mp leaf data transfer */
58 ATM_A11, /* terminated */
63 ATMOP_ABORT_CONNECTION,
64 ATMOP_ACCEPT_INCOMING_CALL,
66 ATMOP_ADD_PARTY_REJECT,
67 ATMOP_ADD_PARTY_SUCCESS, /* 5 */
68 ATMOP_ARRIVAL_OF_INCOMING_CALL,
70 ATMOP_CONNECT_OUTGOING_CALL,
72 ATMOP_GET_LOCAL_PORT_INFO, /* 10 */
73 ATMOP_P2MP_CALL_ACTIVE,
74 ATMOP_P2P_CALL_ACTIVE,
75 ATMOP_PREPARE_INCOMING_CALL,
76 ATMOP_PREPARE_OUTGOING_CALL,
77 ATMOP_QUERY_CONNECTION_ATTRIBUTES, /* 15 */
78 ATMOP_REJECT_INCOMING_CALL,
79 ATMOP_SET_CONNECTION_ATTRIBUTES,
80 ATMOP_WAIT_ON_INCOMING_CALL,
81 ATMOP_SET_CONNECTION_ATTRIBUTES_X,
82 ATMOP_QUERY_CONNECTION_ATTRIBUTES_X, /* 20 */
86 #define ATM_DEFINE_ERRORS \
87 DEF(ATMERR_OK, 0, "OK") \
88 DEF(ATMERR_SYS, -1, "syscall error") \
89 DEF(ATMERR_BAD_OP, -2, "bad operation") \
90 DEF(ATMERR_BAD_ARGS, -3, "bad arguments for operation") \
91 DEF(ATMERR_BAD_STATE, -4, "operation in bad state") \
92 DEF(ATMERR_BAD_ATTR, -5, "unknown attribute") \
93 DEF(ATMERR_BAD_VALUE, -6, "bad attribute value") \
94 DEF(ATMERR_BUSY, -7, "busy") \
95 DEF(ATMERR_RDONLY, -8, "read-only attribute") \
96 DEF(ATMERR_BAD_SAP, -9, "bad SAP") \
97 DEF(ATMERR_OVERLAP, -10,"overlaping SAP") \
98 DEF(ATMERR_BAD_ENDPOINT, -11,"bad ATM endpoint") \
99 DEF(ATMERR_PREVIOUSLY_ABORTED,-12,"previously aborted") \
100 DEF(ATMERR_NO_CALL, -13,"no incoming call") \
101 DEF(ATMERR_BAD_LEAF_IDENT, -14,"bad leaf identifier") \
102 DEF(ATMERR_BAD_PORT, -15,"unknown port") \
103 DEF(ATMERR_BAD_SIGNAL, -29-UNIAPI_ERROR_BAD_SIGNAL, "bad signal")\
104 DEF(ATMERR_BADCU, -29-UNIAPI_ERROR_BADCU, "bad coordinator state")\
105 DEF(ATMERR_BAD_CALLSTATE, -29-UNIAPI_ERROR_BAD_CALLSTATE, "bad call state")\
106 DEF(ATMERR_BAD_EPSTATE, -29-UNIAPI_ERROR_BAD_EPSTATE, "bad party state")\
107 DEF(ATMERR_BAD_UNIARG, -29-UNIAPI_ERROR_BAD_ARG, "bad uni argument")\
108 DEF(ATMERR_BAD_CALL, -29-UNIAPI_ERROR_BAD_CALL, "unknown call")\
109 DEF(ATMERR_BAD_PARTY, -29-UNIAPI_ERROR_BAD_PARTY, "unknown party")\
110 DEF(ATMERR_BAD_CTYPE, -29-UNIAPI_ERROR_BAD_CTYPE, "wrong call type")\
111 DEF(ATMERR_BAD_IE, -29-UNIAPI_ERROR_BAD_IE, "bad information element")\
112 DEF(ATMERR_EPREF_INUSE, -29-UNIAPI_ERROR_EPREF_INUSE, "endpoint reference in use")\
113 DEF(ATMERR_MISSING_IE, -29-UNIAPI_ERROR_MISSING_IE, "missing information element")\
114 DEF(ATMERR_ENCODING, -29-UNIAPI_ERROR_ENCODING, "encoding error")\
115 DEF(ATMERR_NOMEM, -29-UNIAPI_ERROR_NOMEM, "no memory")\
116 DEF(ATMERR_UNIBUSY, -29-UNIAPI_ERROR_BUSY, "uni process busy")
118 #define ATM_MKUNIERR(E) (-29 - (E))
121 #define DEF(NAME,VAL,STR) NAME = (VAL),
128 ATM_ATTR_BLLI_SELECTOR,
151 uint32_t data; /* type of attached data */
154 ATMRESP_NONE, /* no data */
155 ATMRESP_ATTRS, /* attribute(s) */
156 ATMRESP_PORTS, /* port info */
157 ATMRESP_STATE, /* endpoint state */
158 ATMRESP_EXSTAT, /* extended status */
161 struct atm_abort_connection {
162 struct uni_ie_cause cause;
165 struct atm_query_connection_attributes {
168 struct atm_set_connection_attributes {
171 struct atm_query_connection_attributes_x {
173 #if defined(__GNUC__) && __GNUC__ < 3
179 struct atm_set_connection_attributes_x {
181 #if defined(__GNUC__) && __GNUC__ < 3
187 struct atm_prepare_incoming_call {
191 struct atm_connect_outgoing_call {
192 struct uni_ie_called called;
194 struct atm_call_release {
195 struct uni_ie_cause cause[2];
197 struct atm_p2p_call_active {
198 struct uni_ie_connid connid;
200 struct atm_p2mp_call_active {
201 struct uni_ie_connid connid;
203 struct atm_accept_incoming_call {
204 char newep[ATM_EPNAMSIZ];
206 struct atm_reject_incoming_call {
207 struct uni_ie_cause cause;
209 struct atm_add_party {
211 struct uni_ie_called called;
213 struct atm_add_party_success {
216 struct atm_add_party_reject {
218 struct uni_ie_cause cause;
220 struct atm_drop_party {
222 struct uni_ie_cause cause;
226 * Get local port info. If port is 0, information on all ports is returned,
227 * otherwise only on the named port.
228 * The response consists of a header with two counters, a list of ports
229 * (struct atm_port_info) and a list of addresses (struct uni_addr).
230 * The port to which an address belongs is implicit in the num_addrs field
233 struct atm_get_local_port_info {
237 struct atm_port_list {
238 uint32_t num_ports; /* number of ports */
239 uint32_t num_addrs; /* total number of addresses */
242 struct atm_port_info {
245 uint32_t max_vpi_bits;
246 uint32_t max_vci_bits;
247 uint32_t max_svpc_vpi;
248 uint32_t max_svcc_vpi;
249 uint32_t min_svcc_vci;
251 uint32_t num_addrs; /* number of addresses on this port */
255 * Endpoint state info
258 char name[ATM_EPNAMSIZ];
263 * Extended status information.
265 struct atm_exstatus {
266 uint32_t neps; /* endpoints */
267 uint32_t nports; /* ports */
268 uint32_t nconns; /* connections */
269 uint32_t nparties; /* number of parties */
271 struct atm_exstatus_ep {
272 char name[ATM_EPNAMSIZ];
273 uint8_t state; /* Ux */
275 struct atm_exstatus_port {
279 struct atm_exstatus_conn {
281 uint32_t cref; /* (flag << 23) | cref */
283 char ep[ATM_EPNAMSIZ]; /* \0 - none */
284 uint8_t state; /* Cx */
286 struct atm_exstatus_party {
289 uint8_t state; /* Px */