Networking Stack
[HelenOS Services]


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.

Function Documentation

int add_configuration ( measured_strings_t *  configuration,
const uint8_t *  name,
const uint8_t *  value 
)

Add the configured setting to the configuration map.

Parameters:
[in] configuration The configuration map.
[in] name The setting name.
[in] value The setting value.
Returns:
EOK on success.

ENOMEM if there is not enough memory left.

Definition at line 93 of file net.c.

DEVICE_MAP_DECLARE ( netifs  ,
netif_t   
)

Present network interfaces.

Maps devices to the networking device specific data.

See also:
device.h

static device_id_t generate_new_device_id ( void   )  [static]

Generate new system-unique device identifier.

Returns:
The system-unique devic identifier.

Definition at line 117 of file net.c.

GENERIC_CHAR_MAP_DECLARE ( measured_strings  ,
measured_string_t   
)

Configuration settings.

Maps setting names to the values.

See also:
generic_char_map.h

int main ( int  argc,
char *  argv[] 
)

Main entry point.

Parameters:
[in] argc Nmber of arguments in argv vector (ignored).
[in] argv Cmdline argument vector (ignored).
Returns:
Error code.
Driver debug level is set here.

Definition at line 713 of file net.c.

static void net_client_connection ( ipc_callid_t  iid,
ipc_call_t icall 
) [static]

Default thread for new connections.

Parameters:
[in] iid The initial message identifier.
[in] icall The initial message call structure.

Definition at line 683 of file net.c.

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.

Parameters:
[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.
Returns:
EOK.

Definition at line 369 of file net.c.

static int net_initialize ( async_client_conn_t  client_connection  )  [static]

Initialize the networking module.

Parameters:
[in] client_connection The client connection processing function. The module skeleton propagates its own one.
Returns:
EOK on success.

ENOMEM if there is not enough memory left.

Definition at line 273 of file net.c.

int net_initialize_build ( async_client_conn_t  client_connection  ) 

Initialize the networking module for the chosen subsystem build type.

Parameters:
[in] client_connection The client connection processing function. The module skeleton propagates its own one.
Returns:
EOK on success.

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.

Parameters:
[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.
Returns:
EOK on success.

ENOTSUP if the message is not known.

See also:
net_interface.h

IS_NET_NET_MESSAGE()

Definition at line 632 of file net.c.

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.

Parameters:
[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.
Returns:
EOK on success.

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.

Parameters:
[in] client_connection The client connection processing function. The module skeleton propagates its own one.
Returns:
EOK on successful module termination.

Other error codes as defined for the net_initialize() function.

Other error codes as defined for the REGISTER_ME() macro function.

Definition at line 328 of file net.c.

static int read_configuration ( void   )  [static]

Read the networking subsystem global configuration.

Returns:
EOK on success.

Other error codes as defined for the add_configuration() function.

Definition at line 257 of file net.c.

static int read_netif_configuration ( const char *  name,
netif_t netif 
) [static]

Read the network interface specific configuration.

Parameters:
[in] name The network interface name.
[in,out] netif The network interface structure.
Returns:
EOK on success.

Other error codes as defined for the add_configuration() function.

Definition at line 246 of file net.c.

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.

Parameters:
[in] netif The network interface specific data.
Returns:
EOK on success.

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.

Definition at line 437 of file net.c.

static int startup ( void   )  [static]

Read the configuration and start all network interfaces.

Returns:
EOK on success.

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.

Definition at line 531 of file net.c.


Generated on Thu Jun 2 07:45:55 2011 for HelenOS/USB by  doxygen 1.4.7