wpa_supplicant / hostapd  2.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Functions
p2p_sd.c File Reference

Wi-Fi Direct - P2P service discovery. More...

#include "includes.h"
#include "common.h"
#include "common/ieee802_11_defs.h"
#include "common/gas.h"
#include "p2p_i.h"
#include "p2p.h"

Functions

struct p2p_sd_queryp2p_pending_sd_req (struct p2p_data *p2p, struct p2p_device *dev)
 
void p2p_free_sd_queries (struct p2p_data *p2p)
 
int p2p_start_sd (struct p2p_data *p2p, struct p2p_device *dev)
 
void p2p_rx_gas_initial_req (struct p2p_data *p2p, const u8 *sa, const u8 *data, size_t len, int rx_freq)
 
void p2p_sd_response (struct p2p_data *p2p, int freq, const u8 *dst, u8 dialog_token, const struct wpabuf *resp_tlvs)
 Send response to a service discovery query. More...
 
void p2p_rx_gas_initial_resp (struct p2p_data *p2p, const u8 *sa, const u8 *data, size_t len, int rx_freq)
 
void p2p_rx_gas_comeback_req (struct p2p_data *p2p, const u8 *sa, const u8 *data, size_t len, int rx_freq)
 
void p2p_rx_gas_comeback_resp (struct p2p_data *p2p, const u8 *sa, const u8 *data, size_t len, int rx_freq)
 
void * p2p_sd_request (struct p2p_data *p2p, const u8 *dst, const struct wpabuf *tlvs)
 Schedule a service discovery query. More...
 
void p2p_sd_service_update (struct p2p_data *p2p)
 Indicate a change in local services. More...
 
int p2p_sd_cancel_request (struct p2p_data *p2p, void *req)
 Cancel a pending service discovery query. More...
 

Detailed Description

Wi-Fi Direct - P2P service discovery.

Function Documentation

int p2p_sd_cancel_request ( struct p2p_data p2p,
void *  req 
)

Cancel a pending service discovery query.

Parameters
p2pP2P module context from p2p_init()
reqQuery reference from p2p_sd_request()
Returns
0 if request for cancelled; -1 if not found
void* p2p_sd_request ( struct p2p_data p2p,
const u8 *  dst,
const struct wpabuf tlvs 
)

Schedule a service discovery query.

Parameters
p2pP2P module context from p2p_init()
dstDestination peer or NULL to apply for all peers
tlvsP2P Service Query TLV(s)
Returns
Reference to the query or NULL on failure

Response to the query is indicated with the p2p_config::sd_response() callback.

void p2p_sd_response ( struct p2p_data p2p,
int  freq,
const u8 *  dst,
u8  dialog_token,
const struct wpabuf resp_tlvs 
)

Send response to a service discovery query.

Parameters
p2pP2P module context from p2p_init()
freqFrequency from p2p_config::sd_request() callback
dstDestination address from p2p_config::sd_request() callback
dialog_tokenDialog token from p2p_config::sd_request() callback
resp_tlvsP2P Service Response TLV(s)

This function is called as a response to the request indicated with p2p_config::sd_request() callback.

void p2p_sd_service_update ( struct p2p_data p2p)

Indicate a change in local services.

Parameters
p2pP2P module context from p2p_init()

This function needs to be called whenever there is a change in availability of the local services. This will increment the Service Update Indicator value which will be used in SD Request and Response frames.