📄 jwaws2atm.pas
字号:
{******************************************************************************}
{ }
{ Winsock2 ATM API interface Unit for Object Pascal }
{ }
{ Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft }
{ Corporation. All Rights Reserved. }
{ }
{ The original file is: ws2atm.h, released June 2000. The original Pascal }
{ code is: WS2atm.pas, released December 2000. The initial developer of the }
{ Pascal code is Marcel van Brakel (brakelm@chello.nl). }
{ }
{ Portions created by Marcel van Brakel are Copyright (C) 1999-2001 }
{ Marcel van Brakel. All Rights Reserved. }
{ }
{ Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI) }
{ }
{ You may retrieve the latest version of this file at the Project JEDI home }
{ page, located at http://delphi-jedi.org or my personal homepage located at }
{ http://members.chello.nl/m.vanbrakel2 }
{ }
{ The contents of this file are used with permission, subject to the Mozilla }
{ Public License Version 1.1 (the "License"); you may not use this file except }
{ in compliance with the License. You may obtain a copy of the License at }
{ http://www.mozilla.org/MPL/MPL-1.1.html }
{ }
{ Software distributed under the License is distributed on an "AS IS" basis, }
{ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
{ the specific language governing rights and limitations under the License. }
{ }
{ Alternatively, the contents of this file may be used under the terms of the }
{ GNU Lesser General Public License (the "LGPL License"), in which case the }
{ provisions of the LGPL License are applicable instead of those above. }
{ If you wish to allow use of your version of this file only under the terms }
{ of the LGPL License and not to allow others to use your version of this file }
{ under the MPL, indicate your decision by deleting the provisions above and }
{ replace them with the notice and other provisions required by the LGPL }
{ License. If you do not delete the provisions above, a recipient may use }
{ your version of this file under either the MPL or the LGPL License. }
{ }
{ For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
{ }
{******************************************************************************}
unit JwaWS2atm;
{$WEAKPACKAGEUNIT}
{$HPPEMIT ''}
{$HPPEMIT '#include "ws2atm.h"'}
{$HPPEMIT ''}
{$I WINDEFINES.INC}
interface
uses
JwaWinType, JwaWinSock2;
//#include <pshpack4.h>
{$ALIGN ON}
const
ATMPROTO_AALUSER = $00; (* User-defined AAL *)
{$EXTERNALSYM ATMPROTO_AALUSER}
ATMPROTO_AAL1 = $01; (* AAL 1 *)
{$EXTERNALSYM ATMPROTO_AAL1}
ATMPROTO_AAL2 = $02; (* AAL 2 *)
{$EXTERNALSYM ATMPROTO_AAL2}
ATMPROTO_AAL34 = $03; (* AAL 3/4 *)
{$EXTERNALSYM ATMPROTO_AAL34}
ATMPROTO_AAL5 = $05; (* AAL 5 *)
{$EXTERNALSYM ATMPROTO_AAL5}
SAP_FIELD_ABSENT = DWORD($FFFFFFFE);
{$EXTERNALSYM SAP_FIELD_ABSENT}
SAP_FIELD_ANY = DWORD($FFFFFFFF);
{$EXTERNALSYM SAP_FIELD_ANY}
SAP_FIELD_ANY_AESA_SEL = DWORD($FFFFFFFA);
{$EXTERNALSYM SAP_FIELD_ANY_AESA_SEL}
SAP_FIELD_ANY_AESA_REST = DWORD($FFFFFFFB);
{$EXTERNALSYM SAP_FIELD_ANY_AESA_REST}
(*
* values used for AddressType in struct ATM_ADDRESS
*)
ATM_E164 = $01 (* E.164 addressing scheme *);
{$EXTERNALSYM ATM_E164}
ATM_NSAP = $02 (* NSAP-style ATM Endsystem Address scheme *);
{$EXTERNALSYM ATM_NSAP}
ATM_AESA = $02 (* NSAP-style ATM Endsystem Address scheme *);
{$EXTERNALSYM ATM_AESA}
ATM_ADDR_SIZE = 20;
{$EXTERNALSYM ATM_ADDR_SIZE}
type
ATM_ADDRESS = record
AddressType: DWORD; (* E.164 or NSAP-style ATM Endsystem Address *)
NumofDigits: DWORD; (* number of digits; *)
Addr: array [0..ATM_ADDR_SIZE - 1] of UCHAR; (* IA5 digits for E164, BCD encoding for NSAP *)
(* format as defined in the ATM Forum UNI 3.1 *)
end;
{$EXTERNALSYM ATM_ADDRESS}
TAtmAddress = ATM_ADDRESS;
PAtmAddress = ^ATM_ADDRESS;
(*
* values used for Layer2Protocol in B-LLI
*)
const
BLLI_L2_ISO_1745 = $01; (* Basic mode ISO 1745 *)
{$EXTERNALSYM BLLI_L2_ISO_1745}
BLLI_L2_Q921 = $02; (* CCITT Rec. Q.921 *)
{$EXTERNALSYM BLLI_L2_Q921}
BLLI_L2_X25L = $06; (* CCITT Rec. X.25, link layer *)
{$EXTERNALSYM BLLI_L2_X25L}
BLLI_L2_X25M = $07; (* CCITT Rec. X.25, multilink *)
{$EXTERNALSYM BLLI_L2_X25M}
BLLI_L2_ELAPB = $08; (* Extended LAPB; for half duplex operation *)
{$EXTERNALSYM BLLI_L2_ELAPB}
BLLI_L2_HDLC_ARM = $09; (* HDLC ARM (ISO 4335) *)
{$EXTERNALSYM BLLI_L2_HDLC_ARM}
BLLI_L2_HDLC_NRM = $0A; (* HDLC NRM (ISO 4335) *)
{$EXTERNALSYM BLLI_L2_HDLC_NRM}
BLLI_L2_HDLC_ABM = $0B; (* HDLC ABM (ISO 4335) *)
{$EXTERNALSYM BLLI_L2_HDLC_ABM}
BLLI_L2_LLC = $0C; (* LAN logical link control (ISO 8802/2) *)
{$EXTERNALSYM BLLI_L2_LLC}
BLLI_L2_X75 = $0D; (* CCITT Rec. X.75, single link procedure *)
{$EXTERNALSYM BLLI_L2_X75}
BLLI_L2_Q922 = $0E; (* CCITT Rec. Q.922 *)
{$EXTERNALSYM BLLI_L2_Q922}
BLLI_L2_USER_SPECIFIED = $10; (* User Specified *)
{$EXTERNALSYM BLLI_L2_USER_SPECIFIED}
BLLI_L2_ISO_7776 = $11; (* ISO 7776 DTE-DTE operation *)
{$EXTERNALSYM BLLI_L2_ISO_7776}
(*
* values used for Layer3Protocol in B-LLI
*)
BLLI_L3_X25 = $06; (* CCITT Rec. X.25, packet layer *)
{$EXTERNALSYM BLLI_L3_X25}
BLLI_L3_ISO_8208 = $07; (* ISO/IEC 8208 (X.25 packet layer for DTE *)
{$EXTERNALSYM BLLI_L3_ISO_8208}
BLLI_L3_X223 = $08; (* X.223/ISO 8878 *)
{$EXTERNALSYM BLLI_L3_X223}
BLLI_L3_SIO_8473 = $09; (* ISO/IEC 8473 (OSI connectionless) *)
{$EXTERNALSYM BLLI_L3_SIO_8473}
BLLI_L3_T70 = $0A; (* CCITT Rec. T.70 min. network layer *)
{$EXTERNALSYM BLLI_L3_T70}
BLLI_L3_ISO_TR9577 = $0B; (* ISO/IEC TR 9577 Network Layer Protocol ID*)
{$EXTERNALSYM BLLI_L3_ISO_TR9577}
BLLI_L3_USER_SPECIFIED = $10; (* User Specified *)
{$EXTERNALSYM BLLI_L3_USER_SPECIFIED}
(*
* values used for Layer3IPI in B-LLI
*)
BLLI_L3_IPI_SNAP = $80; (* IEEE 802.1 SNAP identifier *)
{$EXTERNALSYM BLLI_L3_IPI_SNAP}
BLLI_L3_IPI_IP = $CC; (* Internet Protocol (IP) identifier *)
{$EXTERNALSYM BLLI_L3_IPI_IP}
type
ATM_BLLI = record
Layer2Protocol: DWORD; (* User information layer 2 protocol *)
Layer2UserSpecifiedProtocol: DWORD; (* User specified layer 2 protocol information *)
Layer3Protocol: DWORD; (* User information layer 3 protocol *)
Layer3UserSpecifiedProtocol: DWORD; (* User specified layer 3 protocol information *)
Layer3IPI: DWORD; (* ISO/IEC TR 9577 Initial Protocol Identifier *)
SnapID: array [0..4] of UCHAR; (* SNAP ID consisting of OUI and PID *)
end;
{$EXTERNALSYM ATM_BLLI}
TAtmBLLI = ATM_BLLI;
PAtmBLLI = ^ATM_BLLI;
(*
* values used for the HighLayerInfoType field in ATM_BHLI
*)
const
BHLI_ISO = $00; (* ISO *)
{$EXTERNALSYM BHLI_ISO}
BHLI_UserSpecific = $01; (* User Specific *)
{$EXTERNALSYM BHLI_UserSpecific}
BHLI_HighLayerProfile = $02; (* High layer profile (only in UNI3.0) *)
{$EXTERNALSYM BHLI_HighLayerProfile}
BHLI_VendorSpecificAppId = $03; (* Vendor-Specific Application ID *)
{$EXTERNALSYM BHLI_VendorSpecificAppId}
type
ATM_BHLI = record
HighLayerInfoType: DWORD; (* High Layer Information Type *)
HighLayerInfoLength: DWORD; (* number of bytes in HighLayerInfo *)
HighLayerInfo: array [0..7] of UCHAR; (* the value dependent on the *)
(* HighLayerInfoType field *)
end;
{$EXTERNALSYM ATM_BHLI}
TAtmBHLI = ATM_BHLI;
PAtmBHLI = ^ATM_BHLI;
SOCKADDR_ATM = record
satm_family: u_short; (* address family should be AF_ATM *)
satm_number: ATM_ADDRESS; (* ATM address *)
satm_blli: ATM_BLLI; (* B-LLI *)
satm_bhli: ATM_BHLI; (* B-HLI *)
end;
{$EXTERNALSYM SOCKADDR_ATM}
PSOCKADDR_ATM = ^SOCKADDR_ATM;
LPSOCKADDR_ATM = ^SOCKADDR_ATM;
TSockAddrAtm = SOCKADDR_ATM;
PSockAddrAtm = LPSOCKADDR_ATM;
Q2931_IE_TYPE = (
IE_AALParameters,
IE_TrafficDescriptor,
IE_BroadbandBearerCapability,
IE_BHLI,
IE_BLLI,
IE_CalledPartyNumber,
IE_CalledPartySubaddress,
IE_CallingPartyNumber,
IE_CallingPartySubaddress,
IE_Cause,
IE_QOSClass,
IE_TransitNetworkSelection);
{$EXTERNALSYM Q2931_IE_TYPE}
TQ2931IEType = Q2931_IE_TYPE;
PQ2931IEType = ^Q2931_IE_TYPE;
Q2931_IE = record
IEType: Q2931_IE_TYPE;
IELength: ULONG;
IE: array [0..0] of UCHAR;
end;
{$EXTERNALSYM Q2931_IE}
TQ2931IE = Q2931_IE;
PQ2931IE = ^Q2931_IE;
(*
* manifest constants for the AALType field in struct AAL_PARAMETERS_IE
*)
const
AALTYPE_5 = 5; (* AAL 5 *)
{$EXTERNALSYM AALTYPE_5}
AALTYPE_USER = 16; (* user-defined AAL *)
{$EXTERNALSYM AALTYPE_USER}
type
AAL_TYPE = DWORD;
{$EXTERNALSYM AAL_TYPE}
TAALType = AAL_TYPE;
PAALType = ^AAL_TYPE;
(*
* values used for the Mode field in struct AAL5_PARAMETERS
*)
const
AAL5_MODE_MESSAGE = $01;
{$EXTERNALSYM AAL5_MODE_MESSAGE}
AAL5_MODE_STREAMING = $02;
{$EXTERNALSYM AAL5_MODE_STREAMING}
(*
* values used for the SSCSType field in struct AAL5_PARAMETERS
*)
AAL5_SSCS_NULL = $00;
{$EXTERNALSYM AAL5_SSCS_NULL}
AAL5_SSCS_SSCOP_ASSURED = $01;
{$EXTERNALSYM AAL5_SSCS_SSCOP_ASSURED}
AAL5_SSCS_SSCOP_NON_ASSURED = $02;
{$EXTERNALSYM AAL5_SSCS_SSCOP_NON_ASSURED}
AAL5_SSCS_FRAME_RELAY = $04;
{$EXTERNALSYM AAL5_SSCS_FRAME_RELAY}
type
AAL5_PARAMETERS = record
ForwardMaxCPCSSDUSize: ULONG;
BackwardMaxCPCSSDUSize: ULONG;
Mode: UCHAR; (* only available in UNI 3.0 *)
SSCSType: UCHAR;
end;
{$EXTERNALSYM AAL5_PARAMETERS}
TAAL5Parameters = AAL5_PARAMETERS;
PAAL5Parameters = ^AAL5_PARAMETERS;
AALUSER_PARAMETERS = record
UserDefined: ULONG;
end;
{$EXTERNALSYM AALUSER_PARAMETERS}
TAALUserParameters = AALUSER_PARAMETERS;
PAALUserParameters = ^AALUSER_PARAMETERS;
AAL_PARAMETERS_IE = record
AALType: AAL_TYPE;
case Integer of
0: (AAL5Parameters: AAL5_PARAMETERS);
1: (AALUserParameters: AALUSER_PARAMETERS);
end;
{$EXTERNALSYM AAL_PARAMETERS_IE}
TAALParametersIE = AAL_PARAMETERS_IE;
PAALParametersIE = ^AAL_PARAMETERS_IE;
ATM_TD = record
PeakCellRate_CLP0: ULONG;
PeakCellRate_CLP01: ULONG;
SustainableCellRate_CLP0: ULONG;
SustainableCellRate_CLP01: ULONG;
MaxBurstSize_CLP0: ULONG;
MaxBurstSize_CLP01: ULONG;
Tagging: BOOL;
end;
{$EXTERNALSYM ATM_TD}
TAtmTD = ATM_TD;
PAtmTD = ^ATM_TD;
ATM_TRAFFIC_DESCRIPTOR_IE = record
Forward_: ATM_TD;
Backward: ATM_TD;
BestEffort: BOOL;
end;
{$EXTERNALSYM ATM_TRAFFIC_DESCRIPTOR_IE}
TAtmTrafficDescriptorIE = ATM_TD;
PAtmTrafficDescriptorIE = ^ATM_TD;
(*
* values used for the BearerClass field in struct ATM_BROADBAND_BEARER_CAPABILITY_IE
*)
const
BCOB_A = $01; (* Bearer class A *)
{$EXTERNALSYM BCOB_A}
BCOB_C = $03; (* Bearer class C *)
{$EXTERNALSYM BCOB_C}
BCOB_X = $10; (* Bearer class X *)
{$EXTERNALSYM BCOB_X}
(*
* values used for the TrafficType field in struct ATM_BROADBAND_BEARER_CAPABILITY_IE
*)
TT_NOIND = $00; (* No indication of traffic type *)
{$EXTERNALSYM TT_NOIND}
TT_CBR = $04; (* Constant bit rate *)
{$EXTERNALSYM TT_CBR}
TT_VBR = $08; (* Variable bit rate *)
{$EXTERNALSYM TT_VBR}
(*
* values used for the TimingRequirements field in struct ATM_BROADBAND_BEARER_CAPABILITY_IE
*)
TR_NOIND = $00; (* No timing requirement indication *)
{$EXTERNALSYM TR_NOIND}
TR_END_TO_END = $01; (* End-to-end timing required *)
{$EXTERNALSYM TR_END_TO_END}
TR_NO_END_TO_END = $02; (* End-to-end timing not required *)
{$EXTERNALSYM TR_NO_END_TO_END}
(*
* values used for the ClippingSusceptability field in struct ATM_BROADBAND_BEARER_CAPABILITY_IE
*)
CLIP_NOT = $00; (* Not susceptible to clipping *)
{$EXTERNALSYM CLIP_NOT}
CLIP_SUS = $20; (* Susceptible to clipping *)
{$EXTERNALSYM CLIP_SUS}
(*
* values used for the UserPlaneConnectionConfig field in
* struct ATM_BROADBAND_BEARER_CAPABILITY_IE
*)
UP_P2P = $00; (* Point-to-point connection *)
{$EXTERNALSYM UP_P2P}
UP_P2MP = $01; (* Point-to-multipoint connection *)
{$EXTERNALSYM UP_P2MP}
type
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -