mirror of
https://github.com/polyfractal/rustl8710.git
synced 2025-07-31 19:01:05 +00:00
Initial checkin
This commit is contained in:
parent
d4f581cea3
commit
34016a7bd3
1285 changed files with 536346 additions and 0 deletions
37
component/common/network/mDNS/mDNSPlatform.c
Normal file
37
component/common/network/mDNS/mDNSPlatform.c
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
#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
|
||||
char *mDNSPlatformHostname(void)
|
||||
{
|
||||
#if LWIP_NETIF_HOSTNAME
|
||||
return xnetif[0].hostname;
|
||||
#else
|
||||
return "ameba";
|
||||
#endif
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------*/
|
||||
Loading…
Add table
Add a link
Reference in a new issue