Deleted Added
full compact
ng_atm.4 (130857) ng_atm.4 (131530)
1.\"
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:

--- 12 unchanged lines hidden (view full) ---

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.\"
1.\"
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:

--- 12 unchanged lines hidden (view full) ---

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.\"
29.\" $FreeBSD: head/share/man/man4/ng_atm.4 130857 2004-06-21 17:42:49Z mpp $
29.\" $FreeBSD: head/share/man/man4/ng_atm.4 131530 2004-07-03 18:29:24Z ru $
30.\"
31.\" ng_atm(4) man page
32.\"
33.Dd June 24, 2003
34.Dt NG_ATM 4
35.Os FreeBSD
36.Sh NAME
37.Nm ng_atm
38.Nd netgraph ATM node type
39.Sh SYNOPSIS
40.Fd #include <net/if_atm.h>
41.Fd #include <netgraph/ng_atm.h>
42.Sh DESCIPTION
43The
44.Nm
45netgraph node type allows
46.Xr natm 4
30.\"
31.\" ng_atm(4) man page
32.\"
33.Dd June 24, 2003
34.Dt NG_ATM 4
35.Os FreeBSD
36.Sh NAME
37.Nm ng_atm
38.Nd netgraph ATM node type
39.Sh SYNOPSIS
40.Fd #include <net/if_atm.h>
41.Fd #include <netgraph/ng_atm.h>
42.Sh DESCIPTION
43The
44.Nm
45netgraph node type allows
46.Xr natm 4
47ATM drivers to be connected to the
47ATM drivers to be connected to the
48.Xr netgraph 4
49networking subsystem.
50When the
51.Nm
52module is loaded a node is automatically create for each
53.Xr natm 4
48.Xr netgraph 4
49networking subsystem.
50When the
51.Nm
52module is loaded a node is automatically create for each
53.Xr natm 4
54ATM interface. The nodes are named with the same name as the
55interface. Nodes are also created, if a driver for an ATM
54ATM interface.
55The nodes are named with the same name as the
56interface.
57Nodes are also created, if a driver for an ATM
56card is loaded after
57.Nm
58was loaded.
59.Pp
60.Nm
58card is loaded after
59.Nm
60was loaded.
61.Pp
62.Nm
61nodes are persistent. They are removed when the interface is removed.
63nodes are persistent.
64They are removed when the interface is removed.
62SHUTDOWN messages are ignored by the node.
63.Sh HOOKS
64Four special hooks with fixed names and an unlimited number of hooks with user
65SHUTDOWN messages are ignored by the node.
66.Sh HOOKS
67Four special hooks with fixed names and an unlimited number of hooks with user
65defined names are supported. Three of the fixed hooks are attached to
68defined names are supported.
69Three of the fixed hooks are attached to
66strategic points in the information flow in the
67.Xr natm 4
70strategic points in the information flow in the
71.Xr natm 4
68system and support only reading. The fourth fixed hook behaves like the other
72system and support only reading.
73The fourth fixed hook behaves like the other
69user hooks, but a number of management messages are sent along the hook.
70The other hooks can be attached to VCIs dynamically by means of
71control messages to the
72.Nm
73node and can be written and read.
74.Pp
75The four fixed hooks are:
76.Bl -tag -width orphans
77.It Dv input
78This is a connection to the raw input stream from the network.
79If this hook is connected, all incoming packets are delivered out to
74user hooks, but a number of management messages are sent along the hook.
75The other hooks can be attached to VCIs dynamically by means of
76control messages to the
77.Nm
78node and can be written and read.
79.Pp
80The four fixed hooks are:
81.Bl -tag -width orphans
82.It Dv input
83This is a connection to the raw input stream from the network.
84If this hook is connected, all incoming packets are delivered out to
80this hook. Note, that this redirects ALL input. Neither
85this hook.
86Note, that this redirects ALL input.
87Neither
81.Xr natm 4
82nor the user hooks will see any input if
83.Dv input
84is connected.
85An
86.Dv atm_pseudohdr
87(see
88.Xr natm 4 )

--- 4 unchanged lines hidden (view full) ---

93the netgraph system and delivered to the hook instead of being delivered
94to the ATM driver.
95An
96.Dv atm_pseudohdr
97(see
98.Xr natm 4 )
99is prepended to the actual data.
100.It Dv orphans
88.Xr natm 4
89nor the user hooks will see any input if
90.Dv input
91is connected.
92An
93.Dv atm_pseudohdr
94(see
95.Xr natm 4 )

--- 4 unchanged lines hidden (view full) ---

100the netgraph system and delivered to the hook instead of being delivered
101to the ATM driver.
102An
103.Dv atm_pseudohdr
104(see
105.Xr natm 4 )
106is prepended to the actual data.
107.It Dv orphans
101This hook receives all packets that are unrecognized, i.e. do not belong to
108This hook receives all packets that are unrecognized, i.e., do not belong to
102either a
103.Xr natm 4
104socket, a
105.Nm
106VCI or
107.Xr natm 4
108IP.
109Because ATM is connection oriented and packets are received on a given VCI only
109either a
110.Xr natm 4
111socket, a
112.Nm
113VCI or
114.Xr natm 4
115IP.
116Because ATM is connection oriented and packets are received on a given VCI only
110when someone initiates this VCI, packets should never be orphaned. There is
117when someone initiates this VCI, packets should never be orphaned.
118There is
111however one exception: if you use
112.Xr natm 4
113IP with LLC/SNAP encapsulation packets with don't have the IP protocol
114indicated in the packet header are delivered out of this hook.
115An
116.Dv atm_pseudohdr
117(see
118.Xr natm 4 )
119is prepended to the actual data send out to the hook.
120.It Dv manage
121This hook behaves exactly like a normal user hook (see below) except, that
122the node at the other hand will receive management messages.
123.El
124.Pp
125Hooks for dynamically initiated VCIs can have whatever name is allowed by
119however one exception: if you use
120.Xr natm 4
121IP with LLC/SNAP encapsulation packets with don't have the IP protocol
122indicated in the packet header are delivered out of this hook.
123An
124.Dv atm_pseudohdr
125(see
126.Xr natm 4 )
127is prepended to the actual data send out to the hook.
128.It Dv manage
129This hook behaves exactly like a normal user hook (see below) except, that
130the node at the other hand will receive management messages.
131.El
132.Pp
133Hooks for dynamically initiated VCIs can have whatever name is allowed by
126.Xr netgraph 4
134.Xr netgraph 4
127as long as the name does not collide with one of the three predefined names.
128.Pp
129To initiate packet sending an receiving on a dynamic hook one has to issue
130a
131.Dv NGM_ATM_CPCS_INIT
135as long as the name does not collide with one of the three predefined names.
136.Pp
137To initiate packet sending an receiving on a dynamic hook one has to issue
138a
139.Dv NGM_ATM_CPCS_INIT
132control message. To terminate sending and receiving one must send a
140control message.
141To terminate sending and receiving one must send a
133.Dv NGM_ATM_CPCS_TERM
134message (see
142.Dv NGM_ATM_CPCS_TERM
143message (see
135.Sx CONTROL MESSAGES ) .
144.Sx CONTROL MESSAGES ) .
136The data send and received on these hooks has no additional
137headers.
138.Sh CONTROL MESSAGES
139This node type supports the generic messages plus the following:
140.Bl -tag -width xxx
141.It Dv NGM_ATM_GET_IFNAME
142Return the name of the interface as a NUL-terminated string.
143This is normally the same name as that of the node.

--- 4 unchanged lines hidden (view full) ---

148 uint32_t pcr; /* peak cell rate */
149 uint32_t maxvpi; /* maximum vpi */
150 uint32_t maxvci; /* maximum vci */
151 uint32_t max_vpcs; /* maximum number of VPCs */
152 uint32_t max_vccs; /* maximum number of VCCs */
153};
154.Ed
155.It Dv NGM_ATM_GET_VCCS
145The data send and received on these hooks has no additional
146headers.
147.Sh CONTROL MESSAGES
148This node type supports the generic messages plus the following:
149.Bl -tag -width xxx
150.It Dv NGM_ATM_GET_IFNAME
151Return the name of the interface as a NUL-terminated string.
152This is normally the same name as that of the node.

--- 4 unchanged lines hidden (view full) ---

157 uint32_t pcr; /* peak cell rate */
158 uint32_t maxvpi; /* maximum vpi */
159 uint32_t maxvci; /* maximum vci */
160 uint32_t max_vpcs; /* maximum number of VPCs */
161 uint32_t max_vccs; /* maximum number of VCCs */
162};
163.Ed
164.It Dv NGM_ATM_GET_VCCS
156Returns the table of open VCCs from the driver. This table consists of
165Returns the table of open VCCs from the driver.
166This table consists of
157a header and a variable sized array of entries, one for each open vcc:
158.Bd -literal
159struct atmio_vcctable {
160 uint32_t count; /* number of vccs */
161 struct atmio_vcc vccs[0]; /* array of VCCs */
162};
163struct atmio_vcc {
164 uint16_t flags; /* flags */

--- 18 unchanged lines hidden (view full) ---

183 uint8_t rif; /* 4bit: ABR RIF */
184 uint8_t rdf; /* 4bit: ABR RDF */
185 uint8_t cdf; /* 3bit: ABR CDF */
186};
187.Ed
188.Pp
189Note, that this is the driver's table, so all VCCs opened via
190.Xr natm 4
167a header and a variable sized array of entries, one for each open vcc:
168.Bd -literal
169struct atmio_vcctable {
170 uint32_t count; /* number of vccs */
171 struct atmio_vcc vccs[0]; /* array of VCCs */
172};
173struct atmio_vcc {
174 uint16_t flags; /* flags */

--- 18 unchanged lines hidden (view full) ---

193 uint8_t rif; /* 4bit: ABR RIF */
194 uint8_t rdf; /* 4bit: ABR RDF */
195 uint8_t cdf; /* 3bit: ABR CDF */
196};
197.Ed
198.Pp
199Note, that this is the driver's table, so all VCCs opened via
200.Xr natm 4
191sockets and IP are also shown. They can, however, be distinguished by
192their flags. The
201sockets and IP are also shown.
202They can, however, be distinguished by
203their flags.
204The
193.Dv flags
194field contains the following flags:
195.Bl -column ATM_PH_LLCSNAP -offset indent
196.It Dv ATM_PH_AAL5 Ta use AAL5 instead of AAL0
197.It Dv ATM_PH_LLCSNAP Ta if AAL5 use LLC SNAP encapsulation
198.It Dv ATM_FLAG_NG Ta this is a netgraph VCC
199.It Dv ATM_FLAG_HARP Ta this is a HARP VCC
200.It Dv ATM_FLAG_NORX Ta transmit only VCC

--- 23 unchanged lines hidden (view full) ---

224all traffic types however):
225.Bl -column ATM_PH_LLCSNAP -offset indent
226.It Dv ATMIO_TRAFFIC_UBR
227.It Dv ATMIO_TRAFFIC_CBR
228.It Dv ATMIO_TRAFFIC_ABR
229.It Dv ATMIO_TRAFFIC_VBR
230.El
231.It Dv NGM_ATM_CPCS_INIT
205.Dv flags
206field contains the following flags:
207.Bl -column ATM_PH_LLCSNAP -offset indent
208.It Dv ATM_PH_AAL5 Ta use AAL5 instead of AAL0
209.It Dv ATM_PH_LLCSNAP Ta if AAL5 use LLC SNAP encapsulation
210.It Dv ATM_FLAG_NG Ta this is a netgraph VCC
211.It Dv ATM_FLAG_HARP Ta this is a HARP VCC
212.It Dv ATM_FLAG_NORX Ta transmit only VCC

--- 23 unchanged lines hidden (view full) ---

236all traffic types however):
237.Bl -column ATM_PH_LLCSNAP -offset indent
238.It Dv ATMIO_TRAFFIC_UBR
239.It Dv ATMIO_TRAFFIC_CBR
240.It Dv ATMIO_TRAFFIC_ABR
241.It Dv ATMIO_TRAFFIC_VBR
242.El
243.It Dv NGM_ATM_CPCS_INIT
232Initialize a VCC for sending and receiving. The argument is a structure:
244Initialize a VCC for sending and receiving.
245The argument is a structure:
233.Bd -literal
234struct ng_atm_cpcs_init {
235 char name[NG_HOOKSIZ];
236 uint32_t flags; /* flags. (if_natmio.h) */
237 uint16_t vci; /* VCI to open */
238 uint16_t vpi; /* VPI to open */
239 uint16_t rmtu; /* receive maximum PDU */
240 uint16_t tmtu; /* transmit maximum PDU */

--- 15 unchanged lines hidden (view full) ---

256.Ed
257.Pp
258.Dv name
259is the name of the hook for which sending and receiving should be enabled.
260This hook must already be connected.
261.Dv vpi
262and
263.Dv vci
246.Bd -literal
247struct ng_atm_cpcs_init {
248 char name[NG_HOOKSIZ];
249 uint32_t flags; /* flags. (if_natmio.h) */
250 uint16_t vci; /* VCI to open */
251 uint16_t vpi; /* VPI to open */
252 uint16_t rmtu; /* receive maximum PDU */
253 uint16_t tmtu; /* transmit maximum PDU */

--- 15 unchanged lines hidden (view full) ---

269.Ed
270.Pp
271.Dv name
272is the name of the hook for which sending and receiving should be enabled.
273This hook must already be connected.
274.Dv vpi
275and
276.Dv vci
264are the respective VPI and VCI values to use for the ATM cells. They must be
265within the range, given by the
277are the respective VPI and VCI values to use for the ATM cells.
278They must be
279within the range, given by the
266.Dv maxvpi
267and
268.Dv maxvci
269fields of the
270.Dv ng_atm_config
271structure.
272.Dv flags
273contains the flags (see above) and the other fields describe the
274type of traffic.
275.It Dv NGM_ATM_CPCS_TERM
280.Dv maxvpi
281and
282.Dv maxvci
283fields of the
284.Dv ng_atm_config
285structure.
286.Dv flags
287contains the flags (see above) and the other fields describe the
288type of traffic.
289.It Dv NGM_ATM_CPCS_TERM
276Stop sending and receiving on the indicated hook. The argument is a
290Stop sending and receiving on the indicated hook.
291The argument is a
277.Bd -literal
278struct ng_atm_cpcs_term {
279 char name[NG_HOOKSIZ];
280};
281.Ed
282.El
283.Sh MANAGEMENT MESSAGES
284If the
285.Dv manage
292.Bd -literal
293struct ng_atm_cpcs_term {
294 char name[NG_HOOKSIZ];
295};
296.Ed
297.El
298.Sh MANAGEMENT MESSAGES
299If the
300.Dv manage
286hook is connected certain messages are sent along the hook. They are
301hook is connected certain messages are sent along the hook.
302They are
287received by the peer node with a cookie of
288.Dv NG_ATM_COOKIE .
289.Bl -tag -width xxx
290.It Dv NGM_ATM_CARRIER_CHANGE
291The carrier state of the ATM physical interface has changed.
292The message has the following structure:
293.Bd -literal
294struct ng_atm_carrier_change {
295 uint32_t node;
296 uint32_t state;
297};
298.Ed
299.Pp
300.Dv node
303received by the peer node with a cookie of
304.Dv NG_ATM_COOKIE .
305.Bl -tag -width xxx
306.It Dv NGM_ATM_CARRIER_CHANGE
307The carrier state of the ATM physical interface has changed.
308The message has the following structure:
309.Bd -literal
310struct ng_atm_carrier_change {
311 uint32_t node;
312 uint32_t state;
313};
314.Ed
315.Pp
316.Dv node
301is the node Id of the ATM node. This can be used by the managing entity
317is the node Id of the ATM node.
318This can be used by the managing entity
302(for example
303.Xr ilmid 8 )
304to manage several interfaces at the same time through the same node.
305.Dv state is 1 if the carrier was detected and 0 if it was lost.
306.It Dv NGM_ATM_VCC_CHANGE
319(for example
320.Xr ilmid 8 )
321to manage several interfaces at the same time through the same node.
322.Dv state is 1 if the carrier was detected and 0 if it was lost.
323.It Dv NGM_ATM_VCC_CHANGE
307A permanent VCC has been added, deleted or changed. This is used by
324A permanent VCC has been added, deleted or changed.
325This is used by
308.Xr ilmid
326.Xr ilmid
309to generate the appropriate ILMI traps. The structure of the message is:
327to generate the appropriate ILMI traps.
328The structure of the message is:
310.Bd -literal
311struct ng_atm_vcc_change {
312 uint32_t node;
313 uint16_t vci;
314 uint8_t vpi;
315 uint8_t state;
316};
317.Ed
318Where
319.Dv state
320is 0 if the PVC was deleted and 1 if it was added or modified.
321.El
322.Sh FLOW CONTROL
323If the hardware driver supports it the node can emit flow control messages
329.Bd -literal
330struct ng_atm_vcc_change {
331 uint32_t node;
332 uint16_t vci;
333 uint8_t vpi;
334 uint8_t state;
335};
336.Ed
337Where
338.Dv state
339is 0 if the PVC was deleted and 1 if it was added or modified.
340.El
341.Sh FLOW CONTROL
342If the hardware driver supports it the node can emit flow control messages
324along a user hook. The format of these messages is described in
343along a user hook.
344The format of these messages is described in
325.Pa netgraph/ng_message.h .
326The
327.Nm
328node may generate
329.Dv NGM_HIGH_WATER_PASSED and NGM_LOW_WATER_PASSED
345.Pa netgraph/ng_message.h .
346The
347.Nm
348node may generate
349.Dv NGM_HIGH_WATER_PASSED and NGM_LOW_WATER_PASSED
330messages. The first one indicates that the hardware driver has stopped output
350messages.
351The first one indicates that the hardware driver has stopped output
331on the channel and drops new packets, the second one reports that
352on the channel and drops new packets, the second one reports that
332output was reenabled. Currently the structures are not filled with
353output was reenabled.
354Currently the structures are not filled with
333information.
334.Sh SHUTDOWN
335The nodes are persistent as long as the corresponding interface exists.
336Upon receipt of a
337.Dv NGM_SHUTDOWN
355information.
356.Sh SHUTDOWN
357The nodes are persistent as long as the corresponding interface exists.
358Upon receipt of a
359.Dv NGM_SHUTDOWN
338messages all hooks are disconnected and the node is reinitialized. All
339VCCs opened via netgraph are closed. When the ATM interface is unloaded
360messages all hooks are disconnected and the node is reinitialized.
361All
362VCCs opened via netgraph are closed.
363When the ATM interface is unloaded
340the node disappears.
341If the node is compiled with
342.Dv NGATM_DEBUG
343there is a sysctl
344.Cm net.graph.atm.allow_shutdown
345which when set to a non-zero values allows the nodes to shut down.
346Note, that this is intended for development only and may lead to kernel
347panics if set.
348.Sh SEE ALSO
349.Xr netgraph 4 ,
350.Xr ng_ether 4 ,
351.Xr natm 4 ,
352.Xr ngctl 8
353.Sh AUTHORS
354.An Harti Brandt Aq harti@freebsd.org
364the node disappears.
365If the node is compiled with
366.Dv NGATM_DEBUG
367there is a sysctl
368.Cm net.graph.atm.allow_shutdown
369which when set to a non-zero values allows the nodes to shut down.
370Note, that this is intended for development only and may lead to kernel
371panics if set.
372.Sh SEE ALSO
373.Xr netgraph 4 ,
374.Xr ng_ether 4 ,
375.Xr natm 4 ,
376.Xr ngctl 8
377.Sh AUTHORS
378.An Harti Brandt Aq harti@freebsd.org