Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

read(2)

write(2)

getmsg(2)

putmsg(2)

socket(2)

bind(2)

connect(2)

send(2)

sendto(2)

recv(2)

recvfrom(2)

streamio(7)

tcp(7)

udp(7)

ip(7)

RAW(7)  —  

NAME

raw − raw interface to internal network protocol

DESCRIPTION

raw is a (N by 1) STREAMS multiplexor.  The upstream side (N) is clonable (see clone(7)).  The downstream side is the ip(7) multiplexor.  raw, emulating the functionality of SOCK_RAW as in the BSD system, provides access to the underlying network protocol.  Each raw stream supports two abstractions: socket abstraction as used in the BSD systems and Transport Level Interface (TLI) abstraction as used in System V Release 3. 

In the socket abstraction, raw(7) can operate in either “connection” or “connectionless” mode.  In the former, the user has to connect(2) to the peer first.  Then the data transfer can take place via the normal read(2) or write(2) system calls.  In the latter, the each data transfer may address to a different peer.  User uses the putmsg(2) and getmsg(2) system calls for data transfer.  Each transfer unit (called a “message” in the STREAMS parlance) contains an M_PROTO block which encodes the address, followed by M_DATA blocks.  The address is specified in the format of struct sockaddr_in as described in <netinet/in.h>. 

In the TLI abstraction, each transfer contains an M_PROTO block and some M_DATA blocks.  The M_PROTO has the type T_UNITDATA_REQ for output and T_UNITDATA_IND for input.  The address is specified in the format of struct sockaddr_in as described in <netinet/in.h>. 

When network data arrive at the ip(7), if the protocol type (in the IP header) is 6, data is sent up to the tcp(7); if the type is 11, data is sent up to the udp(7); otherwise, data is sent up the raw(7) multiplexor.  Once here, data is further multiplexed the following way.  If a channel has been opened and bound to (via RAWIOC_SETPROTO ioctl) that particular type, then data is sent there.  Otherwise, data is directed to the channel which was bound to “wildcard” (that is, “0”) protocol type.  Data is discarded at the raw(7) multiplexor if no s“wildcard” channel. 

COMMAND FUNCTIONS

raw recognizes the following ioctl commands; their interpretations are described in tcp(7). 

I_PUSH
I_POP
SOCK_ON
SOCK_BIND
SOCK_CONNECT
SOCK_SHUTDOWN
SOCK_GETNAME
SOCK_GETPEER
SOCK_SETOPT
SOCK_GETOPT

RAWIOC_SETPROTO Set the protocol number for the channel. 

FILES

/dev/raw raw clone device

/dev/raw0 raw control channel

SEE ALSO

read(2), write(2), getmsg(2), putmsg(2), socket(2), bind(2), connect(2), send(2), sendto(2), recv(2), recvfrom(2)
streamio(7), tcp(7), udp(7), ip(7)

September 02, 1992

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026