Changeset 095ecbf in rtems


Ignore:
Timestamp:
Jun 24, 2016, 8:20:46 AM (3 years ago)
Author:
Christian Mauderer <Christian.Mauderer@…>
Branches:
master
Children:
aa30e2c
Parents:
e79a0ca7
git-author:
Christian Mauderer <Christian.Mauderer@…> (06/24/16 08:20:46)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/28/16 11:10:01)
Message:

libnetworking: Import current <sys/socket.h>

Import the <sys/socket.h> from current FreeBSD. This allows to build
some current software (e.g. libressl).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libnetworking/sys/socket.h

    re79a0ca7 r095ecbf  
    1 /*
     1/*-
    22 * Copyright (c) 1982, 1985, 1986, 1988, 1993, 1994
    33 *      The Regents of the University of California.  All rights reserved.
     
    2828 *
    2929 *      @(#)socket.h    8.4 (Berkeley) 2/21/94
    30  * $FreeBSD: src/sys/sys/socket.h,v 1.88 2005/04/13 00:01:46 mdodd Exp $
    31  */
    32 
     30 * $FreeBSD: head/sys/sys/socket.h 301038 2016-05-31 13:32:33Z ed $
     31 */
    3332
    3433#ifndef _SYS_SOCKET_H_
     
    3635
    3736#include <sys/cdefs.h>
    38 #include <rtems/bsdnet/_types.h>
    39 #include <sys/types.h>
     37#include <sys/_types.h>
     38#include <sys/_iovec.h>
     39#include <machine/_align.h>
    4040
    4141/*
     
    4646 * Data types.
    4747 */
     48#if __BSD_VISIBLE
     49#ifndef _GID_T_DECLARED
     50typedef __gid_t         gid_t;
     51#define _GID_T_DECLARED
     52#endif
     53
     54#ifndef _OFF_T_DECLARED
     55typedef __off_t         off_t;
     56#define _OFF_T_DECLARED
     57#endif
     58
     59#ifndef _PID_T_DECLARED
     60typedef __pid_t         pid_t;
     61#define _PID_T_DECLARED
     62#endif
     63#endif
    4864
    4965#ifndef _SA_FAMILY_T_DECLARED
     
    5672#define _SOCKLEN_T_DECLARED
    5773#endif
     74 
     75#ifndef _SSIZE_T_DECLARED
     76typedef __ssize_t       ssize_t;
     77#define _SSIZE_T_DECLARED
     78#endif
     79
     80#if __BSD_VISIBLE
     81#ifndef _UID_T_DECLARED
     82typedef __uid_t         uid_t;
     83#define _UID_T_DECLARED
     84#endif
     85#endif
     86
     87#ifndef _UINT32_T_DECLARED
     88typedef __uint32_t      uint32_t;
     89#define _UINT32_T_DECLARED
     90#endif
     91
     92#ifndef _UINTPTR_T_DECLARED
     93typedef __uintptr_t     uintptr_t;
     94#define _UINTPTR_T_DECLARED
     95#endif
    5896
    5997/*
     
    67105#endif
    68106#define SOCK_SEQPACKET  5               /* sequenced packet stream */
     107
     108#if __BSD_VISIBLE
     109/*
     110 * Creation flags, OR'ed into socket() and socketpair() type argument.
     111 */
     112#define SOCK_CLOEXEC    0x10000000
     113#define SOCK_NONBLOCK   0x20000000
     114#endif
    69115
    70116/*
     
    89135#define SO_BINTIME      0x2000          /* timestamp received dgram traffic */
    90136#endif
     137#define SO_NO_OFFLOAD   0x4000          /* socket cannot be offloaded */
     138#define SO_NO_DDP       0x8000          /* disable direct data placement */
    91139
    92140/*
    93141 * Additional options, not kept in so_options.
    94142 */
    95 #define SO_SNDBUF       0x1001          /* send buffer size */
    96 #define SO_RCVBUF       0x1002          /* receive buffer size */
    97 #define SO_SNDLOWAT     0x1003          /* send low-water mark */
    98 #define SO_RCVLOWAT     0x1004          /* receive low-water mark */
    99 #define SO_SNDTIMEO     0x1005          /* send timeout */
    100 #define SO_RCVTIMEO     0x1006          /* receive timeout */
     143#define SO_SNDBUF       0x1001          /* send buffer size */
     144#define SO_RCVBUF       0x1002          /* receive buffer size */
     145#define SO_SNDLOWAT     0x1003          /* send low-water mark */
     146#define SO_RCVLOWAT     0x1004          /* receive low-water mark */
     147#define SO_SNDTIMEO     0x1005          /* send timeout */
     148#define SO_RCVTIMEO     0x1006          /* receive timeout */
    101149#define SO_ERROR        0x1007          /* get error status and clear */
    102150#define SO_TYPE         0x1008          /* get socket type */
     151#if __BSD_VISIBLE
     152#define SO_LABEL        0x1009          /* socket's MAC label */
     153#define SO_PEERLABEL    0x1010          /* socket's peer's MAC label */
     154#define SO_LISTENQLIMIT 0x1011          /* socket's backlog limit */
     155#define SO_LISTENQLEN   0x1012          /* socket's complete queue length */
     156#define SO_LISTENINCQLEN        0x1013  /* socket's incomplete queue length */
     157#define SO_SETFIB       0x1014          /* use this FIB to route */
     158#define SO_USER_COOKIE  0x1015          /* user cookie (dummynet etc.) */
     159#define SO_PROTOCOL     0x1016          /* get socket protocol (Linux name) */
     160#define SO_PROTOTYPE    SO_PROTOCOL     /* alias for SO_PROTOCOL (SunOS name) */
     161#endif
     162
     163/*
     164 * Space reserved for new socket options added by third-party vendors.
     165 * This range applies to all socket option levels.  New socket options
     166 * in FreeBSD should always use an option value less than SO_VENDOR.
     167 */
     168#if __BSD_VISIBLE
     169#define SO_VENDOR       0x80000000
     170#endif
    103171
    104172/*
    105173 * Structure used for manipulating linger option.
    106174 */
    107 struct  linger {
     175struct linger {
    108176        int     l_onoff;                /* option on/off */
    109177        int     l_linger;               /* linger time */
    110178};
     179
     180#if __BSD_VISIBLE
     181struct accept_filter_arg {
     182        char    af_name[16];
     183        char    af_arg[256-16];
     184};
     185#endif
    111186
    112187/*
     
    154229#endif
    155230#define AF_INET6        28              /* IPv6 */
    156 
    157 #define AF_MAX          29
     231#if __BSD_VISIBLE
     232#define AF_NATM         29              /* native ATM access */
     233#define AF_ATM          30              /* ATM */
     234#define pseudo_AF_HDRCMPLT 31           /* Used by BPF to not rewrite headers
     235                                         * in interface output routine
     236                                         */
     237#define AF_NETGRAPH     32              /* Netgraph sockets */
     238#define AF_SLOW         33              /* 802.3ad slow protocol */
     239#define AF_SCLUSTER     34              /* Sitara cluster protocol */
     240#define AF_ARP          35
     241#define AF_BLUETOOTH    36              /* Bluetooth sockets */
     242#define AF_IEEE80211    37              /* IEEE 802.11 protocol */
     243#define AF_INET_SDP     40              /* OFED Socket Direct Protocol ipv4 */
     244#define AF_INET6_SDP    42              /* OFED Socket Direct Protocol ipv6 */
     245#define AF_MAX          42
     246/*
     247 * When allocating a new AF_ constant, please only allocate
     248 * even numbered constants for FreeBSD until 134 as odd numbered AF_
     249 * constants 39-133 are now reserved for vendors.
     250 */
     251#define AF_VENDOR00 39
     252#define AF_VENDOR01 41
     253#define AF_VENDOR02 43
     254#define AF_VENDOR03 45
     255#define AF_VENDOR04 47
     256#define AF_VENDOR05 49
     257#define AF_VENDOR06 51
     258#define AF_VENDOR07 53
     259#define AF_VENDOR08 55
     260#define AF_VENDOR09 57
     261#define AF_VENDOR10 59
     262#define AF_VENDOR11 61
     263#define AF_VENDOR12 63
     264#define AF_VENDOR13 65
     265#define AF_VENDOR14 67
     266#define AF_VENDOR15 69
     267#define AF_VENDOR16 71
     268#define AF_VENDOR17 73
     269#define AF_VENDOR18 75
     270#define AF_VENDOR19 77
     271#define AF_VENDOR20 79
     272#define AF_VENDOR21 81
     273#define AF_VENDOR22 83
     274#define AF_VENDOR23 85
     275#define AF_VENDOR24 87
     276#define AF_VENDOR25 89
     277#define AF_VENDOR26 91
     278#define AF_VENDOR27 93
     279#define AF_VENDOR28 95
     280#define AF_VENDOR29 97
     281#define AF_VENDOR30 99
     282#define AF_VENDOR31 101
     283#define AF_VENDOR32 103
     284#define AF_VENDOR33 105
     285#define AF_VENDOR34 107
     286#define AF_VENDOR35 109
     287#define AF_VENDOR36 111
     288#define AF_VENDOR37 113
     289#define AF_VENDOR38 115
     290#define AF_VENDOR39 117
     291#define AF_VENDOR40 119
     292#define AF_VENDOR41 121
     293#define AF_VENDOR42 123
     294#define AF_VENDOR43 125
     295#define AF_VENDOR44 127
     296#define AF_VENDOR45 129
     297#define AF_VENDOR46 131
     298#define AF_VENDOR47 133
     299#endif
    158300
    159301/*
     
    162304 */
    163305struct sockaddr {
    164         unsigned char   sa_len;                 /* total length */
    165         sa_family_t     sa_family;              /* address family */
    166         char    sa_data[14];            /* actually longer; address value */
    167 };
     306        unsigned char   sa_len;         /* total length */
     307        sa_family_t     sa_family;      /* address family */
     308        char            sa_data[14];    /* actually longer; address value */
     309};
     310#if __BSD_VISIBLE
     311#define SOCK_MAXADDRLEN 255             /* longest possible addresses */
    168312
    169313/*
     
    175319        unsigned short  sp_protocol;            /* protocol */
    176320};
    177 
     321#endif
     322
     323#include <sys/_sockaddr_storage.h>
     324
     325#if __BSD_VISIBLE
    178326/*
    179327 * Protocol families, same as address families for now.
     
    210358#define PF_KEY          pseudo_AF_KEY
    211359#define PF_INET6        AF_INET6
     360#define PF_NATM         AF_NATM
     361#define PF_ATM          AF_ATM
     362#define PF_NETGRAPH     AF_NETGRAPH
     363#define PF_SLOW         AF_SLOW
     364#define PF_SCLUSTER     AF_SCLUSTER
     365#define PF_ARP          AF_ARP
     366#define PF_BLUETOOTH    AF_BLUETOOTH
     367#define PF_IEEE80211    AF_IEEE80211
     368#define PF_INET_SDP     AF_INET_SDP
     369#define PF_INET6_SDP    AF_INET6_SDP
    212370
    213371#define PF_MAX          AF_MAX
     
    219377 * Third level is protocol number.
    220378 *
    221  * Further levels are defined by the individual families below.
    222  */
    223 #define NET_MAXID       AF_MAX
    224 
    225 #define CTL_NET_NAMES { \
    226         { 0, 0 }, \
    227         { "unix", CTLTYPE_NODE }, \
    228         { "inet", CTLTYPE_NODE }, \
    229         { "implink", CTLTYPE_NODE }, \
    230         { "pup", CTLTYPE_NODE }, \
    231         { "chaos", CTLTYPE_NODE }, \
    232         { "xerox_ns", CTLTYPE_NODE }, \
    233         { "iso", CTLTYPE_NODE }, \
    234         { "emca", CTLTYPE_NODE }, \
    235         { "datakit", CTLTYPE_NODE }, \
    236         { "ccitt", CTLTYPE_NODE }, \
    237         { "ibm_sna", CTLTYPE_NODE }, \
    238         { "decnet", CTLTYPE_NODE }, \
    239         { "dec_dli", CTLTYPE_NODE }, \
    240         { "lat", CTLTYPE_NODE }, \
    241         { "hylink", CTLTYPE_NODE }, \
    242         { "appletalk", CTLTYPE_NODE }, \
    243         { "route", CTLTYPE_NODE }, \
    244         { "link_layer", CTLTYPE_NODE }, \
    245         { "xtp", CTLTYPE_NODE }, \
    246         { "coip", CTLTYPE_NODE }, \
    247         { "cnt", CTLTYPE_NODE }, \
    248         { "rtip", CTLTYPE_NODE }, \
    249         { "ipx", CTLTYPE_NODE }, \
    250         { "sip", CTLTYPE_NODE }, \
    251         { "pip", CTLTYPE_NODE }, \
    252         { "isdn", CTLTYPE_NODE }, \
    253         { "key", CTLTYPE_NODE }, \
    254 }
     379 * Further levels are defined by the individual families.
     380 */
    255381
    256382/*
     
    265391#define NET_RT_FLAGS    2               /* by flags, e.g. RESOLVING */
    266392#define NET_RT_IFLIST   3               /* survey interface list */
    267 #define NET_RT_MAXID    4
    268 
    269 #define CTL_NET_RT_NAMES { \
    270         { 0, 0 }, \
    271         { "dump", CTLTYPE_STRUCT }, \
    272         { "flags", CTLTYPE_STRUCT }, \
    273         { "iflist", CTLTYPE_STRUCT }, \
    274 }
     393#define NET_RT_IFMALIST 4               /* return multicast address list */
     394#define NET_RT_IFLISTL  5               /* Survey interface list, using 'l'en
     395                                         * versions of msghdr structs. */
     396#endif /* __BSD_VISIBLE */
    275397
    276398/*
     
    285407struct msghdr {
    286408        void            *msg_name;              /* optional address */
    287         socklen_t       msg_namelen;            /* size of address */
    288         struct  iovec *msg_iov;         /* scatter/gather array */
    289         int     msg_iovlen;             /* # elements in msg_iov */
     409        socklen_t        msg_namelen;           /* size of address */
     410        struct iovec    *msg_iov;               /* scatter/gather array */
     411        int              msg_iovlen;            /* # elements in msg_iov */
    290412        void            *msg_control;           /* ancillary data, see below */
    291         socklen_t       msg_controllen;         /* ancillary data buffer len */
    292         int     msg_flags;              /* flags on received message */
     413        socklen_t        msg_controllen;        /* ancillary data buffer len */
     414        int              msg_flags;             /* flags on received message */
    293415};
    294416
     
    300422#define MSG_CTRUNC      0x20            /* control data lost before delivery */
    301423#define MSG_WAITALL     0x40            /* wait for full request or error */
     424#if __POSIX_VISIBLE >= 200809
     425#define MSG_NOSIGNAL    0x20000         /* do not generate SIGPIPE on EOF */
     426#endif
    302427#if __BSD_VISIBLE
    303428#define MSG_DONTWAIT    0x80            /* this message should be nonblocking */
    304429#define MSG_EOF         0x100           /* data completes connection */
    305 #define MSG_COMPAT      0x8000          /* used in sendit() */
     430#define MSG_NOTIFICATION 0x2000         /* SCTP notification */
     431#define MSG_NBIO        0x4000          /* FIONBIO mode, used by fifofs */
     432#define MSG_COMPAT      0x8000          /* used in sendit() */
     433#define MSG_CMSG_CLOEXEC 0x40000        /* make received fds close-on-exec */
     434#define MSG_WAITFORONE  0x80000         /* for recvmmsg() */
     435#endif
     436#ifdef _KERNEL
     437#define MSG_SOCALLBCK   0x10000         /* for use by socket callbacks - soreceive (TCP) */
    306438#endif
    307439
     
    314446struct cmsghdr {
    315447        socklen_t       cmsg_len;               /* data byte count, including hdr */
    316         int     cmsg_level;             /* originating protocol */
    317         int     cmsg_type;              /* protocol-specific type */
     448        int             cmsg_level;             /* originating protocol */
     449        int             cmsg_type;              /* protocol-specific type */
    318450/* followed by  u_char  cmsg_data[]; */
    319451};
    320452
     453#if __BSD_VISIBLE
     454/*
     455 * While we may have more groups than this, the cmsgcred struct must
     456 * be able to fit in an mbuf and we have historically supported a
     457 * maximum of 16 groups.
     458*/
     459#define CMGROUP_MAX 16
     460
     461/*
     462 * Credentials structure, used to verify the identity of a peer
     463 * process that has sent us a message. This is allocated by the
     464 * peer process but filled in by the kernel. This prevents the
     465 * peer from lying about its identity. (Note that cmcred_groups[0]
     466 * is the effective GID.)
     467 */
     468struct cmsgcred {
     469        pid_t   cmcred_pid;             /* PID of sending process */
     470        uid_t   cmcred_uid;             /* real UID of sending process */
     471        uid_t   cmcred_euid;            /* effective UID of sending process */
     472        gid_t   cmcred_gid;             /* real GID of sending process */
     473        short   cmcred_ngroups;         /* number or groups */
     474        gid_t   cmcred_groups[CMGROUP_MAX];     /* groups */
     475};
     476
     477/*
     478 * Socket credentials.
     479 */
     480struct sockcred {
     481        uid_t   sc_uid;                 /* real user id */
     482        uid_t   sc_euid;                /* effective user id */
     483        gid_t   sc_gid;                 /* real group id */
     484        gid_t   sc_egid;                /* effective group id */
     485        int     sc_ngroups;             /* number of supplemental groups */
     486        gid_t   sc_groups[1];           /* variable length */
     487};
     488
     489/*
     490 * Compute size of a sockcred structure with groups.
     491 */
     492#define SOCKCREDSIZE(ngrps) \
     493        (sizeof(struct sockcred) + (sizeof(gid_t) * ((ngrps) - 1)))
     494
     495#endif /* __BSD_VISIBLE */
     496
    321497/* given pointer to struct cmsghdr, return pointer to data */
    322 #define CMSG_DATA(cmsg)         ((u_char *)((cmsg) + 1))
     498#define CMSG_DATA(cmsg)         ((unsigned char *)(cmsg) + \
     499                                 _ALIGN(sizeof(struct cmsghdr)))
    323500
    324501/* given pointer to struct cmsghdr, return pointer to next cmsghdr */
    325502#define CMSG_NXTHDR(mhdr, cmsg) \
    326         (((caddr_t)(cmsg) + (cmsg)->cmsg_len + sizeof(struct cmsghdr) > \
    327             (mhdr)->msg_control + (mhdr)->msg_controllen) ? \
    328             (struct cmsghdr *)NULL : \
    329             (struct cmsghdr *)((caddr_t)(cmsg) + ALIGN((cmsg)->cmsg_len)))
    330 
    331 #define CMSG_FIRSTHDR(mhdr)     ((struct cmsghdr *)(mhdr)->msg_control)
     503        ((char *)(cmsg) == (char *)0 ? CMSG_FIRSTHDR(mhdr) : \
     504            ((char *)(cmsg) + _ALIGN(((struct cmsghdr *)(cmsg))->cmsg_len) + \
     505          _ALIGN(sizeof(struct cmsghdr)) > \
     506            (char *)(mhdr)->msg_control + (mhdr)->msg_controllen) ? \
     507            (struct cmsghdr *)0 : \
     508            (struct cmsghdr *)(void *)((char *)(cmsg) + \
     509            _ALIGN(((struct cmsghdr *)(cmsg))->cmsg_len)))
     510
     511/*
     512 * RFC 2292 requires to check msg_controllen, in case that the kernel returns
     513 * an empty list for some reasons.
     514 */
     515#define CMSG_FIRSTHDR(mhdr) \
     516        ((mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \
     517         (struct cmsghdr *)(mhdr)->msg_control : \
     518         (struct cmsghdr *)0)
     519
     520#if __BSD_VISIBLE
     521/* RFC 2292 additions */
     522#define CMSG_SPACE(l)           (_ALIGN(sizeof(struct cmsghdr)) + _ALIGN(l))
     523#define CMSG_LEN(l)             (_ALIGN(sizeof(struct cmsghdr)) + (l))
     524#endif
     525
     526#ifdef _KERNEL
     527#define CMSG_ALIGN(n)   _ALIGN(n)
     528#endif
    332529
    333530/* "Socket"-level control message types: */
    334531#define SCM_RIGHTS      0x01            /* access rights (array of int) */
     532#if __BSD_VISIBLE
    335533#define SCM_TIMESTAMP   0x02            /* timestamp (struct timeval) */
    336 
     534#define SCM_CREDS       0x03            /* process creds (struct cmsgcred) */
     535#define SCM_BINTIME     0x04            /* timestamp (struct bintime) */
     536#endif
     537
     538#if __BSD_VISIBLE
    337539/*
    338540 * 4.3 compat sockaddr, move to compat file later
    339541 */
    340542struct osockaddr {
    341         unsigned short  sa_family;              /* address family */
     543        unsigned short sa_family;       /* address family */
    342544        char    sa_data[14];            /* up to 14 bytes of direct address */
    343545};
     
    354556        int     msg_accrightslen;
    355557};
     558#endif
    356559
    357560/*
     
    362565#define SHUT_RDWR       2               /* shut down both sides */
    363566
     567#if __BSD_VISIBLE
     568/* for SCTP */
     569/* we cheat and use the SHUT_XX defines for these */
     570#define PRU_FLUSH_RD     SHUT_RD
     571#define PRU_FLUSH_WR     SHUT_WR
     572#define PRU_FLUSH_RDWR   SHUT_RDWR
     573#endif
     574
     575
     576#if __BSD_VISIBLE
     577/*
     578 * sendfile(2) header/trailer struct
     579 */
     580struct sf_hdtr {
     581        struct iovec *headers;  /* pointer to an array of header struct iovec's */
     582        int hdr_cnt;            /* number of header iovec's */
     583        struct iovec *trailers; /* pointer to an array of trailer struct iovec's */
     584        int trl_cnt;            /* number of trailer iovec's */
     585};
     586
     587/*
     588 * Sendfile-specific flag(s)
     589 */
     590#define SF_NODISKIO     0x00000001
     591#define SF_MNOWAIT      0x00000002      /* obsolete */
     592#define SF_SYNC         0x00000004
     593#define SF_NOCACHE      0x00000010
     594#define SF_FLAGS(rh, flags)     (((rh) << 16) | (flags))
     595
     596#ifdef _KERNEL
     597#define SF_READAHEAD(flags)     ((flags) >> 16)
     598#endif /* _KERNEL */
     599
     600/*
     601 * Sendmmsg/recvmmsg specific structure(s)
     602 */
     603struct mmsghdr {
     604        struct msghdr   msg_hdr;                /* message header */
     605        ssize_t         msg_len;                /* message length */
     606};
     607#endif /* __BSD_VISIBLE */
     608
    364609#ifndef _KERNEL
     610
     611#include <sys/cdefs.h>
    365612
    366613__BEGIN_DECLS
     
    368615int     bind(int, const struct sockaddr *, socklen_t);
    369616int     connect(int, const struct sockaddr *, socklen_t);
     617#if __BSD_VISIBLE
     618int     accept4(int, struct sockaddr * __restrict, socklen_t * __restrict, int);
     619int     bindat(int, int, const struct sockaddr *, socklen_t);
     620int     connectat(int, int, const struct sockaddr *, socklen_t);
     621#endif
    370622int     getpeername(int, struct sockaddr * __restrict, socklen_t * __restrict);
    371623int     getsockname(int, struct sockaddr * __restrict, socklen_t * __restrict);
     
    375627ssize_t recvfrom(int, void *, size_t, int, struct sockaddr * __restrict, socklen_t * __restrict);
    376628ssize_t recvmsg(int, struct msghdr *, int);
     629#if __BSD_VISIBLE
     630struct timespec;
     631ssize_t recvmmsg(int, struct mmsghdr * __restrict, size_t, int,
     632    const struct timespec * __restrict);
     633#endif
    377634ssize_t send(int, const void *, size_t, int);
    378635ssize_t sendto(int, const void *,
    379636            size_t, int, const struct sockaddr *, socklen_t);
    380637ssize_t sendmsg(int, const struct msghdr *, int);
     638#if __BSD_VISIBLE
     639int     sendfile(int, int, off_t, size_t, struct sf_hdtr *, off_t *, int);
     640ssize_t sendmmsg(int, struct mmsghdr * __restrict, size_t, int);
     641int     setfib(int);
     642#endif
    381643int     setsockopt(int, int, int, const void *, socklen_t);
    382644int     shutdown(int, int);
     645int     sockatmark(int);
    383646int     socket(int, int, int);
    384647int     socketpair(int, int, int, int *);
     
    387650#endif /* !_KERNEL */
    388651
     652#ifdef _KERNEL
     653struct socket;
     654
     655struct tcpcb *so_sototcpcb(struct socket *so);
     656struct inpcb *so_sotoinpcb(struct socket *so);
     657struct sockbuf *so_sockbuf_snd(struct socket *);
     658struct sockbuf *so_sockbuf_rcv(struct socket *);
     659
     660int so_state_get(const struct socket *);
     661void so_state_set(struct socket *, int);
     662
     663int so_options_get(const struct socket *);
     664void so_options_set(struct socket *, int);
     665
     666int so_error_get(const struct socket *);
     667void so_error_set(struct socket *, int);
     668
     669int so_linger_get(const struct socket *);
     670void so_linger_set(struct socket *, int);
     671
     672struct protosw *so_protosw_get(const struct socket *);
     673void so_protosw_set(struct socket *, struct protosw *);
     674
     675void so_sorwakeup_locked(struct socket *so);
     676void so_sowwakeup_locked(struct socket *so);
     677
     678void so_sorwakeup(struct socket *so);
     679void so_sowwakeup(struct socket *so);
     680
     681void so_lock(struct socket *so);
     682void so_unlock(struct socket *so);
     683
     684void so_listeners_apply_all(struct socket *so, void (*func)(struct socket *, void *), void *arg);
     685
     686#endif
     687
     688
    389689#endif /* !_SYS_SOCKET_H_ */
Note: See TracChangeset for help on using the changeset viewer.