Home | History | Annotate | Download | only in ddk
      1 /*
      2  * ndiswan.h
      3  *
      4  * Definitions for NDIS WAN miniport drivers
      5  *
      6  * This file is part of the w32api package.
      7  *
      8  * Contributors:
      9  *   Created by Casper S. Hornstrup <chorns (at) users.sourceforge.net>
     10  *
     11  * THIS SOFTWARE IS NOT COPYRIGHTED
     12  *
     13  * This source code is offered for use in the public domain. You may
     14  * use, modify or distribute it freely.
     15  *
     16  * This code is distributed in the hope that it will be useful but
     17  * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
     18  * DISCLAIMED. This includes but is not limited to warranties of
     19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     20  *
     21  */
     22 
     23 #pragma once
     24 
     25 #ifndef _NDIS_WAN_
     26 #define _NDIS_WAN_
     27 
     28 #ifdef __cplusplus
     29 extern "C" {
     30 #endif
     31 
     32 #define NDIS_USE_WAN_WRAPPER            0x00000001
     33 
     34 #define NDIS_STATUS_TAPI_INDICATION     ((NDIS_STATUS)0x40010080L)
     35 
     36 /* NDIS_WAN_INFO.FramingBits constants */
     37 #define RAS_FRAMING                     0x00000001
     38 #define RAS_COMPRESSION                 0x00000002
     39 
     40 #define ARAP_V1_FRAMING                 0x00000004
     41 #define ARAP_V2_FRAMING                 0x00000008
     42 #define ARAP_FRAMING                    (ARAP_V1_FRAMING | ARAP_V2_FRAMING)
     43 
     44 #define PPP_MULTILINK_FRAMING           0x00000010
     45 #define PPP_SHORT_SEQUENCE_HDR_FORMAT   0x00000020
     46 #define PPP_MC_MULTILINK_FRAMING        0x00000040
     47 
     48 #define PPP_FRAMING                     0x00000100
     49 #define PPP_COMPRESS_ADDRESS_CONTROL    0x00000200
     50 #define PPP_COMPRESS_PROTOCOL_FIELD     0x00000400
     51 #define PPP_ACCM_SUPPORTED              0x00000800
     52 
     53 #define SLIP_FRAMING                    0x00001000
     54 #define SLIP_VJ_COMPRESSION             0x00002000
     55 #define SLIP_VJ_AUTODETECT              0x00004000
     56 
     57 #define MEDIA_NRZ_ENCODING              0x00010000
     58 #define MEDIA_NRZI_ENCODING             0x00020000
     59 #define MEDIA_NLPID                     0x00040000
     60 
     61 #define RFC_1356_FRAMING                0x00100000
     62 #define RFC_1483_FRAMING                0x00200000
     63 #define RFC_1490_FRAMING                0x00400000
     64 #define LLC_ENCAPSULATION               0x00800000
     65 
     66 #define SHIVA_FRAMING                   0x01000000
     67 #define NBF_PRESERVE_MAC_ADDRESS        0x01000000
     68 
     69 #define PASS_THROUGH_MODE               0x10000000
     70 #define RAW_PASS_THROUGH_MODE           0x20000000
     71 
     72 #define TAPI_PROVIDER                   0x80000000
     73 
     74 #define BRIDGING_FLAG_LANFCS            0x00000001
     75 #define BRIDGING_FLAG_LANID             0x00000002
     76 #define BRIDGING_FLAG_PADDING           0x00000004
     77 
     78 #define BRIDGING_TINYGRAM               0x00000001
     79 #define BRIDGING_LANID                  0x00000002
     80 #define BRIDGING_NO_SPANNING_TREE       0x00000004
     81 #define BRIDGING_8021D_SPANNING_TREE    0x00000008
     82 #define BRIDGING_8021G_SPANNING_TREE    0x00000010
     83 #define BRIDGING_SOURCE_ROUTING         0x00000020
     84 #define BRIDGING_DEC_LANBRIDGE          0x00000040
     85 
     86 #define BRIDGING_TYPE_RESERVED          0x00000001
     87 #define BRIDGING_TYPE_8023_CANON        0x00000002
     88 #define BRIDGING_TYPE_8024_NO_CANON     0x00000004
     89 #define BRIDGING_TYPE_8025_NO_CANON     0x00000008
     90 #define BRIDGING_TYPE_FDDI_NO_CANON     0x00000010
     91 #define BRIDGING_TYPE_8024_CANON        0x00000400
     92 #define BRIDGING_TYPE_8025_CANON        0x00000800
     93 #define BRIDGING_TYPE_FDDI_CANON        0x00001000
     94 
     95 /* NDIS_WAN_COMPRESS_INFO.MSCompType constants */
     96 #define NDISWAN_COMPRESSION             0x00000001
     97 #define NDISWAN_ENCRYPTION              0x00000010
     98 #define NDISWAN_40_ENCRYPTION           0x00000020
     99 #define NDISWAN_128_ENCRYPTION          0x00000040
    100 #define NDISWAN_56_ENCRYPTION           0x00000080
    101 #define NDISWAN_HISTORY_LESS            0x01000000
    102 
    103 /* NDIS_WAN_COMPRESS_INFO.CompType constants */
    104 #define COMPTYPE_OUI                    0
    105 #define COMPTYPE_NT31RAS                254
    106 #define COMPTYPE_NONE                   255
    107 
    108 #define WAN_ERROR_CRC                   ((ULONG)0x00000001)
    109 #define WAN_ERROR_FRAMING               ((ULONG)0x00000002)
    110 #define WAN_ERROR_HARDWAREOVERRUN       ((ULONG)0x00000004)
    111 #define WAN_ERROR_BUFFEROVERRUN         ((ULONG)0x00000008)
    112 #define WAN_ERROR_TIMEOUT               ((ULONG)0x00000010)
    113 #define WAN_ERROR_ALIGNMENT             ((ULONG)0x00000020)
    114 
    115 #define NdisMWanInitializeWrapper(NdisWrapperHandle, \
    116                                   SystemSpecific1,   \
    117                                   SystemSpecific2,   \
    118                                   SystemSpecific3)   \
    119 {                                                     \
    120   NdisMInitializeWrapper(NdisWrapperHandle,           \
    121                          SystemSpecific1,             \
    122                          SystemSpecific2,             \
    123                          SystemSpecific3);            \
    124 }
    125 
    126 typedef struct _NDIS_WAN_INFO {
    127   OUT ULONG MaxFrameSize;
    128   OUT ULONG MaxTransmit;
    129   OUT ULONG HeaderPadding;
    130   OUT ULONG TailPadding;
    131   OUT ULONG Endpoints;
    132   OUT UINT MemoryFlags;
    133   OUT NDIS_PHYSICAL_ADDRESS HighestAcceptableAddress;
    134   OUT ULONG FramingBits;
    135   OUT ULONG DesiredACCM;
    136 } NDIS_WAN_INFO, *PNDIS_WAN_INFO;
    137 
    138 typedef struct _NDIS_WAN_GET_LINK_INFO {
    139   IN NDIS_HANDLE NdisLinkHandle;
    140   IN ULONG MaxSendFrameSize;
    141   OUT ULONG MaxRecvFrameSize;
    142   OUT ULONG HeaderPadding;
    143   OUT ULONG TailPadding;
    144   OUT ULONG SendFramingBits;
    145   OUT ULONG RecvFramingBits;
    146   OUT ULONG SendCompressionBits;
    147   OUT ULONG RecvCompressionBits;
    148   OUT ULONG SendACCM;
    149   OUT ULONG RecvACCM;
    150 } NDIS_WAN_GET_LINK_INFO, *PNDIS_WAN_GET_LINK_INFO;
    151 
    152 typedef struct _NDIS_WAN_SET_LINK_INFO {
    153   IN NDIS_HANDLE NdisLinkHandle;
    154   IN ULONG MaxSendFrameSize;
    155   IN ULONG MaxRecvFrameSize;
    156   IN ULONG HeaderPadding;
    157   IN ULONG TailPadding;
    158   IN ULONG SendFramingBits;
    159   IN ULONG RecvFramingBits;
    160   IN ULONG SendCompressionBits;
    161   IN ULONG RecvCompressionBits;
    162   IN ULONG SendACCM;
    163   IN ULONG RecvACCM;
    164 } NDIS_WAN_SET_LINK_INFO, *PNDIS_WAN_SET_LINK_INFO;
    165 
    166 typedef struct _NDIS_WAN_GET_BRIDGE_INFO {
    167   IN NDIS_HANDLE NdisLinkHandle;
    168   OUT USHORT LanSegmentNumber;
    169   OUT UCHAR BridgeNumber;
    170   OUT UCHAR BridgingOptions;
    171   OUT ULONG BridgingCapabilities;
    172   OUT UCHAR BridgingType;
    173   OUT UCHAR MacBytes[6];
    174 } NDIS_WAN_GET_BRIDGE_INFO, *PNDIS_WAN_GET_BRIDGE_INFO;
    175 
    176 typedef struct _NDIS_WAN_SET_BRIDGE_INFO {
    177   IN NDIS_HANDLE NdisLinkHandle;
    178   IN USHORT LanSegmentNumber;
    179   IN UCHAR BridgeNumber;
    180   IN UCHAR BridgingOptions;
    181   IN ULONG BridgingCapabilities;
    182   IN UCHAR BridgingType;
    183   IN UCHAR MacBytes[6];
    184 } NDIS_WAN_SET_BRIDGE_INFO, *PNDIS_WAN_SET_BRIDGE_INFO;
    185 
    186 typedef struct _NDIS_WAN_COMPRESS_INFO {
    187   UCHAR SessionKey[8];
    188   ULONG MSCompType;
    189   UCHAR CompType;
    190   USHORT CompLength;
    191   _ANONYMOUS_UNION union {
    192     struct {
    193       UCHAR CompOUI[3];
    194       UCHAR CompSubType;
    195       UCHAR CompValues[32];
    196     } Proprietary;
    197     struct {
    198       UCHAR CompValues[32];
    199     } Public;
    200   } DUMMYUNIONNAME;
    201 } NDIS_WAN_COMPRESS_INFO, *PNDIS_WAN_COMPRESS_INFO;
    202 
    203 typedef struct _NDIS_WAN_GET_COMP_INFO {
    204   IN NDIS_HANDLE NdisLinkHandle;
    205   OUT NDIS_WAN_COMPRESS_INFO SendCapabilities;
    206   OUT NDIS_WAN_COMPRESS_INFO RecvCapabilities;
    207 } NDIS_WAN_GET_COMP_INFO, *PNDIS_WAN_GET_COMP_INFO;
    208 
    209 typedef struct _NDIS_WAN_SET_COMP_INFO {
    210   IN NDIS_HANDLE NdisLinkHandle;
    211   IN NDIS_WAN_COMPRESS_INFO SendCapabilities;
    212   IN NDIS_WAN_COMPRESS_INFO RecvCapabilities;
    213 } NDIS_WAN_SET_COMP_INFO, *PNDIS_WAN_SET_COMP_INFO;
    214 
    215 typedef struct _NDIS_WAN_GET_STATS_INFO {
    216   IN NDIS_HANDLE NdisLinkHandle;
    217   OUT ULONG BytesSent;
    218   OUT ULONG BytesRcvd;
    219   OUT ULONG FramesSent;
    220   OUT ULONG FramesRcvd;
    221   OUT ULONG CRCErrors;
    222   OUT ULONG TimeoutErrors;
    223   OUT ULONG AlignmentErrors;
    224   OUT ULONG SerialOverrunErrors;
    225   OUT ULONG FramingErrors;
    226   OUT ULONG BufferOverrunErrors;
    227   OUT ULONG BytesTransmittedUncompressed;
    228   OUT ULONG BytesReceivedUncompressed;
    229   OUT ULONG BytesTransmittedCompressed;
    230   OUT ULONG BytesReceivedCompressed;
    231   OUT ULONG TunnelPacketsRecieved;
    232   OUT ULONG TunnelRecievePacketsPending;
    233   OUT ULONG TunnelPacketsIndicatedUp;
    234   OUT ULONG TunnelRecievePacketsRejected;
    235   OUT ULONG TunnelPacketsSent;
    236   OUT ULONG TunnelPacketsSentComplete;
    237   OUT ULONG TunnelTransmitPacketsPending;
    238   OUT ULONG TunnelPacketsTransmitError;
    239   OUT ULONG TunnelPacketsSentError;
    240   OUT ULONG TunnelTransmitPacketsRejected;
    241   OUT ULONG TunnelAcksSent;
    242   OUT ULONG TunnelAcksSentComplete;
    243   OUT ULONG TunnelGeneric1;
    244   OUT ULONG TunnelGeneric2;
    245   OUT ULONG TunnelGeneric3;
    246 } NDIS_WAN_GET_STATS_INFO, *PNDIS_WAN_GET_STATS_INFO;
    247 
    248 typedef struct _NDIS_MAC_LINE_UP {
    249   IN ULONG LinkSpeed;
    250   IN NDIS_WAN_QUALITY Quality;
    251   IN USHORT SendWindow;
    252   IN NDIS_HANDLE ConnectionWrapperID;
    253   IN NDIS_HANDLE NdisLinkHandle;
    254   OUT NDIS_HANDLE NdisLinkContext;
    255 } NDIS_MAC_LINE_UP, *PNDIS_MAC_LINE_UP;
    256 
    257 typedef struct _NDIS_MAC_LINE_DOWN {
    258   IN NDIS_HANDLE NdisLinkContext;
    259 } NDIS_MAC_LINE_DOWN, *PNDIS_MAC_LINE_DOWN;
    260 
    261 typedef struct _NDIS_MAC_FRAGMENT {
    262   IN NDIS_HANDLE NdisLinkContext;
    263   IN ULONG Errors;
    264 } NDIS_MAC_FRAGMENT, *PNDIS_MAC_FRAGMENT;
    265 
    266 typedef struct _NDIS_WAN_CO_INFO {
    267   OUT ULONG MaxFrameSize;
    268   OUT ULONG MaxSendWindow;
    269   OUT ULONG FramingBits;
    270   OUT ULONG DesiredACCM;
    271 } NDIS_WAN_CO_INFO, *PNDIS_WAN_CO_INFO;
    272 
    273 typedef struct _NDIS_WAN_CO_GET_LINK_INFO {
    274   OUT ULONG MaxSendFrameSize;
    275   OUT ULONG MaxRecvFrameSize;
    276   OUT ULONG SendFramingBits;
    277   OUT ULONG RecvFramingBits;
    278   OUT ULONG SendCompressionBits;
    279   OUT ULONG RecvCompressionBits;
    280   OUT ULONG SendACCM;
    281   OUT ULONG RecvACCM;
    282 } NDIS_WAN_CO_GET_LINK_INFO, *PNDIS_WAN_CO_GET_LINK_INFO;
    283 
    284 typedef struct _NDIS_WAN_CO_SET_LINK_INFO {
    285   IN ULONG MaxSendFrameSize;
    286   IN ULONG MaxRecvFrameSize;
    287   IN ULONG SendFramingBits;
    288   IN ULONG RecvFramingBits;
    289   IN ULONG SendCompressionBits;
    290   IN ULONG RecvCompressionBits;
    291   IN ULONG SendACCM;
    292   IN ULONG RecvACCM;
    293 } NDIS_WAN_CO_SET_LINK_INFO, *PNDIS_WAN_CO_SET_LINK_INFO;
    294 
    295 typedef struct _NDIS_WAN_CO_GET_COMP_INFO {
    296   OUT NDIS_WAN_COMPRESS_INFO SendCapabilities;
    297   OUT NDIS_WAN_COMPRESS_INFO RecvCapabilities;
    298 } NDIS_WAN_CO_GET_COMP_INFO, *PNDIS_WAN_CO_GET_COMP_INFO;
    299 
    300 typedef struct _NDIS_WAN_CO_SET_COMP_INFO {
    301   IN NDIS_WAN_COMPRESS_INFO SendCapabilities;
    302   IN NDIS_WAN_COMPRESS_INFO RecvCapabilities;
    303 } NDIS_WAN_CO_SET_COMP_INFO, *PNDIS_WAN_CO_SET_COMP_INFO;
    304 
    305 typedef struct _NDIS_WAN_CO_GET_STATS_INFO {
    306   OUT ULONG BytesSent;
    307   OUT ULONG BytesRcvd;
    308   OUT ULONG FramesSent;
    309   OUT ULONG FramesRcvd;
    310   OUT ULONG CRCErrors;
    311   OUT ULONG TimeoutErrors;
    312   OUT ULONG AlignmentErrors;
    313   OUT ULONG SerialOverrunErrors;
    314   OUT ULONG FramingErrors;
    315   OUT ULONG BufferOverrunErrors;
    316   OUT ULONG BytesTransmittedUncompressed;
    317   OUT ULONG BytesReceivedUncompressed;
    318   OUT ULONG BytesTransmittedCompressed;
    319   OUT ULONG BytesReceivedCompressed;
    320   OUT ULONG TunnelPacketsRecieved;
    321   OUT ULONG TunnelRecievePacketsPending;
    322   OUT ULONG TunnelPacketsIndicatedUp;
    323   OUT ULONG TunnelRecievePacketsRejected;
    324   OUT ULONG TunnelPacketsSent;
    325   OUT ULONG TunnelPacketsSentComplete;
    326   OUT ULONG TunnelTransmitPacketsPending;
    327   OUT ULONG TunnelPacketsTransmitError;
    328   OUT ULONG TunnelPacketsSentError;
    329   OUT ULONG TunnelTransmitPacketsRejected;
    330   OUT ULONG TunnelAcksSent;
    331   OUT ULONG TunnelAcksSentComplete;
    332   OUT ULONG TunnelGeneric1;
    333   OUT ULONG TunnelGeneric2;
    334   OUT ULONG TunnelGeneric3;
    335 } NDIS_WAN_CO_GET_STATS_INFO, *PNDIS_WAN_CO_GET_STATS_INFO;
    336 
    337 typedef struct _NDIS_WAN_CO_FRAGMENT {
    338   IN ULONG Errors;
    339 } NDIS_WAN_CO_FRAGMENT, *PNDIS_WAN_CO_FRAGMENT;
    340 
    341 typedef struct _WAN_CO_LINKPARAMS {
    342   ULONG TransmitSpeed;
    343   ULONG ReceiveSpeed;
    344   ULONG SendWindow;
    345 } WAN_CO_LINKPARAMS, *PWAN_CO_LINKPARAMS;
    346 
    347 typedef struct _WAN_CO_MTULINKPARAMS {
    348   ULONG Version;
    349   ULONG TransmitSpeed;
    350   ULONG ReceiveSpeed;
    351   ULONG SendWindow;
    352   ULONG MTU;
    353 } WAN_CO_MTULINKPARAMS, *PWAN_CO_MTULINKPARAMS;
    354 
    355 #ifdef __cplusplus
    356 }
    357 #endif
    358 
    359 #endif /* _NDIS_WAN_ */
    360 
    361