pup.4p
来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 4P 代码 · 共 80 行
4P
80 行
.\" SCCSID: @(#)pup.4p 8.1 9/11/90.TH pup 4p VAX "" Unsupported.SH Namepup \- raw PUP socket interface.SH Syntax.B #include <sys/socket.h>.br.B #include <netpup/pup.h>.PP.B socket(AF_PUP, SOCK_RAW, PUPPROTO_BSP);.SH DescriptionA raw pup socket provides PUP-I access to anEthernet network. Users send packets using the .PN sendto call, and receive packets with the.PN recvfrom call. All outgoing packets must have space present atthe front of the packet to allow the PUP header to befilled in. The header format is described in .MS pup 4F .Likewise, packets receivedby the user will have the PUP header on the front. ThePUP header and legal values for the various fieldsare defined in the include file.RI < netpup/pup.h >..PPThe raw pup interface automatically installs the lengthand source and destination addresses in the PUP header of alloutgoing packets; these need not be filled in by the user.The only control bit that may be set in the .I tcontrolfield of outgoing packets is the \*(lqtrace\*(rq bit.A checksum is calculated unless the sender sets the checksumfield to PUP_NOCKSUM..SH DiagnosticsA socket operation may fail and one of the following will be returned:.TP 15[EISCONN]When trying to establish a connection on a socket whichalready has one, or when trying to send a datagram with the destinationaddress specified and the socket is already connected..TP 15[ENOTCONN]When trying to send a datagram, butno destination address is specified, and the socket hasn't beenconnected..TP 15[ENOBUFS]When the system runs out of memory foran internal data structure..TP 15[EADDRNOTAVAIL]When an attempt is made to create a socket with a network address for which no network interfaceexists..PPA .PN sendtooperation may fail if one of the following is true:.TP 15[EINVAL]Insufficient space was left by the user for the PUP header..TP 15[EINVAL]The.I pup_typefield was 0 or the .I pup_tcontrolfield had a bit other than PUP_TRACE set..TP 15[EMSGSIZE]The message was not an even number of bytes, smaller thanMINPUPSIZ, or large than MAXPUPSIZ..TP 15[ENETUNREACH]The destination address was on a network which was notdirectly reachable (the raw interface provides no routing support)..SH See Alsosend(2), recv(2), intro(4n), pup(4f)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?