1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- #ifndef ZEPHYR_INCLUDE_NET_HOSTNAME_H_
- #define ZEPHYR_INCLUDE_NET_HOSTNAME_H_
- #ifdef __cplusplus
- extern "C" {
- #endif
- #define NET_HOSTNAME_MAX_LEN \
- (sizeof(CONFIG_NET_HOSTNAME) - 1 + \
- (IS_ENABLED(CONFIG_NET_HOSTNAME_UNIQUE) ? \
- sizeof("0011223344556677") - 1 : 0))
- #if defined(CONFIG_NET_HOSTNAME_ENABLE)
- const char *net_hostname_get(void);
- #else
- static inline const char *net_hostname_get(void)
- {
- return "zephyr";
- }
- #endif
- #if defined(CONFIG_NET_HOSTNAME_ENABLE)
- void net_hostname_init(void);
- #else
- static inline void net_hostname_init(void)
- {
- }
- #endif
- #if defined(CONFIG_NET_HOSTNAME_UNIQUE)
- int net_hostname_set_postfix(const uint8_t *hostname_postfix,
- int postfix_len);
- #else
- static inline int net_hostname_set_postfix(const uint8_t *hostname_postfix,
- int postfix_len)
- {
- return -EMSGSIZE;
- }
- #endif
- #ifdef __cplusplus
- }
- #endif
- #endif
|