root/include/linux/socket.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 #ifndef _LINUX_SOCKET_H
   2 #define _LINUX_SOCKET_H
   3 
   4 #include <linux/sockios.h>              /* the SIOCxxx I/O controls     */
   5 
   6 
   7 struct sockaddr {
   8   unsigned short        sa_family;      /* address family, AF_xxx       */
   9   char                  sa_data[14];    /* 14 bytes of protocol address */
  10 };
  11 
  12 struct linger {
  13   int                   l_onoff;        /* Linger active                */
  14   int                   l_linger;       /* How long to linger for       */
  15 };
  16 
  17 /* Socket types. */
  18 #define SOCK_STREAM     1               /* stream (connection) socket   */
  19 #define SOCK_DGRAM      2               /* datagram (conn.less) socket  */
  20 #define SOCK_RAW        3               /* raw socket                   */
  21 #define SOCK_RDM        4               /* reliably-delivered message   */
  22 #define SOCK_SEQPACKET  5               /* sequential packet socket     */
  23 #define SOCK_PACKET     10              /* linux specific way of        */
  24                                         /* getting packets at the dev   */
  25                                         /* level.  For writing rarp and */
  26                                         /* other similar things on the  */
  27                                         /* user level.                  */
  28 
  29 /* Supported address families. */
  30 #define AF_UNSPEC       0
  31 #define AF_UNIX         1       /* Unix domain sockets          */
  32 #define AF_INET         2       /* Internet IP Protocol         */
  33 #define AF_AX25         3       /* Amateur Radio AX.25          */
  34 #define AF_IPX          4       /* Novell IPX                   */
  35 #define AF_APPLETALK    5       /* Appletalk DDP                */
  36 #define AF_NETROM       6       /* Amateur radio NetROM         */
  37 #define AF_BRIDGE       7       /* Multiprotocol bridge         */
  38 #define AF_AAL5         8       /* Reserved for Werner's ATM    */
  39 #define AF_X25          9       /* Reserved for X.25 project    */
  40 #define AF_MAX          12      /* For now.. */
  41 
  42 /* Protocol families, same as address families. */
  43 #define PF_UNSPEC       AF_UNSPEC
  44 #define PF_UNIX         AF_UNIX
  45 #define PF_INET         AF_INET
  46 #define PF_AX25         AF_AX25
  47 #define PF_IPX          AF_IPX
  48 #define PF_APPLETALK    AF_APPLETALK
  49 #define PF_NETROM       AF_NETROM
  50 #define PF_BRIDGE       AF_BRIDGE
  51 #define PF_AAL5         AF_AAL5
  52 #define PF_X25          AF_X25
  53 
  54 #define PF_MAX          AF_MAX
  55 
  56 /* Flags we can use with send/ and recv. */
  57 #define MSG_OOB         1
  58 #define MSG_PEEK        2
  59 #define MSG_DONTROUTE   4
  60 
  61 /* Setsockoptions(2) level. Thanks to BSD these must match IPPROTO_xxx */
  62 #define SOL_SOCKET      1
  63 #define SOL_IP          0
  64 #define SOL_IPX         256
  65 #define SOL_AX25        257
  66 #define SOL_ATALK       258
  67 #define SOL_NETROM      259
  68 #define SOL_TCP         6
  69 #define SOL_UDP         17
  70 
  71 /* For setsockoptions(2) */
  72 #define SO_DEBUG        1
  73 #define SO_REUSEADDR    2
  74 #define SO_TYPE         3
  75 #define SO_ERROR        4
  76 #define SO_DONTROUTE    5
  77 #define SO_BROADCAST    6
  78 #define SO_SNDBUF       7
  79 #define SO_RCVBUF       8
  80 #define SO_KEEPALIVE    9
  81 #define SO_OOBINLINE    10
  82 #define SO_NO_CHECK     11
  83 #define SO_PRIORITY     12
  84 #define SO_LINGER       13
  85 /* To add :#define SO_REUSEPORT 14 */
  86 
  87 /* IP options */
  88 #define IP_TOS          1
  89 #define IPTOS_LOWDELAY          0x10
  90 #define IPTOS_THROUGHPUT        0x08
  91 #define IPTOS_RELIABILITY       0x04
  92 #define IP_TTL          2
  93 #ifdef V1_3_WILL_DO_THIS_FUNKY_STUFF
  94 #define IP_HRDINCL      3
  95 #define IP_OPTIONS      4
  96 #endif
  97 
  98 #define IP_MULTICAST_IF                 32
  99 #define IP_MULTICAST_TTL                33
 100 #define IP_MULTICAST_LOOP               34
 101 #define IP_ADD_MEMBERSHIP               35
 102 #define IP_DROP_MEMBERSHIP              36
 103 
 104 
 105 /* These need to appear somewhere around here */
 106 #define IP_DEFAULT_MULTICAST_TTL        1
 107 #define IP_DEFAULT_MULTICAST_LOOP       1
 108 #define IP_MAX_MEMBERSHIPS              20
 109  
 110 /* IPX options */
 111 #define IPX_TYPE        1
 112 
 113 /* TCP options - this way around because someone left a set in the c library includes */
 114 #define TCP_NODELAY     1
 115 #define TCP_MAXSEG      2
 116 
 117 /* The various priorities. */
 118 #define SOPRI_INTERACTIVE       0
 119 #define SOPRI_NORMAL            1
 120 #define SOPRI_BACKGROUND        2
 121 
 122 #endif /* _LINUX_SOCKET_H */

/* [previous][next][first][last][top][bottom][index][help] */