31,7 → 31,7 |
*/ |
|
/** @file |
* Networking subsystem compilation configuration. |
* Networking subsystem central module. |
*/ |
|
#ifndef __NET_NET_H__ |
47,48 → 47,109 |
#include "../structures/module_map.h" |
#include "../structures/packet/packet.h" |
|
/** Loopback network interface module name. |
*/ |
#define LO_NAME "lo" |
|
/** Loopback network interface module full path filename. |
*/ |
#define LO_FILENAME "/srv/lo" |
|
/** DP8390 network interface module name. |
*/ |
#define DP8390_NAME "dp8390" |
|
/** DP8390 network interface module full path filename. |
*/ |
#define DP8390_FILENAME "/srv/dp8390" |
|
/** Ethernet module name. |
*/ |
#define ETHERNET_NAME "ethernet" |
|
/** Ethernet module full path filename. |
*/ |
#define ETHERNET_FILENAME "/srv/eth" |
|
/** Internet protocol module name. |
*/ |
#define IP_NAME "ip" |
|
/** Internet protocol module full path filename. |
*/ |
#define IP_FILENAME "/srv/ip" |
|
/** Network interface name configuration label. |
*/ |
#define CONF_NAME "NAME" |
|
/** Network interface module name configuration label. |
*/ |
#define CONF_NETIF "NETIF" |
|
/** Network interface layer module name configuration label. |
*/ |
#define CONF_NIL "NIL" |
|
/** Internet protocol module name configuration label. |
*/ |
#define CONF_IL "IL" |
|
/** Interrupt number configuration label. |
*/ |
#define CONF_IRQ "IRQ" |
|
/** Device input/output address configuration label. |
*/ |
#define CONF_IO "IO" |
|
/** Maximum transmission unit configuration label. |
*/ |
#define CONF_MTU "MTU" |
|
/** Type definition of the network interface specific data. |
* @see netif |
*/ |
typedef struct netif netif_t; |
|
/** Type definition of the network interface specific data pointer. |
* @see netif |
*/ |
typedef netif_t * netif_ref; |
|
/** Type definition of the networking module global data. |
* @see net_globals |
*/ |
typedef struct net_globals net_globals_t; |
|
/** Present network interfaces. |
* Maps devices to the networking device specific data. |
* @see device.h |
*/ |
DEVICE_MAP_DECLARE( netifs, netif_t ) |
|
/** Configuration settings. |
* Maps setting names to the values. |
* @see generic_char_map.h |
*/ |
GENERIC_CHAR_MAP_DECLARE( measured_strings, measured_string_t ) |
|
/** A present network interface device. |
/** Present network interface device. |
*/ |
struct netif{ |
/** A system-unique network interface identifier. |
/** System-unique network interface identifier. |
*/ |
device_id_t id; |
/** A serving network interface driver module index. |
/** Serving network interface driver module index. |
*/ |
module_ref driver; |
/** A serving link layer module index. |
/** Serving link layer module index. |
*/ |
module_ref nil; |
/** A serving internet layer module index. |
/** Serving internet layer module index. |
*/ |
module_ref il; |
/** A system-unique network interface name. |
/** System-unique network interface name. |
*/ |
char * name; |
/** Configuration. |
96,7 → 157,7 |
measured_strings_t configuration; |
}; |
|
/** A net module global variables. |
/** Networking module global variables. |
*/ |
struct net_globals{ |
/** Present network interfaces. |
113,10 → 174,51 |
measured_strings_t configuration; |
}; |
|
/** Adds the configured setting to the configuration map. |
* @param configuration The configuration map. Input parameter. |
* @param name The setting name. Input parameter. |
* @param value The setting value. Input parameter. |
* @returns EOK on success. |
* @returns ENOMEM if there is not enough memory left. |
*/ |
int add_configuration( measured_strings_ref configuration, const char * name, const char * value ); |
|
/** Processes the networking message. |
* @param callid The message identifier. Input parameter. |
* @param call The message parameters. Input parameter. |
* @param answer The message answer parameters. Output parameter. |
* @param answer_count The last parameter for the actual answer in the answer parameter. Output parameter. |
* @returns EOK on success. |
* @returns ENOTSUP if the message is not known. |
* @see net_interface.h |
* @see IS_NET_NET_MESSAGE() |
*/ |
int net_message( ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count ); |
|
/** Initializes the networking module. |
* @returns EOK on success. |
* @returns ENOMEM if there is not enough memory left. |
*/ |
int net_initialize( void ); |
|
/** Processes the module message. |
* Distributes the message to the right bundled module. |
* @param callid The message identifier. Input parameter. |
* @param call The message parameters. Input parameter. |
* @param answer The message answer parameters. Output parameter. |
* @param answer_count The last parameter for the actual answer in the answer parameter. Output parameter. |
* @returns EOK on success. |
* @returns ENOTSUP if the message is not known. |
* @returns Other error codes as defined for each bundled module message function. |
*/ |
int module_message( ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count ); |
|
/** Reads the network interface specific configuration. |
* @param name The network interface name. Input parameter. |
* @param netif The network interface structure. Input/output parameter. |
* @returns EOK on success. |
* @returns Other error codes as defined for the add_configuration() function. |
*/ |
int read_netif_configuration( char * name, netif_ref netif ); |
|
#endif |