version 1.66, 2003/04/19 21:30:29 |
version 1.67, 2003/04/28 23:16:30 |
|
|
#ifndef _SYS_SOCKET_H_ |
#ifndef _SYS_SOCKET_H_ |
#define _SYS_SOCKET_H_ |
#define _SYS_SOCKET_H_ |
|
|
|
#include <sys/featuretest.h> |
|
|
/* |
/* |
* Definitions related to sockets: types, address families, options. |
* Definitions related to sockets: types, address families, options. |
*/ |
*/ |
|
|
#define AF_APPLETALK 16 /* Apple Talk */ |
#define AF_APPLETALK 16 /* Apple Talk */ |
#define AF_ROUTE 17 /* Internal Routing Protocol */ |
#define AF_ROUTE 17 /* Internal Routing Protocol */ |
#define AF_LINK 18 /* Link layer interface */ |
#define AF_LINK 18 /* Link layer interface */ |
#if !defined(_XOPEN_SOURCE) |
#if defined(_NETBSD_SOURCE) |
#define pseudo_AF_XTP 19 /* eXpress Transfer Protocol (no AF) */ |
#define pseudo_AF_XTP 19 /* eXpress Transfer Protocol (no AF) */ |
#endif |
#endif |
#define AF_COIP 20 /* connection-oriented IP, aka ST II */ |
#define AF_COIP 20 /* connection-oriented IP, aka ST II */ |
#define AF_CNT 21 /* Computer Network Technology */ |
#define AF_CNT 21 /* Computer Network Technology */ |
#if !defined(_XOPEN_SOURCE) |
#if defined(_NETBSD_SOURCE) |
#define pseudo_AF_RTIP 22 /* Help Identify RTIP packets */ |
#define pseudo_AF_RTIP 22 /* Help Identify RTIP packets */ |
#endif |
#endif |
#define AF_IPX 23 /* Novell Internet Protocol */ |
#define AF_IPX 23 /* Novell Internet Protocol */ |
#define AF_INET6 24 /* IP version 6 */ |
#define AF_INET6 24 /* IP version 6 */ |
#if !defined(_XOPEN_SOURCE) |
#if defined(_NETBSD_SOURCE) |
#define pseudo_AF_PIP 25 /* Help Identify PIP packets */ |
#define pseudo_AF_PIP 25 /* Help Identify PIP packets */ |
#endif |
#endif |
#define AF_ISDN 26 /* Integrated Services Digital Network*/ |
#define AF_ISDN 26 /* Integrated Services Digital Network*/ |
#define AF_E164 AF_ISDN /* CCITT E.164 recommendation */ |
#define AF_E164 AF_ISDN /* CCITT E.164 recommendation */ |
#define AF_NATM 27 /* native ATM access */ |
#define AF_NATM 27 /* native ATM access */ |
#define AF_ARP 28 /* (rev.) addr. res. prot. (RFC 826) */ |
#define AF_ARP 28 /* (rev.) addr. res. prot. (RFC 826) */ |
#if !defined(_XOPEN_SOURCE) |
#if defined(_NETBSD_SOURCE) |
#define pseudo_AF_KEY 29 /* Internal key management protocol */ |
#define pseudo_AF_KEY 29 /* Internal key management protocol */ |
#define pseudo_AF_HDRCMPLT 30 /* Used by BPF to not rewrite hdrs |
#define pseudo_AF_HDRCMPLT 30 /* Used by BPF to not rewrite hdrs |
in interface output routine */ |
in interface output routine */ |
Line 229 struct sockproto { |
|
Line 231 struct sockproto { |
|
#define _SS_PAD2SIZE (_SS_MAXSIZE - 2 - \ |
#define _SS_PAD2SIZE (_SS_MAXSIZE - 2 - \ |
_SS_PAD1SIZE - _SS_ALIGNSIZE) |
_SS_PAD1SIZE - _SS_ALIGNSIZE) |
|
|
#if !defined(_XOPEN_SOURCE) || (_XOPEN_SOURCE - 0) >= 500 |
#if (_XOPEN_SOURCE - 0) >= 500 || defined(_NETBSD_SOURCE) |
struct sockaddr_storage { |
struct sockaddr_storage { |
__uint8_t ss_len; /* address length */ |
__uint8_t ss_len; /* address length */ |
sa_family_t ss_family; /* address family */ |
sa_family_t ss_family; /* address family */ |
Line 237 struct sockaddr_storage { |
|
Line 239 struct sockaddr_storage { |
|
__int64_t __ss_align;/* force desired structure storage alignment */ |
__int64_t __ss_align;/* force desired structure storage alignment */ |
char __ss_pad2[_SS_PAD2SIZE]; |
char __ss_pad2[_SS_PAD2SIZE]; |
}; |
}; |
#endif /* !_XOPEN_SOURCE || ... */ |
#endif /* _XOPEN_SOURCE >= 500 || _NETBSD_SOURCE */ |
#endif /* 1 */ |
#endif /* 1 */ |
|
|
/* |
/* |
Line 264 struct sockaddr_storage { |
|
Line 266 struct sockaddr_storage { |
|
#define PF_APPLETALK AF_APPLETALK |
#define PF_APPLETALK AF_APPLETALK |
#define PF_ROUTE AF_ROUTE |
#define PF_ROUTE AF_ROUTE |
#define PF_LINK AF_LINK |
#define PF_LINK AF_LINK |
#if !defined(_XOPEN_SOURCE) |
#if defined(_NETBSD_SOURCE) |
#define PF_XTP pseudo_AF_XTP /* really just proto family, no AF */ |
#define PF_XTP pseudo_AF_XTP /* really just proto family, no AF */ |
#endif |
#endif |
#define PF_COIP AF_COIP |
#define PF_COIP AF_COIP |
#define PF_CNT AF_CNT |
#define PF_CNT AF_CNT |
#define PF_INET6 AF_INET6 |
#define PF_INET6 AF_INET6 |
#define PF_IPX AF_IPX /* same format as AF_NS */ |
#define PF_IPX AF_IPX /* same format as AF_NS */ |
#if !defined(_XOPEN_SOURCE) |
#if defined(_NETBSD_SOURCE) |
#define PF_RTIP pseudo_AF_FTIP /* same format as AF_INET */ |
#define PF_RTIP pseudo_AF_FTIP /* same format as AF_INET */ |
#define PF_PIP pseudo_AF_PIP |
#define PF_PIP pseudo_AF_PIP |
#endif |
#endif |
Line 279 struct sockaddr_storage { |
|
Line 281 struct sockaddr_storage { |
|
#define PF_E164 AF_E164 |
#define PF_E164 AF_E164 |
#define PF_NATM AF_NATM |
#define PF_NATM AF_NATM |
#define PF_ARP AF_ARP |
#define PF_ARP AF_ARP |
#if !defined(_XOPEN_SOURCE) |
#if defined(_NETBSD_SOURCE) |
#define PF_KEY pseudo_AF_KEY /* like PF_ROUTE, only for key mgmt */ |
#define PF_KEY pseudo_AF_KEY /* like PF_ROUTE, only for key mgmt */ |
#endif |
#endif |
|
|
#define PF_MAX AF_MAX |
#define PF_MAX AF_MAX |
|
|
#if !defined(_XOPEN_SOURCE) |
#if defined(_NETBSD_SOURCE) |
|
|
#ifndef gid_t |
#ifndef gid_t |
typedef __gid_t gid_t; /* group id */ |
typedef __gid_t gid_t; /* group id */ |
Line 314 struct sockcred { |
|
Line 316 struct sockcred { |
|
*/ |
*/ |
#define SOCKCREDSIZE(ngrps) \ |
#define SOCKCREDSIZE(ngrps) \ |
(sizeof(struct sockcred) + (sizeof(gid_t) * ((ngrps) - 1))) |
(sizeof(struct sockcred) + (sizeof(gid_t) * ((ngrps) - 1))) |
#endif /* !_XOPEN_SOURCE */ |
#endif /* _NETBSD_SOURCE */ |
|
|
|
|
#if !defined(_XOPEN_SOURCE) |
#if defined(_NETBSD_SOURCE) |
/* |
/* |
* Definitions for network related sysctl, CTL_NET. |
* Definitions for network related sysctl, CTL_NET. |
* |
* |
Line 360 struct sockcred { |
|
Line 362 struct sockcred { |
|
{ "arp", CTLTYPE_NODE }, \ |
{ "arp", CTLTYPE_NODE }, \ |
{ "key", CTLTYPE_NODE }, \ |
{ "key", CTLTYPE_NODE }, \ |
} |
} |
#endif /* !_XOPEN_SOURCE */ |
#endif /* _NETBSD_SOURCE */ |
|
|
#if !defined(_XOPEN_SOURCE) |
#if defined(_NETBSD_SOURCE) |
/* |
/* |
* PF_ROUTE - Routing table |
* PF_ROUTE - Routing table |
* |
* |
Line 384 struct sockcred { |
|
Line 386 struct sockcred { |
|
{ 0, 0 }, \ |
{ 0, 0 }, \ |
{ "iflist", CTLTYPE_STRUCT }, \ |
{ "iflist", CTLTYPE_STRUCT }, \ |
} |
} |
#endif /* !_XOPEN_SOURCE */ |
#endif /* _NETBSD_SOURCE */ |
|
|
/* |
/* |
* Maximum queue length specifiable by listen(2). |
* Maximum queue length specifiable by listen(2). |
Line 472 struct cmsghdr { |
|
Line 474 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) */ |
#if !defined(_XOPEN_SOURCE) |
#if defined(_NETBSD_SOURCE) |
#define SCM_TIMESTAMP 0x02 /* timestamp (struct timeval) */ |
#define SCM_TIMESTAMP 0x02 /* timestamp (struct timeval) */ |
#define SCM_CREDS 0x04 /* credentials (struct sockcred) */ |
#define SCM_CREDS 0x04 /* credentials (struct sockcred) */ |
#endif |
#endif |
Line 484 struct cmsghdr { |
|
Line 486 struct cmsghdr { |
|
#define SHUT_WR 1 /* Disallow further sends. */ |
#define SHUT_WR 1 /* Disallow further sends. */ |
#define SHUT_RDWR 2 /* Disallow further sends/receives. */ |
#define SHUT_RDWR 2 /* Disallow further sends/receives. */ |
|
|
#if !defined(_XOPEN_SOURCE) |
#if defined(_NETBSD_SOURCE) |
/* |
/* |
* 4.3 compat sockaddr, move to compat file later |
* 4.3 compat sockaddr, move to compat file later |
*/ |
*/ |