net.h 6.1 KB

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