net.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2009 Lukas Mejdrech
00003  * All rights reserved.
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions
00007  * are met:
00008  *
00009  * - Redistributions of source code must retain the above copyright
00010  *   notice, this list of conditions and the following disclaimer.
00011  * - Redistributions in binary form must reproduce the above copyright
00012  *   notice, this list of conditions and the following disclaimer in the
00013  *   documentation and/or other materials provided with the distribution.
00014  * - The name of the author may not be used to endorse or promote products
00015  *   derived from this software without specific prior written permission.
00016  *
00017  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
00018  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00019  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
00020  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
00021  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
00022  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00023  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00024  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00025  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
00026  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
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 

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