using System.Runtime.InteropServices;
using Vanara.InteropServices;
namespace Vanara.PInvoke;
/// Items from Qwave.dll.
public static partial class Qwave
{
/// Specifies the protocol type that sends this object identifier.
[PInvokeData("ntddndis.h")]
public enum NDIS_PROTOCOL_ID : ushort
{
/// Default protocol
NDIS_PROTOCOL_ID_DEFAULT = 0x00,
/// TCP/IP protocol
NDIS_PROTOCOL_ID_TCP_IP = 0x02,
/// TCP/IP v6 protocol
NDIS_PROTOCOL_ID_IP6 = 0x03,
/// Netware IPX protocol
NDIS_PROTOCOL_ID_IPX = 0x06,
/// NetBIOS protocol
NDIS_PROTOCOL_ID_NBF = 0x07,
}
///
///
/// The NETWORK_ADDRESS structure describes the network-layer addresses that help define NETWORK_ADDRESS_LIST. The
/// AddressCount member of NETWORK_ADDRESS_LIST contains an array of network-layer addresses, all of which are of type NETWORK_ADDRESS.
///
///
///
///
/// A bound instance is the binding between the calling transport and a driver set up by a call to NdisOpenAdapter. Miniport and other
/// layered drivers use compatible NETWORK_ADDRESS_LIST and NETWORK_ADDRESS structures to set the list of network-layer
/// addresses on a bound interface.
///
///
/// A protocol can set AddressCount to a nonzero value. This notifies a miniport driver or other layered driver to change the list
/// of network-layer addresses on a bound interface. In this case, the AddressType member in NETWORK_ADDRESS_LIST is not
/// valid and the AddressType members in NETWORK_ADDRESS structures are valid.
///
///
/// If a protocol sets AddressCount to zero, the AddressType member in NETWORK_ADDRESS_LIST is valid and the
/// AddressType members in NETWORK_ADDRESS structures are not valid.
///
///
// https://learn.microsoft.com/en-us/previous-versions/windows/embedded/ms905285(v=msdn.10)
[PInvokeData("ntddndis.h")]
[VanaraMarshaler(typeof(SafeAnysizeStructMarshaler), nameof(AddressLength))]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NETWORK_ADDRESS
{
/// The address length
public ushort AddressLength;
/// The address type
public ushort AddressType;
/// The address
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)]
public byte[] Address;
}
///
///
/// Miniport and other layered drivers use compatible NETWORK_ADDRESS_LIST and NETWORK_ADDRESS structures to set the list of
/// network-layer addresses on a bound interface.
///
///
///
///
/// A bound instance is the binding between the calling transport and a driver set up by a call to NdisOpenAdapter. Miniport and other
/// layered drivers use compatible NETWORK_ADDRESS_LIST and NETWORK_ADDRESS structures to set the list of network-layer
/// addresses on a bound interface.
///
///
/// A protocol can set AddressCount to a nonzero value. This notifies a miniport driver or other layered driver to change the list
/// of network-layer addresses on a bound interface. In this case, the AddressType member in NETWORK_ADDRESS_LIST is not
/// valid and the AddressType members in NETWORK_ADDRESS structures are valid.
///
///
/// If a protocol sets AddressCount to zero, the AddressType member in NETWORK_ADDRESS_LIST is valid and the
/// AddressType members in NETWORK_ADDRESS structures are not valid.
///
///
// https://learn.microsoft.com/en-us/previous-versions/windows/embedded/ms905288(v=msdn.10)
[PInvokeData("ntddndis.h")]
[VanaraMarshaler(typeof(SafeAnysizeStructMarshaler), nameof(AddressCount))]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NETWORK_ADDRESS_LIST
{
/// Specifies the number of network-layer addresses listed in the array in the Address member.
public int AddressCount;
///
/// Specifies the protocol type that sends this object identifier. This member is only valid if the AddressCount member is set to
/// zero. The AddressCount member is set to zero to notify a miniport or other layered driver to clear the list of network-layer
/// addresses on a bound interface.
///
public NDIS_PROTOCOL_ID AddressType;
/// Array of network-layer addresses of type NETWORK_ADDRESS.
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)]
public NETWORK_ADDRESS[] Address; // actually AddressCount elements long
}
}