summaryrefslogtreecommitdiffstats
path: root/rtemsbsd/include/rtems/mdns.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-11-06 08:28:06 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-11-06 08:29:57 +0100
commit7a3fe8ef43993f7b598bacc07cf801a6265b11af (patch)
treebfa69eabc123b82ded1054151fa700d2b20552f8 /rtemsbsd/include/rtems/mdns.h
parentHOSTNAME(1): Import from FreeBSD (diff)
downloadrtems-libbsd-7a3fe8ef43993f7b598bacc07cf801a6265b11af.tar.bz2
Add rtems_mdns_sethostname()
Use it to set the multi-cast hostname of the default mDNS resolver instance via sethostname().
Diffstat (limited to 'rtemsbsd/include/rtems/mdns.h')
-rw-r--r--rtemsbsd/include/rtems/mdns.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/rtemsbsd/include/rtems/mdns.h b/rtemsbsd/include/rtems/mdns.h
index ecf9242b..4abfbfe5 100644
--- a/rtemsbsd/include/rtems/mdns.h
+++ b/rtemsbsd/include/rtems/mdns.h
@@ -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 */