Main index | Section 4 | Options |
#include <sys/types.h>
#include <netgraph/ng_async.h>
The node transmits and receives asynchronous data on the async hook. Mbuf boundaries of incoming data are ignored. Once a complete packet has been received, it is decoded and stripped of all framing bytes, and transmitted out the sync hook as a single frame.
Synchronous frames are transmitted and received on the sync hook. Packets received on this hook are encoded as asynchronous frames and sent out on async. Received packets should start with the address and control fields, or the PPP protocol field if address and control field compression is employed, and contain no checksum field. If the first four bytes are 0xff 0x03 0xc0 0x21 (an LCP protocol frame) then complete control character escaping is enabled for that frame (in PPP, LCP packets are always sent with no address and control field compression and all control characters escaped).
This node supports "flag sharing" for packets transmitted on async. This is an optimization where the trailing flag byte of one frame is shared with the opening flag byte of the next. Flag sharing between frames is disabled after one second of transmit idle time.
async | |
Asynchronous connection. Typically this hook would be connected to a ng_tty(4) node, which handles transmission of serial data over a tty device. | |
sync | |
Synchronous connection. This hook sends and receives synchronous frames. For PPP, these frames should contain address, control, and protocol fields, but no checksum field. Typically this hook would be connected to an individual link hook of a ng_ppp(4) type node. | |
NGM_ASYNC_CMD_SET_CONFIG ( setconfig) | |
Sets the node configuration, which is described by a
struct ng_async_cfg:
struct ng_async_cfg { u_char enabled; /* Turn encoding on/off */ uint16_t amru; /* Max receive async frame length */ uint16_t smru; /* Max receive sync frame length */ uint32_t accm; /* ACCM encoding */ };The enabled field enables or disables all encoding/decoding functions (default disabled). When disabled, the node operates in simple "pass through" mode. The amru and smru fields are the asynchronous and synchronous MRU (maximum receive unit) values, respectively. These both default to 1600; note that the async MRU applies to the incoming frame length after asynchronous decoding. The accm field is the asynchronous character control map, which controls the escaping of characters 0x00 thorough 0x1f (default 0xffffffff). | |
NGM_ASYNC_CMD_GET_CONFIG ( getconfig) | |
This command returns the current configuration structure. | |
NGM_ASYNC_CMD_GET_STATS ( getstats) | |
This command returns a struct ng_async_stat containing node statistics for packet, octet, and error counts. | |
NGM_ASYNC_CMD_CLR_STATS ( clrstats) | |
Clears the node statistics. | |
RFC 1662, PPP in HDLC-link Framing,
,RFC 1661, The Point-to-Point Protocol (PPP),
,NG_ASYNC (4) | November 13, 2012 |
Main index | Section 4 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
“ | Like a classics radio station whose play list spans decades, Unix simultaneously exhibits its mixed and dated heritage. There's Clash-era graphics interfaces; Beatles-era two-letter command names; and systems programs (for example, ps) whose terse and obscure output was designed for slow teletypes; Bing Crosby-era command editing (# and @ are still the default line editing commands), and Scott Joplin-era core dumps. | ” |
— The Unix Haters' handbook |