wpa_supplicant / hostapd
2.5
|
P2P - generic helper functions. More...
#include "includes.h"
#include "common.h"
#include "common/defs.h"
#include "common/ieee802_11_common.h"
#include "p2p_i.h"
Functions | |
int | p2p_random (char *buf, size_t len) |
Generate random string for SSID and passphrase. More... | |
int | p2p_channel_to_freq (int op_class, int channel) |
Convert channel info to frequency. More... | |
int | p2p_freq_to_channel (unsigned int freq, u8 *op_class, u8 *channel) |
Convert frequency into channel info. More... | |
void | p2p_channels_intersect (const struct p2p_channels *a, const struct p2p_channels *b, struct p2p_channels *res) |
Intersection of supported channel lists. More... | |
void | p2p_channels_union_inplace (struct p2p_channels *res, const struct p2p_channels *b) |
Inplace union of channel lists. More... | |
void | p2p_channels_union (const struct p2p_channels *a, const struct p2p_channels *b, struct p2p_channels *res) |
Union of channel lists. More... | |
void | p2p_channels_remove_freqs (struct p2p_channels *chan, const struct wpa_freq_range_list *list) |
int | p2p_channels_includes (const struct p2p_channels *channels, u8 reg_class, u8 channel) |
Check whether a channel is included in the list. More... | |
int | p2p_channels_includes_freq (const struct p2p_channels *channels, unsigned int freq) |
int | p2p_supported_freq (struct p2p_data *p2p, unsigned int freq) |
Check whether channel is supported for P2P. More... | |
int | p2p_supported_freq_go (struct p2p_data *p2p, unsigned int freq) |
Check whether channel is supported for P2P GO operation. More... | |
int | p2p_supported_freq_cli (struct p2p_data *p2p, unsigned int freq) |
Check whether channel is supported for P2P client operation. More... | |
unsigned int | p2p_get_pref_freq (struct p2p_data *p2p, const struct p2p_channels *channels) |
Get channel from preferred channel list. More... | |
void | p2p_channels_dump (struct p2p_data *p2p, const char *title, const struct p2p_channels *chan) |
int | p2p_channel_select (struct p2p_channels *chans, const int *classes, u8 *op_class, u8 *op_channel) |
int | p2p_channel_random_social (struct p2p_channels *chans, u8 *op_class, u8 *op_channel) |
int | p2p_channels_to_freqs (const struct p2p_channels *channels, int *freq_list, unsigned int max_len) |
P2P - generic helper functions.
int p2p_channel_to_freq | ( | int | op_class, |
int | channel | ||
) |
Convert channel info to frequency.
op_class | Operating 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.
void p2p_channels_union | ( | const struct p2p_channels * | a, |
const struct p2p_channels * | b, | ||
struct p2p_channels * | res | ||
) |
Union of channel lists.
a | First set of channels |
b | Second set of channels |
res | Data structure for returning the union of channels |
void p2p_channels_union_inplace | ( | struct p2p_channels * | res, |
const struct p2p_channels * | b | ||
) |
Inplace union of channel lists.
res | Input data and place for returning union of the channel sets |
b | Second set of channels |
int p2p_freq_to_channel | ( | unsigned int | freq, |
u8 * | op_class, | ||
u8 * | channel | ||
) |
Convert frequency into channel info.
op_class | Buffer for returning operating class |
channel | Buffer for returning channel number |
unsigned int p2p_get_pref_freq | ( | struct p2p_data * | p2p, |
const struct p2p_channels * | channels | ||
) |
Get channel from preferred channel list.
p2p | P2P module context from p2p_init() |
channels | List of channels |
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 |
int p2p_supported_freq_cli | ( | struct p2p_data * | p2p, |
unsigned int | freq | ||
) |
Check whether channel is supported for P2P client operation.
p2p | P2P module context from p2p_init() |
freq | Channel frequency in MHz |
int p2p_supported_freq_go | ( | struct p2p_data * | p2p, |
unsigned int | freq | ||
) |
Check whether channel is supported for P2P GO operation.
p2p | P2P module context from p2p_init() |
freq | Channel frequency in MHz |