zephyr/include/zephyr/net/mdns_responder.h
Konrad Derda 42e6c1fbc6 net: mdns: add capability of providing records in runtime
Current implementation of mDNS responder does makes it mandatory to have
all the records set at compile time. It is not suited well for applications
that have to publish/unpublish or change records in runtime, e.g. data
received from the network.

Signed-off-by: Konrad Derda <konrad.derda@nordicsemi.no>
2024-03-22 12:41:56 +00:00

35 lines
1.1 KiB
C

/*
* Copyright (c) 2023 Nordic Semiconductor ASA.
*
* SPDX-License-Identifier: Apache-2.0
*/
/** @file
* @brief mDNS responder API
*
* This file contains the mDNS responder API. These APIs are used by the
* to register mDNS records.
*/
#ifndef ZEPHYR_INCLUDE_NET_MDNS_RESPONDER_H_
#define ZEPHYR_INCLUDE_NET_MDNS_RESPONDER_H_
#include <stddef.h>
#include <zephyr/net/dns_sd.h>
/**
* @brief Register continuous memory of @ref dns_sd_rec records.
*
* mDNS responder will start with iteration over mDNS records registered using
* @ref DNS_SD_REGISTER_SERVICE (if any) and then go over external records.
*
* @param records A 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.
* @param count The number of elements
* @return 0 for OK; -EINVAL for invalid parameters.
*/
int mdns_responder_set_ext_records(const struct dns_sd_rec *records, size_t count);
#endif /* ZEPHYR_INCLUDE_NET_MDNS_RESPONDER_H_ */