|
|
1.1 ! root 1: /* ! 2: * Copyright (c) 1982, 1986 Regents of the University of California. ! 3: * All rights reserved. The Berkeley software License Agreement ! 4: * specifies the terms and conditions for redistribution. ! 5: * ! 6: * @(#)unpcb.h 7.1 (Berkeley) 6/4/86 ! 7: */ ! 8: ! 9: /* ! 10: * Protocol control block for an active ! 11: * instance of a UNIX internal protocol. ! 12: * ! 13: * A socket may be associated with an inode in the ! 14: * file system. If so, the unp_inode pointer holds ! 15: * a reference count to this inode, which should be irele'd ! 16: * when the socket goes away. ! 17: * ! 18: * A socket may be connected to another socket, in which ! 19: * case the control block of the socket to which it is connected ! 20: * is given by unp_conn. ! 21: * ! 22: * A socket may be referenced by a number of sockets (e.g. several ! 23: * sockets may be connected to a datagram socket.) These sockets ! 24: * are in a linked list starting with unp_refs, linked through ! 25: * unp_nextref and null-terminated. Note that a socket may be referenced ! 26: * by a number of other sockets and may also reference a socket (not ! 27: * necessarily one which is referencing it). This generates ! 28: * the need for unp_refs and unp_nextref to be separate fields. ! 29: * ! 30: * Stream sockets keep copies of receive sockbuf sb_cc and sb_mbcnt ! 31: * so that changes in the sockbuf may be computed to modify ! 32: * back pressure on the sender accordingly. ! 33: */ ! 34: struct unpcb { ! 35: struct socket *unp_socket; /* pointer back to socket */ ! 36: struct inode *unp_inode; /* if associated with file */ ! 37: ino_t unp_ino; /* fake inode number */ ! 38: struct unpcb *unp_conn; /* control block of connected socket */ ! 39: struct unpcb *unp_refs; /* referencing socket linked list */ ! 40: struct unpcb *unp_nextref; /* link in unp_refs list */ ! 41: struct mbuf *unp_addr; /* bound address of socket */ ! 42: int unp_cc; /* copy of rcv.sb_cc */ ! 43: int unp_mbcnt; /* copy of rcv.sb_mbcnt */ ! 44: }; ! 45: ! 46: #define sotounpcb(so) ((struct unpcb *)((so)->so_pcb))
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.