sockLib.h
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:3k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* sockLib.h -  UNIX BSD 4.3 compatible socket library header */
  2. /* Copyright 1984 - 2001 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 02l,12oct01,rae  merge from truestack (update copyright)
  7. 02k,14nov00,rae  removed unused argument from sockLibAdd()
  8. 02j,09nov99,pul  integrating T2 cumulative patch
  9. 02i,17aug99,pai  changed send() prototype to use const on the second param
  10.                  (SPR 21829)
  11. 02h,29apr99,pul  Upgraded NPT phase3 code to tor2.0.0
  12. 02g,02feb99,sgv  added bitflags to sockLibAdd().
  13. 02f,25jul95,dzb  added prototype for sockLibAdd().
  14. 02e,24jul95,dzb  changed sockInit() to sockLibInit().
  15. 02d,23jul93,jmm  changed #include "socket.h" to "sys/socket.h" (spr 2033)
  16. 02c,22sep92,rrr  added support for c++
  17. 02b,19aug92,smb  changed systime.h to sys/times.h
  18. 02a,04jul92,jcf  cleaned up.
  19. 01e,26may92,rrr  the tree shuffle
  20. 01d,16dec91,gae  added includes for ANSI.
  21. 01c,04oct91,rrr  passed through the ansification filter
  22.   -fixed #else and #endif
  23.   -changed copyright notice
  24. 01b,23oct90,shl replaced all occurances of "int flag s" to "int s".
  25. 01a,05oct90,shl created.
  26. */
  27. #ifndef __INCsockLibh
  28. #define __INCsockLibh
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32. #include "sys/times.h"
  33. #include "sys/socket.h"
  34. /* function declarations */
  35. #if defined(__STDC__) || defined(__cplusplus)
  36. extern STATUS  sockLibInit (int fdMax);
  37. extern STATUS  sockLibAdd (FUNCPTR sockLibInitRtn, int domainMap,
  38.                             int domainReal);
  39. extern STATUS  bind (int s, struct sockaddr *name, int namelen);
  40. extern STATUS  connect (int s, struct sockaddr *name, int namelen);
  41. extern STATUS  connectWithTimeout (int sock, struct sockaddr *adrs,
  42.     int adrsLen, struct timeval *timeVal);
  43. extern STATUS  getpeername (int s, struct sockaddr *name, int *namelen);
  44. extern STATUS  getsockname (int s, struct sockaddr *name, int *namelen);
  45. extern STATUS  getsockopt (int s, int level, int optname, char *optval,
  46.     int *optlen);
  47. extern STATUS  listen (int s, int backlog);
  48. extern STATUS  setsockopt (int s, int level, int optname, char *optval,
  49.     int optlen);
  50. extern STATUS  shutdown (int s, int how);
  51. extern int  accept (int s, struct sockaddr *addr, int *addrlen);
  52. extern int  recv (int s, char *buf, int bufLen, int flags);
  53. extern int  recvfrom (int s, char *buf, int bufLen, int flags,
  54.   struct sockaddr *from, int *pFromLen);
  55. extern int  recvmsg (int sd, struct msghdr *mp, int flags);
  56. extern int  send (int s, const char *buf, int bufLen, int flags);
  57. extern int  sendmsg (int sd, struct msghdr *mp, int flags);
  58. extern int  sendto (int s, caddr_t buf, int bufLen, int flags,
  59. struct sockaddr *to, int tolen);
  60. extern int  socket (int domain, int type, int protocol);
  61. #else /* __STDC__ */
  62. extern STATUS  sockLibInit ();
  63. extern STATUS  sockLibAdd ();
  64. extern STATUS  bind ();
  65. extern STATUS  connect ();
  66. extern STATUS  connectWithTimeout ();
  67. extern STATUS  getpeername ();
  68. extern STATUS  getsockname ();
  69. extern STATUS  getsockopt ();
  70. extern STATUS  listen ();
  71. extern STATUS  setsockopt ();
  72. extern STATUS  shutdown ();
  73. extern int  accept ();
  74. extern int  recv ();
  75. extern int  recvfrom ();
  76. extern int  recvmsg ();
  77. extern int  send ();
  78. extern int  sendmsg ();
  79. extern int  sendto ();
  80. extern int  socket ();
  81. #endif /* __STDC__ */
  82. #ifdef __cplusplus
  83. }
  84. #endif
  85. #endif /* __INCsockLibh */