Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  

sockdefs.h

Go to the documentation of this file.
00001 /*
00002  * Select uses arrays of SOCKETs.  These macros manipulate such
00003  * arrays.  FD_SETSIZE may be defined by the user before including
00004  * this file, but the default here should be >= 64.
00005  *
00006  * CAVEAT IMPLEMENTOR and USER: THESE MACROS AND TYPES MUST BE
00007  * INCLUDED IN WINSOCK.H EXACTLY AS SHOWN HERE.
00008  */
00009 
00010 
00011 #ifndef INADDR_ANY
00012 #define INADDR_ANY ((unsigned long) 0)
00013 #endif
00014 
00015 
00016 #ifndef HOSTENT_DEFINED
00017 #define HOSTENT_DEFINED
00018 struct hostent
00019 {
00020   char *h_name;                 /* official name of host */
00021   char **h_aliases;             /* alias list */
00022   int h_addrtype;               /* host address type */
00023   int h_length;                 /* length of address */
00024   char **h_addr_list;           /* list of addresses from name server */
00025 #ifndef h_addr
00026 #define h_addr  h_addr_list[0]  /* address, for backward compatiblity */
00027 #endif
00028 };
00029 #endif
00030 
00031 /*
00032  * Internet address (old style... should be updated)
00033  */
00034 #ifndef IN_ADDR_DEFINED
00035 #define IN_ADDR_DEFINED
00036 struct in_addr
00037 {
00038   union
00039   {
00040     struct
00041     {
00042       unsigned char s_b1, s_b2, s_b3, s_b4;
00043     }
00044     S_un_b;
00045     struct
00046     {
00047       unsigned short s_w1, s_w2;
00048     }
00049     S_un_w;
00050     unsigned long S_addr;
00051   }
00052   S_un;
00053 #define s_addr  S_un.S_addr     /* can be used for most tcp & ip code */
00054 #define s_host  S_un.S_un_b.s_b2        /* host on imp */
00055 #define s_net   S_un.S_un_b.s_b1        /* network */
00056 #define s_imp   S_un.S_un_w.s_w2        /* imp */
00057 #define s_impno S_un.S_un_b.s_b4        /* imp # */
00058 #define s_lh    S_un.S_un_b.s_b3        /* logical host */
00059 };
00060 #endif
00061 
00062 /*
00063  * Structure used by kernel to store most
00064  * addresses.
00065  */
00066 #ifndef SOCKADDR_DEFINED
00067 #define SOCKADDR_DEFINED
00068 struct sockaddr
00069 {
00070   unsigned short sa_family;     /* address family */
00071   char sa_data[14];             /* up to 14 bytes of direct address */
00072 };
00073 #endif
00074 
00075 
00076 /*
00077  * Socket address, internet style.
00078  */
00079 #ifndef SOCKADDR_IN_DEFINED
00080 #define SOCKADDR_IN_DEFINED
00081 struct sockaddr_in
00082 {
00083   short sin_family;
00084   unsigned short sin_port;
00085   struct in_addr sin_addr;
00086   char sin_zero[8];
00087 };
00088 #endif
00089 
00090 /*
00091  * Structure used in select() call, taken from the BSD file sys/time.h.
00092  */
00093 #ifndef TIMEVAL_DEFINED
00094 #define TIMEVAL_DEFINED
00095 struct timeval
00096 {
00097   long tv_sec;                  /* seconds */
00098   long tv_usec;                 /* and microseconds */
00099 };
00100 #endif
00101 
00102 #ifndef IOVEC_DEFINED
00103 #define IOVEC_DEFINED
00104 struct iovec
00105 {
00106   char RCS_FAR *iov_base;
00107   int iov_len;
00108 };
00109 typedef struct iovec iovec_t;
00110 #endif
00111 
00112 #ifndef MSGHDR_DEFINED
00113 #define MSGHDR_DEFINED
00114 /*
00115  * Message header for recvmsg and sendmsg calls.
00116  */
00117 struct msghdr
00118 {
00119   char RCS_FAR *msg_name;       /* optional address */
00120   int msg_namelen;              /* size of address */
00121   struct iovec RCS_FAR *msg_iov;        /* scatter/gather array */
00122   int msg_iovlen;               /* # elements in msg_iov */
00123   char RCS_FAR *msg_accrights;  /* access rights sent/received */
00124   int msg_accrightslen;
00125 };
00126 #endif
00127 
00128 #ifdef _WINDOWS
00129 
00130 
00131 #ifndef HINSTANCE_ERROR
00132 #define HINSTANCE_ERROR (32)
00133 #endif

Generated on Sun Dec 2 15:56:52 2001 for rcslib by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001