2 .\" Copyright (c) 2004-2005
4 .\" All rights reserved.
5 .\" Copyright (c) 2001-2003
6 .\" Fraunhofer Institute for Open Communication Systems (FhG Fokus).
7 .\" All rights reserved.
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" 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 IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" Author: Hartmut Brandt <harti@FreeBSD.org>
32 .\" $Begemot: libunimsg/man/unisap.3,v 1.5 2005/06/15 11:37:11 brandt_h Exp $
39 .Nm unisve_check_addr ,
40 .Nm unisve_check_selector ,
41 .Nm unisve_check_blli_id2 ,
42 .Nm unisve_check_blli_id3 ,
43 .Nm unisve_check_bhli ,
44 .Nm unisve_check_sap ,
45 .Nm unisve_overlap_addr ,
46 .Nm unisve_overlap_selector ,
47 .Nm unisve_overlap_blli_id2 ,
48 .Nm unisve_overlap_blli_id3 ,
49 .Nm unisve_overlap_bhli ,
50 .Nm unisve_overlap_sap ,
51 .Nm unisve_is_catchall ,
53 .Nd "ATM signalling library - ATM SAP handling"
55 Begemot ATM signalling library
56 .Pq libunimsg, -lunimsg
60 .Fn unisve_check_addr "const struct unisve_addr *sve"
62 .Fn unisve_check_selector "const struct unisve_selector *sve"
64 .Fn unisve_check_blli_id2 "const struct unisve_blli_id2 *sve"
66 .Fn unisve_check_blli_id3 "const struct unisve_blli_id3 *sve"
68 .Fn unisve_check_bhli "const struct unisve_bhli *sve"
70 .Fn unisve_check_sap "const struct uni_sap *sve"
72 .Fn unisve_overlap_addr "const struct unisve_addr *sve1" "const struct unisve_addr *sve2"
74 .Fn unisve_overlap_selector "const struct unisve_selector *sve1" "const struct unisve_selector *sve2"
76 .Fn unisve_overlap_blli_id2 "const struct unisve_blli_id2 *sve1" "const struct unisve_blli_id2 *sve2"
78 .Fn unisve_overlap_blli_id3 "const struct unisve_blli_id3 *sve1" "const struct unisve_blli_id3 *sve2"
80 .Fn unisve_overlap_bhli "const struct unisve_bhli *sve1" "const struct unisve_bhli *sve2"
82 .Fn unisve_overlap_sap "const struct uni_sap *sap1" "const struct uni_sap *sap2"
84 .Fn unisve_is_catchall "const struct uni_sap *sap"
86 .Fn unisve_match "const struct uni_sap *sap" \
87 "const struct uni_ie_called *called" "const struct uni_ie_blli *blli" \
88 "const struct uni_ie_bhli *bhli"
92 library contains functions to handle Service Access Points (SAP) and SAP Vector
93 Elements (SVE) as specified in the ATM Forum ATM API Semantic Description.
94 SAPs are the analog of TCP and UDP ports in the ATM world.
95 As usually in ATM they are a couple of orders of magnitude more complex as
96 their Internet equivalent.
97 See the ATM Forum document for a description.
99 A SAP is a data structure:
100 .Bd -literal -offset indent
102 struct unisve_addr addr;
103 struct unisve_selector selector;
104 struct unisve_blli_id2 blli_id2;
105 struct unisve_blli_id3 blli_id3;
106 struct unisve_bhli bhli;
110 that consists of 5 elements matching different information elements in
112 Each of these elements has a tag that defines how the SVE is to be matched
113 with the information element.
115 .Bl -tag -width ".Dv UNISVE_PRESENT"
117 The information element has to absent from the SETUP message.
118 .It Dv UNISVE_PRESENT
119 The information element has to be present in the SETUP message and must
122 The information element may be absent from the SETUP message or may
126 The called address is matched by a
127 .Bd -literal -offset indent
130 enum uni_addr_type type;/* type of address */
131 enum uni_addr_plan plan;/* addressing plan */
132 uint32_t len; /* length of address */
133 u_char addr[UNI_ADDR_MAXLEN];
139 is the type of address and
143 is the length of the address (for ATME addresses not counting the selector byte)
145 .Fa addr is the address itself.
147 In case of ATME addresses the selector byte is matched by a
148 .Bd -literal -offset indent
149 struct unisve_selector {
157 is the selector byte that must match the 20th byte of the ATME calling address
158 from the SETUP message.
160 The BLLI information element is matched by two SVEs: one for layer 2 options
161 and one for layer 3 options.
163 .Bd -literal -offset indent
164 struct unisve_blli_id2 {
166 uint8_t proto:5;/* the protocol */
167 uint8_t user:7; /* user specific protocol */
173 fields is matched only if the
176 .Dv UNI_BLLI_L2_USER .
178 .Bd -literal -offset indent
179 struct unisve_blli_id3 {
181 uint8_t proto:5;/* L3 protocol */
182 uint8_t user:7; /* user specific protocol */
183 uint8_t ipi:8; /* ISO/IEC TR 9557 IPI */
184 uint32_t oui:24; /* IEEE 802.1 OUI */
185 uint32_t pid:16; /* IEEE 802.1 PID */
186 uint32_t noipi; /* ISO/IEC TR 9557 per frame */
189 For the exact rules how matching occures refer to the source code or the
192 Finally the BHLI information element is matched with a
193 .Bd -literal -offset indent
196 enum uni_bhli type; /* type of info */
197 uint32_t len; /* length of info */
198 uint8_t info[8];/* info itself */
202 For each SVE type there is a function that checks whether the SVE is correct
205 .Fn unisve_check_addr ,
206 .Fn unisve_check_selector ,
207 .Fn unisve_check_blli_id2 ,
208 .Fn unisve_check_blli_id3 ,
210 .Fn unisve_check_bhli
211 return one of the following error codes:
212 .Bd -literal -offset indent
215 UNISVE_ERROR_BAD_TAG,
216 UNISVE_ERROR_TYPE_PLAN_CONFLICT,
217 UNISVE_ERROR_ADDR_SEL_CONFLICT,
218 UNISVE_ERROR_ADDR_LEN,
219 UNISVE_ERROR_BAD_ADDR_TYPE,
220 UNISVE_ERROR_BAD_BHLI_TYPE,
221 UNISVE_ERROR_BAD_BHLI_LEN,
227 means that the SVE has no error.
230 checks a complete SAP and returns one of the above codes.
232 There is a definition
234 that evaluates to a comma separated list of strings that can be used
235 to initializes an array of char pointers to map the error codes into
236 human readable strings.
238 The ATM Forum document defines the concept of overlaping SAPs.
239 This basically means, that an incoming SETUP could match more than one SAP
240 (and more than one application) to receive the SETUP.
241 For each SVE type there is a function that checks whether two SVEs overlap
242 and there is a function that checks whether two SAPs overlap.
244 .Fn unisve_overlap_addr ,
245 .Fn unisve_overlap_selector ,
246 .Fn unisve_overlap_blli_id2 ,
247 .Fn unisve_overlap_blli_id3 ,
248 .Fn unisve_overlap_bhli , and
249 .Fn unisve_overlap_sap
250 return 1 if the SVEs or SAPs overlap and 0 if they do not.
251 They assume, that the SAPs are correct.
253 The ATM Forum document specifies a catch-all SAP.
255 .Fn unisve_is_catchall
256 returns 1 if the SAP is the catch-all SAP and 0 otherwise.
260 is used to match a SAP against the information elements from a SETUP message.
261 It returns 1 if they match and 0 otherwise.
265 .An Hartmut Brandt Aq harti@FreeBSD.org