Back to index

glibc  2.9
Classes | Defines | Typedefs | Enumerations | Functions
socket.h File Reference
#include <stddef.h>
#include <limits.h>
#include <bits/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  cmsgcred
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 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 /* POSIX name for PF_LOCAL. */
#define PF_INET   2 /* IP protocol family. */
#define PF_IMPLINK   3 /* ARPAnet IMP protocol. */
#define PF_PUP   4 /* PUP protocols. */
#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 /* ECMA protocols. */
#define PF_DATAKIT   9 /* AT&T Datakit protocols. */
#define PF_CCITT   10 /* CCITT protocols (X.25 et al). */
#define PF_SNA   11 /* IBM SNA protocol. */
#define PF_DECnet   12 /* DECnet protocols. */
#define PF_DLI   13 /* Direct data link interface. */
#define PF_LAT   14 /* DEC Local Area Transport protocol. */
#define PF_HYLINK   15 /* NSC Hyperchannel protocol. */
#define PF_APPLETALK   16 /* Don't use this. */
#define PF_ROUTE   17 /* Internal Routing Protocol. */
#define PF_LINK   18 /* Link layer interface. */
#define PF_XTP   19 /* eXpress Transfer Protocol (no AF). */
#define PF_COIP   20 /* Connection-oriented IP, aka ST II. */
#define PF_CNT   21 /* Computer Network Technology. */
#define PF_RTIP   22 /* Help Identify RTIP packets. **/
#define PF_IPX   23 /* Novell Internet Protocol. */
#define PF_SIP   24 /* Simple Internet Protocol. */
#define PF_PIP   25 /* Help Identify PIP packets. */
#define PF_INET6   26 /* IP version 6. */
#define PF_MAX   27
#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_ROUTE   PF_ROUTE
#define AF_LINK   PF_LINK
#define pseudo_AF_XTP   PF_XTP
#define AF_COIP   PF_COIP
#define AF_CNT   PF_CNT
#define pseudo_AF_RTIP   PF_RTIP
#define AF_IPX   PF_IPX
#define AF_SIP   PF_SIP
#define pseudo_AF_PIP   PF_PIP
#define AF_INET6   PF_INET6
#define AF_MAX   PF_MAX
#define SOMAXCONN   128 /* 5 on the origional 4.4 BSD. */
#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_DONTWAIT   MSG_DONTWAIT
#define MSG_NOSIGNAL   MSG_NOSIGNAL
#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 SCM_TIMESTAMP   SCM_TIMESTAMP
#define SCM_CREDS   SCM_CREDS
#define CMGROUP_MAX   16
#define SOL_SOCKET   0xffff
#define SO_DEBUG   SO_DEBUG
#define SO_ACCEPTCONN   SO_ACCEPTCONN
#define SO_REUSEADDR   SO_REUSEADDR
#define SO_KEEPALIVE   SO_KEEPALIVE
#define SO_DONTROUTE   SO_DONTROUTE
#define SO_BROADCAST   SO_BROADCAST
#define SO_USELOOPBACK   SO_USELOOPBACK
#define SO_LINGER   SO_LINGER
#define SO_OOBINLINE   SO_OOBINLINE
#define SO_REUSEPORT   SO_REUSEPORT
#define SO_SNDBUF   SO_SNDBUF
#define SO_RCVBUF   SO_RCVBUF
#define SO_SNDLOWAT   SO_SNDLOWAT
#define SO_RCVLOWAT   SO_RCVLOWAT
#define SO_SNDTIMEO   SO_SNDTIMEO
#define SO_RCVTIMEO   SO_RCVTIMEO
#define SO_ERROR   SO_ERROR
#define SO_STYLE   SO_STYLE
#define SO_TYPE   SO_TYPE

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_DONTWAIT = 0x80, MSG_DONTWAIT = 0x80,
  MSG_NOSIGNAL
}
enum  {
  SCM_RIGHTS = 0x01, SCM_RIGHTS = 0x01, SCM_TIMESTAMP = 0x02, SCM_TIMESTAMP = 0x02,
  SCM_CREDS
}
enum  {
  SO_DEBUG = 0x0001, SO_DEBUG = 0x0001, SO_ACCEPTCONN = 0x0002, SO_ACCEPTCONN = 0x0002,
  SO_REUSEADDR = 0x0004, SO_REUSEADDR = 0x0004, SO_KEEPALIVE = 0x0008, SO_KEEPALIVE = 0x0008,
  SO_DONTROUTE = 0x0010, SO_DONTROUTE = 0x0010, SO_BROADCAST = 0x0020, SO_BROADCAST = 0x0020,
  SO_USELOOPBACK = 0x0040, SO_USELOOPBACK = 0x0040, SO_LINGER = 0x0080, SO_LINGER = 0x0080,
  SO_OOBINLINE = 0x0100, SO_OOBINLINE = 0x0100, SO_REUSEPORT = 0x0200, SO_REUSEPORT = 0x0200,
  SO_SNDBUF = 0x1001, SO_SNDBUF = 0x1001, SO_RCVBUF = 0x1002, SO_RCVBUF = 0x1002,
  SO_SNDLOWAT = 0x1003, SO_SNDLOWAT = 0x1003, SO_RCVLOWAT = 0x1004, SO_RCVLOWAT = 0x1004,
  SO_SNDTIMEO = 0x1005, SO_SNDTIMEO = 0x1005, SO_RCVTIMEO = 0x1006, SO_RCVTIMEO = 0x1006,
  SO_ERROR = 0x1007, SO_ERROR = 0x1007, SO_STYLE = 0x1008, SO_STYLE = 0x1008,
  SO_TYPE
}

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 cmsgcred

Definition at line 275 of file socket.h.

Class Members
__uid_t cmcred_euid
__gid_t cmcred_gid
__gid_t cmcred_groups
int cmcred_ngroups
__pid_t cmcred_pid
__uid_t cmcred_uid
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 144 of file socket.h.

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

Definition at line 147 of file socket.h.

#define _SS_SIZE   128

Definition at line 146 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_CNT   PF_CNT

Definition at line 117 of file socket.h.

#define AF_COIP   PF_COIP

Definition at line 116 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 122 of file socket.h.

#define AF_IPX   PF_IPX

Definition at line 119 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 114 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 123 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_ROUTE   PF_ROUTE

Definition at line 113 of file socket.h.

#define AF_SIP   PF_SIP

Definition at line 120 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 CMGROUP_MAX   16

Definition at line 268 of file socket.h.

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

Definition at line 222 of file socket.h.

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

Definition at line 213 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 226 of file socket.h.

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

Definition at line 216 of file socket.h.

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

Definition at line 224 of file socket.h.

#define MSG_CTRUNC   MSG_CTRUNC

Definition at line 171 of file socket.h.

Definition at line 165 of file socket.h.

#define MSG_DONTWAIT   MSG_DONTWAIT

Definition at line 175 of file socket.h.

#define MSG_EOR   MSG_EOR

Definition at line 167 of file socket.h.

#define MSG_NOSIGNAL   MSG_NOSIGNAL
#define MSG_OOB   MSG_OOB

Definition at line 161 of file socket.h.

#define MSG_PEEK   MSG_PEEK

Definition at line 163 of file socket.h.

#define MSG_TRUNC   MSG_TRUNC

Definition at line 169 of file socket.h.

#define MSG_WAITALL   MSG_WAITALL

Definition at line 173 of file socket.h.

#define PF_APPLETALK   16 /* Don't use this. */

Definition at line 79 of file socket.h.

#define PF_CCITT   10 /* CCITT protocols (X.25 et al). */

Definition at line 73 of file socket.h.

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

Definition at line 67 of file socket.h.

#define PF_CNT   21 /* Computer Network Technology. */

Definition at line 84 of file socket.h.

#define PF_COIP   20 /* Connection-oriented IP, aka ST II. */

Definition at line 83 of file socket.h.

#define PF_DATAKIT   9 /* AT&T Datakit protocols. */

Definition at line 72 of file socket.h.

#define PF_DECnet   12 /* DECnet protocols. */

Definition at line 75 of file socket.h.

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

Definition at line 76 of file socket.h.

#define PF_ECMA   8 /* ECMA protocols. */

Definition at line 71 of file socket.h.

#define PF_FILE   PF_LOCAL /* POSIX name for PF_LOCAL. */

Definition at line 63 of file socket.h.

#define PF_HYLINK   15 /* NSC Hyperchannel protocol. */

Definition at line 78 of file socket.h.

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

Definition at line 65 of file socket.h.

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

Definition at line 64 of file socket.h.

#define PF_INET6   26 /* IP version 6. */

Definition at line 89 of file socket.h.

#define PF_IPX   23 /* Novell Internet Protocol. */

Definition at line 86 of file socket.h.

#define PF_ISO   7 /* ISO protocols. */

Definition at line 69 of file socket.h.

#define PF_LAT   14 /* DEC Local Area Transport protocol. */

Definition at line 77 of file socket.h.

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

Definition at line 81 of file socket.h.

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

Definition at line 61 of file socket.h.

#define PF_MAX   27

Definition at line 90 of file socket.h.

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

Definition at line 68 of file socket.h.

#define PF_OSI   PF_ISO

Definition at line 70 of file socket.h.

#define PF_PIP   25 /* Help Identify PIP packets. */

Definition at line 88 of file socket.h.

#define PF_PUP   4 /* PUP protocols. */

Definition at line 66 of file socket.h.

#define PF_ROUTE   17 /* Internal Routing Protocol. */

Definition at line 80 of file socket.h.

#define PF_RTIP   22 /* Help Identify RTIP packets. **/

Definition at line 85 of file socket.h.

#define PF_SIP   24 /* Simple Internet Protocol. */

Definition at line 87 of file socket.h.

#define PF_SNA   11 /* IBM SNA protocol. */

Definition at line 74 of file socket.h.

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

Definition at line 62 of file socket.h.

#define PF_UNSPEC   0 /* Unspecified. */

Definition at line 60 of file socket.h.

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

Definition at line 82 of file socket.h.

#define pseudo_AF_PIP   PF_PIP

Definition at line 121 of file socket.h.

#define pseudo_AF_RTIP   PF_RTIP

Definition at line 118 of file socket.h.

#define pseudo_AF_XTP   PF_XTP

Definition at line 115 of file socket.h.

#define SCM_CREDS   SCM_CREDS
#define SCM_RIGHTS   SCM_RIGHTS

Definition at line 257 of file socket.h.

Definition at line 259 of file socket.h.

Definition at line 295 of file socket.h.

#define SO_BROADCAST   SO_BROADCAST

Definition at line 305 of file socket.h.

#define SO_DEBUG   SO_DEBUG

Definition at line 293 of file socket.h.

#define SO_DONTROUTE   SO_DONTROUTE

Definition at line 302 of file socket.h.

#define SO_ERROR   SO_ERROR

Definition at line 329 of file socket.h.

#define SO_KEEPALIVE   SO_KEEPALIVE

Definition at line 300 of file socket.h.

#define SO_LINGER   SO_LINGER

Definition at line 311 of file socket.h.

#define SO_OOBINLINE   SO_OOBINLINE

Definition at line 313 of file socket.h.

#define SO_RCVBUF   SO_RCVBUF

Definition at line 319 of file socket.h.

#define SO_RCVLOWAT   SO_RCVLOWAT

Definition at line 323 of file socket.h.

#define SO_RCVTIMEO   SO_RCVTIMEO

Definition at line 327 of file socket.h.

#define SO_REUSEADDR   SO_REUSEADDR

Definition at line 297 of file socket.h.

#define SO_REUSEPORT   SO_REUSEPORT

Definition at line 315 of file socket.h.

#define SO_SNDBUF   SO_SNDBUF

Definition at line 317 of file socket.h.

#define SO_SNDLOWAT   SO_SNDLOWAT

Definition at line 321 of file socket.h.

#define SO_SNDTIMEO   SO_SNDTIMEO

Definition at line 325 of file socket.h.

#define SO_STYLE   SO_STYLE

Definition at line 331 of file socket.h.

#define SO_TYPE   SO_TYPE

Definition at line 308 of file socket.h.

#define SOCK_DGRAM   SOCK_DGRAM

Definition at line 49 of file socket.h.

#define SOCK_RAW   SOCK_RAW

Definition at line 51 of file socket.h.

#define SOCK_RDM   SOCK_RDM

Definition at line 53 of file socket.h.

#define SOCK_STREAM   SOCK_STREAM

Definition at line 46 of file socket.h.

#define SOL_SOCKET   0xffff

Definition at line 287 of file socket.h.

#define SOMAXCONN   128 /* 5 on the origional 4.4 BSD. */

Definition at line 126 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_DONTWAIT 
MSG_DONTWAIT 
MSG_NOSIGNAL 

Definition at line 158 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,       /* Data completes record.  */
#define MSG_EOR MSG_EOR
    MSG_TRUNC        = 0x10,       /* Data discarded before delivery.  */
#define MSG_TRUNC MSG_TRUNC
    MSG_CTRUNC              = 0x20,       /* Control data lost before delivery.  */
#define MSG_CTRUNC MSG_CTRUNC
    MSG_WAITALL             = 0x40,       /* Wait for full request or error.  */
#define MSG_WAITALL MSG_WAITALL
    MSG_DONTWAIT     = 0x80,       /* This message should be nonblocking.  */
#define MSG_DONTWAIT MSG_DONTWAIT
    MSG_NOSIGNAL     = 0x0400      /* Do not generate SIGPIPE on EPIPE.  */
#define MSG_NOSIGNAL MSG_NOSIGNAL
  };
anonymous enum
Enumerator:
SCM_RIGHTS 
SCM_RIGHTS 
SCM_TIMESTAMP 
SCM_TIMESTAMP 
SCM_CREDS 

Definition at line 254 of file socket.h.

  {
    SCM_RIGHTS = 0x01,             /* Access rights (array of int).  */
#define SCM_RIGHTS SCM_RIGHTS
    SCM_TIMESTAMP = 0x02,   /* Timestamp (struct timeval).  */
#define SCM_TIMESTAMP SCM_TIMESTAMP
    SCM_CREDS = 0x03        /* Process creds (struct cmsgcred).  */
#define SCM_CREDS SCM_CREDS
  };
anonymous enum
Enumerator:
SO_DEBUG 
SO_DEBUG 
SO_ACCEPTCONN 
SO_ACCEPTCONN 
SO_REUSEADDR 
SO_REUSEADDR 
SO_KEEPALIVE 
SO_KEEPALIVE 
SO_DONTROUTE 
SO_DONTROUTE 
SO_BROADCAST 
SO_BROADCAST 
SO_USELOOPBACK 
SO_USELOOPBACK 
SO_LINGER 
SO_LINGER 
SO_OOBINLINE 
SO_OOBINLINE 
SO_REUSEPORT 
SO_REUSEPORT 
SO_SNDBUF 
SO_SNDBUF 
SO_RCVBUF 
SO_RCVBUF 
SO_SNDLOWAT 
SO_SNDLOWAT 
SO_RCVLOWAT 
SO_RCVLOWAT 
SO_SNDTIMEO 
SO_SNDTIMEO 
SO_RCVTIMEO 
SO_RCVTIMEO 
SO_ERROR 
SO_ERROR 
SO_STYLE 
SO_STYLE 
SO_TYPE 

Definition at line 290 of file socket.h.

  {
    SO_DEBUG = 0x0001,             /* Record debugging information.  */
#define SO_DEBUG SO_DEBUG
    SO_ACCEPTCONN = 0x0002, /* Accept connections on socket.  */
#define SO_ACCEPTCONN SO_ACCEPTCONN
    SO_REUSEADDR = 0x0004,  /* Allow reuse of local addresses.  */
#define SO_REUSEADDR SO_REUSEADDR
    SO_KEEPALIVE = 0x0008,  /* Keep connections alive and send
                               SIGPIPE when they die.  */
#define SO_KEEPALIVE SO_KEEPALIVE
    SO_DONTROUTE = 0x0010,  /* Don't do local routing.  */
#define SO_DONTROUTE SO_DONTROUTE
    SO_BROADCAST = 0x0020,  /* Allow transmission of
                               broadcast messages.  */
#define SO_BROADCAST SO_BROADCAST
    SO_USELOOPBACK = 0x0040,       /* Use the software loopback to avoid
                               hardware use when possible.  */
#define SO_USELOOPBACK SO_USELOOPBACK
    SO_LINGER = 0x0080,            /* Block on close of a reliable
                               socket to transmit pending data.  */
#define SO_LINGER SO_LINGER
    SO_OOBINLINE = 0x0100,  /* Receive out-of-band data in-band.  */
#define SO_OOBINLINE SO_OOBINLINE
    SO_REUSEPORT = 0x0200,  /* Allow local address and port reuse.  */
#define SO_REUSEPORT SO_REUSEPORT
    SO_SNDBUF = 0x1001,            /* Send buffer size.  */
#define SO_SNDBUF SO_SNDBUF
    SO_RCVBUF = 0x1002,            /* Receive buffer.  */
#define SO_RCVBUF SO_RCVBUF
    SO_SNDLOWAT = 0x1003,   /* Send low-water mark.  */
#define SO_SNDLOWAT SO_SNDLOWAT
    SO_RCVLOWAT = 0x1004,   /* Receive low-water mark.  */
#define SO_RCVLOWAT SO_RCVLOWAT
    SO_SNDTIMEO = 0x1005,   /* Send timeout.  */
#define SO_SNDTIMEO SO_SNDTIMEO
    SO_RCVTIMEO = 0x1006,   /* Receive timeout.  */
#define SO_RCVTIMEO SO_RCVTIMEO
    SO_ERROR = 0x1007,             /* Get and clear error status.  */
#define SO_ERROR SO_ERROR
    SO_STYLE = 0x1008,             /* Get socket connection style.  */
#define SO_STYLE SO_STYLE
    SO_TYPE = SO_STYLE             /* Compatible name for SO_STYLE.  */
#define SO_TYPE SO_TYPE
  };
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 42 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
};

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;
}