mDNS responder (Multicast DNS) More...
#include "core/net.h"
#include "core/udp.h"
#include "dns/dns_common.h"
#include "mdns/mdns_common.h"
Go to the source code of this file.
Data Structures | |
struct | MdnsIpv4AddrEntry |
IPv4 address entry. More... | |
struct | MdnsIpv6AddrEntry |
IPv6 address entry. More... | |
struct | MdnsResponderSettings |
mDNS responder settings More... | |
struct | _MdnsResponderContext |
mDNS responder context More... | |
Macros | |
#define | MDNS_RESPONDER_SUPPORT DISABLED |
#define | MDNS_RESPONDER_TICK_INTERVAL 250 |
#define | MDNS_RESPONDER_MAX_HOSTNAME_LEN 32 |
#define | MDNS_INIT_DELAY 1000 |
#define | MDNS_RAND_DELAY_MIN 0 |
#define | MDNS_RAND_DELAY_MAX 250 |
#define | MDNS_PROBE_NUM 3 |
#define | MDNS_PROBE_DELAY 250 |
#define | MDNS_PROBE_CONFLICT_DELAY 1000 |
#define | MDNS_PROBE_DEFER_DELAY 1000 |
#define | MDNS_ANNOUNCE_NUM 2 |
#define | MDNS_ANNOUNCE_DELAY 1000 |
#define | DNS_SD_ADDITIONAL_RECORDS_SUPPORT ENABLED |
#define | MdnsResponderContext struct _MdnsResponderContext |
Typedefs | |
typedef void(* | MdnsResponderStateChangeCallback) (MdnsResponderContext *context, NetInterface *interface, MdnsState state) |
FSM state change callback. More... | |
Enumerations | |
enum | MdnsState { MDNS_STATE_INIT = 0, MDNS_STATE_WAITING = 1, MDNS_STATE_PROBING = 2, MDNS_STATE_ANNOUNCING = 3, MDNS_STATE_IDLE = 4 } |
mDNS responder states More... | |
Functions | |
void | mdnsResponderGetDefaultSettings (MdnsResponderSettings *settings) |
Initialize settings with default values. More... | |
error_t | mdnsResponderInit (MdnsResponderContext *context, const MdnsResponderSettings *settings) |
mDNS responder initialization More... | |
error_t | mdnsResponderStart (MdnsResponderContext *context) |
Start mDNS responder. More... | |
error_t | mdnsResponderStop (MdnsResponderContext *context) |
Stop mDNS responder. More... | |
MdnsState | mdnsResponderGetState (MdnsResponderContext *context) |
Retrieve current state. More... | |
error_t | mdnsResponderSetHostname (MdnsResponderContext *context, const char_t *hostname) |
Set host name. More... | |
error_t | mdnsResponderStartProbing (MdnsResponderContext *context) |
Restart probing process. More... | |
void | mdnsResponderTick (MdnsResponderContext *context) |
mDNS responder timer handler More... | |
void | mdnsResponderLinkChangeEvent (MdnsResponderContext *context) |
Callback function for link change event. More... | |
Variables | |
systime_t | mdnsResponderTickCounter |
Detailed Description
mDNS responder (Multicast DNS)
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneTCP Open.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- Version
- 2.4.4
Definition in file mdns_responder.h.
Macro Definition Documentation
◆ DNS_SD_ADDITIONAL_RECORDS_SUPPORT
#define DNS_SD_ADDITIONAL_RECORDS_SUPPORT ENABLED |
Definition at line 126 of file mdns_responder.h.
◆ MDNS_ANNOUNCE_DELAY
#define MDNS_ANNOUNCE_DELAY 1000 |
Definition at line 119 of file mdns_responder.h.
◆ MDNS_ANNOUNCE_NUM
#define MDNS_ANNOUNCE_NUM 2 |
Definition at line 112 of file mdns_responder.h.
◆ MDNS_INIT_DELAY
#define MDNS_INIT_DELAY 1000 |
Definition at line 63 of file mdns_responder.h.
◆ MDNS_PROBE_CONFLICT_DELAY
#define MDNS_PROBE_CONFLICT_DELAY 1000 |
Definition at line 98 of file mdns_responder.h.
◆ MDNS_PROBE_DEFER_DELAY
#define MDNS_PROBE_DEFER_DELAY 1000 |
Definition at line 105 of file mdns_responder.h.
◆ MDNS_PROBE_DELAY
#define MDNS_PROBE_DELAY 250 |
Definition at line 91 of file mdns_responder.h.
◆ MDNS_PROBE_NUM
#define MDNS_PROBE_NUM 3 |
Definition at line 84 of file mdns_responder.h.
◆ MDNS_RAND_DELAY_MAX
#define MDNS_RAND_DELAY_MAX 250 |
Definition at line 77 of file mdns_responder.h.
◆ MDNS_RAND_DELAY_MIN
#define MDNS_RAND_DELAY_MIN 0 |
Definition at line 70 of file mdns_responder.h.
◆ MDNS_RESPONDER_MAX_HOSTNAME_LEN
#define MDNS_RESPONDER_MAX_HOSTNAME_LEN 32 |
Definition at line 56 of file mdns_responder.h.
◆ MDNS_RESPONDER_SUPPORT
#define MDNS_RESPONDER_SUPPORT DISABLED |
Definition at line 42 of file mdns_responder.h.
◆ MDNS_RESPONDER_TICK_INTERVAL
#define MDNS_RESPONDER_TICK_INTERVAL 250 |
Definition at line 49 of file mdns_responder.h.
◆ MdnsResponderContext
#define MdnsResponderContext struct _MdnsResponderContext |
Definition at line 133 of file mdns_responder.h.
Typedef Documentation
◆ MdnsResponderStateChangeCallback
typedef void(* MdnsResponderStateChangeCallback) (MdnsResponderContext *context, NetInterface *interface, MdnsState state) |
FSM state change callback.
Definition at line 159 of file mdns_responder.h.
Enumeration Type Documentation
◆ MdnsState
enum MdnsState |
mDNS responder states
Enumerator | |
---|---|
MDNS_STATE_INIT | |
MDNS_STATE_WAITING | |
MDNS_STATE_PROBING | |
MDNS_STATE_ANNOUNCING | |
MDNS_STATE_IDLE |
Definition at line 145 of file mdns_responder.h.
Function Documentation
◆ mdnsResponderGetDefaultSettings()
void mdnsResponderGetDefaultSettings | ( | MdnsResponderSettings * | settings | ) |
Initialize settings with default values.
- Parameters
-
[out] settings Structure that contains mDNS responder settings
Definition at line 54 of file mdns_responder.c.
◆ mdnsResponderGetState()
MdnsState mdnsResponderGetState | ( | MdnsResponderContext * | context | ) |
Retrieve current state.
- Parameters
-
[in] context Pointer to the mDNS responder context
- Returns
- Current mDNS responder state
Definition at line 180 of file mdns_responder.c.
◆ mdnsResponderInit()
error_t mdnsResponderInit | ( | MdnsResponderContext * | context, |
const MdnsResponderSettings * | settings | ||
) |
mDNS responder initialization
- Parameters
-
[in] context Pointer to the mDNS responder context [in] settings mDNS responder specific settings
- Returns
- Error code
Definition at line 75 of file mdns_responder.c.
◆ mdnsResponderLinkChangeEvent()
void mdnsResponderLinkChangeEvent | ( | MdnsResponderContext * | context | ) |
Callback function for link change event.
- Parameters
-
[in] context Pointer to the mDNS responder context
Definition at line 608 of file mdns_responder.c.
◆ mdnsResponderSetHostname()
error_t mdnsResponderSetHostname | ( | MdnsResponderContext * | context, |
const char_t * | hostname | ||
) |
Set host name.
- Parameters
-
[in] context Pointer to the mDNS responder context [in] hostname NULL-terminated string that contains the host name
- Returns
- Error code
Definition at line 203 of file mdns_responder.c.
◆ mdnsResponderStart()
error_t mdnsResponderStart | ( | MdnsResponderContext * | context | ) |
Start mDNS responder.
- Parameters
-
[in] context Pointer to the mDNS responder context
- Returns
- Error code
Definition at line 118 of file mdns_responder.c.
◆ mdnsResponderStartProbing()
error_t mdnsResponderStartProbing | ( | MdnsResponderContext * | context | ) |
Restart probing process.
- Parameters
-
[in] context Pointer to the mDNS responder context
- Returns
- Error code
Definition at line 253 of file mdns_responder.c.
◆ mdnsResponderStop()
error_t mdnsResponderStop | ( | MdnsResponderContext * | context | ) |
Stop mDNS responder.
- Parameters
-
[in] context Pointer to the mDNS responder context
- Returns
- Error code
Definition at line 149 of file mdns_responder.c.
◆ mdnsResponderTick()
void mdnsResponderTick | ( | MdnsResponderContext * | context | ) |
mDNS responder timer handler
This routine must be periodically called by the TCP/IP stack to manage mDNS operation
- Parameters
-
[in] context Pointer to the mDNS responder context
Definition at line 370 of file mdns_responder.c.
Variable Documentation
◆ mdnsResponderTickCounter
|
extern |
Definition at line 46 of file mdns_responder.c.