Deleted Added
full compact
unisap.3 (146532) unisap.3 (156678)
1.\"
1.\"
2.\" Copyright (c) 2004-2005
3.\" Hartmut Brandt.
4.\" All rights reserved.
2.\" Copyright (c) 2001-2003
3.\" Fraunhofer Institute for Open Communication Systems (FhG Fokus).
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
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.
14.\"
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
25.\" SUCH DAMAGE.
26.\"
27.\" Author: Hartmut Brandt <harti@freebsd.org>
28.\"
5.\" Copyright (c) 2001-2003
6.\" Fraunhofer Institute for Open Communication Systems (FhG Fokus).
7.\" All rights reserved.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
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.
17.\"
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
28.\" SUCH DAMAGE.
29.\"
30.\" Author: Hartmut Brandt <harti@freebsd.org>
31.\"
29.\" $Begemot: libunimsg/man/unisap.3,v 1.4 2005/05/23 12:00:10 brandt_h Exp $
32.\" $Begemot: libunimsg/man/unisap.3,v 1.5 2005/06/15 11:37:11 brandt_h Exp $
30.\"
33.\"
31.Dd May 23, 2005
34.Dd June 14, 2005
32.Dt UNISAP 3
33.Os
34.Sh NAME
35.Nm unimsg ,
36.Nm unisve_check_addr ,
37.Nm unisve_check_selector ,
38.Nm unisve_check_blli_id2 ,
39.Nm unisve_check_blli_id3 ,
40.Nm unisve_check_bhli ,
41.Nm unisve_check_sap ,
42.Nm unisve_overlap_addr ,
43.Nm unisve_overlap_selector ,
44.Nm unisve_overlap_blli_id2 ,
45.Nm unisve_overlap_blli_id3 ,
46.Nm unisve_overlap_bhli ,
47.Nm unisve_overlap_sap ,
48.Nm unisve_is_catchall ,
49.Nm unisve_match
50.Nd "ATM signalling library - ATM SAP handling"
51.Sh LIBRARY
52Begemot ATM signalling library
53.Pq libunimsg, -lunimsg
54.Sh SYNOPSIS
55.In uni4/unisap.h
56.Ft int
57.Fn unisve_check_addr "const struct unisve_addr *sve"
58.Ft int
59.Fn unisve_check_selector "const struct unisve_selector *sve"
60.Ft int
61.Fn unisve_check_blli_id2 "const struct unisve_blli_id2 *sve"
62.Ft int
63.Fn unisve_check_blli_id3 "const struct unisve_blli_id3 *sve"
64.Ft int
65.Fn unisve_check_bhli "const struct unisve_bhli *sve"
66.Ft int
67.Fn unisve_check_sap "const struct uni_sap *sve"
68.Ft int
69.Fn unisve_overlap_addr "const struct unisve_addr *sve1" "const struct unisve_addr *sve2"
70.Ft int
71.Fn unisve_overlap_selector "const struct unisve_selector *sve1" "const struct unisve_selector *sve2"
72.Ft int
73.Fn unisve_overlap_blli_id2 "const struct unisve_blli_id2 *sve1" "const struct unisve_blli_id2 *sve2"
74.Ft int
75.Fn unisve_overlap_blli_id3 "const struct unisve_blli_id3 *sve1" "const struct unisve_blli_id3 *sve2"
76.Ft int
77.Fn unisve_overlap_bhli "const struct unisve_bhli *sve1" "const struct unisve_bhli *sve2"
78.Ft int
79.Fn unisve_overlap_sap "const struct uni_sap *sap1" "const struct uni_sap *sap2"
80.Ft int
81.Fn unisve_is_catchall "const struct uni_sap *sap"
82.Ft int
83.Fn unisve_match "const struct uni_sap *sap" \
84"const struct uni_ie_called *called" "const struct uni_ie_blli *blli" \
85"const struct uni_ie_bhli *bhli"
86.Sh DESCRIPTION
87The
88.Nm
89library contains functions to handle Service Access Points (SAP) and SAP Vector
90Elements (SVE) as specified in the ATM Forum ATM API Semantic Description.
35.Dt UNISAP 3
36.Os
37.Sh NAME
38.Nm unimsg ,
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 ,
52.Nm unisve_match
53.Nd "ATM signalling library - ATM SAP handling"
54.Sh LIBRARY
55Begemot ATM signalling library
56.Pq libunimsg, -lunimsg
57.Sh SYNOPSIS
58.In uni4/unisap.h
59.Ft int
60.Fn unisve_check_addr "const struct unisve_addr *sve"
61.Ft int
62.Fn unisve_check_selector "const struct unisve_selector *sve"
63.Ft int
64.Fn unisve_check_blli_id2 "const struct unisve_blli_id2 *sve"
65.Ft int
66.Fn unisve_check_blli_id3 "const struct unisve_blli_id3 *sve"
67.Ft int
68.Fn unisve_check_bhli "const struct unisve_bhli *sve"
69.Ft int
70.Fn unisve_check_sap "const struct uni_sap *sve"
71.Ft int
72.Fn unisve_overlap_addr "const struct unisve_addr *sve1" "const struct unisve_addr *sve2"
73.Ft int
74.Fn unisve_overlap_selector "const struct unisve_selector *sve1" "const struct unisve_selector *sve2"
75.Ft int
76.Fn unisve_overlap_blli_id2 "const struct unisve_blli_id2 *sve1" "const struct unisve_blli_id2 *sve2"
77.Ft int
78.Fn unisve_overlap_blli_id3 "const struct unisve_blli_id3 *sve1" "const struct unisve_blli_id3 *sve2"
79.Ft int
80.Fn unisve_overlap_bhli "const struct unisve_bhli *sve1" "const struct unisve_bhli *sve2"
81.Ft int
82.Fn unisve_overlap_sap "const struct uni_sap *sap1" "const struct uni_sap *sap2"
83.Ft int
84.Fn unisve_is_catchall "const struct uni_sap *sap"
85.Ft int
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"
89.Sh DESCRIPTION
90The
91.Nm
92library contains functions to handle Service Access Points (SAP) and SAP Vector
93Elements (SVE) as specified in the ATM Forum ATM API Semantic Description.
91SAPs are the analog of TCP and UDP ports in the ATM world. As usually in ATM
92they are a couple of orders of magnitude more complex as their Internet
93equivalent. See the ATM Forum document for a description.
94SAPs are the analog of TCP and UDP ports in the ATM world.
95As usually in ATM they are a couple of orders of magnitude more complex as
96their Internet equivalent.
97See the ATM Forum document for a description.
94.Pp
95A SAP is a data structure:
96.Bd -literal -offset indent
97struct uni_sap {
98 struct unisve_addr addr;
99 struct unisve_selector selector;
100 struct unisve_blli_id2 blli_id2;
101 struct unisve_blli_id3 blli_id3;
102 struct unisve_bhli bhli;
103};
104.Ed
105.Pp
106that consists of 5 elements matching different information elements in
98.Pp
99A SAP is a data structure:
100.Bd -literal -offset indent
101struct uni_sap {
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;
107};
108.Ed
109.Pp
110that consists of 5 elements matching different information elements in
107the SETUP message. Each of these elements has a tag that defines how
108the SVE is to be matched with the information element. The tag is one of
111the SETUP message.
112Each of these elements has a tag that defines how the SVE is to be matched
113with the information element.
114The tag is one of
109.Bl -tag -width ".Dv UNISVE_PRESENT"
110.It Dv UNISVE_ABSENT
111The information element has to absent from the SETUP message.
112.It Dv UNISVE_PRESENT
113The information element has to be present in the SETUP message and must
114match the SVE.
115.It Dv UNISVE_ANY
116The information element may be absent from the SETUP message or may
117have any value.
118.El
119.Pp
120The called address is matched by a
121.Bd -literal -offset indent
122struct unisve_addr {
123 enum unisve_tag tag;
124 enum uni_addr_type type;/* type of address */
125 enum uni_addr_plan plan;/* addressing plan */
115.Bl -tag -width ".Dv UNISVE_PRESENT"
116.It Dv UNISVE_ABSENT
117The information element has to absent from the SETUP message.
118.It Dv UNISVE_PRESENT
119The information element has to be present in the SETUP message and must
120match the SVE.
121.It Dv UNISVE_ANY
122The information element may be absent from the SETUP message or may
123have any value.
124.El
125.Pp
126The called address is matched by a
127.Bd -literal -offset indent
128struct unisve_addr {
129 enum unisve_tag tag;
130 enum uni_addr_type type;/* type of address */
131 enum uni_addr_plan plan;/* addressing plan */
126 u_int32_t len; /* length of address */
132 uint32_t len; /* length of address */
127 u_char addr[UNI_ADDR_MAXLEN];
128};
129.Ed
130.Pp
131Here
132.Fa type
133is the type of address and
134.Fa plan
135is the address plan.
136.Fa len
137is the length of the address (for ATME addresses not counting the selector byte)
138and
139.Fa addr is the address itself.
140.Pp
141In case of ATME addresses the selector byte is matched by a
142.Bd -literal -offset indent
143struct unisve_selector {
144 enum unisve_tag tag;
133 u_char addr[UNI_ADDR_MAXLEN];
134};
135.Ed
136.Pp
137Here
138.Fa type
139is the type of address and
140.Fa plan
141is the address plan.
142.Fa len
143is the length of the address (for ATME addresses not counting the selector byte)
144and
145.Fa addr is the address itself.
146.Pp
147In case of ATME addresses the selector byte is matched by a
148.Bd -literal -offset indent
149struct unisve_selector {
150 enum unisve_tag tag;
145 u_int8_t selector;
151 uint8_t selector;
146};
147.Ed
148.Pp
149Here
150.Fa selector
151is the selector byte that must match the 20th byte of the ATME calling address
152from the SETUP message.
153.Pp
154The BLLI information element is matched by two SVEs: one for layer 2 options
152};
153.Ed
154.Pp
155Here
156.Fa selector
157is the selector byte that must match the 20th byte of the ATME calling address
158from the SETUP message.
159.Pp
160The BLLI information element is matched by two SVEs: one for layer 2 options
155and one for layer 3 options. The layer 2 SVE is:
161and one for layer 3 options.
162The layer 2 SVE is:
156.Bd -literal -offset indent
157struct unisve_blli_id2 {
158 enum unisve_tag tag;
163.Bd -literal -offset indent
164struct unisve_blli_id2 {
165 enum unisve_tag tag;
159 u_int8_t proto:5;/* the protocol */
160 u_int8_t user:7; /* user specific protocol */
166 uint8_t proto:5;/* the protocol */
167 uint8_t user:7; /* user specific protocol */
161};
162.Ed
163.Pp
164Where the
165.Fa user
166fields is matched only if the
167.Fa proto
168field specifies
169.Dv UNI_BLLI_L2_USER .
170The layer 3 SVE is:
171.Bd -literal -offset indent
172struct unisve_blli_id3 {
173 enum unisve_tag tag;
168};
169.Ed
170.Pp
171Where the
172.Fa user
173fields is matched only if the
174.Fa proto
175field specifies
176.Dv UNI_BLLI_L2_USER .
177The layer 3 SVE is:
178.Bd -literal -offset indent
179struct unisve_blli_id3 {
180 enum unisve_tag tag;
174 u_int8_t proto:5;/* L3 protocol */
175 u_int8_t user:7; /* user specific protocol */
176 u_int8_t ipi:8; /* ISO/IEC TR 9557 IPI */
177 u_int32_t oui:24; /* IEEE 802.1 OUI */
178 u_int32_t pid:16; /* IEEE 802.1 PID */
179 u_int32_t noipi; /* ISO/IEC TR 9557 per frame */
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 */
180};
181.Ed
182For the exact rules how matching occures refer to the source code or the
183ATM Forum document.
184.Pp
185Finally the BHLI information element is matched with a
186.Bd -literal -offset indent
187struct unisve_bhli {
188 enum unisve_tag tag;
189 enum uni_bhli type; /* type of info */
187};
188.Ed
189For the exact rules how matching occures refer to the source code or the
190ATM Forum document.
191.Pp
192Finally the BHLI information element is matched with a
193.Bd -literal -offset indent
194struct unisve_bhli {
195 enum unisve_tag tag;
196 enum uni_bhli type; /* type of info */
190 u_int32_t len; /* length of info */
191 u_int8_t info[8];/* info itself */
197 uint32_t len; /* length of info */
198 uint8_t info[8];/* info itself */
192};
193.Ed
194.Pp
195For each SVE type there is a function that checks whether the SVE is correct
199};
200.Ed
201.Pp
202For each SVE type there is a function that checks whether the SVE is correct
196specified. The functions
203specified.
204The functions
197.Fn unisve_check_addr ,
198.Fn unisve_check_selector ,
199.Fn unisve_check_blli_id2 ,
200.Fn unisve_check_blli_id3 ,
201and
202.Fn unisve_check_bhli
203return one of the following error codes:
204.Bd -literal -offset indent
205enum {
206 UNISVE_OK = 0,
207 UNISVE_ERROR_BAD_TAG,
208 UNISVE_ERROR_TYPE_PLAN_CONFLICT,
209 UNISVE_ERROR_ADDR_SEL_CONFLICT,
210 UNISVE_ERROR_ADDR_LEN,
211 UNISVE_ERROR_BAD_ADDR_TYPE,
212 UNISVE_ERROR_BAD_BHLI_TYPE,
213 UNISVE_ERROR_BAD_BHLI_LEN,
214};
215.Ed
216.Pp
217A code of
218.Li UNISVE_OK
219means that the SVE has no error.
220The function
221.Fn unisve_check_sap
222checks a complete SAP and returns one of the above codes.
223.Pp
224There is a definition
225.Dv UNISVE_ERRSTR
226that evaluates to a comma separated list of strings that can be used
227to initializes an array of char pointers to map the error codes into
228human readable strings.
229.Pp
205.Fn unisve_check_addr ,
206.Fn unisve_check_selector ,
207.Fn unisve_check_blli_id2 ,
208.Fn unisve_check_blli_id3 ,
209and
210.Fn unisve_check_bhli
211return one of the following error codes:
212.Bd -literal -offset indent
213enum {
214 UNISVE_OK = 0,
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,
222};
223.Ed
224.Pp
225A code of
226.Li UNISVE_OK
227means that the SVE has no error.
228The function
229.Fn unisve_check_sap
230checks a complete SAP and returns one of the above codes.
231.Pp
232There is a definition
233.Dv UNISVE_ERRSTR
234that evaluates to a comma separated list of strings that can be used
235to initializes an array of char pointers to map the error codes into
236human readable strings.
237.Pp
230The ATM Forum document defines the concept of overlaping SAPs. This basically
231means, that an incoming SETUP could match more than one SAP (and more than
232one application) to receive the SETUP. For each SVE type there is a function
233that checks whether two SVEs overlap and there is a function that checks whether
234two SAPs overlap. The functions
238The ATM Forum document defines the concept of overlaping SAPs.
239This basically means, that an incoming SETUP could match more than one SAP
240(and more than one application) to receive the SETUP.
241For each SVE type there is a function that checks whether two SVEs overlap
242and there is a function that checks whether two SAPs overlap.
243The functions
235.Fn unisve_overlap_addr ,
236.Fn unisve_overlap_selector ,
237.Fn unisve_overlap_blli_id2 ,
238.Fn unisve_overlap_blli_id3 ,
239.Fn unisve_overlap_bhli , and
240.Fn unisve_overlap_sap
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
241return 1 if the SVEs or SAPs overlap and 0 if they do not. They assume, that
242the SAPs are correct.
250return 1 if the SVEs or SAPs overlap and 0 if they do not.
251They assume, that the SAPs are correct.
243.Pp
252.Pp
244The ATM Forum document specifies a catch-all SAP. The function
253The ATM Forum document specifies a catch-all SAP.
254The function
245.Fn unisve_is_catchall
246returns 1 if the SAP is the catch-all SAP and 0 otherwise.
247.Pp
248Finally the function
249.Fn unisve_match
250is used to match a SAP against the information elements from a SETUP message.
251It returns 1 if they match and 0 otherwise.
252.Sh SEE ALSO
253.Xr libunimsg 3
254.Sh AUTHORS
255.An Hartmut Brandt Aq harti@freebsd.org
255.Fn unisve_is_catchall
256returns 1 if the SAP is the catch-all SAP and 0 otherwise.
257.Pp
258Finally the function
259.Fn unisve_match
260is used to match a SAP against the information elements from a SETUP message.
261It returns 1 if they match and 0 otherwise.
262.Sh SEE ALSO
263.Xr libunimsg 3
264.Sh AUTHORS
265.An Hartmut Brandt Aq harti@freebsd.org