#ifndef __SOCKET_LOADED #define __SOCKET_LOADED 1 /**************************************************************************** ** ** - TCP/IP socket definitions ** ***************************************************************************** ** Header introduced by the X/Open CAE Specification, Issue 4, Version 2 ***************************************************************************** ** ** Copyright 2000 Compaq Computer Corporation ** ** Compaq and the Compaq logo Registered in U.S. Patent and Trademark Office. ** ** Confidential computer software. Valid license from Compaq required for ** possession, use or copying. Consistent with FAR 12.211 and 12.212, ** Commercial Computer Software, Computer Software Documentation, and ** Technical Data for Commercial Items are licensed to the U.S. Government ** under vendor's standard commercial license. ** ****************************************************************************** ** ** Copyright (c) 1982 Regents of the University of California. ** All rights reserved. The Berkeley software License Agreement ** specifies the terms and conditions for redistribution. ** ** socket.h 6.6 (Berkeley) 6/8/85 ** ****************************************************************************** */ #pragma __nostandard #include #ifdef __cplusplus extern "C" { #endif #include #include #if __INITIAL_POINTER_SIZE # pragma __pointer_size __save # pragma __pointer_size 32 #endif /* ** Strict XPG4 V2 compliance requires the BSD 4.4 socket interfaces, ** which is only available on OpenVMS V7.0 or later */ #if defined _XOPEN_SOURCE_EXTENDED && !defined _SOCKADDR_LEN && __CRTL_VER >= 70000000 # define _SOCKADDR_LEN 1 #endif /* ** The OpenVMS V7.0 release added a second implementation of the socket ** functions which is compatible with BSD 4.4. Define a local to be ** used throughout the remaining header file which reflects which ** implementation is being used. ** ** An application program enables this support by defining _SOCKADDR_LEN ** prior to including this header file. */ #ifdef _SOCKADDR_LEN # if (__CRTL_VER < 70000000) # error " BSD 4.4 Socket package not available before OpenVMS V7.0" # undef _SOCKADDR_LEN # endif #endif /* ** All structures should be member aligned on natural boundaries */ #pragma __member_alignment __save #pragma __member_alignment /* ** Public typedefs (32-bit mode) */ #if !defined(__CADDR_T) && !defined(CADDR_T) && !defined _XOPEN_SOURCE_EXTENDED # define __CADDR_T 1 # ifndef __HIDE_FORBIDDEN_NAMES # define CADDR_T 1 # endif typedef __caddr_t caddr_t; #endif #if !defined __SIZE_T && !defined _DECC_V4_SOURCE # define __SIZE_T 1 typedef __size_t size_t; #endif #if !defined __SSIZE_T && !defined _DECC_V4_SOURCE # define __SSIZE_T 1 typedef __ssize_t ssize_t; #endif #if !defined __TIME_T && !defined _DECC_V4_SOURCE # define __TIME_T 1 typedef __time_t time_t; #endif /* ** is a header defined by XPG4 V2. That specification ** puts struct timeval, the FD* macros and select in . ** We define select here for compatibility with DEC C V4, unless ** the program is in XPG4 V2 mode. */ #if !defined __TIMEVAL && !defined _XOPEN_SOURCE_EXTENDED # define __TIMEVAL 1 # if !defined _DECC_V4_SOURCE struct timeval { __time_t tv_sec; /* seconds since Jan. 1, 1970 */ long tv_usec; /* microseconds */ }; # else struct timeval { long tv_sec; /* seconds since Jan. 1, 1970 */ long tv_usec; /* microseconds */ }; # endif #endif /* FD_SETSIZE may be defined by the user. It is normally ** equal to the maximum number of descriptors supported by ** the system. Here it is set to the minimum maximum supported ** by the system. In order to accomodate programs which use ** a larger number of open files with select, increase this size ** within a program by providing a larger definition of FD_SETSIZE ** before including or */ #if !defined __FD_SET && !defined _XOPEN_SOURCE_EXTENDED && !defined _DECC_V4_SOURCE # define __FD_SET 1 # ifndef FD_SETSIZE # define FD_SETSIZE 1024 # endif typedef long fd_mask; # define NBBY 8 /* bits per byte */ # define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */ # define FD_SET(__n, __p) ((__p)->fds_bits[(__n)/NFDBITS] |= (1 << ((__n) % NFDBITS))) # define FD_CLR(__n, __p) ((__p)->fds_bits[(__n)/NFDBITS] &= ~(1 << ((__n) % NFDBITS))) # define FD_ISSET(__n, __p) ((__p)->fds_bits[(__n)/NFDBITS] & (1 << ((__n) % NFDBITS))) # define __howmany(__x, __y) (((__x)+((__y)-1))/(__y)) typedef struct fd_set { /* descriptor set */ fd_mask fds_bits[__howmany(FD_SETSIZE, NFDBITS)]; } fd_set; # ifdef __ALPHA # if __INITIAL_POINTER_SIZE == 64 # pragma __pointer_size 64 # endif void *__MEMSET(void *__s, int __c, __size_t __n); # define FD_ZERO(__p) __MEMSET((__p), 0, sizeof(*(__p))) # if __INITIAL_POINTER_SIZE == 64 # pragma __pointer_size 32 # endif # else void _MOVC5(unsigned short __srclen, const char *__src, char __fill, unsigned short __destlen, char *__dest, ...); # define FD_ZERO(__p) _MOVC5(0, 0, 0, sizeof(*(__p)), (char *)(__p)) # endif #endif /* ** Define non-standard BSD socket compatible typedefs */ #if !defined __SOCKET_TYPEDEFS && !defined _XOPEN_SOURCE_EXTENDED # define __SOCKET_TYPEDEFS 1 typedef unsigned char u_char; typedef unsigned short u_short; typedef unsigned long u_long; #endif /* ** Defined XPG4 typedefs */ #if !defined __SA_FAMILY_T && !defined _DECC_V4_SOURCE # define __SA_FAMILY_T typedef __sa_family_t sa_family_t; #endif /* * Definitions related to sockets: types, address families, options. */ /* * Types */ #define SOCK_STREAM 1 /* stream socket */ #define SOCK_DGRAM 2 /* datagram socket */ #define SOCK_RAW 3 /* raw-protocol interface */ #define SOCK_RDM 4 /* reliably-delivered message */ #define SOCK_SEQPACKET 5 /* sequenced packet stream */ /* * Option flags per-socket. */ #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 addr and port reuse */ #if SEC_BASE #if SEC_NET #define SO_EXPANDED_RIGHTS 0x1016 /* return expanded rights on recv */ #define SO_DEFAULT_ATTR 0x1017 /* set def. socket attr. */ #define SO_RCV_ATTR 0x1018 /* set socket rcv mask. */ #define SO_AUTHENTICATION 0x1019 /* set socket authentication data. */ #define SO_ACCESS_ERROR 0x1020 /* record security violation. */ #define SO_SEC_ATTRIBUTES 0x1021 /* get sec. attrs. for last byte read */ #define SO_REMOTE_KEY 0x1022 /* get auth. data for remote process. */ #define SO_NEW_ATTRS_ONLY 0x1023 /* Only return attrs if they change. */ #define SO_SET_TNET_TCB 0x1024 /* Set/reset ALLOWNETACCESS on socket.*/ #define SO_GET_TNET_TCB 0x1025 /* Return ALLOWNETACC. flag on socket.*/ #else #define SO_EXPANDED_RIGHTS 0x0400 /* return expanded rights on recv */ #endif /*SEC_NET*/ #endif /* * Additional options, not kept in so_options. */ #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_STATE 0x1009 /* get socket state bits */ #define SO_FAMILY 0x100a /* get socket address family*/ #define SO_XSE 0x100b /* _XOPEN_SOURCE_EXTENDED socket */ #define SO_SHARE 0x100c /* ovms Share between processes */ #define SO_CCL 0x100d /* ovms Carriage Control socket */ /* ** Full duplex code socket option */ #define SO_FULL_DUPLEX_CLOSE 0x2000 /* full duplex close option */ /* ** Linger Structure: Used for manipulating linger options. ** ** This structure specifies the setting or resetting of the ** socket opt for the time interval that the socket will ** linger for data. linger is supported only by STREAM ** type sockets. */ struct linger { int l_onoff; /* Linger option; 1 sets linger and 0 resets linger. */ int l_linger; /* Number of seconds to linger; defaulted to ** 120 seconds. */ }; /* ** Level number for (get/set)sockopt() to apply to socket itself. */ #define SOL_SOCKET 0xffff /* options for socket level */ /* ** Address families. */ #define AF_UNSPEC 0 /* unspecified */ #define AF_UNIX 1 /* local to host (pipes, portals) */ #define AF_INET 2 /* internetwork: UDP, TCP, etc. */ #define AF_IMPLINK 3 /* arpanet imp addresses */ #define AF_PUP 4 /* pup protocols: e.g. BSP */ #define AF_CHAOS 5 /* mit CHAOS protocols */ #define AF_NS 6 /* XEROX NS protocols */ #define AF_ISO 7 /* ISO protocols */ #define AF_OSI AF_ISO #define AF_ECMA 8 /* european computer manufacturers */ #define AF_DATAKIT 9 /* datakit protocols */ #define AF_CCITT 10 /* CCITT protocols, X.25 etc */ #define AF_SNA 11 /* IBM SNA */ #define AF_DECnet 12 /* DECnet */ #define AF_DLI 13 /* DEC Direct data link interface */ #define AF_LAT 14 /* LAT */ #define AF_HYLINK 15 /* NSC Hyperchannel */ #define AF_APPLETALK 16 /* Apple Talk */ #define AF_ROUTE 17 /* Internal Routing Protocol */ #define AF_LINK 18 /* Link layer interface */ #ifdef _XOPEN_SOURCE_EXTENDED #define _pseudo_AF_XTP 19 /* eXpress Transfer Protocol (no AF) */ #else #define pseudo_AF_XTP 19 /* eXpress Transfer Protocol (no AF) */ #endif #define AF_NETMAN 20 /* DNA Network Management */ #define AF_X25 21 /* X25 protocol */ #define AF_CTF 22 /* Common Trace Facility */ #define AF_WAN 23 /* Wide Area Network protocols */ #define AF_USER 24 /* Wild card (user defined) protocol */ #define AF_AAL 25 /* Native AAL ATM */ #define AF_INET6 26 /* IPV6: UDP, TCP, etc. */ #define AF_KEY 27 /* Key management */ #define AF_UNUSED1 28 /* Placeholder, currently unused */ #define AF_UNUSED2 29 /* Placeholder, currently unused */ #define AF_UNUSED3 30 /* Placeholder, currently unused */ #define AF_MAX 31 #define SHUT_RD 0 /* Disables further receive operations */ #define SHUT_WR 1 /* Disables further send operations */ #define SHUT_RDWR 2 /* Disables further send and receive operations */ /* ** sockaddr structure used by kernel to store most addresses. */ #ifdef _SOCKADDR_LEN /* ** BSD 4.4 sockaddr */ struct sockaddr { unsigned char sa_len; /* total length */ __sa_family_t sa_family; /* address family */ char sa_data[14]; /* up to 14 bytes of direct address */ }; # if !defined _XOPEN_SOURCE_EXTENDED /* ** BSD 4.3 sockaddr (for compatibility) */ struct osockaddr { unsigned short sa_family; /* address family */ char sa_data[14]; /* up to 14 bytes of direct address */ }; # endif #else /* ** BSD 4.3 sockaddr */ struct sockaddr { unsigned short sa_family; /* address family */ char sa_data[14]; /* up to 14 bytes of direct address */ }; #endif #if !defined _XOPEN_SOURCE_EXTENDED /* ** Structure used by kernel to pass protocol information in raw sockets */ struct sockproto { u_short sp_family; /* address family */ u_short sp_protocol; /* protocol */ }; /* ** Protocol families, same as address families for now */ #define PF_UNSPEC AF_UNSPEC #define PF_UNIX AF_UNIX #define PF_INET AF_INET #define PF_IMPLINK AF_IMPLINK #define PF_PUP AF_PUP #define PF_CHAOS AF_CHAOS #define PF_NS AF_NS #define PF_ISO AF_ISO #define PF_OSI AF_ISO #define PF_ECMA AF_ECMA #define PF_DATAKIT AF_DATAKIT #define PF_CCITT AF_CCITT #define PF_SNA AF_SNA #define PF_DECnet AF_DECnet #define PF_DLI AF_DLI #define PF_LAT AF_LAT #define PF_HYLINK AF_HYLINK #define PF_APPLETALK AF_APPLETALK #define PF_ROUTE AF_ROUTE #define PF_LINK AF_LINK #ifdef _XOPEN_SOURCE_EXTENDED #define PF_XTP _pseudo_AF_XTP /* really just proto family, no AF */ #else #define PF_XTP pseudo_AF_XTP /* really just proto family, no AF */ #endif #define PF_NETMAN AF_NETMAN #define PF_X25 AF_X25 #define PF_CTF AF_CTF #define PF_WAN AF_WAN #define PF_AAL AF_AAL #define PF_INET6 AF_INET6 #define PF_KEY AF_KEY #define PF_UNUSED1 AF_UNUSED1 #define PF_UNUSED2 AF_UNUSED2 #define PF_UNUSED3 AF_UNUSED3 #define PF_MAX AF_MAX /* * Maximum queue length specifiable by listen. */ #define SOMAXCONN 1024 #endif /* ** Msghdr Structure ** ** This structure specifies the message buffer parameter for ** recvmsg and sendmsg calls. It allows you to specify an array ** of scatter/gather buffers. Recvmsg scatters the data to several ** user receive buffers. Sendmsg gathers data from several user ** transmit buffers before transmitting. ** */ #ifdef _SOCKADDR_LEN # ifdef _XOPEN_SOURCE_EXTENDED struct msghdr { void *msg_name; /* The address of the destina- ** tion socket, if the socket is ** connected. If no address is ** required, this field can be ** set to NULL. */ __size_t msg_namelen; /* Len of msg_name field. */ struct iovec *msg_iov; /* scatter/gather array. */ int msg_iovlen; /* # elements in msg_iov. */ void *msg_control; /* Ancillary data consisting ** of a sequence of pairs, each ** consisting of a cmsghdr ** structure followed by a data ** array. The data array con- ** tains the ancillary data ** message, and the cmsghdr ** struct contains info allowing ** applications to parse the ** data. */ __size_t msg_controllen; /* Ancillary data buffer len. */ int msg_flags; /* Flags on received message. */ }; # endif # ifdef _XOPEN_SOURCE_EXTENDED struct __Omsghdr { # else struct msghdr { # endif __caddr_t msg_name; /* The address of the destina- ** tion socket, if the socket is ** connected. If no address is ** required, this field can be ** set to NULL. */ unsigned int msg_namelen; /* Len of msg_name field. */ # ifdef _XOPEN_SOURCE_EXTENDED struct __Oiovec *msg_iov; /* scatter/gather array. */ # else struct iovec *msg_iov; /* scatter/gather array. */ # endif unsigned int msg_iovlen; /* # elements in msg_iov. */ __caddr_t msg_control; /* Ancillary data, see above. */ unsigned int msg_controllen; /* Ancillary data buffer len. */ int msg_flags; /* Flags on received message. */ }; # if !defined _XOPEN_SOURCE_EXTENDED /* ** BSD 4.3 message header (for compatibility) */ struct omsghdr { __caddr_t msg_name; /* The address of the destina- ** tion socket, if the socket is ** connected. If no address is ** required, this field can be ** set to NULL. */ int msg_namelen; /* Len of msg_name field. */ struct iovec *msg_iov; /* scatter/gather array. */ int msg_iovlen; /* # elements in msg_iov. */ __caddr_t msg_accrights; /* Points to a buffer containing ** access rights sent with message. */ int msg_accrightslen;/* Len of the msg_accrights buffer. */ }; # endif #else /* ** BSD 4.3 message header */ struct msghdr { __caddr_t msg_name; /* The address of the destina- ** tion socket, if the socket is ** connected. If no address is ** required, this field can be ** set to NULL. */ int msg_namelen; /* Len of msg_name field. */ struct iovec *msg_iov; /* Scatter/Gather array. */ int msg_iovlen; /* # elements in msg_iov. */ __caddr_t msg_accrights; /* Points to a buffer containing ** access rights sent with message. */ int msg_accrightslen;/* Len of the msg_accrights buffer. */ }; #endif /* ** */ #if !defined _XOPEN_SOURCE_EXTENDED #define MSG_MAXIOVLEN 16 #endif #define MSG_OOB 0x1 /* process out-of-band data */ #define MSG_PEEK 0x2 /* peek at incoming message */ #define MSG_EOR 0x8 /* data completes record */ #define MSG_TRUNC 0x10 /* data discarded before delivery */ #define MSG_CTRUNC 0x20 /* control data lost before delivery */ #define MSG_WAITALL 0x40 /* wait for full request or error */ /* Following used within kernel */ #define MSG_NONBLOCK 0x4000 /* nonblocking request */ #define MSG_COMPAT 0x8000 /* 4.3-format sockaddr */ #if !defined _XOPEN_SOURCE_EXTENDED # define MSG_DONTWAIT 0x80 /* this message should be nonblocking */ # define MSG_DONTROUTE 0x4 /* send without using routing tables */ #endif /* ** Header for ancillary data objects in msg_control buffer. Used for ** additional information with/about a datagram not expressible by ** flags. The format is a sequence of message elements headed by ** cmsghdr structures. */ #ifdef _XOPEN_SOURCE_EXTENDED struct cmsghdr { __size_t cmsg_len; /* data byte count, including hdr. */ int cmsg_level; /* originating protocol, values ** will be legal values for level ** arg to getsockopt(),setsockopt(). */ int cmsg_type; /* protocol-specific type. */ /* followed by u_char cmsg_data[]; */ }; #endif #ifdef _XOPEN_SOURCE_EXTENDED struct __Ocmsghdr { #else struct cmsghdr { #endif unsigned int cmsg_len; /* data byte count, including hdr */ int cmsg_level; /* originating protocol; see above*/ int cmsg_type; /* protocol-specific type */ /* followed by u_char cmsg_data[]; */ }; /* ** Given a pointer to a cmsghdr structure, this macro returns ** an unsigned character pointer to the data array associated with ** the cmsghdr structure. */ #define CMSG_DATA(cmsg) ((unsigned char *)((cmsg) + 1)) /* ** Given a ptr to a msghdr structure and a ptr to cmsghdr structure in ** the ancillary data, pointed to by the msg_control field of the input ** msghdr structure, this macro returns a pointer to the next cmsghdr ** structure, or NULL if this structure is the last cmsghdr in the ** ancillary data. */ #ifdef _XOPEN_SOURCE_EXTENDED /* ** Macro for checking and aligning a pointer to the machines native word size. */ # define _ALIGN(p) \ (void *)((__caddr_t)(p) + sizeof(void *) - 1UL - \ ((unsigned int)((__caddr_t)(p) + sizeof(void *) - 1UL) % \ sizeof(void *))) /* given pointer to struct adatahdr, return pointer to next adatahdr */ # define CMSG_NXTHDR(mhdr, cmsg) \ ((((__caddr_t)(cmsg)) + (cmsg)->cmsg_len + sizeof(struct cmsghdr) > \ ((__caddr_t)((mhdr)->msg_control)) + (mhdr)->msg_controllen) ? \ (struct cmsghdr *)0 : \ (struct cmsghdr *)_ALIGN((((__caddr_t)(cmsg)) + (cmsg)->cmsg_len))) #else /* ! _XOPEN_SOURCE_EXTENDED */ /* ** Round p (pointer or byte index) up to a correctly-aligned value ** for all data types (int, long, ...). The result is unsigned int ** and must be cast to any desired pointer type. */ # define __ALIGNBYTES (sizeof (void *) - 1) # define __ALIGN(__p) (((unsigned int)(__p) + __ALIGNBYTES) &~ __ALIGNBYTES) /* given pointer to struct adatahdr, return pointer to next adatahdr */ # define CMSG_NXTHDR(mhdr, cmsg) \ (((__caddr_t)(cmsg) + (cmsg)->cmsg_len + sizeof(struct cmsghdr) > \ (mhdr)->msg_control + (mhdr)->msg_controllen) ? \ (struct cmsghdr *)0 : \ (struct cmsghdr *)((__caddr_t)(cmsg) + __ALIGN((cmsg)->cmsg_len))) #endif /* _XOPEN_SOURCE_EXTENDED */ /* ** Given a ptr to a msghdr structure, this macro returns a pointer ** to the first cmsghdr structure in the ancillary data associated ** with the msghdr structure or NULL if no ancillary data is associated ** with the msghdr structure. */ #define CMSG_FIRSTHDR(mhdr) ((struct cmsghdr *)(mhdr)->msg_control) /* ** "Socket"-level control message types: */ #define SCM_RIGHTS 0x01 /* access rights (array of int) */ /* ** This section is for functions and declarations which do support 64 bit ** pointers being passed (or returned). The socket interface is different ** from other 64 bit interfaces in that only a select set of functions ** accept 64 bit pointers. The DEC C RTL is a thin layer between the user ** application and a vendors tcp/ip interface. */ #ifdef _SOCKADDR_LEN # if __CAN_USE_EXTERN_PREFIX # pragma __extern_prefix __save # pragma __extern_prefix "__bsd44_" # else # define recvmsg(__p1,__p2,__p3) __bsd44_recvmsg(__p1,__p2,__p3) # define sendmsg(__p1,__p2,__p3) __bsd44_sendmsg(__p1,__p2,__p3) # endif #endif __ssize_t recvmsg (int __sd, struct msghdr *__msg, int __flags); __ssize_t sendmsg (int __sd, const struct msghdr *__msg, int __flags); #ifdef _SOCKADDR_LEN # if __CAN_USE_EXTERN_PREFIX # pragma __extern_prefix __restore # endif #endif /* ** If the user has used /pointer_size=32 or /pointer_size=64, we will allow 64 ** bit pointers to be used in function calls. */ #if __INITIAL_POINTER_SIZE # pragma __pointer_size 64 #endif /* ** Functions which will always accept 32 or 64 bit pointers. If the ** underlying tcp/ip layer has 64 bit support, then the addresses will be ** passed as they are. If the underlying layer does not have 64 bit ** address support, then the data will be copied to a malloced area and ** then passed on to the underlying layer. */ #ifdef _SOCKADDR_LEN # if __CAN_USE_EXTERN_PREFIX # pragma __extern_prefix __save # pragma __extern_prefix "__bsd44_" # else # define accept(__p1,__p2,__p3) __bsd44_accept(__p1,__p2,__p3) # define bind(__p1,__p2,__p3) __bsd44_bind(__p1,__p2,__p3) # define connect(__p1,__p2,__p3) __bsd44_connect(__p1,__p2,__p3) # define getpeername(__p1,__p2,__p3) __bsd44_getpeername(__p1,__p2,__p3) # define getsockname(__p1,__p2,__p3) __bsd44_getsockname(__p1,__p2,__p3) # define recvfrom(__p1,__p2,__p3,__p4,__p5,__p6) __bsd44_recvfrom(__p1,__p2,__p3,__p4,__p5,__p6) # define sendto(__p1,__p2,__p3,__p4,__p5,__p6) __bsd44_sendto(__p1,__p2,__p3,__p4,__p5,__p6) # endif #endif /* ** In DEC C V4.0, the following routines used int or int * ** for the length parameters. X/Open specifies that these ** are size_t. */ #if !defined _DECC_V4_SOURCE int accept (int __sd, struct sockaddr *__S_addr, __size_t *__len); int bind (int __sd, const struct sockaddr *__s_name, __size_t __len); int connect (int __sd, const struct sockaddr *__name, __size_t __len); int getpeername (int __sd, struct sockaddr *__name, __size_t *__len); int getsockname (int __sd, struct sockaddr *__name, __size_t *__len); __ssize_t recvfrom (int __sd, void *__buf, __size_t __buflen, int __flags, struct sockaddr *__from, __size_t *__fromlen); __ssize_t sendto (int __sd, const void *__msg, __size_t __msglen, int __flags, const struct sockaddr *__to, __size_t __tolen); #else int accept (int __sd, struct sockaddr *__S_addr, int *__addrlen); int bind (int __sd, struct sockaddr *__s_name, int __namelen); int connect (int __sd, struct sockaddr *__name, int __namelen); int getpeername (int __sd, struct sockaddr *__name, int *__namelen); int getsockname (int __sd, struct sockaddr *__name, int *__namelen); int recvfrom (int __sd, char *__buf, int __length, int __flags, struct sockaddr *__from, int *__fromlen); int sendto (int __sd, char *__msg, int __length, int __flags, struct sockaddr *__to, int __tolen); #endif #ifdef _SOCKADDR_LEN # if __CAN_USE_EXTERN_PREFIX # pragma __extern_prefix __restore # endif #endif /* ** In DEC C V4.0, the following routines used int or int * ** for the length parameters and char * for the option ** value. X/Open specifies that these are size_t and void *. */ #if !defined _DECC_V4_SOURCE int getsockopt (int __sd, int __level, int __optname, void *__optval, __size_t *__optlen); int setsockopt (int __sd, int __level, int __optname, const void *__optval, __size_t __optlen); __ssize_t recv (int __sd, void *__buf, __size_t __length, int __flags); __ssize_t send (int __sd, const void *__msg, __size_t __length, int __flags); #else int getsockopt (int __sd, int __level, int __optname, char *__optval, int *__optlen); int setsockopt (int __sd, int __level, int __optname, char *__optval, int __optlen); int send (int __sd, char *__msg, int __length, int __flags); int recv (int __sd, char *__buf, int __length, int __flags); #endif int listen (int __sd, int __backlog); int shutdown (int __sd, int __mode); int socket (int __af, int __mess_type, int __prot_type); /* ** DEC C Extensions (64-bit) */ #ifndef _XOPEN_SOURCE_EXTENDED # if __CRTL_VER >= 70000000 int decc$socket_fd (int __channel); # if !defined(_DECC) || (__DECC_VER < 60400000) int socket_fd (int __channel); # endif # endif int decc$get_sdc (int __descrip_no); # define vaxc$get_sdc(x) decc$get_sdc(x) int gethostaddr (char *__addr); # ifdef _DECC_V4_SOURCE int gethostname (char *__name, int __namelen); int select (int __nfds, int *__readfds, int *__writefds, int *__exceptfds, struct timeval *__timeout); # else int gethostname (char *__name, __size_t __namelen); int select (int __nfds, fd_set *__readfds, fd_set *__writefds, fd_set *__exceptfds, struct timeval *__timeout); # endif #endif /* ** Restore the users pointer context */ #if __INITIAL_POINTER_SIZE # pragma __pointer_size __restore #endif #ifdef __cplusplus } #endif #pragma __member_alignment __restore #pragma __standard #endif /* __SOCKET_LOADED */