ws2tcpip.inc
上传用户:hndmjx
上传日期:2014-09-16
资源大小:3369k
文件大小:4k
源码类别:

Delphi控件源码

开发平台:

Delphi

  1. {
  2. WS2TCPIP.H - WinSock2 Extension for TCP/IP protocols
  3. This file contains TCP/IP specific information for use
  4. by WinSock2 compatible applications.
  5. Copyright (c) 1995-1999  Microsoft Corporation
  6. To provide the backward compatibility, all the TCP/IP
  7. specific definitions that were included in the WINSOCK.H
  8. file are now included in WINSOCK2.H file. WS2TCPIP.H
  9. file includes only the definitions  introduced in the
  10. "WinSock 2 Protocol-Specific Annex" document.
  11. Rev 0.3 Nov 13, 1995
  12. Rev 0.4 Dec 15, 1996
  13. }
  14. // Argument structure for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP
  15. type
  16. ip_mreq = packed record
  17. imr_multiaddr : TInAddr; // IP multicast address of group
  18. imr_interface : TInAddr; // local IP address of interface
  19.   end;
  20. // TCP/IP specific Ioctl codes
  21. const
  22. SIO_GET_INTERFACE_LIST    = IOC_OUT or (SizeOf(Longint) shl 16) or (Ord('t') shl 8) or 127;
  23. // New IOCTL with address size independent address array
  24. SIO_GET_INTERFACE_LIST_EX = IOC_OUT or (SizeOf(Longint) shl 16) or (Ord('t') shl 8) or 126;
  25. // Options for use with [gs]etsockopt at the IP level.
  26. IP_OPTIONS         =  1; // set/get IP options
  27. IP_HDRINCL         =  2; // header is included with data
  28. IP_TOS             =  3; // IP type of service and preced
  29. IP_TTL             =  4; // IP time to live
  30. IP_MULTICAST_IF    =  9; // set/get IP multicast i/f
  31. IP_MULTICAST_TTL   = 10; // set/get IP multicast ttl
  32. IP_MULTICAST_LOOP  = 11; // set/get IP multicast loopback
  33. IP_ADD_MEMBERSHIP  = 12; // add an IP group membership
  34. IP_DROP_MEMBERSHIP = 13; // drop an IP group membership
  35. IP_DONTFRAGMENT    = 14; // don't fragment IP datagrams
  36.   IP_DEFAULT_MULTICAST_TTL   = 1;    // normally limit m'casts to 1 hop
  37.   IP_DEFAULT_MULTICAST_LOOP  = 1;    // normally hear sends if a member
  38.   IP_MAX_MEMBERSHIPS         = 20;   // per socket; must fit in one mbuf
  39. // Option to use with [gs]etsockopt at the IPPROTO_UDP level
  40. UDP_NOCHECKSUM     = 1;
  41. // Option to use with [gs]etsockopt at the IPPROTO_TCP level
  42.   TCP_EXPEDITED_1122 = $0002;
  43. // IPv6 definitions
  44. type
  45. IN_ADDR6 = packed record
  46. s6_addr : array[0..15] of u_char; // IPv6 address
  47. end;
  48.   TIn6Addr   = IN_ADDR6;
  49.   PIn6Addr   = ^IN_ADDR6;
  50.   IN6_ADDR   = IN_ADDR6;
  51.   PIN6_ADDR  = ^IN_ADDR6;
  52.   LPIN6_ADDR = ^IN_ADDR6;
  53. // Old IPv6 socket address structure (retained for sockaddr_gen definition below)
  54. SOCKADDR_IN6_OLD = packed record
  55. sin6_family   : Smallint;         // AF_INET6
  56. sin6_port     : u_short;          // Transport level port number
  57. sin6_flowinfo : u_long;           // IPv6 flow information
  58. sin6_addr     : IN_ADDR6;         // IPv6 address
  59. end;
  60. // IPv6 socket address structure, RFC 2553
  61. SOCKADDR_IN6 = packed record
  62. sin6_family   : Smallint;         // AF_INET6
  63. sin6_port     : u_short;          // Transport level port number
  64. sin6_flowinfo : u_long;           // IPv6 flow information
  65. sin6_addr     : IN_ADDR6;         // IPv6 address
  66. sin6_scope_id : u_long;           // set of interfaces for a scope
  67. end;
  68.   TSockAddrIn6   = SOCKADDR_IN6;
  69.   PSockAddrIn6   = ^SOCKADDR_IN6;
  70.   PSOCKADDR_IN6  = ^SOCKADDR_IN6;
  71.   LPSOCKADDR_IN6 = ^SOCKADDR_IN6;
  72. sockaddr_gen = packed record
  73. case Integer of
  74. 1 : ( Address : SOCKADDR; );
  75. 2 : ( AddressIn : SOCKADDR_IN; );
  76. 3 : ( AddressIn6 : SOCKADDR_IN6_OLD; );
  77. end;
  78. // Structure to keep interface specific information
  79. INTERFACE_INFO = packed record
  80. iiFlags            : u_long;       // Interface flags
  81. iiAddress          : sockaddr_gen; // Interface address
  82. iiBroadcastAddress : sockaddr_gen; // Broadcast address
  83. iiNetmask          : sockaddr_gen; // Network mask
  84. end;
  85. TINTERFACE_INFO  = INTERFACE_INFO;
  86. LPINTERFACE_INFO = ^INTERFACE_INFO;
  87. // New structure that does not have dependency on the address size
  88. INTERFACE_INFO_EX = packed record
  89. iiFlags            : u_long;         // Interface flags
  90. iiAddress          : SOCKET_ADDRESS; // Interface address
  91. iiBroadcastAddress : SOCKET_ADDRESS; // Broadcast address
  92. iiNetmask : SOCKET_ADDRESS;          // Network mask
  93. end;
  94. TINTERFACE_INFO_EX  = INTERFACE_INFO_EX;
  95. LPINTERFACE_INFO_EX = ^INTERFACE_INFO_EX;
  96. // Possible flags for the  iiFlags - bitmask
  97. const
  98. IFF_UP           = $00000001;  // Interface is up
  99. IFF_BROADCAST    = $00000002;  // Broadcast is  supported
  100. IFF_LOOPBACK     = $00000004;  // this is loopback interface
  101. IFF_POINTTOPOINT = $00000008;  // this is point-to-point interface
  102. IFF_MULTICAST    = $00000010;  // multicast is supported