1dlpi_recv(3DLPI)Data Link Provider Interface Library Functionsdlpi_recv(3DLPI)
2
3
4
6 dlpi_recv - receive a data message using DLPI
7
9 cc [ flag ... ] file ... -ldlpi [ library ... ]
10 #include <libdlpi.h>
11
12 int dlpi_recv(dlpi_handle_t dh, void *saddrp,
13 size_t * saddrlenp, void *msgbuf, size_t *msglenp,
14 int msec, dlpi_recvinfo_t *recvp);
15
16
18 The dlpi_recv() function attempts to receive data messages over the
19 DLPI link instance associated with the DLPI handle dh. If dh is not in
20 the DL_IDLE DLPI state, the attempt fails. The caller must ensure that
21 msgbuf is at least msglenp bytes in size. Upon success, msgbuf contains
22 the data message received, msglenp contains the number of bytes placed
23 in msgbuf.
24
25
26 The caller must ensure that saddrp is at least DLPI_PHYSADDR_MAX bytes
27 in size and saddrlenp must contain the length of saddrp. Upon success,
28 saddrp contains the address of the source sending the data message and
29 saddrlenp contains the source address length. If the caller is not
30 interested in the source address, both saddrp and saddrlenp can be left
31 as NULL. If the source address is not available, saddrp is not filled
32 in and saddrlenp is set to zero.
33
34
35 The dlpi_recvinfo_t is a structure defined in <libdlpi.h> as follows:
36
37 typedef struct {
38 uchar_t dri_destaddr[DLPI_PHYSADDR_MAX];
39 uchar_t dri_destaddrlen;
40 dlpi_addrtype_t dri_destaddrtype;
41 size_t dri_totmsglen;
42 } dlpi_recvinfo_t;
43
44
45
46 Upon success, if recvp is not set to NULL, dri_destaddr contains the
47 destination address, dri_destaddrlen contains the destination address
48 length, and dri_totmsglen contains the total length of the message
49 received. If the destination address is unicast, dri_destaddrtype is
50 set to DLPI_ADDRTYPE_UNICAST. Otherwise, it is set to DLPI_ADDR‐
51 TYPE_GROUP.
52
53
54 The values of msglenp and dri_totmsglen might vary when a message
55 larger than the size of msgbuf is received. In that case, the caller
56 can use dri_totmsglen to determine the original total length of the
57 message.
58
59
60 If the handle is in raw mode, as described in dlpi_open(3DLPI), msgbuf
61 starts with the link-layer header. See dlpi(7P). The values of saddrp,
62 saddrlenp, and all the members of dlpi_recvinfo_t except dri_totmsglen
63 are invalid because the address information is already included in the
64 link-layer header returned by msgbuf.
65
66
67 If no message is received within msec milliseconds, dlpi_recv() returns
68 DLPI_ETIMEDOUT. If msec is 0, dlpi_recv() does not block. If msec is
69 -1, dlpi_recv() does block until a data message is received.
70
72 Upon success, DLPI_SUCCESS is returned. If DL_SYSERR is returned, errno
73 contains the specific UNIX system error value. Otherwise, a DLPI error
74 value defined in <sys/dlpi.h> or an error value listed in the following
75 section is returned.
76
78 DLPI_EBADMSG Bad DLPI message
79
80
81 DLPI_EINHANDLE Invalid DLPI handle
82
83
84 DLPI_EINVAL Invalid argument
85
86
87 DLPI_ETIMEDOUT DLPI operation timed out
88
89
90 DLPI_EUNAVAILSAP Unavailable DLPI SAP
91
92
93 DLPI_FAILURE DLPI operation failed
94
95
97 See attributes(5) for description of the following attributes:
98
99
100
101
102 ┌─────────────────────────────┬─────────────────────────────┐
103 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
104 ├─────────────────────────────┼─────────────────────────────┤
105 │Interface Stability │Committed │
106 ├─────────────────────────────┼─────────────────────────────┤
107 │MT-Level │Safe │
108 └─────────────────────────────┴─────────────────────────────┘
109
111 dlpi_bind(3DLPI), dlpi_open(3DLPI), libdlpi(3LIB), attributes(5),
112 dlpi(7P)
113
114
115
116SunOS 5.11 22 Aug 2007 dlpi_recv(3DLPI)