NONE(4) BSD Programmer's Manual NONE(4)NAME
none - raw point to point (P2P) interface
SYNOPSIS
#include <sys/types.h>
#include <sys/ioctl.h>
#include <net/if.h>
DESCRIPTION
The none link-level type provides raw access to point to point (P2P) se-
rial device. The serial device, after being assigned the link-type of
none (see ifconfig(8)), may be opened by opening a raw link-level socket
(see socket(2)). The domain must be set to AF_LINK, the type must be set
to SOCK_RAW, and the protocol must be the interface's index number (see
if_nametoindex(3)).
Once opened, the standard read(2) and write(2) families of system call
may be used to read and write packets. Each read will return a single
packet, truncating the packet if there is not enough room in the input
buffer. Each write will be translated into a single outgoing packet.
EXAMPLE
Assuming device ntwo1 has been set to the none link-level type, the fol-
lowing code could be used to obtain a file descriptor from which you may
read and write packets:
int index, fd;
if ((index = if_nametoindex("ntwo1")) > 0)
fd = socket(AF_LINK, SOCK_RAW, index)) <0)
else
fd = -1;
CAVEATS
The none link-type depends on the device dependent P2P driver (or hard-
ware) to recognize actual packets. If the device driver only understands
basic HDLC packet format then only packets sent using the basic HDLC
packet format. Packets sent in any another format will not be recognized
by the device driver and hence will not be available through the none
link-type.
SEE ALSOsocket(2), if_nametoindex(3), intro(4), p2p(4), ifconfig(8)
BSD/OS September 8, 1998 1