]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - share/man/man4/ngatmbase.4
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / share / man / man4 / ngatmbase.4
1 .\"
2 .\" Copyright (c) 2004
3 .\"     Hartmut Brandt.
4 .\"     All rights reserved.
5 .\"
6 .\" Author: Hartmut Brandt <harti@FreeBSD.org>
7 .\"
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
10 .\" are met:
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\"    notice, this list of conditions and the following disclaimer.
13 .\" 2. Redistributions in binary form must reproduce the above copyright
14 .\"    notice, this list of conditions and the following disclaimer in the
15 .\"    documentation and/or other materials provided with the distribution.
16 .\"
17 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 .\" SUCH DAMAGE.
28 .\"
29 .\" $FreeBSD$
30 .\"
31 .\" ngatmbase(4) man page
32 .\"
33 .Dd August 24, 2004
34 .Dt NGATMBASE 4
35 .Os
36 .Sh NAME
37 .Nm ngatmbase
38 .Nd netgraph ATM utility module
39 .Sh SYNOPSIS
40 .In netnatm/unimsg.h
41 .In netgraph/atm/ngatmbase.h
42 .Ft "struct mbuf *"
43 .Fn uni_msg_pack_mbuf "struct uni_msg *msg" "void *hdr" "size_t len"
44 .Ft "struct uni_msg *"
45 .Fn uni_msg_alloc "size_t len"
46 .Ft "struct uni_msg *"
47 .Fn uni_msg_build "void *buf" ...
48 .Ft void
49 .Fn uni_msg_destroy "struct uni_msg *msg"
50 .Ft int
51 .Fn uni_msg_unpack_mbuf "struct mbuf *m" "struct uni_msg *msgp"
52 .Sh DESCRIPTION
53 This module provides utility functions for the handling of signalling
54 messages to the NgATM modules.
55 .Pp
56 The
57 .Fn uni_msg_pack_mbuf
58 function
59 packs a message into one or several
60 .Vt mbuf Ns s
61 optionally prepending a header.
62 The header is given by its address
63 .Fa hdr
64 and length
65 .Fa len .
66 If
67 .Fa hdr
68 is
69 .Dv NULL
70 or
71 .Fa len
72 equals 0, no header is prepended.
73 Either
74 .Fa msg
75 or
76 .Fa hdr
77 may be
78 .Dv NULL
79 but not both.
80 The
81 .Fn uni_msg_pack_mbuf
82 function
83 returns a pointer to the allocated
84 .Vt mbuf
85 chain or
86 .Dv NULL
87 in the case of an error.
88 .Pp
89 The
90 .Fn uni_msg_alloc
91 function
92 allocates a new message with space for at least
93 .Fa len
94 bytes.
95 In the case of an error
96 .Dv NULL
97 is returned.
98 .Pp
99 The
100 .Fn uni_msg_build
101 function constructs a message from pieces.
102 Each piece is given by a pair of
103 arguments, the first of type
104 .Vt "void *"
105 and the second a
106 .Vt size_t .
107 The list of pieces must be terminated by
108 .Po Vt "void *" Pc Ns Dv NULL .
109 .Pp
110 The
111 .Fn uni_msg_destroy
112 function
113 destroys the messages and frees all the messages's memory.
114 .Pp
115 The
116 .Fn uni_msg_unpack_mbuf
117 function
118 unpacks an
119 .Vt mbuf
120 chain info a
121 .Vt uni_msg .
122 A pointer to the newly allocated message is stored in
123 .Fa msgp
124 and 0 is returned.
125 In the case of an error (either when no packet header is found
126 in the first mbuf or memory cannot be allocated) the function
127 returns an appropriate error code.
128 .Sh SEE ALSO
129 .Xr ng_ccatm 4 ,
130 .Xr ng_sscfu 4 ,
131 .Xr ng_sscop 4 ,
132 .Xr ng_uni 4
133 .Sh AUTHORS
134 .An Harti Brandt Aq harti@FreeBSD.org