open-ameba/RTL00_SDKV35a/component/common/network/mDNS/mDNSPlatform.c

38 lines
840 B
C
Raw Normal View History

2016-11-09 00:56:41 +00:00
#include <lwip/sockets.h>
#include <lwip/netif.h>
extern struct netif xnetif[];
/*-----------------------------------------------------------------------
* Mandatory functions
*-----------------------------------------------------------------------*/
// Mandatory function for custom initialization
// called when mDNS initialization
void mDNSPlatformCustomInit(void)
{
xnetif[0].flags |= NETIF_FLAG_IGMP;
}
uint16_t mDNSPlatformHtons(uint16_t hostshort)
{
return htons(hostshort);
}
uint32_t mDNSPlatformInetAddr(char *cp)
{
return inet_addr(cp);
}
// Mandatory function to get hostname
// called when mDNS initialization
2017-03-11 03:10:30 +00:00
_WEAK char *mDNSPlatformHostname(void)
2016-11-09 00:56:41 +00:00
{
#if LWIP_NETIF_HOSTNAME
return xnetif[0].hostname;
#else
2017-03-11 03:10:30 +00:00
return DEF_HOSTNAME;
2016-11-09 00:56:41 +00:00
#endif
}
/*-----------------------------------------------------------------------*/