青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

分享知識

與大家一起分享知識

C++博客 首頁 新隨筆 聯系 聚合 管理
  19 Posts :: 3 Stories :: 45 Comments :: 0 Trackbacks
  1 /* Our own header. Tabs are set for 4 spaces, not 8 */
 
  2 #ifndef __unp_h
  3 #define __unp_h

  4 #include    "../config.h"      /* configuration options for current OS */
  5                            /* "../config.h" is generated by configure */

  6 /* If anything changes in the following list of #includes, must change
  7    acsite.m4 also, for configure's tests. */

  8 #include    <sys/types.h>       /* basic system data types */
  9 #include    <sys/socket.h>      /* basic socket definitions */
 10 #include    <sys/time.h>        /* timeval{} for select() */
 11 #include    <time.h>            /* timespec{} for pselect() */
 12 #include    <netinet/in.h>      /* sockaddr_in{} and other Internet defns */
 13 #include    <arpa/inet.h>       /* inet(3) functions */
 14 #include    <errno.h>
 15 #include    <fcntl.h>           /* for nonblocking */
 16 #include    <netdb.h>
 17 #include    <signal.h>
 18 #include    <stdio.h>
 19 #include    <stdlib.h>
 20 #include    <string.h>
 21 #include    <sys/stat.h>        /* for S_xxx file mode constants */
 22 #include    <sys/uio.h>         /* for iovec{} and readv/writev */
 23 #include    <unistd.h>
 24 #include    <sys/wait.h>
 25 #include    <sys/un.h>          /* for Unix domain sockets */

 26 #ifdef  HAVE_SYS_SELECT_H
 27 # include   <sys/select.h>      /* for convenience */
 28 #endif

 29 #ifdef  HAVE_SYS_SYSCTL_H
 30 # include   <sys/sysctl.h>
 31 #endif

 32 #ifdef  HAVE_POLL_H
 33 # include  <poll.h>             /* for convenience */
 34 #endif

 35 #ifdef  HAVE_SYS_EVENT_H
 36 # include   <sys/event.h>       /* for kqueue */
 37 #endif

 38 #ifdef  HAVE_STRINGS_H
 39 # include   <strings.h>         /* for convenience */
 40 #endif

 41 /* Three headers are normally needed for socket/file ioctl's:
 42  * <sys/ioctl.h>, <sys/filio.h>, and <sys/sockio.h>.
 43  */
 44 #ifdef  HAVE_SYS_IOCTL_H
 45 # include   <sys/ioctl.h>
 46 #endif
 47 #ifdef  HAVE_SYS_FILIO_H
 48 # include   <sys/filio.h>
 49 #endif
 50 #ifdef  HAVE_SYS_SOCKIO_H
 51 # include   <sys/sockio.h>
 52 #endif

 53 #ifdef  HAVE_PTHREAD_H
 54 # include   <pthread.h>
 55 #endif

 56 #ifdef  HAVE_NET_IF_DL_H
 57 # include    <net/if_dl.h>
 58 #endif

 59 #ifdef  HAVE_NETINET_SCTP_H
 60 #include     <netinet/sctp.h>
 61 #endif

 62 /* OSF/1 actually disables recv() and send() in <sys/socket.h> */
 63 #ifdef  __osf__
 64 #undef  recv
 65 #undef  send
 66 #define recv(a,b,c,d)   recvfrom(a,b,c,d,0,0)
 67 #define send(a,b,c,d)   sendto(a,b,c,d,0,0)
 68 #endif

 69 #ifndef INADDR_NONE
 70 #define INADDR_NONE 0xffffffff  /* should have been in <netinet/in.h> */
 71 #endif

 72 #ifndef SHUT_RD                 /* these three POSIX names are new */
 73 #define SHUT_RD     0           /* shutdown for reading */
 74 #define SHUT_WR     1           /* shutdown for writing */
 75 #define SHUT_RDWR   2           /* shutdown for reading and writing */
 76 #endif

 77 #ifndef INET_ADDRSTRLEN
 78 #define INET_ADDRSTRLEN     16  /* "ddd.ddd.ddd.ddd\0"
 79                                    1234567890123456 */
 80 #endif

 81 /* Define following even if IPv6 not supported, so we can always allocate
 82    an adequately sized buffer without #ifdefs in the code. */
 83 #ifndef INET6_ADDRSTRLEN
 84 #define INET6_ADDRSTRLEN    46  /* max size of IPv6 address string:
 85                    "xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx" or
 86                    "xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:ddd.ddd.ddd.ddd\0"
 87                     1234567890123456789012345678901234567890123456 */
 88 #endif

 89 /* Define bzero() as a macro if it's not in standard C library. */
 90 #ifndef HAVE_BZERO
 91 #define bzero(ptr,n)        memset (ptr, 0, n)
 92 #endif

 93 /* Older resolvers do not have gethostbyname2() */
 94 #ifndef HAVE_GETHOSTBYNAME2
 95 #define gethostbyname2(host,family)     gethostbyname((host))
 96 #endif

 97 /* The structure returned by recvfrom_flags() */
 98 struct unp_in_pktinfo {
 99     struct in_addr ipi_addr;    /* dst IPv4 address */
100     int     ipi_ifindex;        /* received interface index */
101 };

102 /* We need the newer CMSG_LEN() and CMSG_SPACE() macros, but few
103    implementations support them today. These two macros really need
104     an ALIGN() macro, but each implementation does this differently. */
105 #ifndef CMSG_LEN
106 #define CMSG_LEN(size)      (sizeof(struct cmsghdr) + (size))
107 #endif
108 #ifndef CMSG_SPACE
109 #define CMSG_SPACE(size)    (sizeof(struct cmsghdr) + (size))
110 #endif

111 /* POSIX requires the SUN_LEN() macro, but not all implementations define
112    it (yet). Note that this 4.4BSD macro works regardless whether there is
113    a length field or not. */
114 #ifndef SUN_LEN
115 # define    SUN_LEN (su) \
116     (sizeof (*(su)) - sizeof ((su)->sun_path) + strlen((su)->sun_path))
117 #endif

118 /* POSIX renames "Unix domain" as "local IPC."
119    Not all systems define AF_LOCAL and PF_LOCAL (yet). */
120 #ifndef AF_LOCAL
121 #define AF_LOCAL    AF_UNIX
122 #endif
123 #ifndef PF_LOCAL
124 #define PF_LOCAL    PF_UNIX
125 #endif

126 /* POSIX requires that an #include of <poll.h> define INFTIM, but many
127    systems still define it in <sys/stropts.h>. We don't want to include
128    all the STREAMS stuff if it's not needed, so we just define INFTIM here.
129    This is the standard value, but there's no guarantee it is -1. */
130 #ifndef INFTIM
131 #define INFTIM          (-1)     /* infinite poll timeout */
132 #ifdef HAVE_POLL_H
133 #define INFTIM_UNPH              /* tell unpxti.h we defined it */
134 #endif
135 #endif

136 /* Following could be derived from SOMAXCONN in <sys/socket.h>, but many
137    kernels still #define it as 5, while actually supporting many more */
138 #define LISTENQ     1024         /* 2nd argument to listen () */

139 /* Miscellaneous constants */
140 #define MAXLINE     4096         /* max text line length */
141 #define BUFFSIZE    8192         /* buffer size for reads and writes */

142 /* Define some port number that can be used for our examples */
143 #define SERV_PORT        9877    /* TCP and UDP */
144 #define SERV_PORT_STR   "9877"   /* TCP and UDP */
145 #define UNIXSTR_PATH    "/tmp/unix.str" /* Unix domain stream */
146 #define UNIXDG_PATH     "/tmp/unix.dg"  /* Unix domain datagram */

147 /* Following shortens all the typecasts of pointer arguments: */
148 #define SA struct sockaddr

149 #define HAVE_STRUCT_SOCKADDR_STORAGE
150 #ifndef HAVE_STRUCT_SOCKADDR_STORAGE
151 /*
152  * RFC 3493: protocol-independent placeholder for socket addresses
153  */
154 #define __SS_MAXSIZE    128
155 #define __SS_ALIGNSIZE  (sizeof(int64_t))
156 #ifdef HAVE_SOCKADDR_SA_LEN
157 #define __SS_PAD1SIZE   (__SS_ALIGNSIZE - sizeof(u_char) - sizeof(sa_family_t))
158 #else
159 #define __SS_PAD1SIZE   (__SS_ALIGNSIZE - sizeof(sa_family_t))
160 #endif
161 #define __SS_PAD2SIZE   (__SS_MAXSIZE - 2*__SS_ALIGNSIZE)

162 struct sockaddr_storage {
163 #ifdef HAVE_SOCKADDR_SA_LEN
164     u_char  ss_len;
165 #endif
166     sa_family_t ss_family;
167     char    __ss_pad1[__SS_PAD1SIZE];
168     int64_t __ss_align;
169     char    __ss_pad2[__SS_PAD2SIZE];
170 };
171 #endif

172 #define FILE_MODE   (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)
173                     /* default file access permissions for new files */
174 #define DIR_MODE    (FILE_MODE | S_IXUSR | S_IXGRP | S_IXOTH)
175                     /* default permissions for new directories */

176 typedef void Sigfunc (int);     /* for signal handlers */

177 #define min(a,b)    ((a) < (b) ? (a) : (b))
178 #define max(a,b)    ((a) > (b) ? (a) : (b))

179 #ifndef HAVE_ADDRINFO_STRUCT
180 # include   "../lib/addrinfo.h"
181 #endif

182 #ifndef HAVE_IF_NAMEINDEX_STRUCT
183 struct if_nameindex {
184     unsigned int if_index;      /* 1, 2, ... */
185     char *if_name;              /* null-terminated name: "le0", ... */
186 };
187 #endif

188 #ifndef HAVE_TIMESPEC_STRUCT
189 struct timespec {
190     time_t tv_sec;              /* seconds */
191     long     tv_nsec;           /* and nanoseconds */
192 };
193 #endif
posted on 2006-05-09 20:43 史傳紅 閱讀(4660) 評論(3)  編輯 收藏 引用 所屬分類: 鏈接目錄

Feedback

# re: unp.h文件內容 2006-10-18 11:39 zz
謝謝!  回復  更多評論
  

# re: unp.h文件內容 2007-01-22 16:25 Zark
Sanks .... and sanks very much .....  回復  更多評論
  

# re: unp.h文件內容 2008-11-06 14:20 x
nice  回復  更多評論
  


只有注冊用戶登錄后才能發表評論。
網站導航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            欧美三级网页| 亚洲精品网站在线播放gif| 一本色道久久88综合亚洲精品ⅰ| 一本不卡影院| 亚洲精品一区二区三区蜜桃久| 国产麻豆成人精品| 欧美少妇一区二区| 国产精品久久久久高潮| 欧美日韩国产页| 欧美日韩1080p| 欧美黄网免费在线观看| 欧美成人精品一区二区| 欧美二区不卡| 国产九九精品| 亚洲国产精品传媒在线观看| 一本大道久久a久久精品综合| 亚洲在线中文字幕| 欧美成人午夜激情在线| 夜久久久久久| 久久精品国亚洲| 西瓜成人精品人成网站| 亚洲欧美三级伦理| 91久久精品一区二区别| 亚洲线精品一区二区三区八戒| 亚洲午夜女主播在线直播| 老巨人导航500精品| 欧美日韩亚洲一区二区三区| 国内精品久久久| 亚洲综合欧美| 一本色道88久久加勒比精品 | 久久精品99久久香蕉国产色戒| 久久精品亚洲一区| 亚洲欧洲精品天堂一级| 久久精品99国产精品酒店日本| 亚洲国产精品va在线看黑人| 久久精品首页| 国产婷婷色综合av蜜臀av| 在线亚洲欧美专区二区| 亚洲福利视频一区二区| 久久久综合视频| 国产亚洲一区在线播放| 久久精品99国产精品酒店日本| 亚洲日韩视频| 欧美色播在线播放| 亚洲在线免费观看| 亚洲男人第一av网站| 欧美四级在线| 亚洲欧美一区二区精品久久久| 亚洲国产精品黑人久久久| 欧美精品综合| 欧美亚洲一级| 欧美在线影院| 亚洲砖区区免费| 国产一区在线观看视频| 老司机亚洲精品| 欧美二区不卡| 麻豆精品一区二区av白丝在线| 浪潮色综合久久天堂| 中文在线资源观看视频网站免费不卡| 亚洲精选一区| 国产欧美一区二区三区视频 | 在线国产精品一区| 亚洲日韩视频| 在线观看91精品国产麻豆| 亚洲精品一区二区网址| 国产日本欧美一区二区三区| 欧美国产日韩免费| 国产精品久久精品日日| 亚洲国产精品va在线观看黑人| 国产精品久久久久aaaa| 欧美激情综合色| 国产亚洲女人久久久久毛片| 亚洲三级毛片| 亚洲成色777777在线观看影院| 国产精品99久久久久久人| 亚洲国产毛片完整版| 亚洲一二三区在线观看| 99国产精品久久久| 麻豆视频一区二区| 久久久久久久国产| 国产伦精品一区二区三区免费| 亚洲精品在线免费观看视频| 亚洲精品国产精品国自产在线| 欧美一区二区免费| 久久亚洲综合| 国产一区日韩欧美| 久久精品亚洲精品| 国产精品视频第一区| 亚洲理伦在线| 亚洲欧美日本国产有色| 国产午夜精品视频免费不卡69堂| 久久国产色av| 亚洲国产一区在线| 亚洲视频一二区| 国产午夜精品久久| 久久综合色综合88| 在线视频欧美精品| 久久三级福利| 亚洲午夜精品一区二区| 国产精品久久久久久久久免费樱桃| 亚洲尤物影院| 欧美大片在线看| 欧美一区二区| 亚洲精品国产精品乱码不99按摩| 欧美激情在线狂野欧美精品| 午夜视频久久久| 亚洲黄色一区| 欧美 日韩 国产在线| 欧美在线在线| 午夜精品福利在线观看| 亚洲精品综合在线| 欧美激情亚洲另类| 久久久一本精品99久久精品66| 亚洲私拍自拍| 亚洲天堂网站在线观看视频| 国产一区二区观看| 国产精品一区免费在线观看| 欧美激情综合五月色丁香小说| 久久夜色精品一区| 久久久国产视频91| 麻豆久久精品| 欧美.www| 国产精品swag| 国产精品一区二区三区免费观看 | 亚洲精品小视频在线观看| 午夜精品福利一区二区蜜股av| 亚洲三级影片| 99精品欧美一区二区三区综合在线 | 亚洲欧美激情视频| 亚洲砖区区免费| 欧美在线视频全部完| 久久国产精品72免费观看| 久久夜色精品国产| 欧美成人久久| 一区二区三区不卡视频在线观看 | 久久九九国产精品| 亚洲激情欧美激情| 日韩香蕉视频| 久久久久国产精品厨房| 牛牛影视久久网| 国产精品人人做人人爽| 国内外成人在线视频| 一本色道久久| 免费观看日韩av| 午夜久久久久久| 免费在线一区二区| 国产一区二区三区视频在线观看| 亚洲精品自在久久| 免费欧美网站| 久久久久久久久久久久久久一区| 欧美巨乳在线观看| 在线观看日韩欧美| 久久精品国产亚洲精品| 一本色道久久综合亚洲精品婷婷 | 欧美亚洲一区二区在线| 欧美日韩高清不卡| 亚洲精品美女久久7777777| 久久大香伊蕉在人线观看热2| 亚洲国产另类久久精品| 免费中文字幕日韩欧美| 亚洲综合色在线| 欧美视频福利| 欧美一区二区视频观看视频| 久久精品在线免费观看| 在线免费观看日韩欧美| 亚洲国产精品成人一区二区 | 久久久久久久久久久久久女国产乱| 亚洲视频播放| 亚洲黄色有码视频| 亚洲乱码精品一二三四区日韩在线| 欧美区日韩区| 久久久久久久久久久一区 | 久久久久久91香蕉国产| 亚洲国产欧美在线| 日韩视频免费看| 国产一区二区三区久久悠悠色av| 亚洲精品乱码久久久久久黑人| 激情综合激情| 亚洲天堂免费在线观看视频| 亚洲性感美女99在线| 国产精品ⅴa在线观看h| 亚洲香蕉网站| 久久综合精品国产一区二区三区| 欧美日韩精品国产| 亚洲欧洲精品成人久久奇米网| 国产精品最新自拍| 亚洲字幕一区二区| 久久久久久电影| 欧美中文日韩| 国产中文一区二区三区| 亚洲欧美日韩精品在线| 亚洲欧美国产制服动漫| 国产精品国产成人国产三级| 亚洲高清精品中出| 亚洲午夜激情网站| 亚洲精品乱码久久久久久日本蜜臀| 国产精品久久久久久av福利软件| 久久久蜜桃精品| 欧美永久精品| 亚洲一区区二区|