Back to index

glibc  2.9
Classes | Defines | Typedefs | Enumerations | Functions
socket.h File Reference
#include <stddef.h>
#include <limits.h>
#include <sys/types.h>
#include <bits/sockaddr.h>

Go to the source code of this file.

Classes

struct  sockaddr
struct  sockaddr_storage
struct  msghdr
struct  cmsghdr
struct  linger

Defines

#define __need_size_t
#define __need_NULL
#define __socklen_t_defined
#define SOCK_STREAM   SOCK_STREAM
#define SOCK_DGRAM   SOCK_DGRAM
#define SOCK_RAW   SOCK_RAW
#define SOCK_RDM   SOCK_RDM
#define SOCK_SEQPACKET   SOCK_SEQPACKET
#define SOCK_CONN_DGRAM   SOCK_CONN_DGRAM
#define PF_UNSPEC   0 /* Unspecified. */
#define PF_LOCAL   1 /* Local to host (pipes and file-domain). */
#define PF_UNIX   PF_LOCAL /* Old BSD name for PF_LOCAL. */
#define PF_FILE   PF_LOCAL /* Another non-standard name for PF_LOCAL. */
#define PF_INET   2 /* IP protocol family. */
#define PF_IMPLINK   3 /* ARPAnet IMP addresses. */
#define PF_PUP   4 /* PUP protocols (e.g., BSP). */
#define PF_CHAOS   5 /* MIT CHAOS protocols. */
#define PF_NS   6 /* XEROX NS protocols. */
#define PF_ISO   7 /* ISO protocols. */
#define PF_OSI   PF_ISO
#define PF_ECMA   8 /* European Computer Manufacturers. */
#define PF_DATAKIT   9 /* Datakit protocols. */
#define PF_CCITT   10 /* CCITT protocols, X.25 etc. */
#define PF_SNA   11 /* IBM SNA. */
#define PF_DECnet   12 /* DECnet. */
#define PF_DLI   13 /* DEC Direct data link interface. */
#define PF_LAT   14 /* LAT. */
#define PF_HYLINK   15 /* NSC Hyperchannel. */
#define PF_APPLETALK   16 /* Apple Talk. */
#define PF_NETLINK   17 /* Internet Routing Protocol. */
#define PF_ROUTE   PF_NETLINK /* Alias to emulate 4.4BSD. */
#define PF_LINK   18 /* Link layer interface. */
#define PF_XTP   19 /* eXpress Transfer Protocol (no AF). */
#define PF_INTF   20 /* Debugging use only. */
#define PF_RIF   21 /* Raw interface. */
#define PF_NETWARE   22
#define PF_NDD   23
#define PF_INET6   24 /* IPv6. */
#define PF_MAX   30 /* For now.. */
#define AF_UNSPEC   PF_UNSPEC
#define AF_LOCAL   PF_LOCAL
#define AF_UNIX   PF_UNIX
#define AF_FILE   PF_FILE
#define AF_INET   PF_INET
#define AF_IMPLINK   PF_IMPLINK
#define AF_PUP   PF_PUP
#define AF_CHAOS   PF_CHAOS
#define AF_NS   PF_NS
#define AF_ISO   PF_ISO
#define AF_OSI   PF_OSI
#define AF_ECMA   PF_ECMA
#define AF_DATAKIT   PF_DATAKIT
#define AF_CCITT   PF_CCITT
#define AF_SNA   PF_SNA
#define AF_DECnet   PF_DECnet
#define AF_DLI   PF_DLI
#define AF_LAT   PF_LAT
#define AF_HYLINK   PF_HYLINK
#define AF_APPLETALK   PF_APPLETALK
#define AF_NETLINK   PF_NETLINK
#define AF_ROUTE   PF_ROUTE
#define AF_LINK   PF_LINK
#define AF_INTF   PF_INTF
#define AF_RIF   PF_RIF
#define AF_NETWARE   PF_NETWARE
#define AF_NDD   PF_NDD
#define AF_INET6   PF_INET6
#define AF_MAX   PF_MAX
#define SOL_SOCKET   0xffff
#define SOMAXCONN   1024
#define __ss_aligntype   __uint32_t
#define _SS_SIZE   128
#define _SS_PADSIZE   (_SS_SIZE - (2 * sizeof (__ss_aligntype)))
#define MSG_OOB   MSG_OOB
#define MSG_PEEK   MSG_PEEK
#define MSG_DONTROUTE   MSG_DONTROUTE
#define MSG_EOR   MSG_EOR
#define MSG_TRUNC   MSG_TRUNC
#define MSG_CTRUNC   MSG_CTRUNC
#define MSG_WAITALL   MSG_WAITALL
#define MSG_MPEG2   MSG_MPEG2
#define CMSG_DATA(cmsg)   ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1))
#define CMSG_NXTHDR(mhdr, cmsg)   __cmsg_nxthdr (mhdr, cmsg)
#define CMSG_FIRSTHDR(mhdr)
#define CMSG_ALIGN(len)
#define CMSG_SPACE(len)
#define CMSG_LEN(len)   (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
#define SCM_RIGHTS   SCM_RIGHTS
#define SO_DEBUG   0x0001 /* Turn on debugging info recording. */
#define SO_ACCEPTCONN   0x0002 /* Socket has had listen(). */
#define SO_REUSEADDR   0x0004 /* Allow local address reuse. */
#define SO_KEEPALIVE   0x0008 /* Keep connections alive. */
#define SO_DONTROUTE   0x0010 /* Just use interface addresses. */
#define SO_BROADCAST   0x0020 /* Permit sending of broadcast msgs. */
#define SO_USELOOPBACK   0x0040 /* Bypass hardware when possible. */
#define SO_LINGER   0x0080 /* Linger on close if data present. */
#define SO_OOBINLINE   0x0100 /* Leave received OOB data in line. */
#define SO_REUSEPORT   0x0200 /* Allow local address & port reuse. */
#define SO_USE_IFBUFS   0x0400 /* Interface will supply buffers. */
#define SO_CKSUMRECV   0x0800 /* Defer checksum until receive. */
#define SO_NOREUSEADDR   0x1000 /* Prevent local address reuse. */
#define SO_SNDBUF   0x1001 /* Send buffer size. */
#define SO_RCVBUF   0x1002 /* Receive buffer size. */
#define SO_SNDLOWAT   0x1003 /* Send low-water mark. */
#define SO_RCVLOWAT   0x1004 /* Receive low-water mark. */
#define SO_SNDTIMEO   0x1005 /* Send timeout. */
#define SO_RCVTIMEO   0x1006 /* Receive timeout. */
#define SO_ERROR   0x1007 /* Get error status and clear. */
#define SO_TYPE   0x1008 /* Get socket type. */
#define SO_KERNACCEPT   0x2000 /* Derive a in-kernel only socket. */
#define SO_AUDIT   0x8000 /* Turn on socket auditing. */

Typedefs

typedef __socklen_t socklen_t

Enumerations

enum  __socket_type {
  SOCK_STREAM = 1, SOCK_STREAM = 1, SOCK_DGRAM = 2, SOCK_DGRAM = 2,
  SOCK_RAW = 3, SOCK_RAW = 3, SOCK_RDM = 4, SOCK_RDM = 4,
  SOCK_SEQPACKET, SOCK_STREAM = 1, SOCK_STREAM = 1, SOCK_DGRAM = 2,
  SOCK_DGRAM = 2, SOCK_RAW = 3, SOCK_RAW = 3, SOCK_RDM = 4,
  SOCK_RDM = 4, SOCK_SEQPACKET = 5, SOCK_SEQPACKET = 5, SOCK_CONN_DGRAM,
  SOCK_DGRAM = 1, SOCK_DGRAM = 1, SOCK_STREAM = 2, SOCK_STREAM = 2,
  SOCK_RAW = 3, SOCK_RAW = 3, SOCK_RDM = 4, SOCK_RDM = 4,
  SOCK_SEQPACKET = 5, SOCK_SEQPACKET = 5, SOCK_DCCP = 6, SOCK_DCCP = 6,
  SOCK_PACKET = 10, SOCK_PACKET = 10, SOCK_CLOEXEC = 02000000, SOCK_CLOEXEC = 02000000,
  SOCK_NONBLOCK, SOCK_STREAM = 1, SOCK_STREAM = 1, SOCK_DGRAM = 2,
  SOCK_DGRAM = 2, SOCK_RAW = 3, SOCK_RAW = 3, SOCK_RDM = 4,
  SOCK_RDM = 4, SOCK_SEQPACKET, SOCK_STREAM = 1, SOCK_STREAM = 1,
  SOCK_DGRAM = 2, SOCK_DGRAM = 2, SOCK_RAW = 3, SOCK_RAW = 3,
  SOCK_RDM = 4, SOCK_RDM = 4, SOCK_SEQPACKET = 5, SOCK_SEQPACKET = 5,
  SOCK_DCCP = 6, SOCK_DCCP = 6, SOCK_PACKET = 10, SOCK_PACKET = 10,
  SOCK_CLOEXEC = 02000000, SOCK_CLOEXEC = 02000000, SOCK_NONBLOCK, SOCK_STREAM = 1,
  SOCK_STREAM = 1, SOCK_DGRAM = 2, SOCK_DGRAM = 2, SOCK_RAW = 3,
  SOCK_RAW = 3, SOCK_RDM = 4, SOCK_RDM = 4, SOCK_SEQPACKET = 5,
  SOCK_SEQPACKET = 5, SOCK_DCCP = 6, SOCK_DCCP = 6, SOCK_PACKET = 10,
  SOCK_PACKET = 10, SOCK_CLOEXEC = 0x400000, SOCK_CLOEXEC = 0x400000, SOCK_NONBLOCK
}
enum  {
  MSG_OOB = 0x01, MSG_OOB = 0x01, MSG_PEEK = 0x02, MSG_PEEK = 0x02,
  MSG_DONTROUTE = 0x04, MSG_DONTROUTE = 0x04, MSG_EOR = 0x08, MSG_EOR = 0x08,
  MSG_TRUNC = 0x10, MSG_TRUNC = 0x10, MSG_CTRUNC = 0x20, MSG_CTRUNC = 0x20,
  MSG_WAITALL = 0x40, MSG_WAITALL = 0x40, MSG_MPEG2 = 0x80, MSG_MPEG2 = 0x80
}
enum  { SCM_RIGHTS }

Functions

struct cmsghdr__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg) __THROW

Class Documentation

struct msghdr

Definition at line 178 of file socket.h.

Collaboration diagram for msghdr:
Class Members
__ptr_t msg_accrights
socklen_t msg_accrightslen
void * msg_control
socklen_t msg_controllen
size_t msg_controllen
int msg_flags
struct iovec * msg_iov
int msg_iovlen
size_t msg_iovlen
__ptr_t msg_name
void * msg_name
socklen_t msg_namelen
struct cmsghdr

Definition at line 200 of file socket.h.

Class Members
socklen_t cmsg_len
size_t cmsg_len
int cmsg_level
int cmsg_type
struct linger

Definition at line 245 of file socket.h.

Class Members
int l_linger
int l_onoff

Define Documentation

#define __need_NULL

Definition at line 28 of file socket.h.

#define __need_size_t

Definition at line 27 of file socket.h.

Definition at line 37 of file socket.h.

#define __ss_aligntype   __uint32_t

Definition at line 148 of file socket.h.

#define _SS_PADSIZE   (_SS_SIZE - (2 * sizeof (__ss_aligntype)))

Definition at line 151 of file socket.h.

#define _SS_SIZE   128

Definition at line 150 of file socket.h.

#define AF_APPLETALK   PF_APPLETALK

Definition at line 112 of file socket.h.

#define AF_CCITT   PF_CCITT

Definition at line 106 of file socket.h.

#define AF_CHAOS   PF_CHAOS

Definition at line 100 of file socket.h.

#define AF_DATAKIT   PF_DATAKIT

Definition at line 105 of file socket.h.

#define AF_DECnet   PF_DECnet

Definition at line 108 of file socket.h.

#define AF_DLI   PF_DLI

Definition at line 109 of file socket.h.

#define AF_ECMA   PF_ECMA

Definition at line 104 of file socket.h.

#define AF_FILE   PF_FILE

Definition at line 96 of file socket.h.

#define AF_HYLINK   PF_HYLINK

Definition at line 111 of file socket.h.

#define AF_IMPLINK   PF_IMPLINK

Definition at line 98 of file socket.h.

#define AF_INET   PF_INET

Definition at line 97 of file socket.h.

#define AF_INET6   PF_INET6

Definition at line 120 of file socket.h.

#define AF_INTF   PF_INTF

Definition at line 116 of file socket.h.

#define AF_ISO   PF_ISO

Definition at line 102 of file socket.h.

#define AF_LAT   PF_LAT

Definition at line 110 of file socket.h.

#define AF_LINK   PF_LINK

Definition at line 115 of file socket.h.

#define AF_LOCAL   PF_LOCAL

Definition at line 94 of file socket.h.

#define AF_MAX   PF_MAX

Definition at line 121 of file socket.h.

#define AF_NDD   PF_NDD

Definition at line 119 of file socket.h.

#define AF_NETLINK   PF_NETLINK

Definition at line 113 of file socket.h.

#define AF_NETWARE   PF_NETWARE

Definition at line 118 of file socket.h.

#define AF_NS   PF_NS

Definition at line 101 of file socket.h.

#define AF_OSI   PF_OSI

Definition at line 103 of file socket.h.

#define AF_PUP   PF_PUP

Definition at line 99 of file socket.h.

#define AF_RIF   PF_RIF

Definition at line 117 of file socket.h.

#define AF_ROUTE   PF_ROUTE

Definition at line 114 of file socket.h.

#define AF_SNA   PF_SNA

Definition at line 107 of file socket.h.

#define AF_UNIX   PF_UNIX

Definition at line 95 of file socket.h.

#define AF_UNSPEC   PF_UNSPEC

Definition at line 93 of file socket.h.

#define CMSG_ALIGN (   len)
Value:
(((len) + sizeof (size_t) - 1) \
                      & ~(sizeof (size_t) - 1))

Definition at line 221 of file socket.h.

#define CMSG_DATA (   cmsg)    ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1))

Definition at line 215 of file socket.h.

#define CMSG_FIRSTHDR (   mhdr)
Value:
((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr)                 \
   ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) NULL)

Definition at line 218 of file socket.h.

#define CMSG_LEN (   len)    (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))

Definition at line 225 of file socket.h.

#define CMSG_NXTHDR (   mhdr,
  cmsg 
)    __cmsg_nxthdr (mhdr, cmsg)

Definition at line 217 of file socket.h.

#define CMSG_SPACE (   len)
Value:
(CMSG_ALIGN (len) \
                      + CMSG_ALIGN (sizeof (struct cmsghdr)))

Definition at line 223 of file socket.h.

#define MSG_CTRUNC   MSG_CTRUNC

Definition at line 175 of file socket.h.

Definition at line 169 of file socket.h.

#define MSG_EOR   MSG_EOR

Definition at line 171 of file socket.h.

#define MSG_MPEG2   MSG_MPEG2

Definition at line 179 of file socket.h.

#define MSG_OOB   MSG_OOB

Definition at line 165 of file socket.h.

#define MSG_PEEK   MSG_PEEK

Definition at line 167 of file socket.h.

#define MSG_TRUNC   MSG_TRUNC

Definition at line 173 of file socket.h.

#define MSG_WAITALL   MSG_WAITALL

Definition at line 177 of file socket.h.

#define PF_APPLETALK   16 /* Apple Talk. */

Definition at line 80 of file socket.h.

#define PF_CCITT   10 /* CCITT protocols, X.25 etc. */

Definition at line 74 of file socket.h.

#define PF_CHAOS   5 /* MIT CHAOS protocols. */

Definition at line 68 of file socket.h.

#define PF_DATAKIT   9 /* Datakit protocols. */

Definition at line 73 of file socket.h.

#define PF_DECnet   12 /* DECnet. */

Definition at line 76 of file socket.h.

#define PF_DLI   13 /* DEC Direct data link interface. */

Definition at line 77 of file socket.h.

#define PF_ECMA   8 /* European Computer Manufacturers. */

Definition at line 72 of file socket.h.

#define PF_FILE   PF_LOCAL /* Another non-standard name for PF_LOCAL. */

Definition at line 64 of file socket.h.

#define PF_HYLINK   15 /* NSC Hyperchannel. */

Definition at line 79 of file socket.h.

#define PF_IMPLINK   3 /* ARPAnet IMP addresses. */

Definition at line 66 of file socket.h.

#define PF_INET   2 /* IP protocol family. */

Definition at line 65 of file socket.h.

#define PF_INET6   24 /* IPv6. */

Definition at line 89 of file socket.h.

#define PF_INTF   20 /* Debugging use only. */

Definition at line 85 of file socket.h.

#define PF_ISO   7 /* ISO protocols. */

Definition at line 70 of file socket.h.

#define PF_LAT   14 /* LAT. */

Definition at line 78 of file socket.h.

#define PF_LINK   18 /* Link layer interface. */

Definition at line 83 of file socket.h.

#define PF_LOCAL   1 /* Local to host (pipes and file-domain). */

Definition at line 62 of file socket.h.

#define PF_MAX   30 /* For now.. */

Definition at line 90 of file socket.h.

#define PF_NDD   23

Definition at line 88 of file socket.h.

#define PF_NETLINK   17 /* Internet Routing Protocol. */

Definition at line 81 of file socket.h.

#define PF_NETWARE   22

Definition at line 87 of file socket.h.

#define PF_NS   6 /* XEROX NS protocols. */

Definition at line 69 of file socket.h.

#define PF_OSI   PF_ISO

Definition at line 71 of file socket.h.

#define PF_PUP   4 /* PUP protocols (e.g., BSP). */

Definition at line 67 of file socket.h.

#define PF_RIF   21 /* Raw interface. */

Definition at line 86 of file socket.h.

#define PF_ROUTE   PF_NETLINK /* Alias to emulate 4.4BSD. */

Definition at line 82 of file socket.h.

#define PF_SNA   11 /* IBM SNA. */

Definition at line 75 of file socket.h.

#define PF_UNIX   PF_LOCAL /* Old BSD name for PF_LOCAL. */

Definition at line 63 of file socket.h.

#define PF_UNSPEC   0 /* Unspecified. */

Definition at line 61 of file socket.h.

#define PF_XTP   19 /* eXpress Transfer Protocol (no AF). */

Definition at line 84 of file socket.h.

#define SCM_RIGHTS   SCM_RIGHTS
#define SO_ACCEPTCONN   0x0002 /* Socket has had listen(). */

Definition at line 262 of file socket.h.

#define SO_AUDIT   0x8000 /* Turn on socket auditing. */

Definition at line 283 of file socket.h.

#define SO_BROADCAST   0x0020 /* Permit sending of broadcast msgs. */

Definition at line 266 of file socket.h.

#define SO_CKSUMRECV   0x0800 /* Defer checksum until receive. */

Definition at line 272 of file socket.h.

#define SO_DEBUG   0x0001 /* Turn on debugging info recording. */

Definition at line 261 of file socket.h.

#define SO_DONTROUTE   0x0010 /* Just use interface addresses. */

Definition at line 265 of file socket.h.

#define SO_ERROR   0x1007 /* Get error status and clear. */

Definition at line 280 of file socket.h.

#define SO_KEEPALIVE   0x0008 /* Keep connections alive. */

Definition at line 264 of file socket.h.

#define SO_KERNACCEPT   0x2000 /* Derive a in-kernel only socket. */

Definition at line 282 of file socket.h.

#define SO_LINGER   0x0080 /* Linger on close if data present. */

Definition at line 268 of file socket.h.

#define SO_NOREUSEADDR   0x1000 /* Prevent local address reuse. */

Definition at line 273 of file socket.h.

#define SO_OOBINLINE   0x0100 /* Leave received OOB data in line. */

Definition at line 269 of file socket.h.

#define SO_RCVBUF   0x1002 /* Receive buffer size. */

Definition at line 275 of file socket.h.

#define SO_RCVLOWAT   0x1004 /* Receive low-water mark. */

Definition at line 277 of file socket.h.

#define SO_RCVTIMEO   0x1006 /* Receive timeout. */

Definition at line 279 of file socket.h.

#define SO_REUSEADDR   0x0004 /* Allow local address reuse. */

Definition at line 263 of file socket.h.

#define SO_REUSEPORT   0x0200 /* Allow local address & port reuse. */

Definition at line 270 of file socket.h.

#define SO_SNDBUF   0x1001 /* Send buffer size. */

Definition at line 274 of file socket.h.

#define SO_SNDLOWAT   0x1003 /* Send low-water mark. */

Definition at line 276 of file socket.h.

#define SO_SNDTIMEO   0x1005 /* Send timeout. */

Definition at line 278 of file socket.h.

#define SO_TYPE   0x1008 /* Get socket type. */

Definition at line 281 of file socket.h.

#define SO_USE_IFBUFS   0x0400 /* Interface will supply buffers. */

Definition at line 271 of file socket.h.

#define SO_USELOOPBACK   0x0040 /* Bypass hardware when possible. */

Definition at line 267 of file socket.h.

#define SOCK_DGRAM   SOCK_DGRAM

Definition at line 48 of file socket.h.

#define SOCK_RAW   SOCK_RAW

Definition at line 50 of file socket.h.

#define SOCK_RDM   SOCK_RDM

Definition at line 52 of file socket.h.

Definition at line 55 of file socket.h.

#define SOCK_STREAM   SOCK_STREAM

Definition at line 45 of file socket.h.

#define SOL_SOCKET   0xffff

Definition at line 127 of file socket.h.

#define SOMAXCONN   1024

Definition at line 130 of file socket.h.


Typedef Documentation

Definition at line 36 of file socket.h.


Enumeration Type Documentation

anonymous enum
Enumerator:
MSG_OOB 
MSG_OOB 
MSG_PEEK 
MSG_PEEK 
MSG_DONTROUTE 
MSG_DONTROUTE 
MSG_EOR 
MSG_EOR 
MSG_TRUNC 
MSG_TRUNC 
MSG_CTRUNC 
MSG_CTRUNC 
MSG_WAITALL 
MSG_WAITALL 
MSG_MPEG2 
MSG_MPEG2 

Definition at line 162 of file socket.h.

  {
    MSG_OOB          = 0x01,       /* Process out-of-band data.  */
#define MSG_OOB             MSG_OOB
    MSG_PEEK         = 0x02,       /* Peek at incoming messages.  */
#define MSG_PEEK     MSG_PEEK
    MSG_DONTROUTE    = 0x04,       /* Don't use local routing.  */
#define MSG_DONTROUTE       MSG_DONTROUTE
    MSG_EOR          = 0x08, /* End of record.  */
#define       MSG_EOR              MSG_EOR
    MSG_TRUNC        = 0x10,
#define       MSG_TRUNC     MSG_TRUNC
    MSG_CTRUNC              = 0x20,       /* Control data lost before delivery.  */
#define MSG_CTRUNC   MSG_CTRUNC
    MSG_WAITALL             = 0x40, /* Wait for a full request.  */
#define       MSG_WAITALL   MSG_WAITALL
    MSG_MPEG2        = 0x80,       /* Message contain MPEG2 data.  */
#define MSG_MPEG2    MSG_MPEG2
  };
anonymous enum
Enumerator:
SCM_RIGHTS 

Definition at line 254 of file socket.h.

  {
    SCM_RIGHTS = 0x01              /* Transfer file descriptors.  */
#define SCM_RIGHTS SCM_RIGHTS
  };
Enumerator:
SOCK_STREAM 
SOCK_STREAM 
SOCK_DGRAM 
SOCK_DGRAM 
SOCK_RAW 
SOCK_RAW 
SOCK_RDM 
SOCK_RDM 
SOCK_SEQPACKET 
SOCK_STREAM 
SOCK_STREAM 
SOCK_DGRAM 
SOCK_DGRAM 
SOCK_RAW 
SOCK_RAW 
SOCK_RDM 
SOCK_RDM 
SOCK_SEQPACKET 
SOCK_SEQPACKET 
SOCK_CONN_DGRAM 
SOCK_DGRAM 
SOCK_DGRAM 
SOCK_STREAM 
SOCK_STREAM 
SOCK_RAW 
SOCK_RAW 
SOCK_RDM 
SOCK_RDM 
SOCK_SEQPACKET 
SOCK_SEQPACKET 
SOCK_DCCP 
SOCK_DCCP 
SOCK_PACKET 
SOCK_PACKET 
SOCK_CLOEXEC 
SOCK_CLOEXEC 
SOCK_NONBLOCK 
SOCK_STREAM 
SOCK_STREAM 
SOCK_DGRAM 
SOCK_DGRAM 
SOCK_RAW 
SOCK_RAW 
SOCK_RDM 
SOCK_RDM 
SOCK_SEQPACKET 
SOCK_STREAM 
SOCK_STREAM 
SOCK_DGRAM 
SOCK_DGRAM 
SOCK_RAW 
SOCK_RAW 
SOCK_RDM 
SOCK_RDM 
SOCK_SEQPACKET 
SOCK_SEQPACKET 
SOCK_DCCP 
SOCK_DCCP 
SOCK_PACKET 
SOCK_PACKET 
SOCK_CLOEXEC 
SOCK_CLOEXEC 
SOCK_NONBLOCK 
SOCK_STREAM 
SOCK_STREAM 
SOCK_DGRAM 
SOCK_DGRAM 
SOCK_RAW 
SOCK_RAW 
SOCK_RDM 
SOCK_RDM 
SOCK_SEQPACKET 
SOCK_SEQPACKET 
SOCK_DCCP 
SOCK_DCCP 
SOCK_PACKET 
SOCK_PACKET 
SOCK_CLOEXEC 
SOCK_CLOEXEC 
SOCK_NONBLOCK 

Definition at line 41 of file socket.h.

{
  SOCK_STREAM = 1,          /* Sequenced, reliable, connection-based
                               byte streams.  */
#define SOCK_STREAM SOCK_STREAM
  SOCK_DGRAM = 2,           /* Connectionless, unreliable datagrams
                               of fixed maximum length.  */
#define SOCK_DGRAM SOCK_DGRAM
  SOCK_RAW = 3,                    /* Raw protocol interface.  */
#define SOCK_RAW SOCK_RAW
  SOCK_RDM = 4,                    /* Reliably-delivered messages.  */
#define SOCK_RDM SOCK_RDM
  SOCK_SEQPACKET = 5,              /* Sequenced, reliable, connection-based,
                               datagrams of fixed maximum length.  */
#define SOCK_SEQPACKET SOCK_SEQPACKET
  SOCK_CONN_DGRAM = 6              /* Conneciton datagram.  */
#define SOCK_CONN_DGRAM     SOCK_CONN_DGRAM
};

Function Documentation

struct cmsghdr* __cmsg_nxthdr ( struct msghdr __mhdr,
struct cmsghdr __cmsg 
) [read]

Definition at line 25 of file cmsg_nxthdr.c.

{
  if ((size_t) cmsg->cmsg_len < sizeof (struct cmsghdr))
    /* The kernel header does this so there may be a reason.  */
    return NULL;

  cmsg = (struct cmsghdr *) ((unsigned char *) cmsg
                          + CMSG_ALIGN (cmsg->cmsg_len));
  if ((unsigned char *) (cmsg + 1) > ((unsigned char *) mhdr->msg_control
                                  + mhdr->msg_controllen)
      || ((unsigned char *) cmsg + CMSG_ALIGN (cmsg->cmsg_len)
         > ((unsigned char *) mhdr->msg_control + mhdr->msg_controllen)))
    /* No more entries.  */
    return NULL;
  return cmsg;
}