1
0

net.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. /*++
  2. Copyright (c) 2014 Minoca Corp. All Rights Reserved
  3. Module Name:
  4. net.h
  5. Abstract:
  6. This header contains the device information structure format for
  7. networking devices.
  8. Author:
  9. Evan Green 9-May-2014
  10. --*/
  11. //
  12. // ------------------------------------------------------------------- Includes
  13. //
  14. //
  15. // ---------------------------------------------------------------- Definitions
  16. //
  17. #define NETWORK_DEVICE_INFORMATION_UUID \
  18. {{0x0EF6E8C6, 0xAE4B4B90, 0xA2D2D0F7, 0x9BE9F31A}}
  19. #define NETWORK_DEVICE_INFORMATION_VERSION 0x00010000
  20. //
  21. // Define network device information flags.
  22. //
  23. //
  24. // This flag is set if the device is connected to some sort of network.
  25. //
  26. #define NETWORK_DEVICE_FLAG_MEDIA_CONNECTED 0x00000001
  27. //
  28. // This flag is set if the device has a network address entry and is configured.
  29. //
  30. #define NETWORK_DEVICE_FLAG_CONFIGURED 0x00000002
  31. //
  32. // Define the maximum number of DNS servers to remember.
  33. //
  34. #define NETWORK_DEVICE_MAX_DNS_SERVERS 4
  35. //
  36. // Define the UUID and version for the 802.11 networking device information.
  37. //
  38. #define NETWORK_80211_DEVICE_INFORMATION_UUID \
  39. {{0xc927b054, 0xead311e5, 0x8ea20401, 0x0fdd7401}}
  40. #define NETWORK_80211_DEVICE_INFORMATION_VERSION 0x00010000
  41. //
  42. // Define the 802.11 network device information flags.
  43. //
  44. #define NETWORK_80211_DEVICE_FLAG_ASSOCIATED 0x00000001
  45. //
  46. // Define the maximum length of an SSID.
  47. //
  48. #define NETWORK_80211_MAX_SSID_LENGTH 32
  49. //
  50. // ------------------------------------------------------ Data Type Definitions
  51. //
  52. typedef enum _NETWORK_ADDRESS_CONFIGURATION_METHOD {
  53. NetworkAddressConfigurationInvalid,
  54. NetworkAddressConfigurationNone,
  55. NetworkAddressConfigurationStatic,
  56. NetworkAddressConfigurationDhcp
  57. } NETWORK_ADDRESS_CONFIGURATION_METHOD, *PNETWORK_ADDRESS_CONFIGURATION_METHOD;
  58. /*++
  59. Structure Description:
  60. This structure defines the information published by networking devices.
  61. Members:
  62. Version - Stores the table version. Future revisions will be backwards
  63. compatible. Set to NETWORK_DEVICE_INFORMATION_VERSION.
  64. Flags - Stores a bitfield of flags describing the network device. See
  65. NETWORK_DEVICE_FLAG_* definitions.
  66. Domain - Stores the socket network domain for which this information is
  67. valid. Network devices may be active on more than network domain
  68. simultaneously (IPv4 and IPv6 for example). The caller sets this to
  69. request information about a given network domain's configuration.
  70. ConfigurationMethod - Stores the method used to configure the address of
  71. this device.
  72. Address - Stores the network address of the link.
  73. Subnet - Stores the network subnet mask of the link.
  74. Gateway - Stores the default gateway network address for the link.
  75. DnsServer - Stores an array of network addresses of Domain Name Servers
  76. to try, in order.
  77. DnsServerCount - Stores the number of valid DNS servers in the array.
  78. PhysicalAddress - Stores the physical address of the link.
  79. LeaseServerAddress - Stores the network address of the server who provided
  80. the network address if it is a dynamic address.
  81. LeaseStartTime - Stores the time the lease on the network address began.
  82. This is only valid for dynamic address configuration methods.
  83. LeaseEndTime - Stores the time the lease on the network address ends. This
  84. is only valid for dynamic address configuration methods.
  85. --*/
  86. typedef struct _NETWORK_DEVICE_INFORMATION {
  87. ULONG Version;
  88. ULONG Flags;
  89. NET_DOMAIN_TYPE Domain;
  90. NETWORK_ADDRESS_CONFIGURATION_METHOD ConfigurationMethod;
  91. NETWORK_ADDRESS Address;
  92. NETWORK_ADDRESS Subnet;
  93. NETWORK_ADDRESS Gateway;
  94. NETWORK_ADDRESS DnsServers[NETWORK_DEVICE_MAX_DNS_SERVERS];
  95. ULONG DnsServerCount;
  96. NETWORK_ADDRESS PhysicalAddress;
  97. NETWORK_ADDRESS LeaseServerAddress;
  98. SYSTEM_TIME LeaseStartTime;
  99. SYSTEM_TIME LeaseEndTime;
  100. } NETWORK_DEVICE_INFORMATION, *PNETWORK_DEVICE_INFORMATION;
  101. typedef enum _NETWORK_ENCRYPTION_TYPE {
  102. NetworkEncryptionNone,
  103. NetworkEncryptionWep,
  104. NetworkEncryptionWpaPsk,
  105. NetworkEncryptionWpaEap,
  106. NetworkEncryptionWpa2Psk,
  107. NetworkEncryptionWpa2Eap,
  108. NetworkEncryptionInvalid
  109. } NETWORK_ENCRYPTION_TYPE, *PNETWORK_ENCRYPTION_TYPE;
  110. /*++
  111. Structure Description:
  112. This structure defines the information published by 802.11 networking
  113. devices.
  114. Members:
  115. Version - Stores the table version. Future revisions will be backwards
  116. compatible. Set to NETWORK_80211_DEVICE_INFORMATION_VERSION.
  117. Flags - Stores a bitfield of flags describing the 802.11 network device.
  118. See NETWORK_80211_DEVICE_FLAG_* for definitions.
  119. PhysicalAddress - Stores the physical address of the link.
  120. Bssid - Stores the BSSID of access point to which the device is associated,
  121. if applicable.
  122. Ssid - Stores the null-terminated SSID of the associated network.
  123. Channel - Stores the channel on which the network operates.
  124. MaxRate - Stores the maximum rate supported by the wireless network, in
  125. megabits per second.
  126. Rssi - Stores the received signal strength indication value for the BSS.
  127. PairwiseEncryption - Stores the pairwise encryption method used for the
  128. network connection.
  129. GroupEncryption - Stores the group encryption method used for the network
  130. connection.
  131. --*/
  132. typedef struct _NETWORK_80211_DEVICE_INFORMATION {
  133. ULONG Version;
  134. ULONG Flags;
  135. NETWORK_ADDRESS PhysicalAddress;
  136. NETWORK_ADDRESS Bssid;
  137. UCHAR Ssid[NETWORK_80211_MAX_SSID_LENGTH + 1];
  138. ULONG Channel;
  139. ULONGLONG MaxRate;
  140. LONG Rssi;
  141. NETWORK_ENCRYPTION_TYPE PairwiseEncryption;
  142. NETWORK_ENCRYPTION_TYPE GroupEncryption;
  143. } NETWORK_80211_DEVICE_INFORMATION, *PNETWORK_80211_DEVICE_INFORMATION;
  144. //
  145. // -------------------------------------------------------------------- Globals
  146. //
  147. //
  148. // -------------------------------------------------------- Function Prototypes
  149. //