[BACK]Return to socket.h CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / sys

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/sys/socket.h between version 1.53 and 1.59.2.2

version 1.53, 2000/04/03 02:06:11 version 1.59.2.2, 2001/08/24 00:13:09
Line 74 
Line 74 
 /*  /*
  * Data types.   * Data types.
  */   */
 typedef unsigned int    socklen_t;  #include <sys/ansi.h>
   
   #ifndef sa_family_t
   typedef __sa_family_t   sa_family_t;
   #define sa_family_t     __sa_family_t
   #endif
   
   #ifndef socklen_t
   typedef __socklen_t     socklen_t;
   #define socklen_t       __socklen_t
   #endif
   
 /*  /*
  * Socket types.   * Socket types.
Line 179  struct linger {
Line 189  struct linger {
  * addresses.   * addresses.
  */   */
 struct sockaddr {  struct sockaddr {
         u_char  sa_len;                 /* total length */          uint8_t         sa_len;         /* total length */
         u_char  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 */
 };  };
   
 #if defined(_KERNEL)  #if defined(_KERNEL)
Line 201  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 */
         u_char  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 */
         char    __ss_pad2[_SS_PAD2SIZE];          char            __ss_pad2[_SS_PAD2SIZE];
 };  };
 #endif /* !_XOPEN_SOURCE || ... */  #endif /* !_XOPEN_SOURCE || ... */
 #endif /* 1 */  #endif /* 1 */
Line 397  struct cmsghdr {
Line 407  struct cmsghdr {
   
 /* given pointer to struct cmsghdr, return pointer to data */  /* given pointer to struct cmsghdr, return pointer to data */
 #define CMSG_DATA(cmsg) \  #define CMSG_DATA(cmsg) \
         ((u_char *)(cmsg) + __CMSG_ALIGN(sizeof(struct cmsghdr)))          ((u_char *)(void *)(cmsg) + __CMSG_ALIGN(sizeof(struct cmsghdr)))
   
 /*  /*
  * Alignment requirement for CMSG struct manipulation.   * Alignment requirement for CMSG struct manipulation.
Line 410  struct cmsghdr {
Line 420  struct cmsghdr {
  */   */
 #define __CMSG_ALIGN(n) (((n) + __cmsg_alignbytes()) & ~__cmsg_alignbytes())  #define __CMSG_ALIGN(n) (((n) + __cmsg_alignbytes()) & ~__cmsg_alignbytes())
 #ifdef _KERNEL  #ifdef _KERNEL
 #define CMSG_ALIGN(n)   CMSG_ALIGN(n)  #define CMSG_ALIGN(n)   __CMSG_ALIGN(n)
 #endif  #endif
   
 /* given pointer to struct cmsghdr, return pointer to next cmsghdr */  /* given pointer to struct cmsghdr, return pointer to next cmsghdr */
Line 445  struct cmsghdr {
Line 455  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 462  struct omsghdr {
Line 472  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 489  int shutdown __P((int, int));
Line 501  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_ */

Legend:
Removed from v.1.53  
changed lines
  Added in v.1.59.2.2

CVSweb <webmaster@jp.NetBSD.org>