The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/include/sys/socket.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*
    2 sys/socket.h
    3 */
    4 
    5 #ifndef SYS_SOCKET_H
    6 #define SYS_SOCKET_H
    7 
    8 /* Can we include <stdint.h> here or do we need an additional header that is
    9  * safe to include?
   10  */
   11 #include <stdint.h>
   12 
   13 /* Open Group Base Specifications Issue 6 (not complete) */
   14 #include <net/gen/socket.h>
   15 
   16 #define SOCK_STREAM     1
   17 #define SOCK_DGRAM      2
   18 #define SOCK_RAW        3
   19 #define SOCK_RDM        4
   20 #define SOCK_SEQPACKET  5
   21 
   22 #define SOL_SOCKET      0xFFFF
   23 
   24 #define SO_DEBUG        0x0001
   25 #define SO_REUSEADDR    0x0004
   26 #define SO_KEEPALIVE    0x0008
   27 
   28 #define SO_SNDBUF       0x1001  /* send buffer size */
   29 #define SO_ERROR        0x1007  /* get and clear error status */
   30 
   31 /* The how argument to shutdown */
   32 #define SHUT_RD         0       /* No further reads */
   33 #define SHUT_WR         1       /* No further writes */
   34 #define SHUT_RDWR       2       /* No further reads and writes */
   35 
   36 #ifndef _SA_FAMILY_T
   37 #define _SA_FAMILY_T
   38 typedef uint8_t         sa_family_t;
   39 #endif /* _SA_FAMILY_T */
   40 
   41 typedef int32_t socklen_t;
   42 
   43 struct sockaddr
   44 {
   45         sa_family_t     sa_family;
   46         char            sa_data[1];
   47 };
   48 
   49 _PROTOTYPE( int accept, (int _socket,
   50                                 struct sockaddr *_RESTRICT _address,
   51                                 socklen_t *_RESTRICT _address_len)      );
   52 _PROTOTYPE( int bind, (int _socket, const struct sockaddr *_address,
   53                                                 socklen_t _address_len) );
   54 _PROTOTYPE( int connect, (int _socket, const struct sockaddr *_address,
   55                                                 socklen_t _address_len) );
   56 _PROTOTYPE( int getpeername, (int _socket,
   57                                 struct sockaddr *_RESTRICT _address,
   58                                 socklen_t *_RESTRICT _address_len)      );
   59 _PROTOTYPE( int getsockname, (int _socket,
   60                                 struct sockaddr *_RESTRICT _address,
   61                                 socklen_t *_RESTRICT _address_len)      );
   62 _PROTOTYPE( int setsockopt,(int _socket, int _level, int _option_name,
   63                 const void *_option_value, socklen_t _option_len)       );
   64 _PROTOTYPE( int listen, (int _socket, int _backlog)                     );
   65 _PROTOTYPE( ssize_t recvfrom, (int _socket, void *_RESTRICT _buffer,
   66         size_t _length, int _flags, struct sockaddr *_RESTRICT _address,
   67                                 socklen_t *_RESTRICT _address_len)      );
   68 _PROTOTYPE( ssize_t sendto, (int _socket, const void *_message,
   69         size_t _length, int _flags, const struct sockaddr *_dest_addr,
   70                                                 socklen_t _dest_len)    );
   71 _PROTOTYPE( int shutdown, (int _socket, int _how)                       );
   72 _PROTOTYPE( int socket, (int _domain, int _type, int _protocol)         );
   73 
   74 #endif /* SYS_SOCKET_H */

Cache object: d21f2b5ca2f6bd021af0a1bc2a2bd492


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.