5.7 WAN Objects

The following chart summarizes the OIDs used to get or set operational characteristics for NDIS drivers and WAN NICs.

Length

Q

S

Name

6

M

OID_WAN_PERMANENT_ADDRESS 
Permanent station address

6

M

OID_WAN_CURRENT_ADDRESS 
Current station

4

M

OID_WAN_QUALITY_OF_SERVICE 
Quality of service

1 or 6

M

OID_WAN_PROTOCOL_TYPE 
Protocol type

4

M

OID_WAN_MEDIUM_SUBTYPE 
Medium subtype

4

M

OID_WAN_HEADER_FORMAT 
Header format

4

M

 

OID_WAN_GET_INFO 
Get information

4

M

OID_WAN_GET_LINK_INFO 
Get link information

4

M

OID_WAN_SET_LINK_INFO 
Set link information

4

M

OID_WAN_LINE_COUNT 
Line count

50

O

OID_WAN_GET_COMP_INFO 
Get compression information

50

O

OID_WAN_SET_COMP_INFO 
Set compression information

60

O

OID_WAN_GET_STATS_INFO 
Get statistics information

The following describes each of the OID_XXX listed in the preceding chart more fully.

The OID_WAN_GET_BRIDGE_INFO and OID_WAN_SET_BRIDGE_INFO codes are reserved.

OID_WAN_PERMANENT_ADDRESS

This OID requests the miniport to return the address encoded in the hardware of the NIC.

OID_WAN_CURRENT_ADDRESS

This OID requests the miniport to return the address that the NIC currently is using.

The miniport should return a unique address for the target NIC. NDISWAN presents the returned value, formatted as an Ethernet address, to higher-level protocols. Consequently, the least-significant bit must not be set in such a returned NIC-specific address to prevent it from being interpreted as an Ethernet multicast address.

The driver of a NIC manufactured by a vendor with an assigned Ethernet ID should use that ID as part of the address it returns for this OID. This prevents conflicts with other vendors’ assigned Ethernet address ranges.

OID_WAN_QUALITY_OF_SERVICE

This OID requests the miniport to return the quality of service that it supports.

The quality of service returned for this query should be a worst-case estimate, specified as one of the following system-defined values:

NdisWanRaw
Specifies a raw binding, in which the NIC driver puts all packets on the network unmodified.
NdisWanErrorControl
Specifies an error control binding.
NdisWanReliable
Specifies a reliable binding.

When a NIC driver calls NdisMIndicateStatus with a line-up indication, it provides QOS information for a specified link.

OID_WAN_PROTOCOL_TYPE

This OID informs the underlying driver of a bound protocol’s type, as a single-byte network-level protocol identifier (NLPID).

Alternatively, a protocol can specify a 6-byte Sub-Network Access Protocol (SNAP) NLPID, with 0x80-0x00-0x00-0x00 for the first four bytes and an Ethertype for the last two bytes.

OID_WAN_MEDIUM_SUBTYPE

This OID requests the miniport to return a list of the media subtypes that it can support as a proper subset of the following system-defined values:

NdisWanMediumHub
Specifies a remote access server (RAS) hub.
NdisWanMediumX_25
Specifies an X.25 medium.
NdisWanMediumIsdn
Specifies an ISDN medium.
NdisWanMediumSerial
Specifies a serial line.
NdisWanMediumFrameRelay
Specifies a frame-relay medium.
NdisWanMediumSonet
Specifies a synchronous optical network (Sonet) fiber medium.
NdisWanMediumSW56K
Specifies a switched 56K medium.

The NdisWanMediumAtm value is reserved.

OID_WAN_HEADER_FORMAT

This OID requests the miniport to return or to set the address-header format used, as either of the following system-defined values:

NdisWanHeaderEthernet
Selects Ethernet-emulation format.
NdisWanHeaderNative
Selects the format native to the NdisWanMediumXxx subtype supported by the underlying driver. NDISWAN always uses Ethernet.

For a query, the miniport returns a list of the address formats that the NIC driver supports. For a set, the miniport subsequently uses the given type to format headers for this binding.

If an underlying NDIS driver does not support a header format that a protocol recognizes, that protocol’s attempt to bind to the underlying driver fails. A NIC driver is not required to support both address types of header format but should if it can.

OID_WAN_GET_INFO

This OID requests the miniport to return information about its or the NIC’s capabilities, formatted as an NDIS_WAN_INFO structure, defined as follows:

typedef struct _NDIS_WAN_INFO {
    OUT ULONG                  MaxFrameSize; 
    OUT ULONG                  MaxTransmit; 
    OUT ULONG                  HeaderPadding; 
    OUT ULONG                  TailPadding; 
    OUT ULONG                  Endpoints; 
    OUT UINT                   MemoryFlags; 
    OUT NDIS_PHYSICAL_ADDRESS  HighestAcceptableAddress; 
    OUT ULONG                  FramingBits; 
    OUT ULONG                  DesiredACCM; 
} NDIS_WAN_INFO, *PNDIS_WAN_INFO; 
 

The members of this structure contain the following information:

MaxFrameSize
Specifies the maximum frame size for any net packet that the NIC driver can send and receive. This value should exclude the driver’s own framing overhead and/or the PPP HDLC overhead. Typically this value is around 1500.

However, all WAN miniports should use an internal MaxFrameSize that is 32 bytes larger than the value they return for this OID. For example, a WAN miniport that returns 1500 for this OID should internally accept and send up to 1532. Such a miniport can readily support future bridging and additional protocols.

MaxTransmit
Specifies the maximum number of outstanding frames that the WAN miniport can handle. This member must be set to at least one.

NDISWAN uses the value of this member as a default throttle on how many send requests it submits to the driver’s MiniportWanSend function before NDISWAN holds incoming sends queued until the miniport completes an outstanding send. A miniport can adjust this value dynamically and on a per-link basis using the SendWindow member in the NDIS_MAC_LINE_UP structure that the driver passes to NdisMIndicateStatus. NDISWAN uses the current line-up SendWindow value as its throttle on outstanding sends unless the miniport sets SendWindow to zero for an indication, whereupon NDISWAN reverts to using the driver-set MaxTransmit value.

Since a WAN NIC driver must queue packets internally, the value of MaxTransmit is theoretically max(ULONG). However, this miniport-determined value should reflect the link speed or hardware capabilities of the NIC.

For example, if its NIC always has room for at least four frames, a miniport would set MaxTransmit to four so that any incoming packet to MiniportWanSend can be placed on the hardware immediately.

HeaderPadding
Specifies the amount of buffer space, in bytes, required at the beginning of each net packet, considering the current defaults, such as a MaxFrameSize of 1500.

For example, if its NIC requires just a flag byte preceding the frame, the miniport would set this member to one.

TailPadding 
Specifies the amount of buffer space, in bytes, required at the end of each net packet, considering the current defaults, such as a MaxFrameSize of 1500.

For example, if its NIC requires three bytes at the end of each net packet for the Frame Checksum Sequence (CRC check) and the flag byte, a miniport would set this member to three.

Endpoints 
Specifies the maximum number of links (sometimes called ports, or point-to-point connections) that the NIC can support at any given time.

For example, a miniport would set this member to two for an ISDN card with two channels. It would set this member to ten for an X.25 card that can accept up to ten virtual circuits.

MemoryFlags 
If the NIC is not a DMA device, set this member to zero.

Otherwise, set this to the type of memory to be allocated for the NIC, that is, NDIS_MEMORY_NONCACHED and/or NDIS_MEMORY_CONTIGUOUS. Subsequently, memory of the specified type will be allocated for all packets to be transmitted by the WAN adapter.

HighestAcceptableAddress 
If the NIC is not a DMA device, set this member with the macro NDIS_PHYSICAL_ADDRESS_CONST(-1,-1).

Otherwise, if the NIC can use 24-bit addresses, set this value to NDIS_PHYSICAL_ADDRESS_CONST (0x1000000, 0). Subsequently, memory within the specified range will be allocated for all packets to be transmitted by the NIC. Thus, memory can just be DMAed directly to the NIC instead of having to be double-buffered through a CPU-memory copy.

FramingBits
Set any bits (ORed) supported by the driver among the following:
RAS_FRAMING
Set only if the driver can detect older RAS framing. Only legacy drivers that supported earlier RAS framing set this flag.
RAS_COMPRESSION
Set only if the driver supports the older RAS compression scheme.
PPP_FRAMING
Should always be set. Indicates the driver can detect and support PPP framing for its medium type.
PPP_COMPRESS_ADDRESS_CONTROL
Set if the driver supports PPP address and control-field compression.

NDISWAN will remove the address and control field if this LCP option is negotiated. Some WAN medium types, such as X.25, do not support this option.

PPP_COMPRESS_PROTOCOL_FIELD
Set if the driver supports PPP protocol field compression.

NDISWAN will remove one byte from the protocol field when applicable if this LCP option is negotiated.

PPP_ACCM_SUPPORTED
Set if the driver supports Asynchronous Control Character Mapping. This bit is only valid for asynchronous media, such as modems. If this bit is set the DesiredACCM member should be valid.
PPP_MULTILINK_FRAMING
Set if the driver supports multilink framing as specified in IETF RFC 1717.
PPP_SHORT_SEQUENCE_HDR_FORMAT
Set if the driver supports header format for multilink framing as specified in IETF RFC 1717.
SLIP_FRAMING
Set if the driver can detect and support SLIP framing (asynchronous drivers only).
SLIP_VJ_COMPRESSION
Set if the driver can support Van Jacobsen TCP/IP header compression for SLIP. NDISWAN supports SLIP_VJ_COMPRESSION (with 16 slots). Asynchronous media (serial drivers) that support SLIP framing should set this bit.

Asynchronous media need not write any code to support VJ header compression. NDISWAN will take care of it.

SLIP_VJ_AUTODETECT
Set if the driver can autodetect Van Jacobsen TCP/IP header compression for SLIP. NDISWAN will auto-detect VJ header compression. Asynchronous media (serial drivers) should set this bit if they support SLIP framing.
TAPI_PROVIDER
Set if the driver supports the TAPI Service Provider OIDs. Unless this bit is set, TAPI OID calls will not be made to the driver.
MEDIA_NRZ_ENCODING
Set if the driver supports NRZ encoding, the PPP default for some media types such as ISDN. This value is reserved for future use.
MEDIA_NRZI_ENCODING
Set if the driver supports NRZI encoding. This value is reserved for future use.
MEDIA_NLPID
Set if the driver has and can set the NLPID in its frame. This value is reserved for future use.
RFC_1356_FRAMING
Set if the driver supports IETF RFC 1356 X.25 and ISDN framing. This value is reserved for future use.
RFC_1483_FRAMING
Set if the driver supports IETF RFC 1483 ATM adaptation layer-5 encapsulation. This value is reserved for future use.
RFC_1490_FRAMING
Set if the driver supports IETF RFC 1490 Frame Relay framing. This value is reserved for future use.
NBF_PRESERVE_MAC_ADDRESS
Set if the driver supports IETF framing as specified in the draft “The PPP NETBIOS Frames Control Protocol (NBFCP).”
SHIVA_FRAMING
Superseded by NBF_PRESERVE_MAC_ADDRESS.
PASS_THROUGH_MODE
Set if the driver does its own framing. If this flag is set, NDISWAN passes frames, uninterpreted and unmodified.

NIC drivers must be in the default PPP framing mode until each driver receives an NDIS_WAN_SET_LINK_INFO call. The NIC driver must auto-detect any framing that it claims to support.

For example, drivers that support old RAS framing must autodetect RAS framing from PPP framing. If a driver detects a framing scheme other than the default, that driver should automatically switch its framing into the newly detected framing.

A subsequent query with OID_WAN_GET_LINK_INFO should indicate the detected framing. If no framing is yet detected, the FramingBits should be zero in the returned NDIS_WAN_GET_LINK_INFO information.

If the WAN miniport is called subsequently with OID_WAN_SET_LINK_INFO in which the FramingBits member is zero, the driver should attempt to autodetect the framing upon reception of each frame.

DesiredACCM
The Asynchronous Control Character Map is negotiated. This member is relevant only for asynchronous media types.

OID_WAN_GET_LINK_INFO

This OID requests the miniport to return information about the current state of a link formatted as an NDIS_WAN_GET_LINK_INFO structure, defined as follows:

typedef struct _NDIS_WAN_GET_LINK_INFO { 
    IN  NDIS_HANDLE     NdisLinkHandle; 
    OUT ULONG           MaxSendFrameSize; 
    OUT ULONG           MaxRecvFrameSize; 
    OUT ULONG           HeaderPadding; 
    OUT ULONG           TailPadding; 
    OUT ULONG           SendFramingBits; 
    OUT ULONG           RecvFramingBits; 
    OUT ULONG           SendCompressionBits; 
    OUT ULONG           RecvCompressionBits; 
    OUT ULONG           SendACCM; 
    OUT ULONG           RecvACCM; 
} NDIS_WAN_GET_LINK_INFO, *PNDIS_WAN_GET_LINK_INFO; 
 

The members of this structure contain the following information:

NdisLinkHandle
Identifies the link. This is the handle that the miniport supplied in its initial line-up indication for this link.
MaxSendFrameSize
Specifies the maximum buffer size, in bytes, that the miniport can accept for transmission on this link. From this both PreamblePadding and PostamblePadding can be calculated, along with the framing bits and ACCM. The driver’s MiniportWanSend function can reject any incoming send packet that is larger than this size.
MaxRecvFrameSize
Specifies the largest packet, not including the driver's padding, that will be received on the wire. The driver can drop any packets that are larger.
HeaderPadding
Specifies the number of padding bytes at the head of the frame.
TailPadding
Specifies the number of padding bytes at the tail of the frame.
SendFramingBits
Specifies send-framing bits indicating the type of framing that should be sent. If the miniport detects incompatibilities between SendFramingBits and RecvFramingBits, it returns NDIS_STATUS_INVALID_WAN_SETTINGS.

The proper NLPID and framing format should be used based on the framing bits wherever applicable.

RecvFramingBits
Specifies receive-framing bits indicating the type of framing that should be received.
SendCompressionBits
Reserved.
RecvCompressionBits
Reserved.
SendACCM
For asynchronous media types, logical bits 0-31 indicate the respective byte to be byte stuffed. That is, if bit 0 is set to 1, then ASCII character 0x00 should be byte stuffed, and so forth.
RecvACCM
As described for SendACCM.

Possible values for SendFramingBits and RecvFramingBits include any the driver returned in response to the OID_WAN_GET_INFO query.

OID_WAN_SET_LINK_INFO

This OID requests the miniport to set information for an established link. The protocol-supplied information is formatted as an NDIS_WAN_SET_LINK_INFO structure, defined as follows:

typedef struct _NDIS_WAN_SET_LINK_INFO { 
    IN NDIS_HANDLE     NdisLinkHandle; 
    IN ULONG           MaxSendFrameSize; 
    IN ULONG           MaxRecvFrameSize; 
    IN ULONG           HeaderPadding; 
    IN ULONG           TailPadding; 
    IN ULONG           SendFramingBits; 
    IN ULONG           RecvFramingBits; 
    IN ULONG           SendCompressionBits; 
    IN ULONG           RecvCompressionBits; 
    IN ULONG           SendACCM; 
    IN ULONG           RecvACCM; 
} NDIS_WAN_SET_LINK_INFO, *PNDIS_WAN_SET_LINK_INFO; 
 

The members of this structure contain the following information:

NdisLinkHandle
Identifies the link. This is the handle the miniport supplied in its initial line-up indication for this link.
MaxSendFrameSize
Specifies the largest buffer, in bytes, the protocol will send for this link. This value must be less than or equal to that returned by the miniport for the OID_WAN_GET_LINK_INFO query.

From this, both PreamblePadding and PostamblePadding can be calculated, along with the framing bits and ACCM. The driver’s MiniportWanSend function can reject any send packets submitted for this link that are larger than this value.

MaxRecvFrameSize
Specifies the largest net packet, not including the driver's padding, that the protocol will receive subsequently. This value must be less than or equal to that returned by the miniport for the OID_WAN_GET_LINK_INFO query. The miniport can drop any received packets for this link that are larger.
HeaderPadding
Specifies the number of padding bytes at the head of the frame.
TailPadding
Specifies the number of padding bytes at the tail of the frame.
SendFramingBits
Specifies send-framing bits indicating the type of framing that should be sent. If the miniport detects incompatibilities between SendFramingBits and RecvFramingBits, it returns NDIS_STATUS_INVALID_WAN_SETTINGS.

The proper NLPID and framing format should be used based on the framing bits wherever applicable.

RecvFramingBits
Specifies receive-framing bits indicating the type of framing that should be received.
SendCompressionBits
Reserved.
RecvCompressionBits
Reserved.
SendACCM
For asynchronous media types, logical bits 0-31 indicate the respective byte to be byte stuffed. That is, if bit 0 is set to one then ASCII character 0x00 should be byte stuffed, and so forth.
RecvACCM
As described for SendACCM.

Possible values for SendFramingBits and RecvFramingBits include any the underlying driver returned in response to the OID_WAN_GET_INFO query.

OID_WAN_LINE_COUNT

This OID requests the miniport to return the total number of lines (endpoints) it exposes.

OID_WAN_GET_COMP_INFO

This OID requests the miniport to return information about the capabilities of the NIC or of its driver, in particular whether either supports compression. If so, the values returned are used to negotiate compression with the Point-to-Point Protocol (PPP) Compression Control Protocol. The protocol subsequently negotiates a compression scheme with an OID_WAN_SET_COMP_INFO request.

Compression information is returned in an NDIS_WAN_GET_COMP_INFO structure, defined as follows:

typedef struct _NDIS_WAN_GET_COMP_INFO { 
    IN NDIS_HANDLE   NdisLinkHandle; 
    OUT NDIS_WAN_COMPRESS_INFO SendCapabilities; 
    OUT NDIS_WAN_COMPRESS_INFO RecvCapabilities; 
} NDIS_WAN_GET_COMP_INFO, *PNDIS_WAN_GET_COMP_INFO; 
 

The members of this structure contain the following information:

NdisLinkHandle
Identifies the link. This is the handle that the miniport supplied in the initial line-up indication for this link.
SendCapabilities
Specifies a structure containing information on compression capabilities for sending data, defined below.
RecvCapabilities
Specifies a structure containing information on compression capabilities for receiving data, defined next.

The NDIS_WAN_COMPRESS_INFO structure is defined as follows:

typedef struct _NDIS_WAN_COMPRESS_INFO { 
    UCHAR    SessionKey[8]; 
    ULONG    MSCompType; 
 
    // Members above reserved to indicate NDISWAN capabilities. 
    // Members below indicate NIC-specific capabilities. 
 
    UCHAR    CompType; 
    USHORT   CompLength; 
    union { 
        struct { 
            UCHAR    CompOUI[3]; 
            UCHAR    CompSubType; 
            UCHAR    CompValues[32]; 
        } Proprietary; 
        struct { 
            UCHAR    CompValues[32]; 
        } Public; 
    }; 
} NDIS_WAN_COMPRESS_INFO; 
 

The members of this structure contain the following information:

SessionKey
Specifies a reserved variable used by NDISWAN as an encryption key. This variable should be ignored by NDIS drivers.
MsCompType
Specifies what type of compression/encryption capabilites NDISWAN has and what is currently being used. This member also is reserved for use by NDISWAN and should be ignored by NDIS drivers.
CompType
Specifies the compression capabilities of the NIC or its driver as one of the following system-defined values:
COMPTYPE_OUI
Set if the CompOUI and CompSubType members are set.
COMPTYPE_NT31RAS
Only legacy drivers that support the original RAS compression scheme set this value.
COMPTYPE_NONE
Set if compression is unsupported.
CompLength
Specifies the number of bytes in the CompValues member.
CompOUI
Specifies a NIC vendor’s IEEE-registered Organization Unique Identifier, which is the most significant three octets of an Ethernet Physical Address, assigned to the vendor by IEEE 802. This identifies the compression type as being proprietary to the vendor.
CompSubType
Specifies a compression specific to the OUI and indicates a compression type for that OUI as described by IETF draft “The PPP Compression Control Protocol (CCP).”
CompValues
Specifies additional data that is specific to the compression protocol.

OID_WAN_SET_COMP_INFO

This OID notifies the miniport of the compression scheme selected by a protocol to which the miniport already returned information in OID_WAN_GET_COMP_INFO.

The protocol supplies a specification for the compression scheme it selected in an NDIS_WAN_SET_COMP_INFO structure, defined as follows:

typedef struct _NDIS_WAN_SET_COMP_INFO { 
    IN NDIS_HANDLE               NdisLinkHandle; 
    IN NDIS_WAN_COMPRESS_INFO    SendCapabilities; 
    IN NDIS_WAN_COMPRESS_INFO    RecvCapabilities; 
} NDIS_WAN_SET_COMP_INFO, *PNDIS_WAN_SET_COMP_INFO; 
 

The members of this structure contain the following information:

NdisLinkHandle
Identifies the link. This is the handle that the miniport supplied in the initial line-up indication for this link.
SendCapabilities
Specifies a structure containing information on compression capabilities for sending data.
RecvCapabilities
Specifies a structure containing information on compression capabilities for receiving data.

For specifics of the NDIS_WAN_COMPRESS_INFO structure, see the preceding OID_WAN_GET_COMP_INFO.

OID_WAN_GET_STATS_INFO

This OID requests the miniport to return statistics information. A WAN NIC driver is expected to keep statistics and to return these statistics for this OID in an NDIS_WAN_GET_STATS_INFO structure, defined as follows:

typedef struct _NDIS_WAN_GET_STATS_INFO { 
    IN NDIS_HANDLE  NdisLinkHandle; 
    OUT ULONG       BytesSent; 
    OUT ULONG       BytesRcvd; 
    OUT ULONG       FramesSent; 
    OUT ULONG       FramesRcvd; 
    OUT ULONG       CRCErrors; 
    OUT ULONG       TimeoutErrors; 
    OUT ULONG       AlignmentErrors; 
    OUT ULONG       SerialOverrunErrors; 
    OUT ULONG       FramingErrors; 
    OUT ULONG       BufferOverrunErrors; 
    OUT ULONG       BytesTransmittedUncompressed; 
    OUT ULONG       BytesReceivedUncompressed; 
    OUT ULONG       BytesTransmittedCompressed; 
    OUT ULONG       BytesReceivedCompressed; 
} NDIS_WAN_GET_STATS_INFO, *PNDIS_WAN_GET_STATS_INFO; 
 

The members of this structure contain the following information:

NdisLinkHandle
Identifies the link. This is the handle that the miniport supplied in the initial line-up indication for this link.
BytesSent
Specifies the number of bytes transmitted.
BytesRcvd
Specifies the number of bytes received.
FramesSent
Specifies the number of frames (WAN packets) sent.
FramesRcvd
Specifies the number of frames received.
CRCErrors
Specifies the number of CRC errors encountered.
TimeoutErrors
Specifies the number of timeout errors encountered.
AlignmentErrors
Specifies the number of alignment errors encountered.
SerialOverrunErrors
Specifies the number of CRC errors encountered.
FramingErrors
Specifies the number of framing errors encountered.
BufferOverrunErrors
Specifies the number of buffer overruns encountered.
BytesTransmittedUncompressed
Specifies the number of bytes of uncompressed data transmitted. A miniport returns a nonzero value only if it supports compression.
BytesReceivedUncompressed
Specifies the number of bytes of uncompressed data received. A miniport returns a nonzero value only if it supports compression.
BytesTransmittedCompressed
Specifies the number of bytes of compressed data transmitted. A miniport returns a nonzero value only if it supports compression.
BytesReceivedCompressed
Specifies the number of bytes of compressed data received. A miniport returns a nonzero value only if it supports compression.

If the underlying driver or its NIC does not support compression, the driver returns zero for the Bytes..Uncompressed/Compressed members.