using System; using System.ComponentModel; using System.Runtime.InteropServices; using Vanara.InteropServices; using static Vanara.PInvoke.Ws2_32; using FILETIME = System.Runtime.InteropServices.ComTypes.FILETIME; namespace Vanara.PInvoke { public static partial class IpHlpApi { /// /// /// The MIB_UDP6ROW structure contains an entry from the User Datagram Protocol (UDP) listener table for IPv6 on the local computer. /// /// /// /// The MIB_UDP6ROW structure is defined on Windows Vista and later. /// /// The GetUdp6Table function retrieves the UDP listener table for IPv6 on the local computer and returns this information in a /// MIB_UDP6TABLE structure. /// /// An array of MIB_UDP6ROW structures are contained in the MIB_UDP6TABLE structure. /// /// The dwLocalAddr member is stored in an in6_addr structure. The RtlIpv6AddressToString or RtlIpv6AddressToStringEx /// functions may be used to convert the IPv6 address in the dwLocalAddr member to a string without loading the Windows /// Sockets DLL. /// /// /// The dwLocalScopeId and dwLocalPort members are in network byte order. In order to use the dwLocalScopeId and /// dwLocalPort members, the ntohs or inet_ntoa functions in Windows Sockets or similar functions may be needed. /// /// /// The MIB_UDP6TABLE structure contains the UDP listener table for IPv6 on the local computer. The name is based on the definition /// of this table in RFC 2454 published by the IETF. For more information, see http://www.ietf.org/rfc/rfc2454.txt. This table /// contains UDP endpoints for IPv6 that have been bound to an address. It should be noted that an application can create a UDP /// socket and bind it to an address for the sole purpose of sending a UDP datagram, with no intention of receiving packets using /// this socket (functioning as a listener). /// /// // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/udpmib/ns-udpmib-_mib_udp6row typedef struct _MIB_UDP6ROW { // IN6_ADDR dwLocalAddr; DWORD dwLocalScopeId; DWORD dwLocalPort; } MIB_UDP6ROW, *PMIB_UDP6ROW; [PInvokeData("udpmib.h", MSDNShortId = "c2cc4f77-8557-4206-9e46-aadf065eb8df")] [StructLayout(LayoutKind.Sequential, Size = 24, Pack = 4)] public struct MIB_UDP6ROW { /// /// /// The IPv6 address of the UDP endpoint on the local computer. This member is stored in a character array in network byte order. /// /// /// A value of zero indicates a UDP listener willing to accept datagrams for any IP interface associated with the local computer. /// /// public IN6_ADDR dwLocalAddr; /// /// /// The scope ID for the IPv6 address of the UDP endpoint on the local computer. This member is stored in network byte order. /// /// public uint dwLocalScopeId; /// /// The port number of the UDP endpoint on the local computer. This member is stored in network byte order. /// public uint dwLocalPort; } /// /// /// The MIB_UDP6ROW_OWNER_MODULE structure contains an entry from the User Datagram Protocol (UDP) listener table for IPv6 on /// the local computer. This entry also also includes any available ownership data and the process ID (PID) that issued the call to /// the bind function for the UDP endpoint. /// /// /// /// /// The MIB_UDP6TABLE_OWNER_MODULE structure is returned by a call to GetExtendedUdpTable with the TableClass parameter set to a /// UDP_TABLE_OWNER_MODULE from the UDP_TABLE_CLASS enumeration and the ulAf parameter set to AF_INET6. The /// MIB_UDP6TABLE_OWNER_MODULE structure contains an array of MIB_UDP6ROW_OWNER_MODULE structures. /// /// /// The ucLocalAddr member is stored in a character array in network byte order. On Windows Vista and later, the /// RtlIpv6AddressToString or RtlIpv6AddressToStringEx functions may be used to convert the IPv6 address in the ucLocalAddr /// member to a string without loading the Windows Sockets DLL. /// /// /// The dwLocalScopeId member is in network byte order. In order to use the dwLocalScopeId member, the ntohl or /// inet_ntoa functions in Windows Sockets or similar functions may be needed. /// /// /// The dwLocalPort member are in network byte order. In order to use the dwLocalPort member, the ntohs or inet_ntoa /// functions in Windows Sockets or similar functions may be needed. /// /// /// The MIB_UDP6TABLE_OWNER_MODULE structure contains the UDP listener table for IPv6 on the local computer. The name is based on the /// definition of this table in RFC 2454 published by the IETF. For more information, see http://www.ietf.org/rfc/rfc2454.txt. This /// table contains UDP endpoints for IPv6 that have been bound to an address. It should be noted that an application can create a UDP /// socket and bind it to an address for the sole purpose of sending a UDP datagram, with no intention of receiving packets using /// this socket (functioning as a listener). /// /// /// On the Microsoft Windows Software Development Kit (SDK) released for Windows Vista and later, the organization of header files /// has changed. This structure is defined in the Udpmib.h header file, not in the Iprtrmib.h header file. Note that the Udpmib.h /// header file is automatically included in Iprtrmib.h, which is automatically included in the Iphlpapi.h header file. The Udpmib.h /// and Iprtrmib.h header files should never be used directly. /// /// // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/udpmib/ns-udpmib-_mib_udp6row_owner_module typedef struct // _MIB_UDP6ROW_OWNER_MODULE { UCHAR ucLocalAddr[16]; DWORD dwLocalScopeId; DWORD dwLocalPort; DWORD dwOwningPid; LARGE_INTEGER // liCreateTimestamp; union { struct { int SpecificPortBind : 1; }; int dwFlags; }; ULONGLONG // OwningModuleInfo[TCPIP_OWNING_MODULE_SIZE]; } MIB_UDP6ROW_OWNER_MODULE, *PMIB_UDP6ROW_OWNER_MODULE; [PInvokeData("udpmib.h", MSDNShortId = "dcc80b3c-d4d5-44f4-9c7f-df6be2e21889")] [StructLayout(LayoutKind.Sequential, Pack = 8)] public struct MIB_UDP6ROW_OWNER_MODULE { /// /// Type: UCHAR[16] /// /// The IPv6 address of the UDP endpoint on the local computer. This member is stored in a character array in network byte order. /// /// /// A value of zero indicates a UDP listener willing to accept datagrams for any IP interface associated with the local computer. /// /// public IN6_ADDR ucLocalAddr; /// /// Type: DWORD /// The scope ID for the IPv6 address of the UDP endpoint on the local computer. /// public uint dwLocalScopeId; /// /// Type: DWORD /// The port number for the local UDP endpoint. /// public uint dwLocalPort; /// /// Type: DWORD /// /// The PID of the process that issued a context bind for this endpoint. If this value is set to 0, the information for this /// endpoint is unavailable. /// /// public uint dwOwningPid; private uint padding; /// /// Type: LARGE_INTEGER /// A FILETIME structure that indicates when the context bind operation that created this endpoint occurred. /// NOTE: The Microsoft documentation suggests this is a SYSTEMTIME structure. This is incorrect. /// public FILETIME liCreateTimestamp; /// public int SpecificPortBind; /// /// Type: ULONGLONG[TCPIP_OWNING_MODULE_SIZE] /// An array of opaque data that contains ownership information. /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = TCPIP_OWNING_MODULE_SIZE)] public ulong[] OwningModuleInfo; } /// /// /// The MIB_UDP6ROW_OWNER_PID structure contains an entry from the User Datagram Protocol (UDP) listener table for IPv6 on the /// local computer. The entry also includes the process ID (PID) that issued the call to the bind function for the UDP endpoint. /// /// /// /// /// The MIB_UDP6TABLE_OWNER_PID structure is returned by a call to GetExtendedUdpTable with the TableClass parameter set to a /// UDP_TABLE_OWNER_PID from the UDP_TABLE_CLASS enumeration and the ulAf parameter set to AF_INET6. The /// MIB_UDP6TABLE_OWNER_PID structure contains an array of MIB_UDP6ROW_OWNER_PID structures. /// /// /// The ucLocalAddr member is stored in a character array in network byte order. On Windows Vista and later, the /// RtlIpv6AddressToString or RtlIpv6AddressToStringEx functions may be used to convert the IPv6 address in the ucLocalAddr /// member to a string without loading the Windows Sockets DLL. /// /// /// The dwLocalScopeId member is in network byte order. In order to use the dwLocalScopeId member, the ntohl or /// inet_ntoa functions in Windows Sockets or similar functions may be needed. /// /// /// The dwLocalPort member are in network byte order. In order to use the dwLocalPort member, the ntohs or inet_ntoa /// functions in Windows Sockets or similar functions may be needed. /// /// /// The MIB_UDP6TABLE_OWNER_PID structure contains the UDP listener table for IPv6 on the local computer. The name is based on the /// definition of this table in RFC 2454 published by the IETF. For more information, see http://www.ietf.org/rfc/rfc2454.txt. This /// table contains UDP endpoints for IPv6 that have been bound to an address. It should be noted that an application can create a UDP /// socket and bind it to an address for the sole purpose of sending a UDP datagram, with no intention of receiving packets using /// this socket (functioning as a listener). /// /// /// On the Microsoft Windows Software Development Kit (SDK) released for Windows Vista and later, the organization of header files /// has changed. This structure is defined in the Udpmib.h header file, not in the Iprtrmib.h header file. Note that the Udpmib.h /// header file is automatically included in Iprtrmib.h, which is automatically included in the Iphlpapi.h header file. The Udpmib.h /// and Iprtrmib.h header files should never be used directly. /// /// // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/udpmib/ns-udpmib-_mib_udp6row_owner_pid typedef struct // _MIB_UDP6ROW_OWNER_PID { UCHAR ucLocalAddr[16]; DWORD dwLocalScopeId; DWORD dwLocalPort; DWORD dwOwningPid; } // MIB_UDP6ROW_OWNER_PID, *PMIB_UDP6ROW_OWNER_PID; [PInvokeData("udpmib.h", MSDNShortId = "d3d02485-381b-4058-b4b9-0a2c9c365f43")] [StructLayout(LayoutKind.Sequential, Size = 28, Pack = 4)] public struct MIB_UDP6ROW_OWNER_PID { /// /// The IPv6 address for the local UDP endpoint. This member is stored in a character array in network byte order. /// /// A value of zero indicates a UDP listener willing to accept datagrams for any IP interface associated with the local computer. /// /// public IN6_ADDR ucLocalAddr; /// /// /// The scope ID for the IPv6 address of the UDP endpoint on the local computer. This member is stored in network byte order. /// /// public uint dwLocalScopeId; /// /// The port number of the UDP endpoint on the local computer. This member is stored in network byte order. /// public uint dwLocalPort; /// /// /// The PID of the process that issued a context bind for this endpoint. If this value is set to 0, the information for this /// endpoint is unavailable. /// /// public uint dwOwningPid; } /// /// /// The MIB_UDPROW structure contains an entry from the User Datagram Protocol (UDP) listener table for IPv4 on the local computer. /// /// /// /// /// The GetUdpTable function retrieves the IPv4 UDP listener table on the local computer and returns this information in a /// MIB_UDPTABLE structure. /// /// An array of MIB_UDPROW structures are contained in the MIB_UDPTABLE structure. /// /// The dwLocalAddr member is stored as a DWORD in the same format as the in_addr structure. In order to use the /// dwLocalAddr member, the ntohl or inet_ntoa functions in Windows Sockets or similar functions may be needed. On Windows /// Vista and later, the RtlIpv4AddressToString or RtlIpv4AddressToStringEx functions may be used to convert the IPv4 address in the /// dwLocalAddr member to a string without loading the Windows Sockets DLL. /// /// /// The dwLocalPort member is in network byte order. In order to use the dwLocalPort member, the ntohs or inet_ntoa /// functions in Windows Sockets or similar functions may be needed. /// /// /// The MIB_UDPTABLE structure contains the UDP listener table for IPv4 on the local computer. The name is based on the definition of /// this table in RFC 1213 published by the IETF. For more information, see http://www.ietf.org/rfc/rfc1213.txt. This table contains /// UDP endpoints for IPv4 that have been bound to an address. It should be noted that an application can create a UDP socket and /// bind it to an address for the sole purpose of sending a UDP datagram, with no intention of receiving packets using this socket /// (functioning as a listener). /// /// /// On the Microsoft Windows Software Development Kit (SDK) released for Windows Vista and later, the organization of header files /// has changed. This structure is defined in the Udpmib.h header file, not in the Iprtrmib.h header file. Note that the Udpmib.h /// header file is automatically included in Iprtrmib.h, which is automatically included in the Iphlpapi.h header file. The Udpmib.h /// and Iprtrmib.h header files should never be used directly. /// /// // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/udpmib/ns-udpmib-_mib_udprow typedef struct _MIB_UDPROW { // DWORD dwLocalAddr; DWORD dwLocalPort; } MIB_UDPROW, *PMIB_UDPROW; [PInvokeData("udpmib.h", MSDNShortId = "db366802-962f-4e83-838e-1e2f51beab92")] [StructLayout(LayoutKind.Sequential, Pack = 4)] public struct MIB_UDPROW { /// /// The IPv4 address of the UDP endpoint on the local computer. /// /// A value of zero indicates a UDP listener willing to accept datagrams for any IP interface associated with the local computer. /// /// public IN_ADDR dwLocalAddr; /// /// The port number of the UDP endpoint on the local computer. This member is stored in network byte order. /// public uint dwLocalPort; } /// /// /// The MIB_UDPROW_OWNER_MODULE structure contains an entry from the IPv4 User Datagram Protocol (UDP) listener table on the /// local computer. This entry also also includes any available ownership data and the process ID (PID) that issued the call to the /// bind function for the UDP endpoint. /// /// /// /// /// The MIB_UDPTABLE_OWNER_MODULE structure is returned by a call to GetExtendedUdpTable with the TableClass parameter set to /// UDP_TABLE_OWNER_MODULE from the UDP_TABLE_CLASS enumeration and the ulAf parameter set to AF_INET. The /// MIB_UDPTABLE_OWNER_MODULE structure contains an array of MIB_UDPROW_OWNER_MODULE structures. /// /// /// The dwLocalAddr member is stored as a DWORD in the same format as the in_addr structure. In order to use the /// dwLocalAddr member, the ntohl or inet_ntoa functions in Windows Sockets or similar functions may be needed. On Windows /// Vista and later, the RtlIpv4AddressToString or RtlIpv4AddressToStringEx functions may be used to convert the IPv4 address in the /// dwLocalAddr member to a string without loading the Windows Sockets DLL. /// /// /// The dwLocalPort member is in network byte order. In order to use the dwLocalPort member, the ntohs or inet_ntoa /// functions in Windows Sockets or similar functions may be needed. /// /// /// The MIB_UDPTABLE_OWNER_MODULE structure contains the UDP listener table for IPv4 on the local computer. The name is based on the /// definition of this table in RFC 1213 published by the IETF. For more information, see http://www.ietf.org/rfc/rfc1213.txt. This /// table contains UDP endpoints for IPv4 that have been bound to an address. It should be noted that an application can create a UDP /// socket and bind it to an address for the sole purpose of sending a UDP datagram, with no intention of receiving packets using /// this socket (functioning as a listener). /// /// /// On the Microsoft Windows Software Development Kit (SDK) released for Windows Vista and later, the organization of header files /// has changed. This structure is defined in the Udpmib.h header file, not in the Iprtrmib.h header file. Note that the Udpmib.h /// header file is automatically included in Iprtrmib.h, which is automatically included in the Iphlpapi.h header file. The Udpmib.h /// and Iprtrmib.h header files should never be used directly. /// /// // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/udpmib/ns-udpmib-_mib_udprow_owner_module typedef struct // _MIB_UDPROW_OWNER_MODULE { DWORD dwLocalAddr; DWORD dwLocalPort; DWORD dwOwningPid; LARGE_INTEGER liCreateTimestamp; union { // struct { int SpecificPortBind : 1; }; int dwFlags; }; ULONGLONG OwningModuleInfo[TCPIP_OWNING_MODULE_SIZE]; } // MIB_UDPROW_OWNER_MODULE, *PMIB_UDPROW_OWNER_MODULE; [PInvokeData("udpmib.h", MSDNShortId = "9ae304e0-4653-4757-a823-d4ccf68627bf")] [StructLayout(LayoutKind.Sequential, Pack = 8)] public struct MIB_UDPROW_OWNER_MODULE { /// /// Type: DWORD /// The IPv4 address of the UDP endpoint on the local computer. /// /// A value of zero indicates a UDP listener willing to accept datagrams for any IP interface associated with the local computer. /// /// public IN_ADDR dwLocalAddr; /// /// Type: DWORD /// The port number of the UDP endpoint on the local computer. This member is stored in network byte order. /// public uint dwLocalPort; /// /// Type: DWORD /// /// The PID of the process that issued the call to the bind function for the UDP endpoint. This member is set to 0 when the PID /// is unavailable. /// /// public uint dwOwningPid; private uint padding; /// /// Type: LARGE_INTEGER /// A FILETIME structure that indicates when the call to the bind function for the UDP endpoint occurred. /// NOTE: The Microsoft documentation suggests this is a SYSTEMTIME structure. This is incorrect. /// public FILETIME liCreateTimestamp; /// Undocumented. public int SpecificPortBind; /// /// Type: ULONGLONG[TCPIP_OWNING_MODULE_SIZE] /// An array of opaque data that contains ownership information. /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = TCPIP_OWNING_MODULE_SIZE)] public ulong[] OwningModuleInfo; } /// /// /// The MIB_UDPROW_OWNER_PID structure contains an entry from the User Datagram Protocol (UDP) listener table for IPv4 on the /// local computer. The entry also includes the process ID (PID) that issued the call to the bind function for the UDP endpoint. /// /// /// /// /// The MIB_UDPTABLE_OWNER_PID structure is returned by a call to GetExtendedUdpTable with the TableClass parameter set to /// UDP_TABLE_OWNER_PID and the ulAf parameter set to AF_INET. The MIB_UDPTABLE_OWNER_PID structure contains an /// array of MIB_UDPROW_OWNER_PID structures. /// /// /// The dwLocalAddr member is stored as a DWORD in the same format as the in_addr structure. In order to use the /// dwLocalAddr member, the ntohl or inet_ntoa functions in Windows Sockets or similar functions may be needed. On Windows /// Vista and later, the RtlIpv4AddressToString or RtlIpv4AddressToStringEx functions may be used to convert the IPv4 address in the /// dwLocalAddr member to a string without loading the Windows Sockets DLL. /// /// /// The dwLocalPort member is in network byte order. In order to use the dwLocalPort member, the ntohs or inet_ntoa /// functions in Windows Sockets or similar functions may be needed. /// /// /// The MIB_UDPTABLE_OWNER_PID structure contains the UDP listener table for IPv4 on the local computer. The name is based on the /// definition of this table in RFC 1213 published by the IETF. For more information, see http://www.ietf.org/rfc/rfc1213.txt. This /// table contains UDP endpoints for IPv4 that have been bound to an address. It should be noted that an application can create a UDP /// socket and bind it to an address for the sole purpose of sending a UDP datagram, with no intention of receiving packets using /// this socket (functioning as a listener). /// /// /// On the Microsoft Windows Software Development Kit (SDK) released for Windows Vista and later, the organization of header files /// has changed. This structure is defined in the Udpmib.h header file, not in the Iprtrmib.h header file. Note that the Udpmib.h /// header file is automatically included in Iprtrmib.h, which is automatically included in the Iphlpapi.h header file. The Udpmib.h /// and Iprtrmib.h header files should never be used directly. /// /// // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/udpmib/ns-udpmib-_mib_udprow_owner_pid typedef struct // _MIB_UDPROW_OWNER_PID { DWORD dwLocalAddr; DWORD dwLocalPort; DWORD dwOwningPid; } MIB_UDPROW_OWNER_PID, *PMIB_UDPROW_OWNER_PID; [PInvokeData("udpmib.h", MSDNShortId = "b914b6eb-adf9-4a61-ae8f-05d3ff90ce90")] [StructLayout(LayoutKind.Sequential, Pack = 4)] public struct MIB_UDPROW_OWNER_PID { /// /// The IPv4 address of the UDP endpoint on the local computer. /// /// A value of zero indicates a UDP listener willing to accept datagrams for any IP interface associated with the local computer. /// /// public IN_ADDR dwLocalAddr; /// /// The port number of the UDP endpoint on the local computer. This member is stored in network byte order. /// public uint dwLocalPort; /// /// /// The PID of the process that issued the call to the bind function for the UDP endpoint. This member is set to 0 when the PID /// is unavailable. /// /// public uint dwOwningPid; } /// /// The MIB_UDPSTATS structure contains statistics for the User Datagram Protocol (UDP) running on the local computer. /// /// /// The GetUdpStatistics function returns a pointer to a MIB_UDPSTATS structure. /// /// On the Microsoft Windows Software Development Kit (SDK) released for Windows Vista and later, the organization of header files /// has changed. This structure is defined in the Udpmib.h header file, not in the Iprtrmib.h header file. Note that the Udpmib.h /// header file is automatically included in Iprtrmib.h, which is automatically included in the Iphlpapi.h header file. The Udpmib.h /// and Iprtrmib.h header files should never be used directly. /// /// // https://docs.microsoft.com/en-us/windows/desktop/api/udpmib/ns-udpmib-_mib_udpstats typedef struct _MIB_UDPSTATS { DWORD // dwInDatagrams; DWORD dwNoPorts; DWORD dwInErrors; DWORD dwOutDatagrams; DWORD dwNumAddrs; } MIB_UDPSTATS, *PMIB_UDPSTATS; [PInvokeData("udpmib.h", MSDNShortId = "128bae44-59a2-4e37-a588-a18805b9e340")] [StructLayout(LayoutKind.Sequential)] public struct MIB_UDPSTATS { /// The number of datagrams received. public uint dwInDatagrams; /// The number of datagrams received that were discarded because the port specified was invalid. public uint dwNoPorts; /// /// The number of erroneous datagrams received. This number does not include the value contained by the dwNoPorts member. /// public uint dwInErrors; /// The number of datagrams transmitted. public uint dwOutDatagrams; /// The number of entries in the UDP listener table. public uint dwNumAddrs; } /// /// /// [Some information relates to pre-released product which may be substantially modified before it's commercially released. /// Microsoft makes no warranties, express or implied, with respect to the information provided here.] /// /// /// The MIB_UDPSTATS2 structure contains statistics for the User Datagram Protocol (UDP) running on the local computer. This /// structure is different from MIB_UDPSTATS structure in that it uses 64-bit counters, rather than 32-bit counters. /// /// /// The GetUdpStatisticsEx2 function returns a pointer to a MIB_UDPSTATS2 structure. // https://docs.microsoft.com/en-us/windows/desktop/api/udpmib/ns-udpmib-mib_udpstats2 typedef struct _MIB_UDPSTATS2 { DWORD64 // dw64InDatagrams; DWORD dwNoPorts; DWORD dwInErrors; DWORD64 dw64OutDatagrams; DWORD dwNumAddrs; } MIB_UDPSTATS2, *PMIB_UDPSTATS2; [PInvokeData("udpmib.h", MSDNShortId = "A225E0E7-54FB-4655-9A45-F3EF6DA1FF4E")] [StructLayout(LayoutKind.Sequential)] public struct MIB_UDPSTATS2 { /// The number of datagrams received. public ulong dw64InDatagrams; /// The number of datagrams received that were discarded because the port specified was invalid. public uint dwNoPorts; /// /// The number of erroneous datagrams received. This number does not include the value contained by the dwNoPorts member. /// public uint dwInErrors; /// The number of datagrams transmitted. public ulong dw64OutDatagrams; /// The number of entries in the UDP listener table. public uint dwNumAddrs; } /// /// The MIB_UDP6TABLE structure contains the User Datagram Protocol (UDP) listener table for IPv6 on the local computer. /// /// /// /// The GetUdp6Table function enumerates the UDP endpoints for IPv6 that have been bound to an address on the local computer and /// returns this information in a MIB_UDP6TABLE structure. /// /// /// This table includes the local IPv6 address, scope ID, and port information for sending and receiving UDP datagrams on the local /// computer. An array of MIB_UDP6ROW structures are contained in the MIB_UDP6TABLE structure. /// /// /// The MIB_UDP6TABLE structure may contain padding for alignment between the dwNumEntries member and the first /// MIB_UDP6ROW array entry in the table member. Padding for alignment may also be present between the MIB_UDP6ROW /// array entries in the table member. Any access to a MIB_UDP6ROW array entry should assume padding may exist. /// /// /// The MIB_UDP6TABLE structure contains the UDP listener table for IPv6 on the local computer. The name is based on the /// definition of this table in RFC 2454 published by the IETF. For more information, see http://www.ietf.org/rfc/rfc2454.txt. This /// table contains UDP endpoints for IPv6 that have been bound to an address. It should be noted that an application can create a UDP /// socket and bind it to an address for the sole purpose of sending a UDP datagram, with no intention of receiving packets using /// this socket (functioning as a listener). /// /// /// The MIB_UDP6TABLE_OWNER_MODULE structure is an enhanced version of the MIB_UDP6TABLE_OWNER_PID structure that includes any /// available ownership data for each UDP endpoint in the table. The MIB_UDP6TABLE_OWNER_PID is an enhanced version of the /// MIB_UDP6TABLE that includes the process ID (PID) that issued the call to the bind function for each UDP endpoint in the table. /// /// // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/udpmib/ns-udpmib-_mib_udp6table typedef struct // _MIB_UDP6TABLE { DWORD dwNumEntries; MIB_UDP6ROW table[ANY_SIZE]; } MIB_UDP6TABLE, *PMIB_UDP6TABLE; [PInvokeData("udpmib.h", MSDNShortId = "49da9a1f-f244-464e-96b2-944a286445d4")] [CorrespondingType(typeof(MIB_UDP6ROW))] [DefaultProperty(nameof(table))] public class MIB_UDP6TABLE : SafeElementArray { /// Initializes a new instance of the class. /// Amount of space, in bytes, to reserve. public MIB_UDP6TABLE(uint byteSize) : base((int)byteSize, 0) { } /// /// The number of entries in the table. /// public uint dwNumEntries => Count; /// /// A pointer to an array of MIB_UDP6ROW structures. /// public MIB_UDP6ROW[] table { get => Elements; set => Elements = value; } /// Performs an implicit conversion from to . /// The MIB_UDP6TABLE instance. /// The result of the conversion. public static implicit operator IntPtr(MIB_UDP6TABLE table) => table.DangerousGetHandle(); } /// /// /// The MIB_UDP6TABLE_OWNER_MODULE structure contains the User Datagram Protocol (UDP) listener table for IPv6 on the local /// computer. The table also includes any available ownership data and the process ID (PID) that issued the call to the bind function /// for each UDP endpoint. /// /// /// /// /// The MIB_UDP6TABLE_OWNER_MODULE structure is returned by a call to GetExtendedUdpTable with the TableClass parameter set to /// a UDP_TABLE_OWNER_MODULE from the UDP_TABLE_CLASS enumeration and the ulAf parameter set to AF_INET6. The /// MIB_UDP6TABLE_OWNER_MODULE structure contains an array of MIB_UDP6ROW_OWNER_MODULE structures. /// /// /// The MIB_UDP6TABLE_OWNER_MODULE structure may contain padding for alignment between the dwNumEntries member and the /// first MIB_UDP6ROW_OWNER_MODULE array entry in the table member. Padding for alignment may also be present between the /// MIB_UDP6ROW_OWNER_MODULE array entries in the table member. Any access to a MIB_UDP6ROW_OWNER_MODULE array /// entry should assume padding may exist. /// /// /// The MIB_UDP6TABLE_OWNER_MODULE structure contains the UDP listener table for IPv6 on the local computer. The name is based /// on the definition of this table in RFC 2454 published by the IETF. For more information, see http://www.ietf.org/rfc/rfc2454.txt. /// This table contains UDP endpoints for IPv6 that have been bound to an address. It should be noted that an application can create /// a UDP socket and bind it to an address for the sole purpose of sending a UDP datagram, with no intention of receiving packets /// using this socket (functioning as a listener). /// /// /// The MIB_UDP6TABLE_OWNER_MODULE structure is an enhanced version of the MIB_UDP6TABLE_OWNER_PID structure that includes any /// available ownership data for each UDP endpoint in the table. The MIB_UDP6TABLE_OWNER_PID is an enhanced version of the /// MIB_UDP6TABLE that includes the process ID (PID) that issued the call to the bind function for each UDP endpoint in the table. /// /// /// On the Microsoft Windows Software Development Kit (SDK) released for Windows Vista and later, the organization of header files /// has changed. This structure is defined in the Udpmib.h header file, not in the Iprtrmib.h header file. Note that the Udpmib.h /// header file is automatically included in Iprtrmib.h, which is automatically included in the Iphlpapi.h header file. The Udpmib.h /// and Iprtrmib.h header files should never be used directly. /// /// // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/udpmib/ns-udpmib-_mib_udp6table_owner_module typedef struct // _MIB_UDP6TABLE_OWNER_MODULE { DWORD dwNumEntries; MIB_UDP6ROW_OWNER_MODULE table[ANY_SIZE]; } MIB_UDP6TABLE_OWNER_MODULE, *PMIB_UDP6TABLE_OWNER_MODULE; [PInvokeData("udpmib.h", MSDNShortId = "11bf2d6d-b9bc-4a4d-b7b0-6f7d61eb3756")] [CorrespondingType(typeof(MIB_UDP6ROW_OWNER_MODULE))] [DefaultProperty(nameof(table))] public class MIB_UDP6TABLE_OWNER_MODULE : SafeElementArray { /// Initializes a new instance of the class. /// Amount of space, in bytes, to reserve. public MIB_UDP6TABLE_OWNER_MODULE(uint byteSize) : base((int)byteSize, 0) { } /// /// The number of MIB_UDP6ROW_OWNER_MODULE elements in table. /// public uint dwNumEntries => (uint)Count; /// /// An array of MIB_UDP6ROW_OWNER_MODULE structures returned by a call to GetExtendedUdpTable. /// public MIB_UDP6ROW_OWNER_MODULE[] table { get => Elements; set => Elements = value; } /// Performs an implicit conversion from to . /// The MIB_UDP6TABLE_OWNER_MODULE instance. /// The result of the conversion. public static implicit operator IntPtr(MIB_UDP6TABLE_OWNER_MODULE table) => table.DangerousGetHandle(); } /// /// /// The MIB_UDP6TABLE_OWNER_PID structure contains the User Datagram Protocol (UDP) listener table for IPv6 on the local /// computer. The table also includes the process ID (PID) that issued the call to the bind function for each UDP endpoint. /// /// /// /// /// The MIB_UDP6TABLE_OWNER_PID structure is returned by a call to GetExtendedUdpTable with the TableClass parameter set to a /// UDP_TABLE_OWNER_PID from the UDP_TABLE_CLASS enumeration and the ulAf parameter set to AF_INET6. The /// MIB_UDP6TABLE_OWNER_PID structure contains an array of MIB_UDP6ROW_OWNER_PID structures. /// /// /// The MIB_UDP6TABLE_OWNER_PID structure may contain padding for alignment between the dwNumEntries member and the /// first MIB_UDP6ROW_OWNER_PID array entry in the table member. Padding for alignment may also be present between the /// MIB_UDP6ROW_OWNER_PID array entries in the table member. Any access to a MIB_UDP6ROW_OWNER_PID array entry /// should assume padding may exist. /// /// /// The MIB_UDP6TABLE_OWNER_PID structure contains the UDP listener table for IPv6 on the local computer. The name is based on /// the definition of this table in RFC 2454 published by the IETF. For more information, see http://www.ietf.org/rfc/rfc2454.txt. /// This table contains UDP endpoints for IPv6 that have been bound to an address. It should be noted that an application can create /// a UDP socket and bind it to an address for the sole purpose of sending a UDP datagram, with no intention of receiving packets /// using this socket (functioning as a listener). /// /// /// The MIB_UDP6TABLE_OWNER_MODULE structure is an enhanced version of the MIB_UDP6TABLE_OWNER_PID structure that includes any /// available ownership data for each UDP endpoint in the table. The MIB_UDP6TABLE_OWNER_PID is an enhanced version of the /// MIB_UDP6TABLE that includes the process ID (PID) that issued the call to the bind function for each UDP endpoint in the table. /// /// /// On the Microsoft Windows Software Development Kit (SDK) released for Windows Vista and later, the organization of header files /// has changed. This structure is defined in the Udpmib.h header file, not in the Iprtrmib.h header file. Note that the Udpmib.h /// header file is automatically included in Iprtrmib.h, which is automatically included in the Iphlpapi.h header file. The Udpmib.h /// and Iprtrmib.h header files should never be used directly. /// /// // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/udpmib/ns-udpmib-_mib_udp6table_owner_pid typedef struct // _MIB_UDP6TABLE_OWNER_PID { DWORD dwNumEntries; MIB_UDP6ROW_OWNER_PID table[ANY_SIZE]; } MIB_UDP6TABLE_OWNER_PID, *PMIB_UDP6TABLE_OWNER_PID; [PInvokeData("udpmib.h", MSDNShortId = "6c8d1cb9-209b-47a0-b41c-6b4098a4a81e")] [CorrespondingType(typeof(MIB_UDP6ROW_OWNER_PID))] [DefaultProperty(nameof(table))] public class MIB_UDP6TABLE_OWNER_PID : SafeElementArray { /// Initializes a new instance of the class. /// Amount of space, in bytes, to reserve. public MIB_UDP6TABLE_OWNER_PID(uint byteSize) : base((int)byteSize, 0) { } /// The number of MIB_UDP6ROW_OWNER_PID elements in table. public uint dwNumEntries => Count; /// An array of MIB_UDP6ROW_OWNER_PID structures returned by a call to GetExtendedUdpTable. public MIB_UDP6ROW_OWNER_PID[] table { get => Elements; set => Elements = value; } /// Performs an implicit conversion from to . /// The MIB_UDP6TABLE_OWNER_PID instance. /// The result of the conversion. public static implicit operator IntPtr(MIB_UDP6TABLE_OWNER_PID table) => table.DangerousGetHandle(); } /// /// The MIB_UDPTABLE structure contains the User Datagram Protocol (UDP) listener table for IPv4 on the local computer. /// /// /// /// The GetUdpTable function enumerates the table of UDP endpoints for IPv4 that have been bound to an address on the local computer /// and returns this information in a MIB_UDPTABLE structure. /// /// /// This table includes the local IPv4 address and port information for sending and receiving UDP datagrams on the local computer. An /// array of MIB_UDPROW structures are contained in the MIB_UDPTABLE structure. /// /// /// The MIB_UDPTABLE structure may contain padding for alignment between the dwNumEntries member and the first /// MIB_UDPROW array entry in the table member. Padding for alignment may also be present between the MIB_UDPROW array /// entries in the table member. Any access to a MIB_UDPROW array entry should assume padding may exist. /// /// /// The MIB_UDPTABLE structure contains the UDP listener table for IPv4 on the local computer. The name is based on the /// definition of this table in RFC 1213 published by the IETF. For more information, see http://www.ietf.org/rfc/rfc1213.txt. This /// table contains UDP endpoints for IPv4 that have been bound to an address. It should be noted that an application can create a UDP /// socket and bind it to an address for the sole purpose of sending a UDP datagram, with no intention of receiving packets using /// this socket (functioning as a listener). /// /// /// The MIB_UDPTABLE_OWNER_MODULE structure is an enhanced version of the MIB_UDPTABLE_OWNER_PID structure that includes any /// available ownership data for each UDP endpoint in the table. The MIB_UDPTABLE_OWNER_PID is an enhanced version of the /// MIB_UDPTABLE that includes the process ID (PID) that issued the call to the bind function for each UDP endpoint in the table. /// /// /// On the Microsoft Windows Software Development Kit (SDK) released for Windows Vista and later, the organization of header files /// has changed. This structure is defined in the Udpmib.h header file, not in the Iprtrmib.h header file. Note that the Udpmib.h /// header file is automatically included in Iprtrmib.h, which is automatically included in the Iphlpapi.h header file. The Udpmib.h /// and Iprtrmib.h header files should never be used directly. /// /// // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/udpmib/ns-udpmib-_mib_udptable typedef struct _MIB_UDPTABLE // { DWORD dwNumEntries; MIB_UDPROW table[ANY_SIZE]; } MIB_UDPTABLE, *PMIB_UDPTABLE; [PInvokeData("udpmib.h", MSDNShortId = "83608d38-e352-483a-b284-2f9cb444e64f")] [CorrespondingType(typeof(MIB_UDPROW))] [DefaultProperty(nameof(table))] public class MIB_UDPTABLE : SafeElementArray { /// Initializes a new instance of the class. /// Amount of space, in bytes, to reserve. public MIB_UDPTABLE(uint byteSize) : base((int)byteSize, 0) { } /// /// The number of entries in the table. /// public uint dwNumEntries => Count; /// /// A pointer to an array of MIB_UDPROW structures. /// public MIB_UDPROW[] table { get => Elements; set => Elements = value; } /// Performs an implicit conversion from to . /// The MIB_UDPTABLE instance. /// The result of the conversion. public static implicit operator IntPtr(MIB_UDPTABLE table) => table.DangerousGetHandle(); } /// /// /// The MIB_UDPTABLE_OWNER_MODULE structure contains the User Datagram Protocol (UDP) listener table for IPv4 on the local /// computer. The table also includes any available ownership data and the process ID (PID) that issued the call to the bind function /// for each UDP endpoint. /// /// /// /// /// The MIB_UDPTABLE_OWNER_MODULE structure is returned by a call to GetExtendedUdpTable with the TableClass parameter set to /// UDP_TABLE_OWNER_MODULE from the UDP_TABLE_CLASS enumeration and the ulAf parameter set to AF_INET4. The /// MIB_UDPTABLE_OWNER_MODULE structure contains an array of MIB_UDPROW_OWNER_MODULE structures. /// /// /// The MIB_UDPTABLE_OWNER_MODULE structure may contain padding for alignment between the dwNumEntries member and the /// first MIB_UDPROW_OWNER_MODULE array entry in the table member. Padding for alignment may also be present between the /// MIB_UDPROW_OWNER_MODULE array entries in the table member. Any access to a MIB_UDPROW_OWNER_MODULE array /// entry should assume padding may exist. /// /// /// The MIB_UDPTABLE_OWNER_MODULE structure contains the UDP listener table for IPv4 on the local computer. The name is based /// on the definition of this table in RFC 1213 published by the IETF. For more information, see http://www.ietf.org/rfc/rfc1213.txt. /// This table contains UDP endpoints for IPv4 that have been bound to an address. It should be noted that an application can create /// a UDP socket and bind it to an address for the sole purpose of sending a UDP datagram, with no intention of receiving packets /// using this socket (functioning as a listener). /// /// /// The MIB_UDPTABLE_OWNER_MODULE structure is an enhanced version of the MIB_UDPTABLE_OWNER_PID structure that includes any /// available ownership data for each UDP endpoint in the table. The MIB_UDPTABLE_OWNER_PID is an enhanced version of the /// MIB_UDPTABLE that includes the process ID (PID) that issued the call to the bind function for each UDP endpoint in the table. /// /// /// On the Microsoft Windows Software Development Kit (SDK) released for Windows Vista and later, the organization of header files /// has changed. This structure is defined in the Udpmib.h header file, not in the Iprtrmib.h header file. Note that the Udpmib.h /// header file is automatically included in Iprtrmib.h, which is automatically included in the Iphlpapi.h header file. The Udpmib.h /// and Iprtrmib.h header files should never be used directly. /// /// // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/udpmib/ns-udpmib-_mib_udptable_owner_module typedef struct // _MIB_UDPTABLE_OWNER_MODULE { DWORD dwNumEntries; MIB_UDPROW_OWNER_MODULE table[ANY_SIZE]; } MIB_UDPTABLE_OWNER_MODULE, *PMIB_UDPTABLE_OWNER_MODULE; [PInvokeData("udpmib.h", MSDNShortId = "909749d7-a6be-4b3a-b432-79a5aa6e3f4c")] [CorrespondingType(typeof(MIB_UDPROW_OWNER_MODULE))] [DefaultProperty(nameof(table))] public class MIB_UDPTABLE_OWNER_MODULE : SafeElementArray { /// Initializes a new instance of the class. /// Amount of space, in bytes, to reserve. public MIB_UDPTABLE_OWNER_MODULE(uint byteSize) : base((int)byteSize, 0) { } /// /// The number of MIB_UDPROW_OWNER_MODULE elements in table. /// public uint dwNumEntries => (uint)Count; /// /// An array of MIB_UDPROW_OWNER_MODULE structures returned by a call to GetExtendedUdpTable. /// public MIB_UDPROW_OWNER_MODULE[] table { get => Elements; set => Elements = value; } /// Performs an implicit conversion from to . /// The MIB_UDPTABLE_OWNER_MODULE instance. /// The result of the conversion. public static implicit operator IntPtr(MIB_UDPTABLE_OWNER_MODULE table) => table.DangerousGetHandle(); } /// /// /// The MIB_UDPTABLE_OWNER_PID structure contains the User Datagram Protocol (UDP) listener table for IPv4 on the local /// computer. The table also includes the process ID (PID) that issued the call to the bind function for each UDP endpoint. /// /// /// /// /// The MIB_UDPTABLE_OWNER_PID structure is returned by a call to GetExtendedUdpTable with the TableClass parameter set to /// UDP_TABLE_OWNER_PID from the UDP_TABLE_CLASS enumeration and the ulAf parameter set to AF_INET4. The /// MIB_UDPTABLE_OWNER_PID structure contains an array of MIB_UDPROW_OWNER_PID structures. /// /// /// The MIB_UDPTABLE_OWNER_PID structure may contain padding for alignment between the dwNumEntries member and the /// first MIB_UDPROW_OWNER_PID array entry in the table member. Padding for alignment may also be present between the /// MIB_UDPROW_OWNER_PID array entries in the table member. Any access to a MIB_UDPROW_OWNER_PID array entry /// should assume padding may exist. /// /// /// The MIB_UDPTABLE_OWNER_PID structure contains the UDP listener table for IPv4 on the local computer. The name is based on /// the definition of this table in RFC 1213 published by the IETF. For more information, see http://www.ietf.org/rfc/rfc1213.txt. /// This table contains UDP endpoints for IPv4 that have been bound to an address. It should be noted that an application can create /// a UDP socket and bind it to an address for the sole purpose of sending a UDP datagram, with no intention of receiving packets /// using this socket (functioning as a listener). /// /// /// The MIB_UDPTABLE_OWNER_MODULE structure is an enhanced version of the MIB_UDPTABLE_OWNER_PID structure that includes any /// available ownership data for each UDP endpoint in the table. The MIB_UDPTABLE_OWNER_PID is an enhanced version of the /// MIB_UDPTABLE that includes the process ID (PID) that issued the call to the bind function for each UDP endpoint in the table. /// /// /// On the Microsoft Windows Software Development Kit (SDK) released for Windows Vista and later, the organization of header files /// has changed. This structure is defined in the Udpmib.h header file, not in the Iprtrmib.h header file. Note that the Udpmib.h /// header file is automatically included in Iprtrmib.h, which is automatically included in the Iphlpapi.h header file. The Udpmib.h /// and Iprtrmib.h header files should never be used directly. /// /// // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/udpmib/ns-udpmib-_mib_udptable_owner_pid typedef struct // _MIB_UDPTABLE_OWNER_PID { DWORD dwNumEntries; MIB_UDPROW_OWNER_PID table[ANY_SIZE]; } MIB_UDPTABLE_OWNER_PID, *PMIB_UDPTABLE_OWNER_PID; [PInvokeData("udpmib.h", MSDNShortId = "7c51a1e4-1e07-4fb1-8db3-e48229f12aca")] [CorrespondingType(typeof(MIB_UDPROW_OWNER_PID))] [DefaultProperty(nameof(table))] public class MIB_UDPTABLE_OWNER_PID : SafeElementArray { /// Initializes a new instance of the class. /// Amount of space, in bytes, to reserve. public MIB_UDPTABLE_OWNER_PID(uint byteSize) : base((int)byteSize, 0) { } /// /// The number of MIB_UDPROW_OWNER_PID elements in table. /// public uint dwNumEntries => Count; /// /// An array of MIB_UDPROW_OWNER_PID structures returned by a call to GetExtendedUdpTable. /// public MIB_UDPROW_OWNER_PID[] table { get => Elements; set => Elements = value; } /// Performs an implicit conversion from to . /// The MIB_UDPTABLE_OWNER_PID instance. /// The result of the conversion. public static implicit operator IntPtr(MIB_UDPTABLE_OWNER_PID table) => table.DangerousGetHandle(); } } }