esp-idf/examples/network/sta_to_eth/main/wired_iface.h
David Cermak 6ac17b5020 Examples/network: Add Ethernet iface to sta-2-wired bridge
* adds description about that it's not a bridge, but more like an 1:1
forwarder on L2
* add and describe mac spoofing for Ethernet interface
* describe virtual networking for USB-NCM interface
2023-06-08 07:33:52 +02:00

25 lines
630 B
C

/*
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Unlicense OR CC0-1.0
*/
#pragma once
typedef esp_err_t (*wired_rx_cb_t)(void *buffer, uint16_t len, void *ctx);
typedef void (*wired_free_cb_t)(void *buffer, void *ctx);
typedef enum {
FROM_WIRED,
TO_WIRED
} mac_spoof_direction_t;
void mac_spoof(mac_spoof_direction_t direction, uint8_t *buffer, uint16_t len, uint8_t own_mac[6]);
esp_err_t wired_bridge_init(wired_rx_cb_t rx_cb, wired_free_cb_t free_cb);
esp_err_t wired_send(void *buffer, uint16_t len, void *buff_free_arg);
esp_err_t wired_netif_init(void);