Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
Network Hostname Library

Network hostname configuration library. More...

Macros

#define NET_HOSTNAME_MAX_LEN
 

Functions

static const char * net_hostname_get (void)
 Get the device hostname. More...
 
static void net_hostname_init (void)
 Initialize and set the device hostname. More...
 
static int net_hostname_set_postfix (const uint8_t *hostname_postfix, int postfix_len)
 Set the device hostname postfix. More...
 

Detailed Description

Network hostname configuration library.

Macro Definition Documentation

◆ NET_HOSTNAME_MAX_LEN

#define NET_HOSTNAME_MAX_LEN

#include <include/net/hostname.h>

Value:
(sizeof(CONFIG_NET_HOSTNAME) - 1 + \
(IS_ENABLED(CONFIG_NET_HOSTNAME_UNIQUE) ? \
sizeof("0011223344556677") - 1 : 0))
#define IS_ENABLED(config_macro)
Check for macro definition in compiler-visible expressions.
Definition: util_macro.h:101

Function Documentation

◆ net_hostname_get()

static const char * net_hostname_get ( void  )
inlinestatic

#include <include/net/hostname.h>

Get the device hostname.

Return pointer to device hostname.

Returns
Pointer to hostname or NULL if not set.

◆ net_hostname_init()

static void net_hostname_init ( void  )
inlinestatic

#include <include/net/hostname.h>

Initialize and set the device hostname.

◆ net_hostname_set_postfix()

static int net_hostname_set_postfix ( const uint8_t hostname_postfix,
int  postfix_len 
)
inlinestatic

#include <include/net/hostname.h>

Set the device hostname postfix.

Set the device hostname to some value. This is only used if CONFIG_NET_HOSTNAME_UNIQUE is set.

Parameters
hostname_postfixUsually link address. The function will convert this to a string.
postfix_lenLength of the hostname_postfix array.
Returns
0 if ok, <0 if error