1: /*
2: * Copyright (c) 1982, 1986 Regents of the University of California.
3: * All rights reserved.
4: *
5: * Redistribution and use in source and binary forms are permitted
6: * provided that this notice is preserved and that due credit is given
7: * to the University of California at Berkeley. The name of the University
8: * may not be used to endorse or promote products derived from this
9: * software without specific prior written permission. This software
10: * is provided ``as is'' without express or implied warranty.
11: *
12: * @(#)unpcb.h 7.2 (Berkeley) 1/7/88
13: */
14:
15: /*
16: * Protocol control block for an active
17: * instance of a UNIX internal protocol.
18: *
19: * A socket may be associated with an inode in the
20: * file system. If so, the unp_inode pointer holds
21: * a reference count to this inode, which should be irele'd
22: * when the socket goes away.
23: *
24: * A socket may be connected to another socket, in which
25: * case the control block of the socket to which it is connected
26: * is given by unp_conn.
27: *
28: * A socket may be referenced by a number of sockets (e.g. several
29: * sockets may be connected to a datagram socket.) These sockets
30: * are in a linked list starting with unp_refs, linked through
31: * unp_nextref and null-terminated. Note that a socket may be referenced
32: * by a number of other sockets and may also reference a socket (not
33: * necessarily one which is referencing it). This generates
34: * the need for unp_refs and unp_nextref to be separate fields.
35: *
36: * Stream sockets keep copies of receive sockbuf sb_cc and sb_mbcnt
37: * so that changes in the sockbuf may be computed to modify
38: * back pressure on the sender accordingly.
39: */
40: struct unpcb {
41: struct socket *unp_socket; /* pointer back to socket */
42: struct inode *unp_inode; /* if associated with file */
43: ino_t unp_ino; /* fake inode number */
44: struct unpcb *unp_conn; /* control block of connected socket */
45: struct unpcb *unp_refs; /* referencing socket linked list */
46: struct unpcb *unp_nextref; /* link in unp_refs list */
47: struct mbuf *unp_addr; /* bound address of socket */
48: int unp_cc; /* copy of rcv.sb_cc */
49: int unp_mbcnt; /* copy of rcv.sb_mbcnt */
50: };
51:
52: #define sotounpcb(so) ((struct unpcb *)((so)->so_pcb))
Defined struct's
unpcb
defined in line
40; used 42 times
- in line 44-46(6)
- in /usr/src/new/crash/dispnet.c line
541(2)
- in /usr/src/sys/sys/uipc_usrreq.c line
42(2),
285(2),
303(2),
310(2),
330(2),
387-388(4),
415-417(4),
452(2),
461(2),
467(2)
- in /usr/src/ucb/netstat/unix.c line
97(2)
- in /usr/src/usr.bin/fstat/fstat.c line
422(2),
531-536(6)
Defined macros
Usage of this include