/* Determine if a name lookup is for this node. Two names are given
to this node: that returned by pcApplicationHostnameHook() and that set
by mainDEVICE_NAME. */
if( strcmp( pcName, pcApplicationHostnameHook() ) == 0 )
{
xReturn = pdPASS;
}
else if( strcmp( pcName, mainDEVICE_NAME ) == 0 )
{
xReturn = pdPASS;
}
else
{
xReturn = pdFAIL;
}
return xReturn;
}
const char pcApplicationHostnameHook( void )
{
/ Assign the name “rtosdemo” to this network node. This function will be
called during the DHCP: the machine will be registered with an IP address
plus this name. */
return mainHOST_NAME;
}
~~~
thanks
mainDEVICE_NAME and mainHOST_NAME purpose
Hi
I would like to know what is the purpose of mainDEVICENAME and mainHOSTNAME that are used by the two Hook functions below:
~~~
BaseTypet xApplicationDNSQueryHook( const char *pcName )
{
BaseTypet xReturn;
mainDEVICE_NAME and mainHOST_NAME purpose
They are human readable text names you can give the device. DNS being
‘d’omain ‘n’ame ‘s’ervice. So for example, if you set the name to
“MyDevice” and you have LLMNR (link local name resolution) then you can
ping MyDevice without needing to know the IP address of your device –
the name is resolved to the IP address.