|
Zephyr Project API 4.4.99
A Scalable Open Source RTOS
|
Network configuration library. More...
Data Structures | |
| struct | net_config_ssh_password_auth |
| This contains configuration data for password authentication for sshd on the device. More... | |
| struct | net_config_ssh_key |
| This contains key configuration data for sshd on the device. More... | |
Macros | |
| #define | NET_CONFIG_NEED_ROUTER 0x00000001 |
| Application needs routers to be set so that connectivity to remote network is possible. | |
| #define | NET_CONFIG_NEED_IPV6 0x00000002 |
| Application needs IPv6 subsystem configured and initialized. | |
| #define | NET_CONFIG_NEED_IPV4 0x00000004 |
| Application needs IPv4 subsystem configured and initialized. | |
| #define | NET_CONFIG_SSH_KEY_BUF_DEFINE_STATIC(name, key_bits) |
| Temporary key buffer needed for loading and saving keys. | |
| #define | NET_CONFIG_SSH_PASSWORD_AUTH_DEFINE_STATIC(name, user_name, pwd) |
| Statically define a username and password for SSH server configuration. | |
| #define | NET_CONFIG_SSH_PRIV_KEY_DEFINE_STATIC(name, _key_buf_name, _key_buf_len, _key_name, _key_id, _key_type, _key_bits) |
| Statically define a private key for SSH server configuration. | |
| #define | NET_CONFIG_SSH_PUB_KEY_DEFINE_STATIC(name, _key_buf_name, _key_buf_len, _key_name, _key_id) |
| Statically define a public key for SSH server configuration. | |
Functions | |
| int | net_config_init (const char *app_info, uint32_t flags, int32_t timeout) |
| Initialize this network application. | |
| int | net_config_init_by_iface (struct net_if *iface, const char *app_info, uint32_t flags, int32_t timeout) |
| Initialize this network application using a specific network interface. | |
| int | net_config_init_app (const struct device *dev, const char *app_info) |
| Initialize this network application. | |
| static int | net_config_init_sshd (struct net_if *iface, const struct net_config_ssh_key *priv_key_config, const struct net_config_ssh_key *pub_key_config, const struct net_config_ssh_password_auth *password_auth_config, int sshd_instance) |
| Initialize SSH server on the device. | |
Network configuration library.
| #define NET_CONFIG_NEED_IPV4 0x00000004 |
#include <net_config.h>
Application needs IPv4 subsystem configured and initialized.
Typically this means that the device has IPv4 address set.
| #define NET_CONFIG_NEED_IPV6 0x00000002 |
#include <net_config.h>
Application needs IPv6 subsystem configured and initialized.
Typically this means that the device has IPv6 address set.
| #define NET_CONFIG_NEED_ROUTER 0x00000001 |
#include <net_config.h>
Application needs routers to be set so that connectivity to remote network is possible.
For IPv6 networks, this means that the device should receive IPv6 router advertisement message before continuing.
| #define NET_CONFIG_SSH_KEY_BUF_DEFINE_STATIC | ( | name, | |
| key_bits ) |
#include <net_config.h>
Temporary key buffer needed for loading and saving keys.
| name | Name of the SSH server configuration instance. This is used to identify the instance and must be unique if multiple instances are defined. |
| key_bits | Size of the SSH key in bits. |
| #define NET_CONFIG_SSH_PASSWORD_AUTH_DEFINE_STATIC | ( | name, | |
| user_name, | |||
| pwd ) |
#include <net_config.h>
Statically define a username and password for SSH server configuration.
| name | Name of the SSH server configuration instance. This is used to identify the instance and must be unique if multiple instances are defined. |
| user_name | Username to use for password authentication. If NULL or empty string, then username is not used. The username cannot contain spaces. |
| pwd | Password to use for password authentication. If NULL or empty string, password authentication will be disabled and only public key authentication will be allowed. |
| #define NET_CONFIG_SSH_PRIV_KEY_DEFINE_STATIC | ( | name, | |
| _key_buf_name, | |||
| _key_buf_len, | |||
| _key_name, | |||
| _key_id, | |||
| _key_type, | |||
| _key_bits ) |
#include <net_config.h>
Statically define a private key for SSH server configuration.
| name | Name of the SSH server configuration instance. This is used to identify the instance and must be unique if multiple instances are defined. |
| _key_buf_name | Name of the temporary key buffer defined with NET_CONFIG_SSH_KEY_BUF_DEFINE_STATIC() macro. This buffer is needed for loading and saving keys. The buffer can be shared between private and public key configurations if needed, but it must be big enough to hold the key data for both configurations. |
| _key_name | SSH key name. This is used when saving or loading keys to identify them. The key name cannot contain spaces. |
| _key_id | Key id. This is used to identify the key. |
| _key_type | Type of the SSH key. For example RSA key etc. |
| _key_bits | Size of the SSH key in bits. This is used to determine the size of the buffer needed for loading and saving keys. |
| #define NET_CONFIG_SSH_PUB_KEY_DEFINE_STATIC | ( | name, | |
| _key_buf_name, | |||
| _key_buf_len, | |||
| _key_name, | |||
| _key_id ) |
#include <net_config.h>
Statically define a public key for SSH server configuration.
| name | Name of the SSH server configuration instance. This is used to identify the instance and must be unique if multiple instances are defined. |
| _key_buf_name | Name of the temporary key buffer defined with NET_CONFIG_SSH_KEY_BUF_DEFINE_STATIC() macro. This buffer is needed for loading and saving keys. The buffer can be shared between private and public key configurations if needed, but it must be big enough to hold the key data for both configurations. |
| _key_name | SSH key name. This is used when saving or loading keys to identify them. The key name cannot contain spaces. |
| _key_id | Key id. This is used to identify the key. |
#include <net_config.h>
Initialize this network application.
This will call net_config_init_by_iface() with NULL network interface.
| app_info | String describing this application. |
| flags | Flags related to services needed by the client. |
| timeout | How long to wait the network setup before continuing the startup. |
| int net_config_init_app | ( | const struct device * | dev, |
| const char * | app_info ) |
#include <net_config.h>
Initialize this network application.
If CONFIG_NET_CONFIG_AUTO_INIT is set, then this function is called automatically when the device boots. If that is not desired, unset the config option and call the function manually when the application starts.
| dev | Network device to use. The function will figure out what network interface to use based on the device. If the device is NULL, then default network interface is used by the function. |
| app_info | String describing this application. |
| int net_config_init_by_iface | ( | struct net_if * | iface, |
| const char * | app_info, | ||
| uint32_t | flags, | ||
| int32_t | timeout ) |
#include <net_config.h>
Initialize this network application using a specific network interface.
If network interface is set to NULL, then the default one is used in the configuration.
| iface | Initialize networking using this network interface. |
| app_info | String describing this application. |
| flags | Flags related to services needed by the client. |
| timeout | How long to wait the network setup before continuing the startup. |
|
inlinestatic |
#include <net_config.h>
Initialize SSH server on the device.
| iface | Network interface to use for the SSH server. If NULL, the SSH server will bind to the wildcard address and be reachable through all network interfaces. |
| priv_key_config | Private key configuration for the SSH server. |
| pub_key_config | Public key configuration for the SSH server. |
| password_auth_config | Password authentication configuration for the SSH server. If using public key authetication, then this can be left as NULL or with NULL username and password. The public key authentication will have higher priority than password authentication, so if both are configured, then password authentication will only be used if public key authentication fails. If you want to specify a username for public key authentication, then set the username in the password_auth_config struct, even if password authentication is not used. This is because the SSH server needs to know the username to associate it with the public key. |
| sshd_instance | SSH server instance number. This is used to identify the SSH server instance and must be unique if multiple instances are defined. |