|
wpa_supplicant / hostapd 2.0
|
P2P - generic helper functions. More...
Functions | |
| int | p2p_random (char *buf, size_t len) |
| Generate random string for SSID and passphrase. | |
| int | p2p_channel_to_freq (const char *country, int reg_class, int channel) |
| Convert channel info to frequency. | |
| int | p2p_freq_to_channel (const char *country, unsigned int freq, u8 *reg_class, u8 *channel) |
| Convert frequency into channel info. | |
| void | p2p_channels_intersect (const struct p2p_channels *a, const struct p2p_channels *b, struct p2p_channels *res) |
| Intersection of supported channel lists. | |
| int | p2p_channels_includes (const struct p2p_channels *channels, u8 reg_class, u8 channel) |
| Check whether a channel is included in the list. | |
| int | p2p_supported_freq (struct p2p_data *p2p, unsigned int freq) |
| Check whether channel is supported for P2P. | |
P2P - generic helper functions.
This software may be distributed under the terms of the BSD license. See README for more details.
| int p2p_channel_to_freq | ( | const char * | country, |
| int | reg_class, | ||
| int | channel | ||
| ) |
Convert channel info to frequency.
| country | Country code |
| reg_class | Regulatory class |
| channel | Channel number |
| int p2p_channels_includes | ( | const struct p2p_channels * | channels, |
| u8 | reg_class, | ||
| u8 | channel | ||
| ) |
Check whether a channel is included in the list.
| channels | List of supported channels |
| reg_class | Regulatory class of the channel to search |
| channel | Channel number of the channel to search |
| void p2p_channels_intersect | ( | const struct p2p_channels * | a, |
| const struct p2p_channels * | b, | ||
| struct p2p_channels * | res | ||
| ) |
Intersection of supported channel lists.
| a | First set of supported channels |
| b | Second set of supported channels |
| res | Data structure for returning the intersection of support channels |
This function can be used to find a common set of supported channels. Both input channels sets are assumed to use the same country code. If different country codes are used, the regulatory class numbers may not be matched correctly and results are undefined.
| int p2p_freq_to_channel | ( | const char * | country, |
| unsigned int | freq, | ||
| u8 * | reg_class, | ||
| u8 * | channel | ||
| ) |
Convert frequency into channel info.
| country | Country code |
| reg_class | Buffer for returning regulatory class |
| channel | Buffer for returning channel number |
| int p2p_random | ( | char * | buf, |
| size_t | len | ||
| ) |
Generate random string for SSID and passphrase.
| buf | Buffer for returning the result |
| len | Number of octets to write to the buffer |
This function generates a random string using the following character set: 'A'-'Z', 'a'-'z', '0'-'9'.
| int p2p_supported_freq | ( | struct p2p_data * | p2p, |
| unsigned int | freq | ||
| ) |
Check whether channel is supported for P2P.
| p2p | P2P module context from p2p_init() |
| freq | Channel frequency in MHz |
1.7.3