mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-08-04 13:14:33 +02:00
mdns: update mdns to use esp-netif for mdns supported services such as STA, AP, ETH
removes also include dependency on lwip to use esp_netif defined address fields and structures * Original commit: espressif/esp-idf@19e24fe61e
This commit is contained in:
committed by
suren-gabrielyan-espressif
parent
dfcefc38fd
commit
48b819bbc1
@@ -34,12 +34,12 @@ esp_err_t _mdns_send_rx_action(mdns_rx_packet_t * packet);
|
||||
/**
|
||||
* @brief Start PCB
|
||||
*/
|
||||
esp_err_t _mdns_pcb_init(tcpip_adapter_if_t tcpip_if, mdns_ip_protocol_t ip_protocol);
|
||||
esp_err_t _mdns_pcb_init(mdns_if_t tcpip_if, mdns_ip_protocol_t ip_protocol);
|
||||
|
||||
/**
|
||||
* @brief Stop PCB
|
||||
*/
|
||||
esp_err_t _mdns_pcb_deinit(tcpip_adapter_if_t tcpip_if, mdns_ip_protocol_t ip_protocol);
|
||||
esp_err_t _mdns_pcb_deinit(mdns_if_t tcpip_if, mdns_ip_protocol_t ip_protocol);
|
||||
|
||||
/**
|
||||
* @brief send packet over UDP
|
||||
@@ -50,6 +50,6 @@ esp_err_t _mdns_pcb_deinit(tcpip_adapter_if_t tcpip_if, mdns_ip_protocol_t ip_pr
|
||||
*
|
||||
* @return length of sent packet or 0 on error
|
||||
*/
|
||||
size_t _mdns_udp_pcb_write(tcpip_adapter_if_t tcpip_if, mdns_ip_protocol_t ip_protocol, const ip_addr_t *ip, uint16_t port, uint8_t * data, size_t len);
|
||||
size_t _mdns_udp_pcb_write(mdns_if_t tcpip_if, mdns_ip_protocol_t ip_protocol, const esp_ip_addr_t *ip, uint16_t port, uint8_t * data, size_t len);
|
||||
|
||||
#endif /* ESP_MDNS_NETWORKING_H_ */
|
||||
|
@@ -214,10 +214,10 @@ typedef struct mdns_parsed_record_s {
|
||||
} mdns_parsed_record_t;
|
||||
|
||||
typedef struct {
|
||||
tcpip_adapter_if_t tcpip_if;
|
||||
mdns_if_t tcpip_if;
|
||||
mdns_ip_protocol_t ip_protocol;
|
||||
//struct udp_pcb *pcb;
|
||||
ip_addr_t src;
|
||||
esp_ip_addr_t src;
|
||||
uint16_t src_port;
|
||||
uint8_t multicast;
|
||||
uint8_t authoritative;
|
||||
@@ -229,11 +229,11 @@ typedef struct {
|
||||
} mdns_parsed_packet_t;
|
||||
|
||||
typedef struct {
|
||||
tcpip_adapter_if_t tcpip_if;
|
||||
mdns_if_t tcpip_if;
|
||||
mdns_ip_protocol_t ip_protocol;
|
||||
struct pbuf *pb;
|
||||
ip_addr_t src;
|
||||
ip_addr_t dest;
|
||||
esp_ip_addr_t src;
|
||||
esp_ip_addr_t dest;
|
||||
uint16_t src_port;
|
||||
uint8_t multicast;
|
||||
} mdns_rx_packet_t;
|
||||
@@ -283,9 +283,9 @@ typedef struct mdns_out_answer_s {
|
||||
typedef struct mdns_tx_packet_s {
|
||||
struct mdns_tx_packet_s * next;
|
||||
uint32_t send_at;
|
||||
tcpip_adapter_if_t tcpip_if;
|
||||
mdns_if_t tcpip_if;
|
||||
mdns_ip_protocol_t ip_protocol;
|
||||
ip_addr_t dst;
|
||||
esp_ip_addr_t dst;
|
||||
uint16_t port;
|
||||
uint16_t flags;
|
||||
uint8_t distributed;
|
||||
@@ -333,7 +333,7 @@ typedef struct mdns_search_once_s {
|
||||
typedef struct mdns_server_s {
|
||||
struct {
|
||||
mdns_pcb_t pcbs[MDNS_IP_PROTOCOL_MAX];
|
||||
} interfaces[TCPIP_ADAPTER_IF_MAX];
|
||||
} interfaces[MDNS_IF_MAX];
|
||||
const char * hostname;
|
||||
const char * instance;
|
||||
mdns_srv_item_t * services;
|
||||
@@ -352,7 +352,7 @@ typedef struct {
|
||||
struct {
|
||||
esp_event_base_t event_base;
|
||||
int32_t event_id;
|
||||
tcpip_adapter_if_t interface;
|
||||
esp_netif_t* interface;
|
||||
} sys_event;
|
||||
struct {
|
||||
mdns_srv_item_t * service;
|
||||
@@ -393,4 +393,16 @@ typedef struct {
|
||||
} data;
|
||||
} mdns_action_t;
|
||||
|
||||
/*
|
||||
* @brief Convert mnds if to esp-netif handle
|
||||
*
|
||||
* @param tcpip_if mdns supported interface as internal enum
|
||||
*
|
||||
* @return
|
||||
* - ptr to esp-netif on success
|
||||
* - NULL if no available netif for current interface index
|
||||
*/
|
||||
esp_netif_t *_mdns_get_esp_netif(mdns_if_t tcpip_if);
|
||||
|
||||
|
||||
#endif /* MDNS_PRIVATE_H_ */
|
||||
|
Reference in New Issue
Block a user