Zephyr Project API 4.0.0
A Scalable Open Source RTOS
|
Network hostname configuration library. More...
Macros | |
#define | NET_HOSTNAME_MAX_LEN |
Maximum hostname length. | |
Functions | |
static const char * | net_hostname_get (void) |
Get the device hostname. | |
static int | net_hostname_set (char *host, size_t len) |
Set the device hostname. | |
static void | net_hostname_init (void) |
Initialize and set the device hostname. | |
static int | net_hostname_set_postfix (const uint8_t *hostname_postfix, int postfix_len) |
Set the device hostname postfix. | |
static int | net_hostname_set_postfix_str (const uint8_t *hostname_postfix, int postfix_len) |
Set the postfix string for the network hostname. | |
Network hostname configuration library.
#define NET_HOSTNAME_MAX_LEN |
#include <include/zephyr/net/hostname.h>
Maximum hostname length.
|
inlinestatic |
#include <include/zephyr/net/hostname.h>
Get the device hostname.
Return pointer to device hostname.
|
inlinestatic |
#include <include/zephyr/net/hostname.h>
Initialize and set the device hostname.
|
inlinestatic |
#include <include/zephyr/net/hostname.h>
Set the device hostname.
host | new hostname as char array. |
len | Length of the hostname array. |
|
inlinestatic |
#include <include/zephyr/net/hostname.h>
Set the device hostname postfix.
Convert the hostname postfix to hexadecimal value and set the device hostname with the converted value. This is only used if CONFIG_NET_HOSTNAME_UNIQUE is set.
hostname_postfix | Usually link address. The function will convert this to a hexadecimal string. |
postfix_len | Length of the hostname_postfix array. |
|
inlinestatic |
#include <include/zephyr/net/hostname.h>
Set the postfix string for the network hostname.
Set the hostname postfix string for the network hostname as is, without any conversion. This is only used if CONFIG_NET_HOSTNAME_UNIQUE is set. The function checks if the combined length of the default hostname (defined by CONFIG_NET_HOSTNAME) and the postfix does not exceed NET_HOSTNAME_MAX_LEN. If the postfix is too long, the function returns an error.
hostname_postfix | Pointer to the postfix string to be appended to the network hostname. |
postfix_len | Length of the hostname_postfix array. |