00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00038 #ifndef NET_NET_H_
00039 #define NET_NET_H_
00040
00041 #include <net/device.h>
00042 #include <adt/char_map.h>
00043 #include <adt/generic_char_map.h>
00044 #include <adt/measured_strings.h>
00045 #include <adt/module_map.h>
00046 #include <net/packet.h>
00047
00052 #define NE2000_FILENAME "/srv/ne2000"
00053 #define NE2000_NAME "ne2000"
00054
00055 #define ETHERNET_FILENAME "/srv/eth"
00056 #define ETHERNET_NAME "eth"
00057
00058 #define IP_FILENAME "/srv/ip"
00059 #define IP_NAME "ip"
00060
00061 #define LO_FILENAME "/srv/lo"
00062 #define LO_NAME "lo"
00063
00064 #define NILDUMMY_FILENAME "/srv/nildummy"
00065 #define NILDUMMY_NAME "nildummy"
00066
00074 #define CONF_IL "IL"
00075 #define CONF_IO "IO"
00076 #define CONF_IRQ "IRQ"
00077 #define CONF_MTU "MTU"
00078 #define CONF_NAME "NAME"
00079 #define CONF_NETIF "NETIF"
00080 #define CONF_NIL "NIL"
00085 #define CONF_DIR "/cfg/net"
00086 #define CONF_GENERAL_FILE "general"
00094 GENERIC_CHAR_MAP_DECLARE(measured_strings, measured_string_t);
00095
00099 typedef struct {
00100 measured_strings_t configuration;
00103 module_t *driver;
00104
00105 device_id_t id;
00106 module_t *il;
00107 uint8_t *name;
00108 module_t *nil;
00109 } netif_t;
00110
00117 DEVICE_MAP_DECLARE(netifs, netif_t);
00118
00122 typedef struct {
00123 measured_strings_t configuration;
00124 modules_t modules;
00127 char_map_t netif_names;
00128
00130 netifs_t netifs;
00131 } net_globals_t;
00132
00133 extern int add_configuration(measured_strings_t *, const uint8_t *,
00134 const uint8_t *);
00135 extern int net_module_message(ipc_callid_t, ipc_call_t *, ipc_call_t *, size_t *);
00136 extern int net_initialize_build(async_client_conn_t);
00137 extern int net_message(ipc_callid_t, ipc_call_t *, ipc_call_t *, size_t *);
00138
00139 #endif
00140