home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / ws2atm.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  17KB  |  460 lines

  1. /*++
  2.  
  3. Copyright 1997 - 1998 Microsoft Corporation
  4.  
  5. Module Name:
  6.  
  7.     ws2atm.h
  8.  
  9. Abstract:
  10.  
  11.     Winsock 2 ATM Annex definitions.
  12.  
  13. Revision History:
  14.  
  15. Notes:
  16.  
  17. --*/
  18.  
  19. #ifndef _WS2ATM_H_
  20. #define _WS2ATM_H_
  21.  
  22. #include <pshpack4.h>
  23.  
  24. #define ATMPROTO_AALUSER           0x00   /* User-defined AAL */
  25. #define ATMPROTO_AAL1              0x01   /* AAL 1 */
  26. #define ATMPROTO_AAL2              0x02   /* AAL 2 */
  27. #define ATMPROTO_AAL34             0x03   /* AAL 3/4 */
  28. #define ATMPROTO_AAL5              0x05   /* AAL 5 */
  29.  
  30. #define SAP_FIELD_ABSENT           0xFFFFFFFE
  31. #define SAP_FIELD_ANY              0xFFFFFFFF
  32. #define SAP_FIELD_ANY_AESA_SEL     0xFFFFFFFA
  33. #define SAP_FIELD_ANY_AESA_REST    0xFFFFFFFB
  34.  
  35. /* 
  36.  *  values used for AddressType in struct ATM_ADDRESS
  37.  */
  38. #define ATM_E164               0x01   /* E.164 addressing scheme */
  39. #define ATM_NSAP               0x02   /* NSAP-style ATM Endsystem Address scheme */
  40. #define ATM_AESA               0x02   /* NSAP-style ATM Endsystem Address scheme */
  41.  
  42. #define ATM_ADDR_SIZE          20     
  43. typedef struct {
  44.     DWORD AddressType;                /* E.164 or NSAP-style ATM Endsystem Address */
  45.     DWORD NumofDigits;                /* number of digits; */
  46.     UCHAR Addr[ATM_ADDR_SIZE];        /* IA5 digits for E164, BCD encoding for NSAP */
  47.                                       /* format as defined in the ATM Forum UNI 3.1 */
  48. } ATM_ADDRESS;
  49.  
  50. /* 
  51.  *  values used for Layer2Protocol in B-LLI
  52.  */
  53. #define BLLI_L2_ISO_1745           0x01   /* Basic mode ISO 1745                      */
  54. #define BLLI_L2_Q921               0x02   /* CCITT Rec. Q.921                         */
  55. #define BLLI_L2_X25L               0x06   /* CCITT Rec. X.25, link layer              */
  56. #define BLLI_L2_X25M               0x07   /* CCITT Rec. X.25, multilink               */
  57. #define BLLI_L2_ELAPB              0x08   /* Extended LAPB; for half duplex operation */
  58. #define BLLI_L2_HDLC_NRM           0x09   /* HDLC NRM (ISO 4335)                      */
  59. #define BLLI_L2_HDLC_ABM           0x0A   /* HDLC ABM (ISO 4335)                      */
  60. #define BLLI_L2_HDLC_ARM           0x0B   /* HDLC ARM (ISO 4335)                      */
  61. #define BLLI_L2_LLC                0x0C   /* LAN logical link control (ISO 8802/2)    */
  62. #define BLLI_L2_X75                0x0D   /* CCITT Rec. X.75, single link procedure   */
  63. #define BLLI_L2_Q922               0x0E   /* CCITT Rec. Q.922                         */
  64. #define BLLI_L2_USER_SPECIFIED     0x10   /* User Specified                           */
  65. #define BLLI_L2_ISO_7776           0x11   /* ISO 7776 DTE-DTE operation               */
  66.  
  67. /* 
  68.  *  values used for Layer3Protocol in B-LLI
  69.  */
  70. #define BLLI_L3_X25                0x06   /* CCITT Rec. X.25, packet layer            */
  71. #define BLLI_L3_ISO_8208           0x07   /* ISO/IEC 8208 (X.25 packet layer for DTE  */
  72. #define BLLI_L3_X223               0x08   /* X.223/ISO 8878                           */
  73. #define BLLI_L3_SIO_8473           0x09   /* ISO/IEC 8473 (OSI connectionless)        */
  74. #define BLLI_L3_T70                0x0A   /* CCITT Rec. T.70 min. network layer       */
  75. #define BLLI_L3_ISO_TR9577         0x0B   /* ISO/IEC TR 9577 Network Layer Protocol ID*/
  76. #define BLLI_L3_USER_SPECIFIED     0x10   /* User Specified                           */
  77.  
  78. /* 
  79.  *  values used for Layer3IPI in B-LLI
  80.  */
  81. #define BLLI_L3_IPI_SNAP           0x80   /* IEEE 802.1 SNAP identifier               */
  82. #define BLLI_L3_IPI_IP             0xCC   /* Internet Protocol (IP) identifier        */
  83.  
  84. typedef struct {
  85.     DWORD Layer2Protocol;                 /* User information layer 2 protocol           */
  86.     DWORD Layer2UserSpecifiedProtocol;    /* User specified layer 2 protocol information */
  87.     DWORD Layer3Protocol;                 /* User information layer 3 protocol           */
  88.     DWORD Layer3UserSpecifiedProtocol;    /* User specified layer 3 protocol information */
  89.     DWORD Layer3IPI;                      /* ISO/IEC TR 9577 Initial Protocol Identifier */
  90.     UCHAR SnapID[5];                      /* SNAP ID consisting of OUI and PID           */
  91. } ATM_BLLI;
  92.  
  93. /* 
  94.  *  values used for the HighLayerInfoType field in ATM_BHLI
  95.  */
  96. #define BHLI_ISO                   0x00   /* ISO                                 */
  97. #define BHLI_UserSpecific          0x01   /* User Specific                       */
  98. #define BHLI_HighLayerProfile      0x02   /* High layer profile (only in UNI3.0) */
  99. #define BHLI_VendorSpecificAppId   0x03   /* Vendor-Specific Application ID      */
  100.  
  101. typedef struct {
  102.     DWORD HighLayerInfoType;          /* High Layer Information Type      */
  103.     DWORD HighLayerInfoLength;        /* number of bytes in HighLayerInfo */
  104.     UCHAR HighLayerInfo[8];           /* the value dependent on the       */
  105.                                       /*   HighLayerInfoType field        */
  106. } ATM_BHLI;
  107.  
  108. typedef struct sockaddr_atm {
  109.     u_short satm_family;              /* address family should be AF_ATM  */
  110.     ATM_ADDRESS satm_number;          /* ATM address                      */
  111.     ATM_BLLI satm_blli;               /* B-LLI                            */
  112.     ATM_BHLI satm_bhli;               /* B-HLI                            */
  113. } sockaddr_atm, SOCKADDR_ATM, *PSOCKADDR_ATM, *LPSOCKADDR_ATM;
  114.  
  115. typedef enum {
  116.     IE_AALParameters,
  117.     IE_TrafficDescriptor,
  118.     IE_BroadbandBearerCapability,
  119.     IE_BHLI,
  120.     IE_BLLI,
  121.     IE_CalledPartyNumber,
  122.     IE_CalledPartySubaddress,
  123.     IE_CallingPartyNumber,
  124.     IE_CallingPartySubaddress,
  125.     IE_Cause,
  126.     IE_QOSClass,
  127.     IE_TransitNetworkSelection,
  128. } Q2931_IE_TYPE;
  129.  
  130. typedef struct {
  131.     Q2931_IE_TYPE IEType;
  132.     ULONG         IELength;
  133.     UCHAR         IE[1];
  134. } Q2931_IE;
  135.  
  136. /* 
  137.  *  manifest constants for the AALType field in struct AAL_PARAMETERS_IE
  138.  */
  139. typedef enum {
  140.     AALTYPE_5     = 5,   /* AAL 5 */
  141.     AALTYPE_USER  = 16,  /* user-defined AAL */
  142. } AAL_TYPE;
  143.  
  144. /* 
  145.  *  values used for the Mode field in struct AAL5_PARAMETERS
  146.  */
  147. #define AAL5_MODE_MESSAGE           0x01
  148. #define AAL5_MODE_STREAMING         0x02
  149.  
  150. /* 
  151.  *  values used for the SSCSType field in struct AAL5_PARAMETERS
  152.  */
  153. #define AAL5_SSCS_NULL              0x00
  154. #define AAL5_SSCS_SSCOP_ASSURED     0x01
  155. #define AAL5_SSCS_SSCOP_NON_ASSURED 0x02
  156. #define AAL5_SSCS_FRAME_RELAY       0x04
  157.  
  158. typedef struct {
  159.     ULONG ForwardMaxCPCSSDUSize;
  160.     ULONG BackwardMaxCPCSSDUSize;
  161.     UCHAR Mode;                        /* only available in UNI 3.0 */
  162.     UCHAR SSCSType;
  163. } AAL5_PARAMETERS;
  164.  
  165. typedef struct {
  166.     ULONG UserDefined;
  167. } AALUSER_PARAMETERS; 
  168.     
  169. typedef struct {
  170.     AAL_TYPE AALType;
  171.     union {
  172.         AAL5_PARAMETERS     AAL5Parameters;
  173.         AALUSER_PARAMETERS  AALUserParameters;
  174.     } AALSpecificParameters;
  175. } AAL_PARAMETERS_IE;
  176.  
  177. typedef struct {
  178.     ULONG PeakCellRate_CLP0;
  179.     ULONG PeakCellRate_CLP01;
  180.     ULONG SustainableCellRate_CLP0;
  181.     ULONG SustainableCellRate_CLP01;
  182.     ULONG MaxBurstSize_CLP0;
  183.     ULONG MaxBurstSize_CLP01;
  184.     BOOL  Tagging;
  185. } ATM_TD;
  186.  
  187. typedef struct {
  188.     ATM_TD Forward;
  189.     ATM_TD Backward;
  190.     BOOL   BestEffort;
  191. } ATM_TRAFFIC_DESCRIPTOR_IE;
  192.  
  193. /* 
  194.  *  values used for the BearerClass field in struct ATM_BROADBAND_BEARER_CAPABILITY_IE
  195.  */
  196. #define BCOB_A                   0x01   /* Bearer class A                      */
  197. #define BCOB_C                   0x03   /* Bearer class C                      */
  198. #define BCOB_X                   0x10   /* Bearer class X                      */
  199.  
  200. /* 
  201.  *  values used for the TrafficType field in struct ATM_BROADBAND_BEARER_CAPABILITY_IE
  202.  */
  203. #define TT_NOIND                 0x00   /* No indication of traffic type       */
  204. #define TT_CBR                   0x04   /* Constant bit rate                   */
  205. #define TT_VBR                   0x06   /* Variable bit rate                   */
  206.  
  207. /* 
  208.  *  values used for the TimingRequirements field in struct ATM_BROADBAND_BEARER_CAPABILITY_IE
  209.  */
  210. #define TR_NOIND                 0x00   /* No timing requirement indication    */
  211. #define TR_END_TO_END            0x01   /* End-to-end timing required          */
  212. #define TR_NO_END_TO_END         0x02   /* End-to-end timing not required      */
  213.  
  214. /* 
  215.  *  values used for the ClippingSusceptability field in struct ATM_BROADBAND_BEARER_CAPABILITY_IE
  216.  */
  217. #define CLIP_NOT                 0x00   /* Not susceptible to clipping         */
  218. #define CLIP_SUS                 0x20   /* Susceptible to clipping             */
  219.  
  220. /* 
  221.  *  values used for the UserPlaneConnectionConfig field in 
  222.  *  struct ATM_BROADBAND_BEARER_CAPABILITY_IE
  223.  */
  224. #define UP_P2P                   0x00   /* Point-to-point connection           */
  225. #define UP_P2MP                  0x01   /* Point-to-multipoint connection      */
  226.  
  227. typedef struct {
  228.     UCHAR BearerClass;
  229.     UCHAR TrafficType;
  230.     UCHAR TimingRequirements;
  231.     UCHAR ClippingSusceptability;
  232.     UCHAR UserPlaneConnectionConfig;
  233. } ATM_BROADBAND_BEARER_CAPABILITY_IE;
  234.  
  235. typedef ATM_BHLI ATM_BHLI_IE;
  236.  
  237. /* 
  238.  *  values used for the Layer2Mode field in struct ATM_BLLI_IE
  239.  */
  240. #define BLLI_L2_MODE_NORMAL         0x40
  241. #define BLLI_L2_MODE_EXT            0x80
  242.  
  243. /* 
  244.  *  values used for the Layer3Mode field in struct ATM_BLLI_IE
  245.  */
  246. #define BLLI_L3_MODE_NORMAL         0x40
  247. #define BLLI_L3_MODE_EXT            0x80
  248.  
  249. /* 
  250.  *  values used for the Layer3DefaultPacketSize field in struct ATM_BLLI_IE
  251.  */
  252. #define BLLI_L3_PACKET_16           0x04
  253. #define BLLI_L3_PACKET_32           0x05
  254. #define BLLI_L3_PACKET_64           0x06
  255. #define BLLI_L3_PACKET_128          0x07
  256. #define BLLI_L3_PACKET_256          0x08
  257. #define BLLI_L3_PACKET_512          0x09
  258. #define BLLI_L3_PACKET_1024         0x0A
  259. #define BLLI_L3_PACKET_2048         0x0B
  260. #define BLLI_L3_PACKET_4096         0x0C
  261.  
  262. typedef struct {
  263.     DWORD Layer2Protocol;                 /* User information layer 2 protocol           */
  264.     UCHAR Layer2Mode;
  265.     UCHAR Layer2WindowSize;
  266.     DWORD Layer2UserSpecifiedProtocol;    /* User specified layer 2 protocol information */
  267.     DWORD Layer3Protocol;                 /* User information layer 3 protocol           */
  268.     UCHAR Layer3Mode;
  269.     UCHAR Layer3DefaultPacketSize;
  270.     UCHAR Layer3PacketWindowSize;
  271.     DWORD Layer3UserSpecifiedProtocol;    /* User specified layer 3 protocol information */
  272.     DWORD Layer3IPI;                      /* ISO/IEC TR 9577 Initial Protocol Identifier */
  273.     UCHAR SnapID[5];                      /* SNAP ID consisting of OUI and PID           */
  274. } ATM_BLLI_IE;
  275.  
  276. typedef ATM_ADDRESS ATM_CALLED_PARTY_NUMBER_IE;
  277.  
  278. typedef ATM_ADDRESS ATM_CALLED_PARTY_SUBADDRESS_IE;
  279.  
  280. /* 
  281.  *  values used for the Presentation_Indication field in 
  282.  *  struct ATM_CALLING_PARTY_NUMBER_IE
  283.  */
  284. #define PI_ALLOWED                  0x00
  285. #define PI_RESTRICTED               0x40
  286. #define PI_NUMBER_NOT_AVAILABLE     0x80
  287.  
  288. /* 
  289.  *  values used for the Screening_Indicator field in 
  290.  *  struct ATM_CALLING_PARTY_NUMBER_IE
  291.  */
  292. #define SI_USER_NOT_SCREENED        0x00
  293. #define SI_USER_PASSED              0x01
  294. #define SI_USER_FAILED              0x02
  295. #define SI_NETWORK                  0x03
  296.  
  297. typedef struct {
  298.     ATM_ADDRESS ATM_Number;
  299.     UCHAR       Presentation_Indication;
  300.     UCHAR       Screening_Indicator;
  301. } ATM_CALLING_PARTY_NUMBER_IE;
  302.  
  303. typedef ATM_ADDRESS ATM_CALLING_PARTY_SUBADDRESS_IE;
  304.  
  305. /* 
  306.  *  values used for the Location field in struct ATM_CAUSE_IE
  307.  */
  308. #define CAUSE_LOC_USER                      0x00
  309. #define CAUSE_LOC_PRIVATE_LOCAL             0x01
  310. #define CAUSE_LOC_PUBLIC_LOCAL              0x02
  311. #define CAUSE_LOC_TRANSIT_NETWORK           0x03
  312. #define CAUSE_LOC_PUBLIC_REMOTE             0x04
  313. #define CAUSE_LOC_PRIVATE_REMOTE            0x05
  314. #define CAUSE_LOC_INTERNATIONAL_NETWORK     0x06
  315. #define CAUSE_LOC_BEYOND_INTERWORKING       0x0A
  316.  
  317. /* 
  318.  *  values used for the Cause field in struct ATM_CAUSE_IE
  319.  */
  320. #define CAUSE_UNALLOCATED_NUMBER                0x01
  321. #define CAUSE_NO_ROUTE_TO_TRANSIT_NETWORK       0x02
  322. #define CAUSE_NO_ROUTE_TO_DESTINATION           0x03
  323. #define CAUSE_VPI_VCI_UNACCEPTABLE              0x0A
  324. #define CAUSE_NORMAL_CALL_CLEARING              0x10
  325. #define CAUSE_USER_BUSY                         0x11
  326. #define CAUSE_NO_USER_RESPONDING                0x12
  327. #define CAUSE_CALL_REJECTED                     0x15
  328. #define CAUSE_NUMBER_CHANGED                    0x16
  329. #define CAUSE_USER_REJECTS_CLIR                 0x17
  330. #define CAUSE_DESTINATION_OUT_OF_ORDER          0x1B
  331. #define CAUSE_INVALID_NUMBER_FORMAT             0x1C
  332. #define CAUSE_STATUS_ENQUIRY_RESPONSE           0x1E
  333. #define CAUSE_NORMAL_UNSPECIFIED                0x1F
  334. #define CAUSE_VPI_VCI_UNAVAILABLE               0x23
  335. #define CAUSE_NETWORK_OUT_OF_ORDER              0x26
  336. #define CAUSE_TEMPORARY_FAILURE                 0x29
  337. #define CAUSE_ACCESS_INFORMAION_DISCARDED       0x2B
  338. #define CAUSE_NO_VPI_VCI_AVAILABLE              0x2D
  339. #define CAUSE_RESOURCE_UNAVAILABLE              0x2F
  340. #define CAUSE_QOS_UNAVAILABLE                   0x31
  341. #define CAUSE_USER_CELL_RATE_UNAVAILABLE        0x33
  342. #define CAUSE_BEARER_CAPABILITY_UNAUTHORIZED    0x39
  343. #define CAUSE_BEARER_CAPABILITY_UNAVAILABLE     0x3A
  344. #define CAUSE_OPTION_UNAVAILABLE                0x3F
  345. #define CAUSE_BEARER_CAPABILITY_UNIMPLEMENTED   0x41
  346. #define CAUSE_UNSUPPORTED_TRAFFIC_PARAMETERS    0x49
  347. #define CAUSE_INVALID_CALL_REFERENCE            0x51
  348. #define CAUSE_CHANNEL_NONEXISTENT               0x52
  349. #define CAUSE_INCOMPATIBLE_DESTINATION          0x58
  350. #define CAUSE_INVALID_ENDPOINT_REFERENCE        0x59
  351. #define CAUSE_INVALID_TRANSIT_NETWORK_SELECTION 0x5B
  352. #define CAUSE_TOO_MANY_PENDING_ADD_PARTY        0x5C
  353. #define CAUSE_AAL_PARAMETERS_UNSUPPORTED        0x5D
  354. #define CAUSE_MANDATORY_IE_MISSING              0x60
  355. #define CAUSE_UNIMPLEMENTED_MESSAGE_TYPE        0x61
  356. #define CAUSE_UNIMPLEMENTED_IE                  0x63
  357. #define CAUSE_INVALID_IE_CONTENTS               0x64
  358. #define CAUSE_INVALID_STATE_FOR_MESSAGE         0x65
  359. #define CAUSE_RECOVERY_ON_TIMEOUT               0x66
  360. #define CAUSE_INCORRECT_MESSAGE_LENGTH          0x68
  361. #define CAUSE_PROTOCOL_ERROR                    0x6F
  362.  
  363. /* 
  364.  *  values used for the Condition portion of the Diagnostics field
  365.  *  in struct ATM_CAUSE_IE, for certain Cause values
  366.  */
  367. #define CAUSE_COND_UNKNOWN                  0x00
  368. #define CAUSE_COND_PERMANENT                0x01
  369. #define CAUSE_COND_TRANSIENT                0x02
  370.  
  371. /* 
  372.  *  values used for the Rejection Reason portion of the Diagnostics field
  373.  *  in struct ATM_CAUSE_IE, for certain Cause values
  374.  */
  375. #define CAUSE_REASON_USER                   0x00
  376. #define CAUSE_REASON_IE_MISSING             0x04
  377. #define CAUSE_REASON_IE_INSUFFICIENT        0x08
  378.  
  379. /* 
  380.  *  values used for the P-U flag of the Diagnostics field
  381.  *  in struct ATM_CAUSE_IE, for certain Cause values
  382.  */
  383. #define CAUSE_PU_PROVIDER                   0x00
  384. #define CAUSE_PU_USER                       0x08
  385.  
  386. /* 
  387.  *  values used for the N-A flag of the Diagnostics field
  388.  *  in struct ATM_CAUSE_IE, for certain Cause values
  389.  */
  390. #define CAUSE_NA_NORMAL                     0x00
  391. #define CAUSE_NA_ABNORMAL                   0x04
  392.  
  393. typedef struct {
  394.     UCHAR Location;
  395.     UCHAR Cause;
  396.     UCHAR DiagnosticsLength;
  397.     UCHAR Diagnostics[4];
  398. } ATM_CAUSE_IE;
  399.  
  400. /* 
  401.  *  values used for the QOSClassForward and QOSClassBackward
  402.  *  field in struct ATM_QOS_CLASS_IE
  403.  */
  404. #define QOS_CLASS0                  0x00
  405. #define QOS_CLASS1                  0x01
  406. #define QOS_CLASS2                  0x02
  407. #define QOS_CLASS3                  0x03
  408. #define QOS_CLASS4                  0x04
  409.  
  410. typedef struct {
  411.     UCHAR QOSClassForward;
  412.     UCHAR QOSClassBackward;
  413. } ATM_QOS_CLASS_IE;
  414.  
  415. /* 
  416.  *  values used for the TypeOfNetworkId field in struct ATM_TRANSIT_NETWORK_SELECTION_IE
  417.  */
  418. #define TNS_TYPE_NATIONAL           0x40
  419.  
  420. /* 
  421.  *  values used for the NetworkIdPlan field in struct ATM_TRANSIT_NETWORK_SELECTION_IE
  422.  */
  423. #define TNS_PLAN_CARRIER_ID_CODE    0x01
  424.  
  425. typedef struct {
  426.     UCHAR TypeOfNetworkId;
  427.     UCHAR NetworkIdPlan;
  428.     UCHAR NetworkIdLength;
  429.     UCHAR NetworkId[1];
  430. } ATM_TRANSIT_NETWORK_SELECTION_IE;
  431.  
  432. /*
  433.  *  ATM specific Ioctl codes
  434.  */
  435. #define SIO_GET_NUMBER_OF_ATM_DEVICES   0x50160001
  436. #define SIO_GET_ATM_ADDRESS             0xd0160002
  437. #define SIO_ASSOCIATE_PVC               0x90160003
  438. #define SIO_GET_ATM_CONNECTION_ID       0x50160004
  439.  
  440. /* ATM Connection Identifier */
  441.  
  442. typedef struct {
  443.     DWORD  DeviceNumber;
  444.     DWORD  VPI;
  445.     DWORD  VCI;
  446. } ATM_CONNECTION_ID;
  447.  
  448. /*
  449.  * Input buffer format for SIO_ASSOCIATE_PVC
  450.  */
  451.  
  452. typedef struct {
  453.    ATM_CONNECTION_ID   PvcConnectionId;
  454.    QOS                 PvcQos;
  455. } ATM_PVC_PARAMS;
  456.  
  457. #include <poppack.h>
  458.  
  459. #endif   /* _WS2ATM_H_ */
  460.