mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
4c76af3f68
Update wifi lib with below - 1. Create NAN Discovery SM for beaconing & cluster formation 2. Create NAN interface for Tx/Rx of beacons & action frames 3. Add commands & events for NAN Services Publish/Subscribe/Followup 4. Add NAN Datapath definitions, Events, Peer structures 5. Support for forming and parsing of Datapath related attributes 6. Modules for NDP Req, Resp, Confirm, Term, Peer management 7. NAN Interface related additions in Datapath, Data Tx Q's In addition include below changes - 1. Add netif and driver support for NAN Interface 2. Add simple examples for Publisher-Subscriber usecases 3. Add an advanced console example that supports commands for NAN Discovery, Services & Datapath 4. Add wifi_apps for providing better NAN API's and Peer management Co-authored-by: Shyamal Khachane <shyamal.khachane@espressif.com>
87 lines
2.3 KiB
C
87 lines
2.3 KiB
C
/*
|
|
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "esp_netif.h"
|
|
#include "lwip/netif.h"
|
|
#include "esp_netif_ppp.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef err_t (*init_fn_t)(struct netif*);
|
|
typedef void (*input_fn_t)(void *netif, void *buffer, size_t len, void *eb);
|
|
|
|
struct esp_netif_netstack_lwip_vanilla_config {
|
|
init_fn_t init_fn;
|
|
input_fn_t input_fn;
|
|
};
|
|
|
|
struct esp_netif_netstack_lwip_ppp_config {
|
|
input_fn_t input_fn;
|
|
esp_netif_ppp_config_t ppp_events;
|
|
};
|
|
|
|
// LWIP netif specific network stack configuration
|
|
struct esp_netif_netstack_config {
|
|
union {
|
|
struct esp_netif_netstack_lwip_vanilla_config lwip;
|
|
struct esp_netif_netstack_lwip_ppp_config lwip_ppp;
|
|
};
|
|
};
|
|
|
|
/**
|
|
* @brief LWIP's network stack init function for Ethernet
|
|
* @param netif LWIP's network interface handle
|
|
* @return ERR_OK on success
|
|
*/
|
|
err_t ethernetif_init(struct netif *netif);
|
|
|
|
/**
|
|
* @brief LWIP's network stack input packet function for Ethernet
|
|
* @param h LWIP's network interface handle
|
|
* @param buffer Input buffer pointer
|
|
* @param len Input buffer size
|
|
* @param l2_buff External buffer pointer (to be passed to custom input-buffer free)
|
|
*/
|
|
void ethernetif_input(void *h, void *buffer, size_t len, void *l2_buff);
|
|
|
|
/**
|
|
* @brief LWIP's network stack init function for WiFi (AP)
|
|
* @param netif LWIP's network interface handle
|
|
* @return ERR_OK on success
|
|
*/
|
|
err_t wlanif_init_ap(struct netif *netif);
|
|
|
|
/**
|
|
* @brief LWIP's network stack init function for WiFi (Station)
|
|
* @param netif LWIP's network interface handle
|
|
* @return ERR_OK on success
|
|
*/
|
|
err_t wlanif_init_sta(struct netif *netif);
|
|
|
|
/**
|
|
* @brief LWIP's network stack init function for WiFi Aware interface (NAN)
|
|
* @param netif LWIP's network interface handle
|
|
* @return ERR_OK on success
|
|
*/
|
|
err_t wlanif_init_nan(struct netif *netif);
|
|
|
|
/**
|
|
* @brief LWIP's network stack input packet function for WiFi (both STA/AP)
|
|
* @param h LWIP's network interface handle
|
|
* @param buffer Input buffer pointer
|
|
* @param len Input buffer size
|
|
* @param l2_buff External buffer pointer (to be passed to custom input-buffer free)
|
|
*/
|
|
void wlanif_input(void *h, void *buffer, size_t len, void* l2_buff);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|