Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
mdns_responder.h File Reference

mDNS responder API More...

#include <stddef.h>
#include <errno.h>
#include <zephyr/net/dns_sd.h>
#include <zephyr/net/net_if.h>

Go to the source code of this file.

Functions

int mdns_responder_set_ext_records (const struct dns_sd_rec *records, size_t count)
 Register continuous memory of dns_sd_rec records.
int mdns_responder_enable_iface (struct net_if *iface)
 Enable the mDNS responder on a specific network interface at runtime.
int mdns_responder_disable_iface (struct net_if *iface)
 Disable the mDNS responder on a specific network interface at runtime.

Detailed Description

mDNS responder API

This file contains the mDNS responder API. These APIs are used by the to register mDNS records.

Function Documentation

◆ mdns_responder_disable_iface()

int mdns_responder_disable_iface ( struct net_if * iface)

Disable the mDNS responder on a specific network interface at runtime.

The runtime setting overrides the build-time interface policy for the given interface. The listener socket bound to the interface is closed and its mDNS multicast group memberships are left, so no further queries are answered on that interface.

Attention
Available only when the following Kconfig option is enabled:
CONFIG_MDNS_RESPONDER_RUNTIME_IFACE_CONTROL 
.
Parameters
ifaceNetwork interface to disable the responder on.
Returns
0 for OK; -EINVAL if iface is NULL; -ERANGE if the interface index is out of range; -ENOTSUP if runtime control is not enabled.

◆ mdns_responder_enable_iface()

int mdns_responder_enable_iface ( struct net_if * iface)

Enable the mDNS responder on a specific network interface at runtime.

The runtime setting overrides the build-time interface policy (

CONFIG_MDNS_RESPONDER_IFACE_POLICY_ALL 

and friends) for the given interface. The responder listener sockets and multicast group memberships are reconfigured so that queries arriving on the interface are answered.

Attention
Available only when the following Kconfig option is enabled:
CONFIG_MDNS_RESPONDER_RUNTIME_IFACE_CONTROL 
.
Parameters
ifaceNetwork interface to enable the responder on.
Returns
0 for OK; -EINVAL if iface is NULL; -ERANGE if the interface index is out of range; -ENOTSUP if runtime control is not enabled.

◆ mdns_responder_set_ext_records()

int mdns_responder_set_ext_records ( const struct dns_sd_rec * records,
size_t count )

Register continuous memory of dns_sd_rec records.

mDNS responder will start with iteration over mDNS records registered using DNS_SD_REGISTER_SERVICE (if any) and then go over external records.

Parameters
recordsA pointer to an array of mDNS records. It is stored internally without copying the content so it must be kept valid. It can be set to NULL, e.g. before freeing the memory block.
countThe number of elements
Returns
0 for OK; -EINVAL for invalid parameters.