Add rtems_mdns_sethostname()

Use it to set the multi-cast hostname of the default mDNS resolver
instance via sethostname().
This commit is contained in:
Sebastian Huber
2014-11-06 08:28:06 +01:00
parent 50e82a6d15
commit 7a3fe8ef43
6 changed files with 104 additions and 4 deletions

View File

@@ -40,6 +40,9 @@
extern "C" {
#endif /* __cplusplus */
/* Private variable, do not touch. Use rtems_mdns_sethostname() instead. */
extern void (*rtems_mdns_sethostname_handler)(const char *hostname);
/**
* @brief Initializes an mDNS resolver instance.
*
@@ -67,6 +70,20 @@ rtems_status_code rtems_mdns_initialize(rtems_task_priority daemon_priority,
*/
mDNS *rtems_mdns_get_instance(void);
/**
* @brief Sets the multi-cast hostname of the mDNS resolver instance.
*
* In case the mDNS resolver instance is not initialized, then this function
* has no effect.
*
* @param[in] hostname The new multi-cast hostname.
*/
static inline void
rtems_mdns_sethostname(const char *hostname)
{
(*rtems_mdns_sethostname_handler)(hostname);
}
#ifdef __cplusplus
}
#endif /* __cplusplus */