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) |
Detailed Description
Handling network addresses and encryption keys.
Function Documentation
kvrAddressFromString()
| kvrStatus kvrAddressFromString | ( | int32_t | address_type, |
| kvrAddress * | address, | ||
| const char * | address_string | ||
| ) |
Convert a C string into a kvrAddress.
Examples:
- MAC address
address_string: "90:E6:BA:3C:32:12"
type: kvrAddressType_MAC - IP v.4
address_string: "192.168.1.142"
type: kvrAddressType_IPV4 - IP v.4 with port
address_string: "192.168.1.142:8080"
type: kvrAddressType_IPV4_PORT
- Parameters
-
[in] address_type kvrAddressType_xxx to convert into. [out] address Returned address. [in] address_string C string to convert into a kvrAddress.
- Examples:
- example/c/kvrConnect.c.
kvrGetErrorText()
Convert a kvrStatus errorcode to a text.
- Parameters
-
[in] error The error code to convert. [out] buffer Buffer to receive error text. [in] buffer_size Buffer size in bytes.
- Examples:
- example/c/kvrConnect.c.
kvrGetVersion()
| 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.
- C#
- static Int16 kvrGetVersion();
- Delphi
- function kvrGetVersion: Word;
- Returns
- version number of kvrlib32.dll
kvrNetworkGenerateWepKeys()
| 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.
- Parameters
-
[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).
kvrNetworkGenerateWpaKeys()
| kvrStatus kvrNetworkGenerateWpaKeys | ( | const char * | pass_phrase, |
| const char * | ssid, | ||
| char * | key | ||
| ) |
kvrStringFromAddress()
| 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.
- Parameters
-
[out] buffer The converted string as a C string. [in] buffer_size Size of buffer. [in] address The address to convert.
- Examples:
- example/c/kvrConnect.c.
kvrWlanGetSecurityText()
| 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.
- Parameters
-
[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.
- Examples:
- example/c/kvrConfig.c.