Files | |
file | net.c |
Networking subsystem central module implementation. | |
file | net.h |
Networking subsystem central module. | |
file | net_standalone.c |
Wrapper for the standalone networking module. | |
Modules | |
Network interface drivers | |
Network interface layer | |
Inter-networking layer | |
Transport layer | |
Packet management system | |
Applications | |
Application library | |
Data Structures | |
struct | net_globals_t |
Networking module global data. More... | |
struct | netif_t |
Present network interface device. More... | |
Configuration setting names definitions | |
#define | CONF_IL "IL" |
Internet protocol module name configuration label. | |
#define | CONF_IO "IO" |
Device input/output address configuration label. | |
#define | CONF_IRQ "IRQ" |
Interrupt number configuration label. | |
#define | CONF_MTU "MTU" |
Maximum transmission unit configuration label. | |
#define | CONF_NAME "NAME" |
Network interface name configuration label. | |
#define | CONF_NETIF "NETIF" |
Network interface module name configuration label. | |
#define | CONF_NIL "NIL" |
Network interface layer module name configuration label. | |
Modules definitions | |
#define | ETHERNET_FILENAME "/srv/eth" |
#define | ETHERNET_NAME "eth" |
#define | IP_FILENAME "/srv/ip" |
#define | IP_NAME "ip" |
#define | LO_FILENAME "/srv/lo" |
#define | LO_NAME "lo" |
#define | NE2000_FILENAME "/srv/ne2000" |
#define | NE2000_NAME "ne2000" |
#define | NILDUMMY_FILENAME "/srv/nildummy" |
#define | NILDUMMY_NAME "nildummy" |
Defines | |
#define | BUFFER_SIZE 256 |
File read buffer size. | |
#define | CONF_DIR "/cfg/net" |
Configuration directory. | |
#define | CONF_GENERAL_FILE "general" |
General configuration file. | |
#define | NAME "net" |
Networking module name. | |
Functions | |
int | add_configuration (measured_strings_t *configuration, const uint8_t *name, const uint8_t *value) |
Add the configured setting to the configuration map. | |
DEVICE_MAP_DECLARE (netifs, netif_t) | |
Present network interfaces. | |
static device_id_t | generate_new_device_id (void) |
Generate new system-unique device identifier. | |
GENERIC_CHAR_MAP_DECLARE (measured_strings, measured_string_t) | |
Configuration settings. | |
int | main (int argc, char *argv[]) |
Main entry point. | |
static void | net_client_connection (ipc_callid_t iid, ipc_call_t *icall) |
Default thread for new connections. | |
void | net_free_settings (measured_string_t *settings, uint8_t *data) |
static int | net_get_conf (measured_strings_t *netif_conf, measured_string_t *configuration, size_t count, uint8_t **data) |
Return the configured values. | |
int | net_get_conf_req (int net_phone, measured_string_t **configuration, size_t count, uint8_t **data) |
int | net_get_device_conf_req (int net_phone, device_id_t device_id, measured_string_t **configuration, size_t count, uint8_t **data) |
static int | net_initialize (async_client_conn_t client_connection) |
Initialize the networking module. | |
int | net_initialize_build (async_client_conn_t client_connection) |
Initialize the networking module for the chosen subsystem build type. | |
int | net_message (ipc_callid_t callid, ipc_call_t *call, ipc_call_t *answer, size_t *answer_count) |
Process the networking message. | |
int | net_module_message (ipc_callid_t callid, ipc_call_t *call, ipc_call_t *answer, size_t *count) |
Process the module message. | |
static int | net_module_start (async_client_conn_t client_connection) |
Start the networking module. | |
static int | parse_line (measured_strings_t *configuration, uint8_t *line) |
static int | read_configuration (void) |
Read the networking subsystem global configuration. | |
static int | read_configuration_file (const char *directory, const char *filename, measured_strings_t *configuration) |
static int | read_netif_configuration (const char *name, netif_t *netif) |
Read the network interface specific configuration. | |
static int | start_device (netif_t *netif) |
Start the network interface according to its configuration. | |
static int | startup (void) |
Read the configuration and start all network interfaces. | |
Variables | |
net_globals_t | net_globals |
Networking module global data. | |
net_globals_t | net_globals |
Networking module global data. |
int add_configuration | ( | measured_strings_t * | configuration, | |
const uint8_t * | name, | |||
const uint8_t * | value | |||
) |
DEVICE_MAP_DECLARE | ( | netifs | , | |
netif_t | ||||
) |
static device_id_t generate_new_device_id | ( | void | ) | [static] |
GENERIC_CHAR_MAP_DECLARE | ( | measured_strings | , | |
measured_string_t | ||||
) |
int main | ( | int | argc, | |
char * | argv[] | |||
) |
static void net_client_connection | ( | ipc_callid_t | iid, | |
ipc_call_t * | icall | |||
) | [static] |
static int net_get_conf | ( | measured_strings_t * | netif_conf, | |
measured_string_t * | configuration, | |||
size_t | count, | |||
uint8_t ** | data | |||
) | [static] |
Return the configured values.
The network interface configuration is searched first.
[in] | netif_conf | The network interface configuration setting. |
[out] | configuration | The found configured values. |
[in] | count | The desired settings count. |
[out] | data | The found configuration settings data. |
static int net_initialize | ( | async_client_conn_t | client_connection | ) | [static] |
int net_initialize_build | ( | async_client_conn_t | client_connection | ) |
Initialize the networking module for the chosen subsystem build type.
[in] | client_connection | The client connection processing function. The module skeleton propagates its own one. |
ENOMEM if there is not enough memory left.
Definition at line 60 of file net_standalone.c.
int net_message | ( | ipc_callid_t | callid, | |
ipc_call_t * | call, | |||
ipc_call_t * | answer, | |||
size_t * | answer_count | |||
) |
Process the networking message.
[in] | callid | The message identifier. |
[in] | call | The message parameters. |
[out] | answer | The message answer parameters. |
[out] | answer_count | The last parameter for the actual answer in the answer parameter. |
ENOTSUP if the message is not known.
int net_module_message | ( | ipc_callid_t | callid, | |
ipc_call_t * | call, | |||
ipc_call_t * | answer, | |||
size_t * | count | |||
) |
Process the module message.
Distribute the message to the right module.
[in] | callid | The message identifier. |
[in] | call | The message parameters. |
[out] | answer | The message answer parameters. |
[out] | answer_count | The last parameter for the actual answer in the answer parameter. |
ENOTSUP if the message is not known.
Other error codes.
Definition at line 100 of file net_standalone.c.
static int net_module_start | ( | async_client_conn_t | client_connection | ) | [static] |
Start the networking module.
Initializes the client connection serving function, initializes the module, registers the module service and starts the async manager, processing IPC messages in an infinite loop.
[in] | client_connection | The client connection processing function. The module skeleton propagates its own one. |
Other error codes as defined for the net_initialize() function.
Other error codes as defined for the REGISTER_ME() macro function.
static int read_configuration | ( | void | ) | [static] |
Read the networking subsystem global configuration.
Other error codes as defined for the add_configuration() function.
static int read_netif_configuration | ( | const char * | name, | |
netif_t * | netif | |||
) | [static] |
Read the network interface specific configuration.
[in] | name | The network interface name. |
[in,out] | netif | The network interface structure. |
Other error codes as defined for the add_configuration() function.
static int start_device | ( | netif_t * | netif | ) | [static] |
Start the network interface according to its configuration.
Register the network interface with the subsystem modules. Start the needed subsystem modules.
[in] | netif | The network interface specific data. |
EINVAL if there are some settings missing.
ENOENT if the internet protocol module is not known.
Other error codes as defined for the netif_probe_req() function.
Other error codes as defined for the nil_device_req() function.
Other error codes as defined for the needed internet layer registering function.
static int startup | ( | void | ) | [static] |
Read the configuration and start all network interfaces.
EXDEV if there is no available system-unique device identifier.
EINVAL if any of the network interface names are not configured.
ENOMEM if there is not enough memory left.
Other error codes as defined for the read_configuration() function.
Other error codes as defined for the read_netif_configuration() function.
Other error codes as defined for the start_device() function.