diff --git a/CHANGELOG b/CHANGELOG index fb51d723..e30bd729 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -19,6 +19,9 @@ HISTORY ++ New features: + 2010-02-05: Simon Goldschmidt + * netif.h: Added function-like macros to get/set the hostname on a netif + 2010-02-04: Simon Goldschmidt * nearly every file: Replaced struct ip_addr by typedef ip_addr_t to make changing the actual implementation behind the typedef easier. diff --git a/src/include/lwip/netif.h b/src/include/lwip/netif.h index 3fcc101a..b155152a 100644 --- a/src/include/lwip/netif.h +++ b/src/include/lwip/netif.h @@ -280,6 +280,11 @@ void netif_set_link_down(struct netif *netif); void netif_set_link_callback(struct netif *netif, netif_status_callback_fn link_callback); #endif /* LWIP_NETIF_LINK_CALLBACK */ +#if LWIP_NETIF_HOSTNAME +#define netif_set_hostname(netif, name) do { if((netif) != NULL) { (netif)->hostname = name; }}while(0) +#define netif_get_hostname(netif) (((netif) != NULL) ? ((netif)->hostname) : NULL) +#endif /* LWIP_NETIF_HOSTNAME */ + #if ENABLE_LOOPBACK err_t netif_loop_output(struct netif *netif, struct pbuf *p, ip_addr_t *dest_ip); void netif_poll(struct netif *netif);