Handling network addresses and encryption keys. More...
Functions | |
kvrStatus | kvrGetErrorText (kvrStatus error, char *buffer, uint32_t buffer_size) |
uint16_t | kvrGetVersion (void) |
kvrStatus | kvrStringFromAddress (char *buffer, uint32_t buffer_size, const kvrAddress *address) |
kvrStatus | kvrAddressFromString (int32_t address_type, kvrAddress *address, const char *address_string) |
kvrStatus | kvrWlanGetSecurityText (char *security_string, uint32_t security_string_size, uint32_t capability, uint32_t type_wpa, const kvrCipherInfoElement *wpa_info, const kvrCipherInfoElement *rsn_info) |
kvrStatus | kvrNetworkGenerateWepKeys (const char *pass_phrase, char *key64_1, char *key64_2, char *key64_3, char *key64_4, char *key128) |
kvrStatus | kvrNetworkGenerateWpaKeys (const char *pass_phrase, const char *ssid, char *key) |
Handling network addresses and encryption keys.
kvrStatus kvrAddressFromString | ( | int32_t | address_type, |
kvrAddress * | address, | ||
const char * | address_string | ||
) |
Convert a C string into a kvrAddress.
Examples:
[in] | address_type | kvrAddressType_xxx to convert into. |
[out] | address | Returned address. |
[in] | address_string | C string to convert into a kvrAddress. |
Convert a kvrStatus errorcode to a text.
[in] | error | The error code to convert. |
[out] | buffer | Buffer to receive error text. |
[in] | buffer_size | Buffer size in bytes. |
uint16_t kvrGetVersion | ( | void | ) |
Return the version of the kvrlib DLL. The most significant byte is the major version number and the least significant byte is the minor version number.
kvrStatus kvrNetworkGenerateWepKeys | ( | const char * | pass_phrase, |
char * | key64_1, | ||
char * | key64_2, | ||
char * | key64_3, | ||
char * | key64_4, | ||
char * | key128 | ||
) |
Generates four 64-bit and one 128-bit WEP keys.
All generated keys are returned as ASCII hexadecimal C strings.
[in] | pass_phrase | The pass phrase as a C string. |
[out] | key64_1 | Generated 64-bit WEP key 1 (10 + 1 bytes). |
[out] | key64_2 | Generated 64-bit WEP key 2 (10 + 1 bytes). |
[out] | key64_3 | Generated 64-bit WEP key 3 (10 + 1 bytes). |
[out] | key64_4 | Generated 64-bit WEP key 4 (10 + 1 bytes). |
[out] | key128 | Generated 128-bit WEP key (26 + 1 bytes). |
kvrStatus kvrNetworkGenerateWpaKeys | ( | const char * | pass_phrase, |
const char * | ssid, | ||
char * | key | ||
) |
kvrStatus kvrStringFromAddress | ( | char * | buffer, |
uint32_t | buffer_size, | ||
const kvrAddress * | address | ||
) |
Convert a kvrAddress to a text string. The output format depends on the kvrAddressType_xxx. buffer_size must be the maximum lenth for each type. i.e. kvrAddressType_IPV4 must have lenght at least 16.
[out] | buffer | The converted string as a C string. |
[in] | buffer_size | Size of buffer. |
[in] | address | The address to convert. |
kvrStatus kvrWlanGetSecurityText | ( | char * | security_string, |
uint32_t | security_string_size, | ||
uint32_t | capability, | ||
uint32_t | type_wpa, | ||
const kvrCipherInfoElement * | wpa_info, | ||
const kvrCipherInfoElement * | rsn_info | ||
) |
Returns a C string in human readable format from the security information gathered with kvrWlanGetScanResults()
Example output: "WPA2: G-TKIP (PSK) P1-AES P2-TKIP WPA: G-TKIP (PSK) P1-AES P2-TKIP"
The above example shows a network using Pre-Shared Key with both WPA2 and WPA enabled, for both modes, a group key using TKIP is needed, and in both modes you can choose between AES (CCMP) and TKIP as the cipher for the pairwise key.
The length of the generated string could theoretically be up to about 180 characters. If the length of the supplied security_string is too short, the result will be truncated and the function will return kvrERR_PARAMETER.
[out] | security_string | A C string. |
[in] | security_string_size | Max size of security_string. |
[in] | capability | The advertised capabilities of the BSS. |
[in] | type_wpa | Authentication suite type. |
[in] | wpa_info | Advertised information for WPA. |
[in] | rsn_info | Advertised information for RSN. |