Lines Matching +full:one +full:- +full:channel
1 .. SPDX-License-Identifier: GPL-2.0
4 PPP Generic Driver and Channel Interface
12 The generic PPP driver in linux-2.4 provides an implementation of the
26 the services of PPP ``channels``. A PPP channel encapsulates a
27 mechanism for transporting PPP frames from one machine to another. A
28 PPP channel implementation can be arbitrarily complex internally but
31 handle ioctl requests. Currently there are PPP channel
36 natural and straightforward way, by allowing more than one channel to
42 PPP channel API
43 ---------------
49 Each channel has to provide two functions to the generic PPP layer,
53 send. The channel has the option of rejecting the frame for
54 flow-control reasons. In this case, start_xmit() should return 0
55 and the channel should call the ppp_output_wakeup() function at a
60 * ioctl() provides an interface which can be used by a user-space
61 program to control aspects of the channel's behaviour. This
62 procedure will be called when a user-space program does an ioctl
64 channel. (Usually it would only be pppd which would do this.)
68 * ppp_register_channel() is called when a channel has been created, to
71 channel code to call this function.
73 * ppp_unregister_channel() is called when a channel is to be
74 destroyed. For example, the ppp_async channel code calls this when
77 * ppp_output_wakeup() is called by a channel when it has previously
81 * ppp_input() is called by a channel when it has received a complete
84 * ppp_input_error() is called by a channel when it has detected that a
88 * ppp_channel_index() returns the channel index assigned by the PPP
89 generic layer to this channel. The channel should provide some way
90 (e.g. an ioctl) to transmit this back to user-space, as user-space
91 will need it to attach an instance of /dev/ppp to this channel.
94 interface to which this channel is connected, or -1 if the channel
97 Connecting a channel to the ppp generic layer is initiated from the
98 channel code, rather than from the generic layer. The channel is
99 expected to have some way for a user-level process to control it
101 ppp_async channel, this is provided by the file descriptor to the
104 Generally a user-level process will initialize the underlying
109 as ``discovery``. Then the user-level process tells the medium to
110 become a PPP channel and register itself with the generic PPP layer.
111 The channel then has to report the channel number assigned to it back
112 to the user-level process. From that point, the PPP negotiation code
114 negotiation, accessing the channel through the /dev/ppp interface.
117 skbuff structures and start with the two-byte PPP protocol number.
121 characters included. That is all the responsibility of the channel
123 presented to the start_xmit() function contain only the 2-byte
127 The channel must provide an instance of a ppp_channel struct to
128 represent the channel. The channel is free to use the ``private`` field
129 however it wishes. The channel should initialize the ``mtu`` and
133 is, it does not include the 2-byte protocol number.
135 If the channel needs some headroom in the skbuffs presented to it for
139 PPP layer will attempt to provide that much headroom but the channel
149 --------------------------
154 queue of transmit packets for each attached channel. Normally the
155 transmit queue for the unit will contain at most one packet; the
165 (Deflate or BSD-Compress compression), as appropriate. After this
171 channel's start_xmit() function. If the channel refuses to take
173 generic layer will call the channel's start_xmit() function again
174 when the channel calls ppp_output_wakeup() or when the core
179 If multilink is in use, the generic layer divides the packet into one
183 fragment at the moment. A channel is potentially able to accept a
185 to transmit. The channel may still refuse a fragment; in this case
186 the fragment is queued up for the channel to transmit later. This
187 scheme has the effect that more fragments are given to higher-
196 ----------
198 The PPP generic layer has been designed to be SMP-safe. Locks are
205 channel and the generic layer. This is because the channel provides
206 the storage for the ppp_channel structure, and so the channel is
210 The generic layer requires these guarantees from the channel:
218 channel at the time that ppp_unregister_channel() is called for that
219 channel.
227 * The generic layer may call the channel start_xmit() function at
231 * The generic layer will only call the channel ioctl() function in
237 channel while any thread is already executing in that function for
238 that channel.
240 * The generic layer will not call the ioctl() function for a channel
242 channel.
245 will be executing in a call from the generic layer to that channel's
251 -----------------
255 channels. Although there is only one /dev/ppp, each open instance of
257 or a PPP channel. This is achieved using the file->private_data field
265 existing unit, attached to a newly-created unit, or attached to an
266 existing channel. An instance attached to a unit can be used to send
269 attached to a channel can be used to send and receive PPP frames on
270 that channel.
275 unit) will be subject to bundle-level compression and to fragmentation
277 PPP frame sent by a write to the channel will be sent as-is on that
278 channel, without any multilink header.
280 A channel is not initially attached to any unit. In this state it can
287 to a PPP channel. The ioctl calls which are available on an
292 an int which is the desired unit number if >= 0, or -1 to assign the
301 * PPPIOCATTCHAN attaches this instance to an existing PPP channel.
302 The argument should point to an int containing the channel number.
305 channel are:
307 * PPPIOCCONNECT connects this channel to a PPP interface. The
309 number. It will return an EINVAL error if the channel is already
313 * PPPIOCDISCONN disconnects this channel from the PPP interface that
314 it is connected to. It will return an EINVAL error if the channel
317 * PPPIOCBRIDGECHAN bridges a channel with another. The argument should
318 point to an int containing the channel number of the channel to bridge
319 to. Once two channels are bridged, frames presented to one channel by
321 This allows frames to be switched from one channel into another: for
322 example, to pass PPPoE frames into a PPPoL2TP session. Since channel
323 bridging interrupts the normal ppp_input() path, a given channel may
325 This ioctl will return an EALREADY error if the channel is already
326 part of a bridge or unit, or ENXIO if the requested channel does not
330 a channel pair. This ioctl will return an EINVAL error if the channel
333 * All other ioctl commands are passed to the channel ioctl() function.
348 SC_NO_TCP_CCID disable connection-id compression for
362 The values of these flags are defined in <linux/ppp-ioctl.h>. Note
375 SC_DC_ERROR CCP decompressor detected non-fatal error
381 structure (defined in <linux/ppp-ioctl.h>), which contains a
408 expecting times as either 32-bit or 64-bit time_t seconds.
410 * PPPIOCSMAXCID sets the maximum connection-ID parameter (and thus the
413 argument specify the maximum connection-ID for the compressor. If
414 the upper 16 bits of that int are non-zero, they specify the maximum
415 connection-ID for the decompressor, otherwise the decompressor's
416 maximum connection-ID is set to 15.
418 * PPPIOCSNPMODE sets the network-protocol mode for a given network
420 in <linux/ppp-ioctl.h>). The ``protocol`` field gives the PPP protocol
435 * PPPIOCGNPMODE returns the network-protocol mode for a given
438 interest. On return the ``mode`` field will be set to the network-
456 Last modified: 7-feb-2002