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 .\" Author: Hartmut Brandt <harti@freebsd.org>
11 .\" Redistribution and use in source and binary forms, with or without
12 .\" modification, are permitted provided that the following conditions
14 .\" 1. Redistributions of source code must retain the above copyright
15 .\" notice, this list of conditions and the following disclaimer.
16 .\" 2. Redistributions in binary form must reproduce the above copyright
17 .\" notice, this list of conditions and the following disclaimer in the
18 .\" documentation and/or other materials provided with the distribution.
20 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" $Begemot: libunimsg/man/uniaddr.3,v 1.6 2005/06/15 11:37:08 brandt_h Exp $
44 .Nd "ATM signalling library - address handling"
46 Begemot ATM signalling library
47 .Pq libunimsg, -lunimsg
51 .Fn uni_str2nsap "u_char *nsap" "const char *str"
53 .Fn uni_nsap2str "char *str" "const u_char *nsap" "int dots"
55 .Fn uni_prefix2str "char *str" "const u_char *prefix" "u_int len" "int dots"
57 .Fn uni_e1642nsap "u_char *nsap" "const char *e164"
59 .Fn uni_nsap2e164 "char *e164" "const u_char *nsap" "int check"
61 The UNI message library contains a number of utility functions to handle
62 NSAP and E.164 addresses.
66 parses a string and interprets it as an NSAP address.
67 The string should consist of exact 40 hexadecimal digits
68 (upper and lower case are allowed) and any
69 number of dots at any position.
70 Any other character is illegal.
71 The resulting NSAP address is written to the buffer pointed to by
73 This buffer should be at least 20 bytes.
74 On success the funtion returns 0.
75 If an parsing error happens -1 is returned.
79 converts the NSAP address pointed to by
82 For some commonly used NSAP formats (those with leading
83 octets 0x39, 0x45 or 0x47) dots may be inserted to make the address more
84 readable by passing a non-0 value in
86 The buffer pointed to by
88 should be large enough to hold the resulting string plus the terminating NUL.
89 A size of 80 byte is large enough for all cases.
93 converts an NSAP prefix to a string.
94 The length of the NSAP prefix in bytes is passed in
96 .Li "uni_nsap2str(str, nsap, dots)"
98 .Li "uni_prefix2str(str, nsap, 20, dots)" .
102 converts an E.164 address given as an ASCII string to an embedded E.164 NSAP
104 The string pointed to by
106 must consist of at least 1 and not more than 15 ASCII digits.
107 The function returns 0 on success and -1 if the E.164 address was malformed.
111 extracts the E.164 address from an embedded E.164 NSAP address.
114 specifies whether the NSAP address should be checked for correct syntax.
117 is 0 the last 11 bytes of the address are ignored.
120 is 1 the last 11 bytes except the selector byte must be zero.
123 is 2 the last 11 bytes must be zero.
124 The function returns 0 on success and -1 when the NSAP address was not an
125 embedded E.164 NSAP or one of the additional checks failed.
129 .An Hartmut Brandt Aq harti@freebsd.org