Back to index

glibc  2.9
Classes | Defines | Typedefs | Enumerations | Functions
socket.h File Reference
#include <stddef.h>
#include <sys/types.h>
#include <bits/sockaddr.h>
#include <asm/socket.h>
This graph shows which files directly or indirectly include this file:

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 __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_DCCP   SOCK_DCCP
#define SOCK_PACKET   SOCK_PACKET
#define SOCK_CLOEXEC   SOCK_CLOEXEC
#define SOCK_NONBLOCK   SOCK_NONBLOCK
#define PF_UNSPEC   0 /* Unspecified. */
#define PF_LOCAL   1 /* Local to host (pipes and file-domain). */
#define PF_UNIX   PF_LOCAL /* POSIX 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_AX25   3 /* Amateur Radio AX.25. */
#define PF_IPX   4 /* Novell Internet Protocol. */
#define PF_APPLETALK   5 /* Appletalk DDP. */
#define PF_NETROM   6 /* Amateur radio NetROM. */
#define PF_BRIDGE   7 /* Multiprotocol bridge. */
#define PF_ATMPVC   8 /* ATM PVCs. */
#define PF_X25   9 /* Reserved for X.25 project. */
#define PF_INET6   10 /* IP version 6. */
#define PF_ROSE   11 /* Amateur Radio X.25 PLP. */
#define PF_DECnet   12 /* Reserved for DECnet project. */
#define PF_NETBEUI   13 /* Reserved for 802.2LLC project. */
#define PF_SECURITY   14 /* Security callback pseudo AF. */
#define PF_KEY   15 /* PF_KEY key management API. */
#define PF_NETLINK   16
#define PF_ROUTE   PF_NETLINK /* Alias to emulate 4.4BSD. */
#define PF_PACKET   17 /* Packet family. */
#define PF_ASH   18 /* Ash. */
#define PF_ECONET   19 /* Acorn Econet. */
#define PF_ATMSVC   20 /* ATM SVCs. */
#define PF_SNA   22 /* Linux SNA Project */
#define PF_IRDA   23 /* IRDA sockets. */
#define PF_PPPOX   24 /* PPPoX sockets. */
#define PF_WANPIPE   25 /* Wanpipe API sockets. */
#define PF_BLUETOOTH   31 /* Bluetooth sockets. */
#define PF_IUCV   32 /* IUCV sockets. */
#define PF_RXRPC   33 /* RxRPC sockets. */
#define PF_ISDN   34 /* mISDN sockets. */
#define PF_MAX   35 /* 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_AX25   PF_AX25
#define AF_IPX   PF_IPX
#define AF_APPLETALK   PF_APPLETALK
#define AF_NETROM   PF_NETROM
#define AF_BRIDGE   PF_BRIDGE
#define AF_ATMPVC   PF_ATMPVC
#define AF_X25   PF_X25
#define AF_INET6   PF_INET6
#define AF_ROSE   PF_ROSE
#define AF_DECnet   PF_DECnet
#define AF_NETBEUI   PF_NETBEUI
#define AF_SECURITY   PF_SECURITY
#define AF_KEY   PF_KEY
#define AF_NETLINK   PF_NETLINK
#define AF_ROUTE   PF_ROUTE
#define AF_PACKET   PF_PACKET
#define AF_ASH   PF_ASH
#define AF_ECONET   PF_ECONET
#define AF_ATMSVC   PF_ATMSVC
#define AF_SNA   PF_SNA
#define AF_IRDA   PF_IRDA
#define AF_PPPOX   PF_PPPOX
#define AF_WANPIPE   PF_WANPIPE
#define AF_BLUETOOTH   PF_BLUETOOTH
#define AF_IUCV   PF_IUCV
#define AF_RXRPC   PF_RXRPC
#define AF_ISDN   PF_ISDN
#define AF_MAX   PF_MAX
#define SOL_RAW   255
#define SOL_DECNET   261
#define SOL_X25   262
#define SOL_PACKET   263
#define SOL_ATM   264 /* ATM layer (cell level). */
#define SOL_AAL   265 /* ATM Adaption Layer (packet level). */
#define SOL_IRDA   266
#define SOMAXCONN   128
#define __ss_aligntype   unsigned long int
#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_CTRUNC   MSG_CTRUNC
#define MSG_PROXY   MSG_PROXY
#define MSG_TRUNC   MSG_TRUNC
#define MSG_DONTWAIT   MSG_DONTWAIT
#define MSG_EOR   MSG_EOR
#define MSG_WAITALL   MSG_WAITALL
#define MSG_FIN   MSG_FIN
#define MSG_SYN   MSG_SYN
#define MSG_CONFIRM   MSG_CONFIRM
#define MSG_RST   MSG_RST
#define MSG_ERRQUEUE   MSG_ERRQUEUE
#define MSG_NOSIGNAL   MSG_NOSIGNAL
#define MSG_MORE   MSG_MORE
#define MSG_CMSG_CLOEXEC   MSG_CMSG_CLOEXEC
#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 __SYS_SOCKET_H_undef_FIOGETOWN
#define __SYS_SOCKET_H_undef_FIOSETOWN
#define __SYS_SOCKET_H_undef_SIOCATMARK
#define __SYS_SOCKET_H_undef_SIOCGPGRP
#define __SYS_SOCKET_H_undef_SIOCGSTAMP
#define __SYS_SOCKET_H_undef_SIOCGSTAMPNS
#define __SYS_SOCKET_H_undef_SIOCSPGRP

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_CTRUNC = 0x08, MSG_CTRUNC = 0x08,
  MSG_PROXY = 0x10, MSG_PROXY = 0x10, MSG_TRUNC = 0x20, MSG_TRUNC = 0x20,
  MSG_DONTWAIT = 0x40, MSG_DONTWAIT = 0x40, MSG_EOR = 0x80, MSG_EOR = 0x80,
  MSG_WAITALL = 0x100, MSG_WAITALL = 0x100, MSG_FIN = 0x200, MSG_FIN = 0x200,
  MSG_SYN = 0x400, MSG_SYN = 0x400, MSG_CONFIRM = 0x800, MSG_CONFIRM = 0x800,
  MSG_RST = 0x1000, MSG_RST = 0x1000, MSG_ERRQUEUE = 0x2000, MSG_ERRQUEUE = 0x2000,
  MSG_NOSIGNAL = 0x4000, MSG_NOSIGNAL = 0x4000, MSG_MORE = 0x8000, MSG_MORE = 0x8000,
  MSG_CMSG_CLOEXEC
}
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_size_t

Definition at line 28 of file socket.h.

Definition at line 36 of file socket.h.

#define __ss_aligntype   unsigned long int

Definition at line 170 of file socket.h.

Definition at line 330 of file socket.h.

Definition at line 333 of file socket.h.

Definition at line 336 of file socket.h.

Definition at line 339 of file socket.h.

Definition at line 342 of file socket.h.

Definition at line 345 of file socket.h.

Definition at line 348 of file socket.h.

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

Definition at line 172 of file socket.h.

#define _SS_SIZE   128

Definition at line 171 of file socket.h.

#define AF_APPLETALK   PF_APPLETALK

Definition at line 115 of file socket.h.

#define AF_ASH   PF_ASH

Definition at line 129 of file socket.h.

#define AF_ATMPVC   PF_ATMPVC

Definition at line 118 of file socket.h.

#define AF_ATMSVC   PF_ATMSVC

Definition at line 131 of file socket.h.

#define AF_AX25   PF_AX25

Definition at line 113 of file socket.h.

#define AF_BLUETOOTH   PF_BLUETOOTH

Definition at line 136 of file socket.h.

#define AF_BRIDGE   PF_BRIDGE

Definition at line 117 of file socket.h.

#define AF_DECnet   PF_DECnet

Definition at line 122 of file socket.h.

#define AF_ECONET   PF_ECONET

Definition at line 130 of file socket.h.

#define AF_FILE   PF_FILE

Definition at line 111 of file socket.h.

#define AF_INET   PF_INET

Definition at line 112 of file socket.h.

#define AF_INET6   PF_INET6

Definition at line 120 of file socket.h.

#define AF_IPX   PF_IPX

Definition at line 114 of file socket.h.

#define AF_IRDA   PF_IRDA

Definition at line 133 of file socket.h.

#define AF_ISDN   PF_ISDN

Definition at line 139 of file socket.h.

#define AF_IUCV   PF_IUCV

Definition at line 137 of file socket.h.

#define AF_KEY   PF_KEY

Definition at line 125 of file socket.h.

#define AF_LOCAL   PF_LOCAL

Definition at line 109 of file socket.h.

#define AF_MAX   PF_MAX

Definition at line 140 of file socket.h.

#define AF_NETBEUI   PF_NETBEUI

Definition at line 123 of file socket.h.

#define AF_NETLINK   PF_NETLINK

Definition at line 126 of file socket.h.

#define AF_NETROM   PF_NETROM

Definition at line 116 of file socket.h.

#define AF_PACKET   PF_PACKET

Definition at line 128 of file socket.h.

#define AF_PPPOX   PF_PPPOX

Definition at line 134 of file socket.h.

#define AF_ROSE   PF_ROSE

Definition at line 121 of file socket.h.

#define AF_ROUTE   PF_ROUTE

Definition at line 127 of file socket.h.

#define AF_RXRPC   PF_RXRPC

Definition at line 138 of file socket.h.

#define AF_SECURITY   PF_SECURITY

Definition at line 124 of file socket.h.

#define AF_SNA   PF_SNA

Definition at line 132 of file socket.h.

#define AF_UNIX   PF_UNIX

Definition at line 110 of file socket.h.

#define AF_UNSPEC   PF_UNSPEC

Definition at line 108 of file socket.h.

#define AF_WANPIPE   PF_WANPIPE

Definition at line 135 of file socket.h.

#define AF_X25   PF_X25

Definition at line 119 of file socket.h.

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

Definition at line 274 of file socket.h.

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

Definition at line 268 of file socket.h.

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

Definition at line 271 of file socket.h.

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

Definition at line 278 of file socket.h.

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

Definition at line 270 of file socket.h.

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

Definition at line 276 of file socket.h.

#define MSG_CONFIRM   MSG_CONFIRM

Definition at line 213 of file socket.h.

#define MSG_CTRUNC   MSG_CTRUNC

Definition at line 197 of file socket.h.

Definition at line 190 of file socket.h.

#define MSG_DONTWAIT   MSG_DONTWAIT

Definition at line 203 of file socket.h.

#define MSG_EOR   MSG_EOR

Definition at line 205 of file socket.h.

#define MSG_ERRQUEUE   MSG_ERRQUEUE

Definition at line 217 of file socket.h.

#define MSG_FIN   MSG_FIN

Definition at line 209 of file socket.h.

#define MSG_MORE   MSG_MORE

Definition at line 221 of file socket.h.

#define MSG_NOSIGNAL   MSG_NOSIGNAL

Definition at line 219 of file socket.h.

#define MSG_OOB   MSG_OOB

Definition at line 186 of file socket.h.

#define MSG_PEEK   MSG_PEEK

Definition at line 188 of file socket.h.

#define MSG_PROXY   MSG_PROXY

Definition at line 199 of file socket.h.

#define MSG_RST   MSG_RST

Definition at line 215 of file socket.h.

#define MSG_SYN   MSG_SYN

Definition at line 211 of file socket.h.

#define MSG_TRUNC   MSG_TRUNC

Definition at line 201 of file socket.h.

#define MSG_WAITALL   MSG_WAITALL

Definition at line 207 of file socket.h.

#define PF_APPLETALK   5 /* Appletalk DDP. */

Definition at line 80 of file socket.h.

#define PF_ASH   18 /* Ash. */

Definition at line 94 of file socket.h.

#define PF_ATMPVC   8 /* ATM PVCs. */

Definition at line 83 of file socket.h.

#define PF_ATMSVC   20 /* ATM SVCs. */

Definition at line 96 of file socket.h.

#define PF_AX25   3 /* Amateur Radio AX.25. */

Definition at line 78 of file socket.h.

#define PF_BLUETOOTH   31 /* Bluetooth sockets. */

Definition at line 101 of file socket.h.

#define PF_BRIDGE   7 /* Multiprotocol bridge. */

Definition at line 82 of file socket.h.

#define PF_DECnet   12 /* Reserved for DECnet project. */

Definition at line 87 of file socket.h.

#define PF_ECONET   19 /* Acorn Econet. */

Definition at line 95 of file socket.h.

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

Definition at line 76 of file socket.h.

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

Definition at line 77 of file socket.h.

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

Definition at line 85 of file socket.h.

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

Definition at line 79 of file socket.h.

#define PF_IRDA   23 /* IRDA sockets. */

Definition at line 98 of file socket.h.

#define PF_ISDN   34 /* mISDN sockets. */

Definition at line 104 of file socket.h.

#define PF_IUCV   32 /* IUCV sockets. */

Definition at line 102 of file socket.h.

#define PF_KEY   15 /* PF_KEY key management API. */

Definition at line 90 of file socket.h.

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

Definition at line 74 of file socket.h.

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

Definition at line 105 of file socket.h.

#define PF_NETBEUI   13 /* Reserved for 802.2LLC project. */

Definition at line 88 of file socket.h.

#define PF_NETLINK   16

Definition at line 91 of file socket.h.

#define PF_NETROM   6 /* Amateur radio NetROM. */

Definition at line 81 of file socket.h.

#define PF_PACKET   17 /* Packet family. */

Definition at line 93 of file socket.h.

#define PF_PPPOX   24 /* PPPoX sockets. */

Definition at line 99 of file socket.h.

#define PF_ROSE   11 /* Amateur Radio X.25 PLP. */

Definition at line 86 of file socket.h.

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

Definition at line 92 of file socket.h.

#define PF_RXRPC   33 /* RxRPC sockets. */

Definition at line 103 of file socket.h.

#define PF_SECURITY   14 /* Security callback pseudo AF. */

Definition at line 89 of file socket.h.

#define PF_SNA   22 /* Linux SNA Project */

Definition at line 97 of file socket.h.

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

Definition at line 75 of file socket.h.

#define PF_UNSPEC   0 /* Unspecified. */

Definition at line 73 of file socket.h.

#define PF_WANPIPE   25 /* Wanpipe API sockets. */

Definition at line 100 of file socket.h.

#define PF_X25   9 /* Reserved for X.25 project. */

Definition at line 84 of file socket.h.

#define SCM_RIGHTS   SCM_RIGHTS
#define SOCK_CLOEXEC   SOCK_CLOEXEC

Definition at line 66 of file socket.h.

#define SOCK_DCCP   SOCK_DCCP

Definition at line 56 of file socket.h.

#define SOCK_DGRAM   SOCK_DGRAM

Definition at line 47 of file socket.h.

#define SOCK_PACKET   SOCK_PACKET

Definition at line 60 of file socket.h.

#define SOCK_RAW   SOCK_RAW

Definition at line 49 of file socket.h.

#define SOCK_RDM   SOCK_RDM

Definition at line 51 of file socket.h.

Definition at line 54 of file socket.h.

#define SOCK_STREAM   SOCK_STREAM

Definition at line 44 of file socket.h.

#define SOL_AAL   265 /* ATM Adaption Layer (packet level). */

Definition at line 151 of file socket.h.

#define SOL_ATM   264 /* ATM layer (cell level). */

Definition at line 150 of file socket.h.

#define SOL_DECNET   261

Definition at line 147 of file socket.h.

#define SOL_IRDA   266

Definition at line 152 of file socket.h.

#define SOL_PACKET   263

Definition at line 149 of file socket.h.

#define SOL_RAW   255

Definition at line 146 of file socket.h.

#define SOL_X25   262

Definition at line 148 of file socket.h.

#define SOMAXCONN   128

Definition at line 155 of file socket.h.


Typedef Documentation

Definition at line 35 of file socket.h.


Enumeration Type Documentation

anonymous enum
Enumerator:
MSG_OOB 
MSG_OOB 
MSG_PEEK 
MSG_PEEK 
MSG_DONTROUTE 
MSG_DONTROUTE 
MSG_CTRUNC 
MSG_CTRUNC 
MSG_PROXY 
MSG_PROXY 
MSG_TRUNC 
MSG_TRUNC 
MSG_DONTWAIT 
MSG_DONTWAIT 
MSG_EOR 
MSG_EOR 
MSG_WAITALL 
MSG_WAITALL 
MSG_FIN 
MSG_FIN 
MSG_SYN 
MSG_SYN 
MSG_CONFIRM 
MSG_CONFIRM 
MSG_RST 
MSG_RST 
MSG_ERRQUEUE 
MSG_ERRQUEUE 
MSG_NOSIGNAL 
MSG_NOSIGNAL 
MSG_MORE 
MSG_MORE 
MSG_CMSG_CLOEXEC 

Definition at line 183 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
#ifdef __USE_GNU
    /* DECnet uses a different name.  */
    MSG_TRYHARD             = MSG_DONTROUTE,
# define MSG_TRYHARD MSG_DONTROUTE
#endif
    MSG_CTRUNC              = 0x08,       /* Control data lost before delivery.  */
#define MSG_CTRUNC   MSG_CTRUNC
    MSG_PROXY        = 0x10,       /* Supply or ask second address.  */
#define MSG_PROXY    MSG_PROXY
    MSG_TRUNC        = 0x20,
#define       MSG_TRUNC     MSG_TRUNC
    MSG_DONTWAIT     = 0x40, /* Nonblocking IO.  */
#define       MSG_DONTWAIT  MSG_DONTWAIT
    MSG_EOR          = 0x80, /* End of record.  */
#define       MSG_EOR              MSG_EOR
    MSG_WAITALL             = 0x100, /* Wait for a full request.  */
#define       MSG_WAITALL   MSG_WAITALL
    MSG_FIN          = 0x200,
#define       MSG_FIN              MSG_FIN
    MSG_SYN          = 0x400,
#define       MSG_SYN              MSG_SYN
    MSG_CONFIRM             = 0x800, /* Confirm path validity.  */
#define       MSG_CONFIRM   MSG_CONFIRM
    MSG_RST          = 0x1000,
#define       MSG_RST              MSG_RST
    MSG_ERRQUEUE     = 0x2000, /* Fetch message from error queue.  */
#define       MSG_ERRQUEUE  MSG_ERRQUEUE
    MSG_NOSIGNAL     = 0x4000, /* Do not generate SIGPIPE.  */
#define       MSG_NOSIGNAL  MSG_NOSIGNAL
    MSG_MORE         = 0x8000,  /* Sender will send more.  */
#define       MSG_MORE      MSG_MORE

    MSG_CMSG_CLOEXEC = 0x40000000  /* Set close_on_exit for file
                                           descriptor received through
                                           SCM_RIGHTS.  */
#define MSG_CMSG_CLOEXEC MSG_CMSG_CLOEXEC
  };
anonymous enum
Enumerator:
SCM_RIGHTS 

Definition at line 307 of file socket.h.

  {
    SCM_RIGHTS = 0x01              /* Transfer file descriptors.  */
#define SCM_RIGHTS SCM_RIGHTS
#ifdef __USE_BSD
    , SCM_CREDENTIALS = 0x02       /* Credentials passing.  */
# define SCM_CREDENTIALS SCM_CREDENTIALS
#endif
  };
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 40 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_DCCP = 6,            /* Datagram Congestion Control Protocol.  */
#define SOCK_DCCP SOCK_DCCP
  SOCK_PACKET = 10,         /* Linux specific way of getting packets
                               at the dev level.  For writing rarp and
                               other similar things on the user level. */
#define SOCK_PACKET SOCK_PACKET

  /* Flags to be ORed into the type parameter of socket and socketpair.  */

  SOCK_CLOEXEC = 0x400000,  /* Atomically set close-on-exec flag for the
                               new descriptor(s).  */
#define SOCK_CLOEXEC SOCK_CLOEXEC
  SOCK_NONBLOCK = 0x4000    /* Atomically mark descriptor(s) as
                               non-blocking.  */
#define SOCK_NONBLOCK SOCK_NONBLOCK
};

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