BSD 4_2 development
[unix-history] / usr / man / man4 / pup.4p
CommitLineData
007b65a2
C
1.TH PUP 4P "7 July 1983"
2.UC 4
3.SH NAME
4pup \- raw PUP socket interface
5.SH SYNOPSIS
6.B #include <sys/socket.h>
7.br
8.B #include <netpup/pup.h>
9.PP
10.B socket(AF_PUP, SOCK_RAW, PUPPROTO_BSP);
11.SH DESCRIPTION
12A raw pup socket provides PUP-I access to an
13Ethernet network. Users send packets using the
14.I sendto
15call, and receive packets with the
16.IR recvfrom
17call. All outgoing packets must have space present at
18the front of the packet to allow the PUP header to be
19filled in. The header format is described in
20.IR pup (4F).
21Likewise, packets received
22by the user will have the PUP header on the front. The
23PUP header and legal values for the various fields
24are defined in the include file
25.RI < netpup/pup.h >.
26.PP
27The raw pup interface automatically installs the length
28and source and destination addresses in the PUP header of all
29outgoing packets; these need not be filled in by the user.
30The only control bit that may be set in the
31.I tcontrol
32field of outgoing packets is the \*(lqtrace\*(rq bit.
33A checksum is calculated unless the sender sets the checksum
34field to PUP_NOCKSUM.
35.SH DIAGNOSTICS
36A socket operation may fail and one of the following will be returned:
37.TP 15
38[EISCONN]
39when trying to establish a connection on a socket which
40already has one, or when trying to send a datagram with the destination
41address specified and the socket is already connected;
42.TP 15
43[ENOTCONN]
44when trying to send a datagram, but
45no destination address is specified, and the socket hasn't been
46connected;
47.TP 15
48[ENOBUFS]
49when the system runs out of memory for
50an internal data structure;
51.TP 15
52[EADDRNOTAVAIL]
53when an attempt is made to create a
54socket with a network address for which no network interface
55exists.
56.PP
57A
58.I sendto
59operation may fail if one of the following is true:
60.TP 15
61[EINVAL]
62Insufficient space was left by the user for the PUP header.
63.TP 15
64[EINVAL]
65The
66.I pup_type
67field was 0 or the
68.I pup_tcontrol
69field had a bit other than PUP_TRACE set.
70.TP 15
71[EMSGSIZE]
72The message was not an even number of bytes, smaller than
73MINPUPSIZ, or large than MAXPUPSIZ.
74.TP 15
75[ENETUNREACH]
76The destination address was on a network which was not
77directly reachable (the raw interface provides no routing support).
78.SH SEE ALSO
79send(2), recv(2), intro(4N), pup(4F)
80.SH BUGS
81The interface is untested against other PUP implementations.