2022-10-11 16:31:57 +02:00
|
|
|
/*
|
2025-02-07 11:39:11 +01:00
|
|
|
* SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
|
2022-10-11 16:31:57 +02:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
*/
|
2025-02-07 11:39:11 +01:00
|
|
|
#pragma once
|
2018-05-04 16:42:54 +02:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* MDNS Server Networking -- private include
|
2019-06-06 10:57:29 +08:00
|
|
|
*
|
2018-05-04 16:42:54 +02:00
|
|
|
*/
|
|
|
|
|
#include "mdns.h"
|
|
|
|
|
#include "mdns_private.h"
|
|
|
|
|
|
2025-02-07 11:39:11 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
2018-05-04 16:42:54 +02:00
|
|
|
|
|
|
|
|
/**
|
2025-02-07 11:39:11 +01:00
|
|
|
* @brief Check if the netif on the selected interfacce and protocol is ready
|
2018-05-04 16:42:54 +02:00
|
|
|
*/
|
2025-02-07 11:39:11 +01:00
|
|
|
bool mdns_priv_if_ready(mdns_if_t tcpip_if, mdns_ip_protocol_t ip_protocol);
|
2022-08-08 16:39:13 +02:00
|
|
|
|
2018-05-04 16:42:54 +02:00
|
|
|
/**
|
|
|
|
|
* @brief Start PCB
|
|
|
|
|
*/
|
2025-02-07 11:39:11 +01:00
|
|
|
esp_err_t mdns_priv_if_init(mdns_if_t tcpip_if, mdns_ip_protocol_t ip_protocol);
|
2018-05-04 16:42:54 +02:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Stop PCB
|
|
|
|
|
*/
|
2025-02-07 11:39:11 +01:00
|
|
|
esp_err_t mdns_priv_if_deinit(mdns_if_t tcpip_if, mdns_ip_protocol_t ip_protocol);
|
2018-05-04 16:42:54 +02:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief send packet over UDP
|
|
|
|
|
*
|
|
|
|
|
* @param server The server
|
|
|
|
|
* @param data byte array containing the packet data
|
|
|
|
|
* @param len length of the packet data
|
|
|
|
|
*
|
|
|
|
|
* @return length of sent packet or 0 on error
|
|
|
|
|
*/
|
2025-02-07 11:39:11 +01:00
|
|
|
size_t mdns_priv_if_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);
|
2018-05-04 16:42:54 +02:00
|
|
|
|
2021-06-29 10:02:44 +02:00
|
|
|
/**
|
|
|
|
|
* @brief Gets data pointer to the mDNS packet
|
|
|
|
|
*/
|
2025-02-07 11:39:11 +01:00
|
|
|
void *mdns_priv_get_packet_data(mdns_rx_packet_t *packet);
|
2021-06-29 10:02:44 +02:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Gets data length of c
|
|
|
|
|
*/
|
2025-02-07 11:39:11 +01:00
|
|
|
size_t mdns_priv_get_packet_len(mdns_rx_packet_t *packet);
|
2021-06-29 10:02:44 +02:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Free the mDNS packet
|
|
|
|
|
*/
|
2025-02-07 11:39:11 +01:00
|
|
|
void mdns_priv_packet_free(mdns_rx_packet_t *packet);
|
2021-06-29 10:02:44 +02:00
|
|
|
|
2025-02-07 11:39:11 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|