Changeset 14f1db0 in mainline for uspace/srv/net/net/net_standalone.c


Ignore:
Timestamp:
2010-04-09T12:54:57Z (14 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a1caa3c2
Parents:
24ab58b3
Message:

networking overhaul:

  • separation of conserns
  • removal of (almost all) overlaping symbols, libnetif is not needed anymore
  • again, it is possible to build the networking in multiple architecture configurations (however, currently only the bundling netif and nil layers is supported, more to come)
  • code style updates and fixes (still a huge amount of work to do)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/net/net_standalone.c

    r24ab58b3 r14f1db0  
    4949/** Networking module global data.
    5050 */
    51 extern net_globals_t    net_globals;
     51extern net_globals_t net_globals;
    5252
    53 /** Initializes the networking module for the chosen subsystem build type.
    54  *  @param[in] client_connection The client connection processing function. The module skeleton propagates its own one.
    55  *  @returns EOK on success.
    56  *  @returns ENOMEM if there is not enough memory left.
     53/** Initialize the networking module for the chosen subsystem build type.
     54 *
     55 *  @param[in] client_connection The client connection processing function.
     56 *                               The module skeleton propagates its own one.
     57 *
     58 *  @return EOK on success.
     59 *  @return ENOMEM if there is not enough memory left.
     60 *
    5761 */
    5862int net_initialize_build(async_client_conn_t client_connection){
    5963        ERROR_DECLARE;
    60 
    61         task_id_t task_id;
    62 
    63         task_id = spawn("/srv/ip");
    64         if(! task_id){
     64       
     65        task_id_t task_id = spawn("/srv/ip");
     66        if (!task_id)
    6567                return EINVAL;
    66         }
    67         ERROR_PROPAGATE(add_module(NULL, &net_globals.modules, IP_NAME, IP_FILENAME, SERVICE_IP, task_id, ip_connect_module));
    68         if(! spawn("/srv/icmp")){
     68       
     69        ERROR_PROPAGATE(add_module(NULL, &net_globals.modules, IP_NAME,
     70            IP_FILENAME, SERVICE_IP, task_id, ip_connect_module));
     71       
     72        if (!spawn("/srv/icmp"))
    6973                return EINVAL;
    70         }
    71         if(! spawn("/srv/udp")){
     74       
     75        if (!spawn("/srv/udp"))
    7276                return EINVAL;
    73         }
    74         if(! spawn("/srv/tcp")){
     77       
     78        if (!spawn("/srv/tcp"))
    7579                return EINVAL;
    76         }
     80       
    7781        return EOK;
    7882}
    7983
    80 /** Processes the module message.
    81  *  Distributes the message to the right bundled module.
    82  *  @param[in] callid The message identifier.
    83  *  @param[in] call The message parameters.
    84  *  @param[out] answer The message answer parameters.
    85  *  @param[out] answer_count The last parameter for the actual answer in the answer parameter.
    86  *  @returns EOK on success.
    87  *  @returns ENOTSUP if the message is not known.
    88  *  @returns Other error codes as defined for each bundled module message function.
     84/** Process the module message.
     85 *
     86 * Distribute the message to the right module.
     87 *
     88 * @param[in]  callid       The message identifier.
     89 * @param[in]  call         The message parameters.
     90 * @param[out] answer       The message answer parameters.
     91 * @param[out] answer_count The last parameter for the actual answer in
     92 *                          the answer parameter.
     93 *
     94 * @return EOK on success.
     95 * @return ENOTSUP if the message is not known.
     96 * @return Other error codes as defined for each bundled module
     97 *         message function.
     98 *
    8999 */
    90 int net_module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
    91         if(IS_NET_PACKET_MESSAGE(call)){
     100int net_module_message(ipc_callid_t callid, ipc_call_t *call,
     101    ipc_call_t *answer, int *answer_count)
     102{
     103        if (IS_NET_PACKET_MESSAGE(call))
    92104                return packet_server_message(callid, call, answer, answer_count);
    93         }else{
    94                 return net_message(callid, call, answer, answer_count);
    95         }
     105       
     106        return net_message(callid, call, answer, answer_count);
    96107}
    97108
Note: See TracChangeset for help on using the changeset viewer.