|
wpa_supplicant / hostapd
2.5
|
Wi-Fi Direct - P2P group operations. More...
#include "includes.h"#include "common.h"#include "common/ieee802_11_defs.h"#include "common/ieee802_11_common.h"#include "common/wpa_ctrl.h"#include "wps/wps_defs.h"#include "wps/wps_i.h"#include "p2p_i.h"#include "p2p.h"Data Structures | |
| struct | p2p_group_member |
| struct | p2p_group |
| Internal P2P module per-group data. More... | |
Functions | |
| struct p2p_group * | p2p_group_init (struct p2p_data *p2p, struct p2p_group_config *config) |
| Initialize P2P group. More... | |
| void | p2p_group_deinit (struct p2p_group *group) |
| Deinitialize P2P group. More... | |
| void | p2p_buf_add_group_info (struct p2p_group *group, struct wpabuf *buf, int max_clients) |
| void | p2p_group_buf_add_id (struct p2p_group *group, struct wpabuf *buf) |
| void | p2p_group_update_ies (struct p2p_group *group) |
| int | p2p_group_notif_assoc (struct p2p_group *group, const u8 *addr, const u8 *ie, size_t len) |
| Notification of P2P client association with GO. More... | |
| struct wpabuf * | p2p_group_assoc_resp_ie (struct p2p_group *group, u8 status) |
| Build P2P IE for (re)association response. More... | |
| void | p2p_group_notif_disassoc (struct p2p_group *group, const u8 *addr) |
| Notification of P2P client disassociation from GO. More... | |
| int | p2p_group_match_dev_type (struct p2p_group *group, struct wpabuf *wps) |
| Match device types in group with requested type. More... | |
| int | p2p_group_match_dev_id (struct p2p_group *group, struct wpabuf *p2p) |
| Match P2P Device Address in group with requested device id. | |
| void | p2p_group_notif_formation_done (struct p2p_group *group) |
| Notification of completed group formation. More... | |
| int | p2p_group_notif_noa (struct p2p_group *group, const u8 *noa, size_t noa_len) |
| Notification of NoA change. More... | |
| const u8 * | p2p_group_get_dev_addr (struct p2p_group *group, const u8 *addr) |
| Get a P2P Device Address of a client in a group. More... | |
| int | p2p_group_go_discover (struct p2p_group *group, const u8 *dev_id, const u8 *searching_dev, int rx_freq) |
| Send GO Discoverability Request to a group client. More... | |
| const u8 * | p2p_group_get_interface_addr (struct p2p_group *group) |
| u8 | p2p_group_presence_req (struct p2p_group *group, const u8 *client_interface_addr, const u8 *noa, size_t noa_len) |
| unsigned int | p2p_get_group_num_members (struct p2p_group *group) |
| Get number of members in group. More... | |
| int | p2p_client_limit_reached (struct p2p_group *group) |
| Check if client limit is reached. More... | |
| const u8 * | p2p_iterate_group_members (struct p2p_group *group, void **next) |
| Iterate group members. More... | |
| int | p2p_group_is_client_connected (struct p2p_group *group, const u8 *dev_addr) |
| Check whether a specific client is connected. More... | |
| int | p2p_group_is_group_id_match (struct p2p_group *group, const u8 *group_id, size_t group_id_len) |
| void | p2p_group_force_beacon_update_ies (struct p2p_group *group) |
| int | p2p_group_get_freq (struct p2p_group *group) |
| const struct p2p_group_config * | p2p_group_get_config (struct p2p_group *group) |
| Get the group configuration. More... | |
| void | p2p_loop_on_all_groups (struct p2p_data *p2p, int(*group_callback)(struct p2p_group *group, void *user_data), void *user_data) |
| Run the given callback on all groups. More... | |
| int | p2p_group_get_common_freqs (struct p2p_group *group, int *common_freqs, unsigned int *num) |
| Get the group common frequencies. More... | |
Wi-Fi Direct - P2P group operations.
| int p2p_client_limit_reached | ( | struct p2p_group * | group | ) |
Check if client limit is reached.
| group | P2P group context from p2p_group_init() |
| unsigned int p2p_get_group_num_members | ( | struct p2p_group * | group | ) |
Get number of members in group.
| group | P2P group context from p2p_group_init() |
Build P2P IE for (re)association response.
| group | P2P group context from p2p_group_init() |
| status | Status value (P2P_SC_SUCCESS if association succeeded) |
The caller is responsible for freeing the returned buffer with wpabuf_free().
| void p2p_group_deinit | ( | struct p2p_group * | group | ) |
Deinitialize P2P group.
| group | P2P group context from p2p_group_init() |
| int p2p_group_get_common_freqs | ( | struct p2p_group * | group, |
| int * | common_freqs, | ||
| unsigned int * | num | ||
| ) |
Get the group common frequencies.
| group | P2P group context from p2p_group_init() |
| common_freqs | On return will hold the group common frequencies |
| num | On return will hold the number of group common frequencies |
| const struct p2p_group_config* p2p_group_get_config | ( | struct p2p_group * | group | ) |
Get the group configuration.
| group | P2P group context from p2p_group_init() |
| const u8* p2p_group_get_dev_addr | ( | struct p2p_group * | group, |
| const u8 * | addr | ||
| ) |
Get a P2P Device Address of a client in a group.
| group | P2P group context from p2p_group_init() |
| addr | P2P Interface Address of the client |
| int p2p_group_go_discover | ( | struct p2p_group * | group, |
| const u8 * | dev_id, | ||
| const u8 * | searching_dev, | ||
| int | rx_freq | ||
| ) |
Send GO Discoverability Request to a group client.
| group | P2P group context from p2p_group_init() |
| struct p2p_group* p2p_group_init | ( | struct p2p_data * | p2p, |
| struct p2p_group_config * | config | ||
| ) |
Initialize P2P group.
| p2p | P2P module context from p2p_init() |
| config | P2P group configuration (will be freed by p2p_group_deinit()) |
This function is used to initialize per-group P2P module context. Currently, this is only used to manage GO functionality and P2P clients do not need to create an instance of this per-group information.
| int p2p_group_is_client_connected | ( | struct p2p_group * | group, |
| const u8 * | dev_addr | ||
| ) |
Check whether a specific client is connected.
| group | P2P group context from p2p_group_init() |
| addr | P2P Device Address of the client |
Match device types in group with requested type.
| group | P2P group context from p2p_group_init() |
| wps | WPS TLVs from Probe Request frame (concatenated WPS IEs) |
This function can be used to match the Requested Device Type attribute in WPS IE with the device types of a group member for deciding whether a GO should reply to a Probe Request frame. Match will be reported if the WPS IE is not requested any specific device type.
| int p2p_group_notif_assoc | ( | struct p2p_group * | group, |
| const u8 * | addr, | ||
| const u8 * | ie, | ||
| size_t | len | ||
| ) |
Notification of P2P client association with GO.
| group | P2P group context from p2p_group_init() |
| addr | Interface address of the P2P client |
| ie | IEs from the (Re)association Request frame |
| len | Length of the ie buffer in octets |
| void p2p_group_notif_disassoc | ( | struct p2p_group * | group, |
| const u8 * | addr | ||
| ) |
Notification of P2P client disassociation from GO.
| group | P2P group context from p2p_group_init() |
| addr | Interface address of the P2P client |
| void p2p_group_notif_formation_done | ( | struct p2p_group * | group | ) |
Notification of completed group formation.
| group | P2P group context from p2p_group_init() |
| int p2p_group_notif_noa | ( | struct p2p_group * | group, |
| const u8 * | noa, | ||
| size_t | noa_len | ||
| ) |
Notification of NoA change.
| group | P2P group context from p2p_group_init() |
| noa | Notice of Absence attribute payload, NULL if none |
| noa_len | Length of noa buffer in octets |
Notify the P2P group management about a new NoA contents. This will be inserted into the P2P IEs in Beacon and Probe Response frames with rest of the group information.
| const u8* p2p_iterate_group_members | ( | struct p2p_group * | group, |
| void ** | next | ||
| ) |
Iterate group members.
| group | P2P group context from p2p_group_init() |
| next | iteration pointer, must be a pointer to a void * that is set to NULL on the first call and not modified later |
| void p2p_loop_on_all_groups | ( | struct p2p_data * | p2p, |
| int(*)(struct p2p_group *group, void *user_data) | group_callback, | ||
| void * | user_data | ||
| ) |
Run the given callback on all groups.
| p2p | P2P module context from p2p_init() |
| group_callback | The callback function pointer |
| user_data | Some user data pointer which can be NULL |
The group_callback function can stop the iteration by returning 0.
1.8.6