jwawshisotp.pas 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. {******************************************************************************}
  2. { }
  3. { Winsock2 ISO TP4 API interface Unit for Object Pascal }
  4. { }
  5. { Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft }
  6. { Corporation. All Rights Reserved. }
  7. { }
  8. { The original file is: wshisotp.h, released June 2000. The original Pascal }
  9. { code is: WShisotp.pas, released December 2000. The initial developer of the }
  10. { Pascal code is Marcel van Brakel (brakelm att chello dott nl). }
  11. { }
  12. { Portions created by Marcel van Brakel are Copyright (C) 1999-2001 }
  13. { Marcel van Brakel. All Rights Reserved. }
  14. { }
  15. { Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI) }
  16. { }
  17. { You may retrieve the latest version of this file at the Project JEDI }
  18. { APILIB home page, located at http://jedi-apilib.sourceforge.net }
  19. { }
  20. { The contents of this file are used with permission, subject to the Mozilla }
  21. { Public License Version 1.1 (the "License"); you may not use this file except }
  22. { in compliance with the License. You may obtain a copy of the License at }
  23. { http://www.mozilla.org/MPL/MPL-1.1.html }
  24. { }
  25. { Software distributed under the License is distributed on an "AS IS" basis, }
  26. { WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
  27. { the specific language governing rights and limitations under the License. }
  28. { }
  29. { Alternatively, the contents of this file may be used under the terms of the }
  30. { GNU Lesser General Public License (the "LGPL License"), in which case the }
  31. { provisions of the LGPL License are applicable instead of those above. }
  32. { If you wish to allow use of your version of this file only under the terms }
  33. { of the LGPL License and not to allow others to use your version of this file }
  34. { under the MPL, indicate your decision by deleting the provisions above and }
  35. { replace them with the notice and other provisions required by the LGPL }
  36. { License. If you do not delete the provisions above, a recipient may use }
  37. { your version of this file under either the MPL or the LGPL License. }
  38. { }
  39. { For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
  40. { }
  41. {******************************************************************************}
  42. // $Id: JwaWShisotp.pas,v 1.4 2004/12/08 08:18:40 marquardt Exp $
  43. unit JwaWShisotp;
  44. {$WEAKPACKAGEUNIT}
  45. {$HPPEMIT ''}
  46. {$HPPEMIT '#include "wshisotp.h"'}
  47. {$HPPEMIT ''}
  48. {$I jediapilib.inc}
  49. interface
  50. uses
  51. JwaWinSock2;
  52. //
  53. // wshisotp.h
  54. // Copyright (c) 1994-1999, Microsoft Corp. All rights reserved.
  55. //
  56. // Windows Sockets include file for ISO TP4. This file contains all
  57. // standardized ISO TP4 information. Include this header file after
  58. // winsock.h.
  59. //
  60. // The information contained in this header file was originally
  61. // created by Alcatel TITN Inc.
  62. //
  63. //
  64. // Protocol values for ISO transport protocols.
  65. //
  66. const
  67. ISOPROTO_TP0 = 25; // connection orientated transport protocol
  68. {$EXTERNALSYM ISOPROTO_TP0}
  69. ISOPROTO_TP1 = 26; // not implemented
  70. {$EXTERNALSYM ISOPROTO_TP1}
  71. ISOPROTO_TP2 = 27; // not implemented
  72. {$EXTERNALSYM ISOPROTO_TP2}
  73. ISOPROTO_TP3 = 28; // not implemented
  74. {$EXTERNALSYM ISOPROTO_TP3}
  75. ISOPROTO_TP4 = 29; // connection orientated transport protocol
  76. {$EXTERNALSYM ISOPROTO_TP4}
  77. ISOPROTO_TP = ISOPROTO_TP4;
  78. {$EXTERNALSYM ISOPROTO_TP}
  79. ISOPROTO_CLTP = 30; // connectionless transport
  80. {$EXTERNALSYM ISOPROTO_CLTP}
  81. ISOPROTO_CLNP = 31; // connectionless internetworking protocol
  82. {$EXTERNALSYM ISOPROTO_CLNP}
  83. ISOPROTO_X25 = 32; // cons
  84. {$EXTERNALSYM ISOPROTO_X25}
  85. ISOPROTO_INACT_NL = 33; // inactive network layer
  86. {$EXTERNALSYM ISOPROTO_INACT_NL}
  87. ISOPROTO_ESIS = 34; // ES-IS protocol
  88. {$EXTERNALSYM ISOPROTO_ESIS}
  89. ISOPROTO_INTRAISIS = 35; // IS-IS protocol
  90. {$EXTERNALSYM ISOPROTO_INTRAISIS}
  91. IPPROTO_RAW = 255; // raw clnp
  92. {$EXTERNALSYM IPPROTO_RAW}
  93. IPPROTO_MAX = 256;
  94. {$EXTERNALSYM IPPROTO_MAX}
  95. //
  96. // The maximum size of the tranport address (tp_addr field of a
  97. // sockaddr_tp structure) is 64.
  98. //
  99. const
  100. ISO_MAX_ADDR_LENGTH = 64;
  101. {$EXTERNALSYM ISO_MAX_ADDR_LENGTH}
  102. //
  103. // There are two types of ISO addresses, hierarchical and
  104. // non-hierarchical. For hierarchical addresses, the tp_addr
  105. // field contains both the transport selector and the network
  106. // address. For non-hierarchical addresses, tp_addr contains only
  107. // the transport address, which must be translated by the ISO TP4
  108. // transport provider into the transport selector and network address.
  109. //
  110. const
  111. ISO_HIERARCHICAL = 0;
  112. {$EXTERNALSYM ISO_HIERARCHICAL}
  113. ISO_NON_HIERARCHICAL = 1;
  114. {$EXTERNALSYM ISO_NON_HIERARCHICAL}
  115. //
  116. // The format of the address structure (sockaddr) to pass to Windows
  117. // Sockets APIs.
  118. //
  119. type
  120. SOCKADDR_TP = record
  121. tp_family: u_short; // Always AF_ISO
  122. tp_addr_type: u_short; // ISO_HIERARCHICAL or ISO_NON_HIERARCHICAL
  123. tp_taddr_len: u_short; // Length of transport address, <= 52
  124. tp_tsel_len: u_short; // Length of transport selector, <= 32 0 if ISO_NON_HIERARCHICAL
  125. tp_addr: array [0..ISO_MAX_ADDR_LENGTH - 1] of u_char;
  126. end;
  127. {$EXTERNALSYM SOCKADDR_TP}
  128. PSOCKADDR_TP = ^SOCKADDR_TP;
  129. {$EXTERNALSYM PSOCKADDR_TP}
  130. LPSOCKADDR_TP = ^SOCKADDR_TP;
  131. {$EXTERNALSYM LPSOCKADDR_TP}
  132. TSockAddrTP = SOCKADDR_TP;
  133. PSockAddrTP = LPSOCKADDR_TP;
  134. //procedure ISO_SET_TP_ADDR(var sa_tp: TSockAddrTP; port: PChar; portlen: u_short; node: PChar; nodelen: u_short);
  135. //{$EXTERNALSYM ISO_SET_TP_ADDR}
  136. //
  137. // Expedited Data Usage Negotiation option.
  138. // Default when the option is not present is be EXP_DATA_USE
  139. // as per ISO 8073
  140. //
  141. const
  142. ISO_EXP_DATA_USE = 00; // Use of Expedited Data
  143. {$EXTERNALSYM ISO_EXP_DATA_USE}
  144. ISO_EXP_DATA_NUSE = 01; // Non-use of Expedited Data
  145. {$EXTERNALSYM ISO_EXP_DATA_NUSE}
  146. implementation
  147. // TODO
  148. //procedure ISO_SET_TP_ADDR(var sa_tp: TSockAddrTP; port: PChar; portlen: u_short; node: PChar; nodelen: u_short);
  149. //begin
  150. // sa_tp.tp_family := AF_ISO;
  151. // sa_tp.tp_addr_type := ISO_HIERARCHICAL;
  152. // sa_tp.tp_tsel_len := portlen;
  153. // sa_tp.tp_taddr_len := portlen + nodelen;
  154. // System.Move(port, @sa_tp.tp_addr[0], portlen);
  155. // System.Move(node, @sa_tp.tp_addr[portlen], nodelen);
  156. //end;
  157. end.