.TH PUP 4P "26 March 1982" .UC 4 .SH NAME pup \- raw PUP socket interface .SH SYNOPSIS .B #include .br .B #include .PP .B socket(AF_PUP, SOCK_RAW, PUPPROTO_BSP); .SH DESCRIPTION The raw pup socket provides nearly direct access to an Ethernet network interface. Users send packets through the interface using the .I sendto call, and receive packets with the .IR recvfrom call. All outgoing packets must have space present at the front of the packet to allow the PUP header to be filled in. The header format is described in .IR pup (4F). Likewise, packets received by the user will have the PUP header on the front. The PUP header and legal values for the various fields are defined in the include file .RI < netpup/pup.h >. .PP The raw pup interface automatically installs the length and source and destination addresses in the PUP header of all outgoing packets; these need not be filled in by the user. The only control bit that may be set in the .I tcontrol field of outgoing packets is the \*(lqtrace\*(rq bit. .SH DIAGNOSTICS A socket operation may fail and one of the following will be returned: .TP 15 [EISCONN] when trying to establish a connection on a socket which already has one, or when trying to send a datagram with the destination address specified and the socket is already connected; .TP 15 [ENOTCONN] when trying to send a datagram, but no destination address is specified, and the socket hasn't been connected; .TP 15 [ENOBUFS] when the system runs out of memory for an internal data structure; .TP 15 [EADDRNOTAVAIL] when an attempt is made to create a socket with a network address for which no network interface exists. .SH SEE ALSO send(2), recv(2), intro(4N), pup(4F) .SH BUGS The interface is untested with 4.1c.