version 1.21, 1997/03/18 03:47:42 |
version 1.30, 1998/04/25 17:29:45 |
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
* |
* |
* @(#)socket.h 8.4 (Berkeley) 2/21/94 |
* @(#)socket.h 8.6 (Berkeley) 5/3/95 |
*/ |
*/ |
|
|
#ifndef _SYS_SOCKET_H_ |
#ifndef _SYS_SOCKET_H_ |
|
|
*/ |
*/ |
struct linger { |
struct linger { |
int l_onoff; /* option on/off */ |
int l_onoff; /* option on/off */ |
int l_linger; /* linger time */ |
int l_linger; /* linger time in seconds */ |
}; |
}; |
|
|
/* |
/* |
Line 189 struct sockproto { |
|
Line 189 struct sockproto { |
|
#define PF_MAX AF_MAX |
#define PF_MAX AF_MAX |
|
|
/* |
/* |
|
* Socket credentials. |
|
*/ |
|
struct sockcred { |
|
uid_t sc_uid; /* real user id */ |
|
uid_t sc_euid; /* effective user id */ |
|
gid_t sc_gid; /* real group id */ |
|
gid_t sc_egid; /* effective group id */ |
|
int sc_ngroups; /* number of supplemental groups */ |
|
gid_t sc_groups[1]; /* variable length */ |
|
}; |
|
|
|
/* |
|
* Compute size of a sockcred structure with groups. |
|
*/ |
|
#define SOCKCREDSIZE(ngrps) \ |
|
(sizeof(struct sockcred) + (sizeof(gid_t) * ((ngrps) - 1))) |
|
|
|
/* |
* Definitions for network related sysctl, CTL_NET. |
* Definitions for network related sysctl, CTL_NET. |
* |
* |
* Second level is protocol family. |
* Second level is protocol family. |
Line 200 struct sockproto { |
|
Line 218 struct sockproto { |
|
|
|
#define CTL_NET_NAMES { \ |
#define CTL_NET_NAMES { \ |
{ 0, 0 }, \ |
{ 0, 0 }, \ |
{ "unix", CTLTYPE_NODE }, \ |
{ "local", CTLTYPE_NODE }, \ |
{ "inet", CTLTYPE_NODE }, \ |
{ "inet", CTLTYPE_NODE }, \ |
{ "implink", CTLTYPE_NODE }, \ |
{ "implink", CTLTYPE_NODE }, \ |
{ "pup", CTLTYPE_NODE }, \ |
{ "pup", CTLTYPE_NODE }, \ |
|
|
#define MSG_CTRUNC 0x20 /* control data lost before delivery */ |
#define MSG_CTRUNC 0x20 /* control data lost before delivery */ |
#define MSG_WAITALL 0x40 /* wait for full request or error */ |
#define MSG_WAITALL 0x40 /* wait for full request or error */ |
#define MSG_DONTWAIT 0x80 /* this message should be nonblocking */ |
#define MSG_DONTWAIT 0x80 /* this message should be nonblocking */ |
|
#define MSG_BCAST 0x100 /* this message was rcvd using link-level brdcst */ |
|
#define MSG_MCAST 0x200 /* this message was rcvd using link-level mcast */ |
|
|
/* |
/* |
* Header for ancillary data objects in msg_control buffer. |
* Header for ancillary data objects in msg_control buffer. |
Line 308 struct cmsghdr { |
|
Line 328 struct cmsghdr { |
|
/* "Socket"-level control message types: */ |
/* "Socket"-level control message types: */ |
#define SCM_RIGHTS 0x01 /* access rights (array of int) */ |
#define SCM_RIGHTS 0x01 /* access rights (array of int) */ |
#define SCM_TIMESTAMP 0x02 /* timestamp (struct timeval) */ |
#define SCM_TIMESTAMP 0x02 /* timestamp (struct timeval) */ |
|
#define SCM_CREDS 0x04 /* credientials (struct sockcred) */ |
|
|
|
/* |
|
* Types of socket shutdown(2). |
|
*/ |
|
#define SHUT_RD 0 /* Disallow further receives. */ |
|
#define SHUT_WR 1 /* Disallow further sends. */ |
|
#define SHUT_RDWR 2 /* Disallow further sends/receives. */ |
|
|
/* |
/* |
* 4.3 compat sockaddr, move to compat file later |
* 4.3 compat sockaddr, move to compat file later |