hostapd
Public Attributes | List of all members
p2p_config Struct Reference

struct p2p_config - P2P configuration More...

#include <p2p.h>

Public Attributes

char country [3]
 country - Country code to use in P2P operations
 
u8 reg_class
 reg_class - Regulatory class for own listen channel
 
u8 channel
 channel - Own listen channel
 
u8 channel_forced
 channel_forced - the listen channel was forced by configuration or by control interface and cannot be overridden
 
u8 op_reg_class
 Regulatory class for own operational channel.
 
u8 op_channel
 op_channel - Own operational channel
 
u8 cfg_op_channel
 cfg_op_channel - Whether op_channel is hardcoded in configuration
 
struct p2p_channels channels
 channels - Own supported regulatory classes and channels More...
 
struct p2p_channels cli_channels
 cli_channels - Additional client channels More...
 
unsigned int num_pref_chan
 num_pref_chan - Number of pref_chan entries
 
struct p2p_channelpref_chan
 pref_chan - Preferred channels for GO Negotiation
 
u8 pri_dev_type [8]
 pri_dev_type - Primary Device Type (see WPS)
 
u8 sec_dev_type [P2P_SEC_DEVICE_TYPES][8]
 sec_dev_type - Optional secondary device types
 
size_t num_sec_dev_types
 num_sec_dev_types - Number of sec_dev_type entries
 
u8 dev_addr [ETH_ALEN]
 dev_addr - P2P Device Address
 
char * dev_name
 dev_name - Device Name
 
char * manufacturer
 
char * model_name
 
char * model_number
 
char * serial_number
 
u8 uuid [16]
 
u16 config_methods
 
int concurrent_operations
 concurrent_operations - Whether concurrent operations are supported
 
size_t max_peers
 max_peers - Maximum number of discovered peers to remember More...
 
int p2p_intra_bss
 p2p_intra_bss - Intra BSS communication is supported
 
u8 ssid_postfix [SSID_MAX_LEN - 9]
 ssid_postfix - Postfix data to add to the SSID More...
 
size_t ssid_postfix_len
 ssid_postfix_len - Length of the ssid_postfix data
 
unsigned int max_listen
 max_listen - Maximum listen duration in ms
 
unsigned int passphrase_len
 passphrase_len - Passphrase length (8..63) More...
 
void * cb_ctx
 cb_ctx - Context to use with callback functions
 
void(* debug_print )(void *ctx, int level, const char *msg)
 debug_print - Debug print : Callback context from cb_ctx : Debug verbosity level (MSG_*) : Debug message
 
int(* p2p_scan )(void *ctx, enum p2p_scan_type type, int freq, unsigned int num_req_dev_types, const u8 *req_dev_types, const u8 *dev_id, u16 pw_id)
 p2p_scan - Request a P2P scan/search : Callback context from cb_ctx : Scan type : Specific frequency (MHz) to scan or 0 for no restriction : Number of requested device types : Array containing requested device types : Device ID to search for or NULL to find all devices : Device Password ID Returns: 0 on success, -1 on failure More...
 
int(* send_probe_resp )(void *ctx, const struct wpabuf *buf, unsigned int freq)
 send_probe_resp - Transmit a Probe Response frame : Callback context from cb_ctx : Probe Response frame (including the header and body) : Forced frequency (in MHz) to use or 0. More...
 
int(* send_action )(void *ctx, unsigned int freq, const u8 *dst, const u8 *src, const u8 *bssid, const u8 *buf, size_t len, unsigned int wait_time)
 send_action - Transmit an Action frame : Callback context from cb_ctx : Frequency in MHz for the channel on which to transmit : Destination MAC address (Address 1) : Source MAC address (Address 2) : BSSID (Address 3) : Frame body (starting from Category field) : Length of buf in octets : How many msec to wait for a response frame Returns: 0 on success, -1 on failure More...
 
void(* send_action_done )(void *ctx)
 send_action_done - Notify that Action frame sequence was completed : Callback context from cb_ctx More...
 
int(* start_listen )(void *ctx, unsigned int freq, unsigned int duration, const struct wpabuf *probe_resp_ie)
 start_listen - Start Listen state : Callback context from cb_ctx : Frequency of the listen channel in MHz : Duration for the Listen state in milliseconds : IE(s) to be added to Probe Response frames Returns: 0 on success, -1 on failure More...
 
void(* stop_listen )(void *ctx)
 stop_listen - Stop Listen state : Callback context from cb_ctx More...
 
int(* get_noa )(void *ctx, const u8 *interface_addr, u8 *buf, size_t buf_len)
 get_noa - Get current Notice of Absence attribute payload : Callback context from cb_ctx : P2P Interface Address of the GO : Buffer for returning NoA : Buffer length in octets Returns: Number of octets used in buf, 0 to indicate no NoA is being advertized, or -1 on failure More...
 
void(* dev_found )(void *ctx, const u8 *addr, const struct p2p_peer_info *info, int new_device)
 dev_found - Notification of a found P2P Device : Callback context from cb_ctx : Source address of the message triggering this notification : P2P peer information : Inform if the peer is newly found More...
 
void(* dev_lost )(void *ctx, const u8 *dev_addr)
 dev_lost - Notification of a lost P2P Device : Callback context from cb_ctx : P2P Device Address of the lost P2P Device More...
 
void(* find_stopped )(void *ctx)
 find_stopped - Notification of a p2p_find operation stopping : Callback context from cb_ctx
 
void(* go_neg_req_rx )(void *ctx, const u8 *src, u16 dev_passwd_id, u8 go_intent)
 go_neg_req_rx - Notification of a receive GO Negotiation Request : Callback context from cb_ctx : Source address of the message triggering this notification : WPS Device Password ID : Peer's GO Intent More...
 
void(* go_neg_completed )(void *ctx, struct p2p_go_neg_results *res)
 go_neg_completed - Notification of GO Negotiation results : Callback context from cb_ctx : GO Negotiation results More...
 
void(* sd_request )(void *ctx, int freq, const u8 *sa, u8 dialog_token, u16 update_indic, const u8 *tlvs, size_t tlvs_len)
 sd_request - Callback on Service Discovery Request : Callback context from cb_ctx : Frequency (in MHz) of the channel More...
 
void(* sd_response )(void *ctx, const u8 *sa, u16 update_indic, const u8 *tlvs, size_t tlvs_len)
 sd_response - Callback on Service Discovery Response : Callback context from cb_ctx More...
 
void(* prov_disc_req )(void *ctx, const u8 *peer, u16 config_methods, const u8 *dev_addr, const u8 *pri_dev_type, const char *dev_name, u16 supp_config_methods, u8 dev_capab, u8 group_capab, const u8 *group_id, size_t group_id_len)
 prov_disc_req - Callback on Provisiong Discovery Request : Callback context from cb_ctx : Source address of the request : Requested WPS Config Method : P2P Device Address of the found P2P Device : Primary Device Type : Device Name : Supported configuration Methods : Device Capabilities : Group Capabilities : P2P Group ID (or NULL if not included) : Length of P2P Group ID More...
 
void(* prov_disc_resp )(void *ctx, const u8 *peer, u16 config_methods)
 prov_disc_resp - Callback on Provisiong Discovery Response : Callback context from cb_ctx : Source address of the response : Value from p2p_prov_disc_req() or 0 on failure More...
 
void(* prov_disc_fail )(void *ctx, const u8 *peer, enum p2p_prov_disc_status status, u32 adv_id, const u8 *adv_mac, const char *deferred_session_resp)
 prov_disc_fail - Callback on Provision Discovery failure : Callback context from cb_ctx : Source address of the response : Cause of failure, will not be P2P_PROV_DISC_SUCCESS : If non-zero, then the adv_id of the PD Request : P2P Device Address of the advertizer : Deferred session response sent by advertizer More...
 
u8(* invitation_process )(void *ctx, const u8 *sa, const u8 *bssid, const u8 *go_dev_addr, const u8 *ssid, size_t ssid_len, int *go, u8 *group_bssid, int *force_freq, int persistent_group, const struct p2p_channels *channels, int dev_pw_id)
 invitation_process - Optional callback for processing Invitations : Callback context from cb_ctx More...
 
void(* invitation_received )(void *ctx, const u8 *sa, const u8 *bssid, const u8 *ssid, size_t ssid_len, const u8 *go_dev_addr, u8 status, int op_freq)
 invitation_received - Callback on Invitation Request RX : Callback context from cb_ctx More...
 
void(* invitation_result )(void *ctx, int status, const u8 *bssid, const struct p2p_channels *channels, const u8 *addr, int freq, int peer_oper_freq)
 invitation_result - Callback on Invitation result : Callback context from cb_ctx : Negotiation result (Status Code) : P2P Group BSSID or NULL if not received : Available operating channels for the group : Peer address : Frequency (in MHz) indicated during invitation or 0 : Operating frequency (in MHz) advertized by the peer during invitation or 0 More...
 
int(* go_connected )(void *ctx, const u8 *dev_addr)
 go_connected - Check whether we are connected to a GO : Callback context from cb_ctx : P2P Device Address of a GO Returns: 1 if we are connected as a P2P client to the specified GO or 0 if not.
 
void(* presence_resp )(void *ctx, const u8 *src, u8 status, const u8 *noa, size_t noa_len)
 presence_resp - Callback on Presence Response : Callback context from cb_ctx : Source address (GO's P2P Interface Address) : Result of the request (P2P_SC_*) : Returned NoA value : Length of the NoA buffer in octets
 
int(* is_concurrent_session_active )(void *ctx)
 is_concurrent_session_active - Check whether concurrent session is active on other virtual interfaces : Callback context from cb_ctx Returns: 1 if concurrent session is active on other virtual interface or 0 if not.
 
int(* is_p2p_in_progress )(void *ctx)
 is_p2p_in_progress - Check whether P2P operation is in progress : Callback context from cb_ctx Returns: 1 if P2P operation (e.g., group formation) is in progress or 0 if not.
 
int(* get_persistent_group )(void *ctx, const u8 *addr, const u8 *ssid, size_t ssid_len, u8 *go_dev_addr, u8 *ret_ssid, size_t *ret_ssid_len, u8 *intended_iface_addr)
 Determine if we have a persistent group we share with remote peer and allocate interface for this group if needed : Callback context from cb_ctx : Peer device address to search for : Persistent group SSID or NULL if any : Length of : Buffer for returning GO P2P Device Address : Buffer for returning group SSID : Buffer for returning length of : Buffer for returning intended iface address Returns: 1 if a matching persistent group was found, 0 otherwise.
 
int(* get_go_info )(void *ctx, u8 *intended_addr, u8 *ssid, size_t *ssid_len, int *group_iface, unsigned int *freq)
 Get information about a possible local GO role : Callback context from cb_ctx : Buffer for returning intended GO interface address : Buffer for returning group SSID : Buffer for returning length of : Buffer for returning whether a separate group interface would be used : Variable for returning the current operating frequency of a currently running P2P GO. More...
 
int(* remove_stale_groups )(void *ctx, const u8 *peer, const u8 *go, const u8 *ssid, size_t ssid_len)
 remove_stale_groups - Remove stale P2PS groups More...
 
void(* p2ps_prov_complete )(void *ctx, u8 status, const u8 *dev, const u8 *adv_mac, const u8 *ses_mac, const u8 *grp_mac, u32 adv_id, u32 ses_id, u8 conncap, int passwd_id, const u8 *persist_ssid, size_t persist_ssid_size, int response_done, int prov_start, const char *session_info, const u8 *feat_cap, size_t feat_cap_len, unsigned int freq, const u8 *group_ssid, size_t group_ssid_len)
 p2ps_prov_complete - P2PS provisioning complete More...
 
int(* prov_disc_resp_cb )(void *ctx)
 prov_disc_resp_cb - Callback for indicating completion of PD Response : Callback context from cb_ctx Returns: 1 if operation was started, 0 otherwise More...
 
u8(* p2ps_group_capability )(void *ctx, u8 incoming, u8 role, unsigned int *force_freq, unsigned int *pref_freq)
 p2ps_group_capability - Determine group capability : Callback context from cb_ctx : Peer requested roles, expressed with P2PS_SETUP_* bitmap. More...
 
int(* get_pref_freq_list )(void *ctx, int go, unsigned int *len, unsigned int *freq_list)
 get_pref_freq_list - Get preferred frequency list for an interface : Callback context from cb_ctx : Whether the use if for GO role : Length of freq_list in entries (both IN and OUT) : Buffer for returning the preferred frequencies (MHz) Returns: 0 on success, -1 on failure More...
 

Detailed Description

struct p2p_config - P2P configuration

This configuration is provided to the P2P module during initialization with p2p_init().

Member Data Documentation

§ channels

struct p2p_channels p2p_config::channels

channels - Own supported regulatory classes and channels

List of supposerted channels per regulatory class. The regulatory classes are defined in IEEE Std 802.11-2007 Annex J and the numbering of the clases depends on the configured country code.

§ cli_channels

struct p2p_channels p2p_config::cli_channels

cli_channels - Additional client channels

This list of channels (if any) will be used when advertising local channels during GO Negotiation or Invitation for the cases where the local end may become the client. This may allow the peer to become a GO on additional channels if it supports these options. The main use case for this is to include passive-scan channels on devices that may not know their current location and have configured most channels to not allow initiation of radition (i.e., another device needs to take master responsibilities).

§ dev_found

void(* p2p_config::dev_found) (void *ctx, const u8 *addr, const struct p2p_peer_info *info, int new_device)

dev_found - Notification of a found P2P Device : Callback context from cb_ctx : Source address of the message triggering this notification : P2P peer information : Inform if the peer is newly found

This callback is used to notify that a new P2P Device has been found. This may happen, e.g., during Search state based on scan results or during Listen state based on receive Probe Request and Group Owner Negotiation Request.

§ dev_lost

void(* p2p_config::dev_lost) (void *ctx, const u8 *dev_addr)

dev_lost - Notification of a lost P2P Device : Callback context from cb_ctx : P2P Device Address of the lost P2P Device

This callback is used to notify that a P2P Device has been deleted.

§ get_go_info

int(* p2p_config::get_go_info) (void *ctx, u8 *intended_addr, u8 *ssid, size_t *ssid_len, int *group_iface, unsigned int *freq)

Get information about a possible local GO role : Callback context from cb_ctx : Buffer for returning intended GO interface address : Buffer for returning group SSID : Buffer for returning length of : Buffer for returning whether a separate group interface would be used : Variable for returning the current operating frequency of a currently running P2P GO.

Returns: 1 if GO info found, 0 otherwise

This is used to compose New Group settings (SSID, and intended address) during P2PS provisioning if results of provisioning might result in our being an autonomous GO.

§ get_noa

int(* p2p_config::get_noa) (void *ctx, const u8 *interface_addr, u8 *buf, size_t buf_len)

get_noa - Get current Notice of Absence attribute payload : Callback context from cb_ctx : P2P Interface Address of the GO : Buffer for returning NoA : Buffer length in octets Returns: Number of octets used in buf, 0 to indicate no NoA is being advertized, or -1 on failure

This function is used to fetch the current Notice of Absence attribute value from GO.

§ get_pref_freq_list

int(* p2p_config::get_pref_freq_list) (void *ctx, int go, unsigned int *len, unsigned int *freq_list)

get_pref_freq_list - Get preferred frequency list for an interface : Callback context from cb_ctx : Whether the use if for GO role : Length of freq_list in entries (both IN and OUT) : Buffer for returning the preferred frequencies (MHz) Returns: 0 on success, -1 on failure

This function can be used to query the preferred frequency list from the driver specific to a particular interface type.

§ go_neg_completed

void(* p2p_config::go_neg_completed) (void *ctx, struct p2p_go_neg_results *res)

go_neg_completed - Notification of GO Negotiation results : Callback context from cb_ctx : GO Negotiation results

This callback is used to notify that Group Owner Negotiation has been completed. Non-zero struct p2p_go_neg_results::status indicates failed negotiation. In case of success, this function is responsible for creating a new group interface (or using the existing interface depending on driver features), setting up the group interface in proper mode based on struct p2p_go_neg_results::role_go and initializing WPS provisioning either as a Registrar (if GO) or as an Enrollee. Successful WPS provisioning must be indicated by calling p2p_wps_success_cb(). The callee is responsible for timing out group formation if WPS provisioning cannot be completed successfully within 15 seconds.

§ go_neg_req_rx

void(* p2p_config::go_neg_req_rx) (void *ctx, const u8 *src, u16 dev_passwd_id, u8 go_intent)

go_neg_req_rx - Notification of a receive GO Negotiation Request : Callback context from cb_ctx : Source address of the message triggering this notification : WPS Device Password ID : Peer's GO Intent

This callback is used to notify that a P2P Device is requesting group owner negotiation with us, but we do not have all the necessary information to start GO Negotiation. This indicates that the local user has not authorized the connection yet by providing a PIN or PBC button press. This information can be provided with a call to p2p_connect().

§ invitation_process

u8(* p2p_config::invitation_process) (void *ctx, const u8 *sa, const u8 *bssid, const u8 *go_dev_addr, const u8 *ssid, size_t ssid_len, int *go, u8 *group_bssid, int *force_freq, int persistent_group, const struct p2p_channels *channels, int dev_pw_id)

invitation_process - Optional callback for processing Invitations : Callback context from cb_ctx

See also
: Source address of the Invitation Request : P2P Group BSSID from the request or NULL if not included : GO Device Address from P2P Group ID : SSID from P2P Group ID : Length of ssid buffer in octets : Variable for returning whether the local end is GO in the group : Buffer for returning P2P Group BSSID (if local end GO) : Variable for returning forced frequency for the group : Whether this is an invitation to reinvoke a persistent group (instead of invitation to join an active group) : Available operating channels for the group : Device Password ID for NFC static handover or -1 if not used Returns: Status code (P2P_SC_*)

This optional callback can be used to implement persistent reconnect by allowing automatic restarting of persistent groups without user interaction. If this callback is not implemented (i.e., is NULL), the received Invitation Request frames are replied with P2P_SC_REQ_RECEIVED status and indicated to upper layer with the invitation_result() callback.

If the requested parameters are acceptable and the group is known, P2P_SC_SUCCESS may be returned. If the requested group is unknown, P2P_SC_FAIL_UNKNOWN_GROUP should be returned. P2P_SC_REQ_RECEIVED can be returned if there is not enough data to provide immediate response, i.e., if some sort of user interaction is needed. The invitation_received() callback will be called in that case immediately after this call.

§ invitation_received

void(* p2p_config::invitation_received) (void *ctx, const u8 *sa, const u8 *bssid, const u8 *ssid, size_t ssid_len, const u8 *go_dev_addr, u8 status, int op_freq)

invitation_received - Callback on Invitation Request RX : Callback context from cb_ctx

See also
: Source address of the Invitation Request : P2P Group BSSID or NULL if not received : SSID of the group : Length of ssid in octets : GO Device Address : Response Status : Operational frequency for the group

This callback is used to indicate sending of an Invitation Response for a received Invitation Request. If status == 0 (success), the upper layer code is responsible for starting the group. status == 1 indicates need to get user authorization for the group. Other status values indicate that the invitation request was rejected.

§ invitation_result

void(* p2p_config::invitation_result) (void *ctx, int status, const u8 *bssid, const struct p2p_channels *channels, const u8 *addr, int freq, int peer_oper_freq)

invitation_result - Callback on Invitation result : Callback context from cb_ctx : Negotiation result (Status Code) : P2P Group BSSID or NULL if not received : Available operating channels for the group : Peer address : Frequency (in MHz) indicated during invitation or 0 : Operating frequency (in MHz) advertized by the peer during invitation or 0

This callback is used to indicate result of an Invitation procedure started with a call to p2p_invite(). The indicated status code is the value received from the peer in Invitation Response with 0 (P2P_SC_SUCCESS) indicating success or -1 to indicate a timeout or a local failure in transmitting the Invitation Request.

§ max_peers

size_t p2p_config::max_peers

max_peers - Maximum number of discovered peers to remember

If more peers are discovered, older entries will be removed to make room for the new ones.

§ p2p_scan

int(* p2p_config::p2p_scan) (void *ctx, enum p2p_scan_type type, int freq, unsigned int num_req_dev_types, const u8 *req_dev_types, const u8 *dev_id, u16 pw_id)

p2p_scan - Request a P2P scan/search : Callback context from cb_ctx : Scan type : Specific frequency (MHz) to scan or 0 for no restriction : Number of requested device types : Array containing requested device types : Device ID to search for or NULL to find all devices : Device Password ID Returns: 0 on success, -1 on failure

This callback function is used to request a P2P scan or search operation to be completed. Type type argument specifies which type of scan is to be done. indicates that only the social channels (1, 6, 11) should be scanned. indicates that all channels are to be scanned. request a scan of a single channel specified by freq. request scan of all the social channels plus one extra channel specified by freq.

The full scan is used for the initial scan to find group owners from all. The other types are used during search phase scan of the social channels (with potential variation if the Listen channel of the target peer is known or if other channels are scanned in steps).

The scan results are returned after this call by calling p2p_scan_res_handler() for each scan result that has a P2P IE and then calling p2p_scan_res_handled() to indicate that all scan results have been indicated.

§ p2ps_group_capability

u8(* p2p_config::p2ps_group_capability) (void *ctx, u8 incoming, u8 role, unsigned int *force_freq, unsigned int *pref_freq)

p2ps_group_capability - Determine group capability : Callback context from cb_ctx : Peer requested roles, expressed with P2PS_SETUP_* bitmap.

: Local roles, expressed with P2PS_SETUP_* bitmap. : Variable for returning forced frequency for the group. : Variable for returning preferred frequency for the group. Returns: P2PS_SETUP_* bitmap of group capability result.

This function can be used to determine group capability and frequencies based on information from P2PS PD exchange and the current state of ongoing groups and driver capabilities.

§ p2ps_prov_complete

void(* p2p_config::p2ps_prov_complete) (void *ctx, u8 status, const u8 *dev, const u8 *adv_mac, const u8 *ses_mac, const u8 *grp_mac, u32 adv_id, u32 ses_id, u8 conncap, int passwd_id, const u8 *persist_ssid, size_t persist_ssid_size, int response_done, int prov_start, const char *session_info, const u8 *feat_cap, size_t feat_cap_len, unsigned int freq, const u8 *group_ssid, size_t group_ssid_len)

p2ps_prov_complete - P2PS provisioning complete

When P2PS provisioning completes (successfully or not) we must transmit all of the results to the upper layers.

§ passphrase_len

unsigned int p2p_config::passphrase_len

passphrase_len - Passphrase length (8..63)

This parameter controls the length of the random passphrase that is generated at the GO.

§ prov_disc_fail

void(* p2p_config::prov_disc_fail) (void *ctx, const u8 *peer, enum p2p_prov_disc_status status, u32 adv_id, const u8 *adv_mac, const char *deferred_session_resp)

prov_disc_fail - Callback on Provision Discovery failure : Callback context from cb_ctx : Source address of the response : Cause of failure, will not be P2P_PROV_DISC_SUCCESS : If non-zero, then the adv_id of the PD Request : P2P Device Address of the advertizer : Deferred session response sent by advertizer

This callback is used to indicate either a failure or no response to an earlier provision discovery request.

This callback handler can be set to NULL if provision discovery is not used or failures do not need to be indicated.

§ prov_disc_req

void(* p2p_config::prov_disc_req) (void *ctx, const u8 *peer, u16 config_methods, const u8 *dev_addr, const u8 *pri_dev_type, const char *dev_name, u16 supp_config_methods, u8 dev_capab, u8 group_capab, const u8 *group_id, size_t group_id_len)

prov_disc_req - Callback on Provisiong Discovery Request : Callback context from cb_ctx : Source address of the request : Requested WPS Config Method : P2P Device Address of the found P2P Device : Primary Device Type : Device Name : Supported configuration Methods : Device Capabilities : Group Capabilities : P2P Group ID (or NULL if not included) : Length of P2P Group ID

This callback is used to indicate reception of a Provision Discovery Request frame that the P2P module accepted.

§ prov_disc_resp

void(* p2p_config::prov_disc_resp) (void *ctx, const u8 *peer, u16 config_methods)

prov_disc_resp - Callback on Provisiong Discovery Response : Callback context from cb_ctx : Source address of the response : Value from p2p_prov_disc_req() or 0 on failure

This callback is used to indicate reception of a Provision Discovery Response frame for a pending request scheduled with p2p_prov_disc_req(). This callback handler can be set to NULL if provision discovery is not used.

§ prov_disc_resp_cb

int(* p2p_config::prov_disc_resp_cb) (void *ctx)

prov_disc_resp_cb - Callback for indicating completion of PD Response : Callback context from cb_ctx Returns: 1 if operation was started, 0 otherwise

This callback can be used to perform any pending actions after provisioning. It is mainly used for P2PS pending group creation.

§ remove_stale_groups

int(* p2p_config::remove_stale_groups) (void *ctx, const u8 *peer, const u8 *go, const u8 *ssid, size_t ssid_len)

remove_stale_groups - Remove stale P2PS groups

Because P2PS stages potential GOs, and remote devices can remove credentials unilaterally, we need to make sure we don't let stale unusable groups build up.

§ sd_request

void(* p2p_config::sd_request) (void *ctx, int freq, const u8 *sa, u8 dialog_token, u16 update_indic, const u8 *tlvs, size_t tlvs_len)

sd_request - Callback on Service Discovery Request : Callback context from cb_ctx : Frequency (in MHz) of the channel

See also
: Source address of the request : Dialog token : Service Update Indicator from the source of request : P2P Service Request TLV(s) : Length of tlvs buffer in octets

This callback is used to indicate reception of a service discovery request. Response to the query must be indicated by calling p2p_sd_response() with the context information from the arguments to this callback function.

This callback handler can be set to NULL to indicate that service discovery is not supported.

§ sd_response

void(* p2p_config::sd_response) (void *ctx, const u8 *sa, u16 update_indic, const u8 *tlvs, size_t tlvs_len)

sd_response - Callback on Service Discovery Response : Callback context from cb_ctx

See also
: Source address of the request : Service Update Indicator from the source of response : P2P Service Response TLV(s) : Length of tlvs buffer in octets

This callback is used to indicate reception of a service discovery response. This callback handler can be set to NULL if no service discovery requests are used. The information provided with this call is replies to the queries scheduled with p2p_sd_request().

§ send_action

int(* p2p_config::send_action) (void *ctx, unsigned int freq, const u8 *dst, const u8 *src, const u8 *bssid, const u8 *buf, size_t len, unsigned int wait_time)

send_action - Transmit an Action frame : Callback context from cb_ctx : Frequency in MHz for the channel on which to transmit : Destination MAC address (Address 1) : Source MAC address (Address 2) : BSSID (Address 3) : Frame body (starting from Category field) : Length of buf in octets : How many msec to wait for a response frame Returns: 0 on success, -1 on failure

The Action frame may not be transmitted immediately and the status of the transmission must be reported by calling p2p_send_action_cb() once the frame has either been transmitted or it has been dropped due to excessive retries or other failure to transmit.

§ send_action_done

void(* p2p_config::send_action_done) (void *ctx)

send_action_done - Notify that Action frame sequence was completed : Callback context from cb_ctx

This function is called when the Action frame sequence that was started with send_action() has been completed, i.e., when there is no need to wait for a response from the destination peer anymore.

§ send_probe_resp

int(* p2p_config::send_probe_resp) (void *ctx, const struct wpabuf *buf, unsigned int freq)

send_probe_resp - Transmit a Probe Response frame : Callback context from cb_ctx : Probe Response frame (including the header and body) : Forced frequency (in MHz) to use or 0.

Returns: 0 on success, -1 on failure

This function is used to reply to Probe Request frames that were indicated with a call to p2p_probe_req_rx(). The response is to be sent on the same channel, unless otherwise specified, or to be dropped if the driver is not listening to Probe Request frames anymore.

Alternatively, the responsibility for building the Probe Response frames in Listen state may be in another system component in which case this function need to be implemented (i.e., the function pointer can be NULL). The WPS and P2P IEs to be added for Probe Response frames in such a case are available from the start_listen() callback. It should be noted that the received Probe Request frames must be indicated by calling p2p_probe_req_rx() even if this send_probe_resp() is not used.

§ ssid_postfix

u8 p2p_config::ssid_postfix[SSID_MAX_LEN - 9]

ssid_postfix - Postfix data to add to the SSID

This data will be added to the end of the SSID after the DIRECT-<random two="" octets>=""> prefix.

§ start_listen

int(* p2p_config::start_listen) (void *ctx, unsigned int freq, unsigned int duration, const struct wpabuf *probe_resp_ie)

start_listen - Start Listen state : Callback context from cb_ctx : Frequency of the listen channel in MHz : Duration for the Listen state in milliseconds : IE(s) to be added to Probe Response frames Returns: 0 on success, -1 on failure

This Listen state may not start immediately since the driver may have other pending operations to complete first. Once the Listen state has started, p2p_listen_cb() must be called to notify the P2P module. Once the Listen state is stopped, p2p_listen_end() must be called to notify the P2P module that the driver is not in the Listen state anymore.

If the send_probe_resp() is not used for generating the response, the IEs from probe_resp_ie need to be added to the end of the Probe Response frame body. If send_probe_resp() is used, the probe_resp_ie information can be ignored.

§ stop_listen

void(* p2p_config::stop_listen) (void *ctx)

stop_listen - Stop Listen state : Callback context from cb_ctx

This callback can be used to stop a Listen state operation that was previously requested with start_listen().


The documentation for this struct was generated from the following file: