version 1.57, 2000/07/05 02:47:23 |
version 1.60.2.2, 2001/09/13 01:16:28 |
|
|
|
|
#ifndef sa_family_t |
#ifndef sa_family_t |
typedef __sa_family_t sa_family_t; |
typedef __sa_family_t sa_family_t; |
#define sa_family_t sa_family_t |
#define sa_family_t __sa_family_t |
#endif |
#endif |
|
|
#ifndef socklen_t |
#ifndef socklen_t |
typedef __socklen_t socklen_t; |
typedef __socklen_t socklen_t; |
#define socklen_t socklen_t |
#define socklen_t __socklen_t |
#endif |
#endif |
|
|
/* |
/* |
|
|
* addresses. |
* addresses. |
*/ |
*/ |
struct sockaddr { |
struct sockaddr { |
u_char sa_len; /* total length */ |
uint8_t sa_len; /* total length */ |
sa_family_t sa_family; /* address family */ |
sa_family_t sa_family; /* address family */ |
char sa_data[14]; /* actually longer; address value */ |
char sa_data[14]; /* actually longer; address value */ |
}; |
}; |
Line 211 struct sockproto { |
|
Line 211 struct sockproto { |
|
*/ |
*/ |
#define _SS_MAXSIZE 128 |
#define _SS_MAXSIZE 128 |
#define _SS_ALIGNSIZE (sizeof(int64_t)) |
#define _SS_ALIGNSIZE (sizeof(int64_t)) |
#define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof(u_char) * 2) |
#define _SS_PAD1SIZE (_SS_ALIGNSIZE - 2) |
#define _SS_PAD2SIZE (_SS_MAXSIZE - sizeof(u_char) * 2 - \ |
#define _SS_PAD2SIZE (_SS_MAXSIZE - 2 - \ |
_SS_PAD1SIZE - _SS_ALIGNSIZE) |
_SS_PAD1SIZE - _SS_ALIGNSIZE) |
|
|
#if !defined(_XOPEN_SOURCE) || (_XOPEN_SOURCE - 0) >= 500 |
#if !defined(_XOPEN_SOURCE) || (_XOPEN_SOURCE - 0) >= 500 |
struct sockaddr_storage { |
struct sockaddr_storage { |
u_char ss_len; /* address length */ |
uint8_t ss_len; /* address length */ |
sa_family_t ss_family; /* address family */ |
sa_family_t ss_family; /* address family */ |
char __ss_pad1[_SS_PAD1SIZE]; |
char __ss_pad1[_SS_PAD1SIZE]; |
int64_t __ss_align;/* force desired structure storage alignment */ |
int64_t __ss_align;/* force desired structure storage alignment */ |
Line 431 struct cmsghdr { |
|
Line 431 struct cmsghdr { |
|
(struct cmsghdr *)NULL : \ |
(struct cmsghdr *)NULL : \ |
(struct cmsghdr *)((caddr_t)(cmsg) + __CMSG_ALIGN((cmsg)->cmsg_len))) |
(struct cmsghdr *)((caddr_t)(cmsg) + __CMSG_ALIGN((cmsg)->cmsg_len))) |
|
|
#define CMSG_FIRSTHDR(mhdr) ((struct cmsghdr *)(mhdr)->msg_control) |
/* |
|
* RFC 2292 requires to check msg_controllen, in case that the kernel returns |
|
* an empty list for some reasons. |
|
*/ |
|
#define CMSG_FIRSTHDR(mhdr) \ |
|
((mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \ |
|
(struct cmsghdr *)(mhdr)->msg_control : \ |
|
(struct cmsghdr *)NULL) |
|
|
#define CMSG_SPACE(l) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + __CMSG_ALIGN(l)) |
#define CMSG_SPACE(l) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + __CMSG_ALIGN(l)) |
#define CMSG_LEN(l) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + (l)) |
#define CMSG_LEN(l) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + (l)) |
Line 455 struct cmsghdr { |
|
Line 462 struct cmsghdr { |
|
* 4.3 compat sockaddr, move to compat file later |
* 4.3 compat sockaddr, move to compat file later |
*/ |
*/ |
struct osockaddr { |
struct osockaddr { |
u_short sa_family; /* address family */ |
uint16_t sa_family; /* address family */ |
char sa_data[14]; /* up to 14 bytes of direct address */ |
char sa_data[14]; /* up to 14 bytes of direct address */ |
}; |
}; |
|
|
/* |
/* |
Line 472 struct omsghdr { |
|
Line 479 struct omsghdr { |
|
}; |
}; |
#endif |
#endif |
|
|
|
#include <sys/cdefs.h> |
|
|
|
__BEGIN_DECLS |
int __cmsg_alignbytes __P((void)); |
int __cmsg_alignbytes __P((void)); |
|
__END_DECLS |
|
|
#ifndef _KERNEL |
#ifndef _KERNEL |
|
|
#include <sys/cdefs.h> |
|
|
|
__BEGIN_DECLS |
__BEGIN_DECLS |
int accept __P((int, struct sockaddr *, socklen_t *)); |
int accept __P((int, struct sockaddr *, socklen_t *)); |
int bind __P((int, const struct sockaddr *, socklen_t)); |
int bind __P((int, const struct sockaddr *, socklen_t)); |
Line 499 int shutdown __P((int, int)); |
|
Line 508 int shutdown __P((int, int)); |
|
int socket __P((int, int, int)); |
int socket __P((int, int, int)); |
int socketpair __P((int, int, int, int *)); |
int socketpair __P((int, int, int, int *)); |
__END_DECLS |
__END_DECLS |
#else |
|
#ifdef COMPAT_OLDSOCK |
|
#define MSG_COMPAT 0x8000 |
|
#endif |
|
#endif /* !_KERNEL */ |
#endif /* !_KERNEL */ |
|
|
#endif /* !_SYS_SOCKET_H_ */ |
#endif /* !_SYS_SOCKET_H_ */ |