Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/net/net.h

    ra64c64d r01a9ef5  
    5252/*@{*/
    5353
     54/** Loopback network interface module name.
     55 */
     56#define LO_NAME                         "lo"
     57
     58/** Loopback network interface module full path filename.
     59 */
     60#define LO_FILENAME                     "/srv/lo"
     61
     62/** DP8390 network interface module name.
     63 */
     64#define DP8390_NAME                     "dp8390"
     65
    5466/** DP8390 network interface module full path filename.
    5567 */
    5668#define DP8390_FILENAME         "/srv/dp8390"
    5769
    58 /** DP8390 network interface module name.
    59  */
    60 #define DP8390_NAME                     "dp8390"
     70/** Ethernet module name.
     71 */
     72#define ETHERNET_NAME           "ethernet"
    6173
    6274/** Ethernet module full path filename.
     
    6678/** Ethernet module name.
    6779 */
    68 #define ETHERNET_NAME           "ethernet"
     80#define NILDUMMY_NAME           "nildummy"
     81
     82/** Ethernet module full path filename.
     83 */
     84#define NILDUMMY_FILENAME       "/srv/nildummy"
     85
     86/** IP module name.
     87 */
     88#define IP_NAME                         "ip"
    6989
    7090/** IP module full path filename.
     
    7292#define IP_FILENAME                     "/srv/ip"
    7393
    74 /** IP module name.
    75  */
    76 #define IP_NAME                         "ip"
    77 
    78 /** Loopback network interface module full path filename.
    79  */
    80 #define LO_FILENAME                     "/srv/lo"
    81 
    82 /** Loopback network interface module name.
    83  */
    84 #define LO_NAME                         "lo"
    85 
    86 /** Ethernet module full path filename.
    87  */
    88 #define NILDUMMY_FILENAME       "/srv/nildummy"
    89 
    90 /** Ethernet module name.
    91  */
    92 #define NILDUMMY_NAME           "nildummy"
    93 
    9494/*@}*/
    9595
     
    9898/*@{*/
    9999
     100/** Network interface name configuration label.
     101 */
     102#define CONF_NAME                       "NAME"
     103
     104/** Network interface module name configuration label.
     105 */
     106#define CONF_NETIF                      "NETIF"
     107
     108/** Network interface layer module name configuration label.
     109 */
     110#define CONF_NIL                        "NIL"
     111
    100112/** Internet protocol module name configuration label.
    101113 */
    102114#define CONF_IL                         "IL"
    103115
     116/** Interrupt number configuration label.
     117 */
     118#define CONF_IRQ                        "IRQ"
     119
    104120/** Device input/output address configuration label.
    105121 */
    106122#define CONF_IO                         "IO"
    107123
    108 /** Interrupt number configuration label.
    109  */
    110 #define CONF_IRQ                        "IRQ"
    111 
    112124/** Maximum transmission unit configuration label.
    113125 */
    114126#define CONF_MTU                        "MTU"
    115127
    116 /** Network interface name configuration label.
    117  */
    118 #define CONF_NAME                       "NAME"
    119 
    120 /** Network interface module name configuration label.
    121  */
    122 #define CONF_NETIF                      "NETIF"
    123 
    124 /** Network interface layer module name configuration label.
    125  */
    126 #define CONF_NIL                        "NIL"
    127 
    128128/*@}*/
    129129
     
    135135 */
    136136#define CONF_GENERAL_FILE       "general"
     137
     138/** Type definition of the network interface specific data.
     139 *  @see netif
     140 */
     141typedef struct netif    netif_t;
     142
     143/** Type definition of the network interface specific data pointer.
     144 *  @see netif
     145 */
     146typedef netif_t *               netif_ref;
    137147
    138148/** Type definition of the networking module global data.
     
    141151typedef struct net_globals      net_globals_t;
    142152
    143 /** Type definition of the network interface specific data.
    144  *  @see netif
    145  */
    146 typedef struct netif    netif_t;
    147 
    148 /** Type definition of the network interface specific data pointer.
    149  *  @see netif
    150  */
    151 typedef netif_t *               netif_ref;
     153/** Present network interfaces.
     154 *  Maps devices to the networking device specific data.
     155 *  @see device.h
     156 */
     157DEVICE_MAP_DECLARE( netifs, netif_t )
    152158
    153159/** Configuration settings.
     
    155161 *  @see generic_char_map.h
    156162 */
    157 GENERIC_CHAR_MAP_DECLARE(measured_strings, measured_string_t)
    158 
    159 /** Present network interfaces.
    160  *  Maps devices to the networking device specific data.
    161  *  @see device.h
    162  */
    163 DEVICE_MAP_DECLARE(netifs, netif_t)
     163GENERIC_CHAR_MAP_DECLARE( measured_strings, measured_string_t )
     164
     165/** Present network interface device.
     166 */
     167struct netif{
     168        /** System-unique network interface identifier.
     169         */
     170        device_id_t             id;
     171        /** Serving network interface driver module index.
     172         */
     173        module_ref              driver;
     174        /** Serving link layer module index.
     175         */
     176        module_ref              nil;
     177        /** Serving internet layer module index.
     178         */
     179        module_ref              il;
     180        /** System-unique network interface name.
     181         */
     182        char *                  name;
     183        /** Configuration.
     184         */
     185        measured_strings_t      configuration;
     186};
    164187
    165188/** Networking module global variables.
    166189 */
    167190struct net_globals{
     191        /** Present network interfaces.
     192         */
     193        netifs_t                netifs;
     194        /** Network interface structure indices by names.
     195         */
     196        char_map_t              netif_names;
     197        /** Available modules.
     198         */
     199        modules_t               modules;
    168200        /** Global configuration.
    169201         */
    170         measured_strings_t configuration;
    171         /** Available modules.
    172          */
    173         modules_t modules;
    174         /** Network interface structure indices by names.
    175          */
    176         char_map_t netif_names;
    177         /** Present network interfaces.
    178          */
    179         netifs_t netifs;
    180 };
    181 
    182 /** Present network interface device.
    183  */
    184 struct netif{
    185         /** Configuration.
    186          */
    187         measured_strings_t configuration;
    188         /** Serving network interface driver module index.
    189          */
    190         module_ref driver;
    191         /** System-unique network interface identifier.
    192          */
    193         device_id_t id;
    194         /** Serving internet layer module index.
    195          */
    196         module_ref il;
    197         /** System-unique network interface name.
    198          */
    199         char * name;
    200         /** Serving link layer module index.
    201          */
    202         module_ref nil;
     202        measured_strings_t      configuration;
    203203};
    204204
     
    210210 *  @returns ENOMEM if there is not enough memory left.
    211211 */
    212 int add_configuration(measured_strings_ref configuration, const char * name, const char * value);
     212int     add_configuration( measured_strings_ref configuration, const char * name, const char * value );
     213
     214/** Processes the networking message.
     215 *  @param[in] callid The message identifier.
     216 *  @param[in] call The message parameters.
     217 *  @param[out] answer The message answer parameters.
     218 *  @param[out] answer_count The last parameter for the actual answer in the answer parameter.
     219 *  @returns EOK on success.
     220 *  @returns ENOTSUP if the message is not known.
     221 *  @see net_interface.h
     222 *  @see IS_NET_NET_MESSAGE()
     223 */
     224int net_message( ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count );
     225
     226/** Initializes the networking module for the chosen subsystem build type.
     227 *  @param[in] client_connection The client connection processing function. The module skeleton propagates its own one.
     228 *  @returns EOK on success.
     229 *  @returns ENOMEM if there is not enough memory left.
     230 */
     231int     net_initialize_build( async_client_conn_t client_connection );
    213232
    214233/** Processes the module message.
     
    222241 *  @returns Other error codes as defined for each bundled module message function.
    223242 */
    224 int module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
    225 
    226 /** Initializes the networking module for the chosen subsystem build type.
    227  *  @param[in] client_connection The client connection processing function. The module skeleton propagates its own one.
    228  *  @returns EOK on success.
    229  *  @returns ENOMEM if there is not enough memory left.
    230  */
    231 int net_initialize_build(async_client_conn_t client_connection);
    232 
    233 /** Processes the networking message.
    234  *  @param[in] callid The message identifier.
    235  *  @param[in] call The message parameters.
    236  *  @param[out] answer The message answer parameters.
    237  *  @param[out] answer_count The last parameter for the actual answer in the answer parameter.
    238  *  @returns EOK on success.
    239  *  @returns ENOTSUP if the message is not known.
    240  *  @see net_interface.h
    241  *  @see IS_NET_NET_MESSAGE()
    242  */
    243 int net_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
     243int     module_message( ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count );
    244244
    245245#endif
Note: See TracChangeset for help on using the changeset viewer.