Changeset 858fc90 in mainline for uspace/srv/net/net/net.h


Ignore:
Timestamp:
2010-03-15T19:35:25Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6092b56e
Parents:
92307f1 (diff), 4684368 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge from bzr://bzr.helenos.org/head.

File:
1 edited

Legend:

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

    r92307f1 r858fc90  
    5252/*@{*/
    5353
     54/** DP8390 network interface module full path filename.
     55 */
     56#define DP8390_FILENAME         "/srv/dp8390"
     57
     58/** DP8390 network interface module name.
     59 */
     60#define DP8390_NAME                     "dp8390"
     61
     62/** Ethernet module full path filename.
     63 */
     64#define ETHERNET_FILENAME       "/srv/eth"
     65
     66/** Ethernet module name.
     67 */
     68#define ETHERNET_NAME           "ethernet"
     69
     70/** IP module full path filename.
     71 */
     72#define IP_FILENAME                     "/srv/ip"
     73
     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
    5482/** Loopback network interface module name.
    5583 */
    5684#define LO_NAME                         "lo"
    5785
    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 
    66 /** DP8390 network interface module full path filename.
    67  */
    68 #define DP8390_FILENAME         "/srv/dp8390"
     86/** Ethernet module full path filename.
     87 */
     88#define NILDUMMY_FILENAME       "/srv/nildummy"
    6989
    7090/** Ethernet module name.
    7191 */
    72 #define ETHERNET_NAME           "ethernet"
    73 
    74 /** Ethernet module full path filename.
    75  */
    76 #define ETHERNET_FILENAME       "/srv/eth"
    77 
    78 /** Ethernet module name.
    79  */
    8092#define NILDUMMY_NAME           "nildummy"
    8193
    82 /** Ethernet module full path filename.
    83  */
    84 #define NILDUMMY_FILENAME       "/srv/nildummy"
    85 
    86 /** IP module name.
    87  */
    88 #define IP_NAME                         "ip"
    89 
    90 /** IP module full path filename.
    91  */
    92 #define IP_FILENAME                     "/srv/ip"
    93 
    9494/*@}*/
    9595
     
    9898/*@{*/
    9999
     100/** Internet protocol module name configuration label.
     101 */
     102#define CONF_IL                         "IL"
     103
     104/** Device input/output address configuration label.
     105 */
     106#define CONF_IO                         "IO"
     107
     108/** Interrupt number configuration label.
     109 */
     110#define CONF_IRQ                        "IRQ"
     111
     112/** Maximum transmission unit configuration label.
     113 */
     114#define CONF_MTU                        "MTU"
     115
    100116/** Network interface name configuration label.
    101117 */
     
    110126#define CONF_NIL                        "NIL"
    111127
    112 /** Internet protocol module name configuration label.
    113  */
    114 #define CONF_IL                         "IL"
    115 
    116 /** Interrupt number configuration label.
    117  */
    118 #define CONF_IRQ                        "IRQ"
    119 
    120 /** Device input/output address configuration label.
    121  */
    122 #define CONF_IO                         "IO"
    123 
    124 /** Maximum transmission unit configuration label.
    125  */
    126 #define CONF_MTU                        "MTU"
    127 
    128128/*@}*/
    129129
     
    135135 */
    136136#define CONF_GENERAL_FILE       "general"
     137
     138/** Type definition of the networking module global data.
     139 *  @see net_globals
     140 */
     141typedef struct net_globals      net_globals_t;
    137142
    138143/** Type definition of the network interface specific data.
     
    146151typedef netif_t *               netif_ref;
    147152
    148 /** Type definition of the networking module global data.
    149  *  @see net_globals
    150  */
    151 typedef struct net_globals      net_globals_t;
     153/** Configuration settings.
     154 *  Maps setting names to the values.
     155 *  @see generic_char_map.h
     156 */
     157GENERIC_CHAR_MAP_DECLARE(measured_strings, measured_string_t)
    152158
    153159/** Present network interfaces.
     
    155161 *  @see device.h
    156162 */
    157 DEVICE_MAP_DECLARE( netifs, netif_t )
    158 
    159 /** Configuration settings.
    160  *  Maps setting names to the values.
    161  *  @see generic_char_map.h
    162  */
    163 GENERIC_CHAR_MAP_DECLARE( measured_strings, measured_string_t )
     163DEVICE_MAP_DECLARE(netifs, netif_t)
     164
     165/** Networking module global variables.
     166 */
     167struct net_globals{
     168        /** Global configuration.
     169         */
     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};
    164181
    165182/** Present network interface device.
    166183 */
    167184struct netif{
     185        /** Configuration.
     186         */
     187        measured_strings_t configuration;
     188        /** Serving network interface driver module index.
     189         */
     190        module_ref driver;
    168191        /** System-unique network interface identifier.
    169192         */
    170         device_id_t             id;
    171         /** Serving network interface driver module index.
    172          */
    173         module_ref              driver;
     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;
    174200        /** Serving link layer module index.
    175201         */
    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 };
    187 
    188 /** Networking module global variables.
    189  */
    190 struct 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;
    200         /** Global configuration.
    201          */
    202         measured_strings_t      configuration;
     202        module_ref nil;
    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 );
    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  */
    224 int 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  */
    231 int     net_initialize_build( async_client_conn_t client_connection );
     212int add_configuration(measured_strings_ref configuration, const char * name, const char * value);
    232213
    233214/** Processes the module message.
     
    241222 *  @returns Other error codes as defined for each bundled module message function.
    242223 */
    243 int     module_message( ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count );
     224int 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 */
     231int 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 */
     243int net_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.