Changeset b5e68c8 in mainline for uspace/lib/net/include/il_skel.h


Ignore:
Timestamp:
2011-05-12T16:49:44Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f36787d7
Parents:
e80329d6 (diff), 750636a (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 mainline changes.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/net/include/il_skel.h

    re80329d6 rb5e68c8  
    11/*
    2  * Copyright (c) 2009 Lukas Mejdrech
     2 * Copyright (c) 2010 Martin Decky
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup ip
     29/** @addtogroup libnet
    3030 * @{
    3131 */
    3232
     33#ifndef LIBNET_IL_SKEL_H_
     34#define LIBNET_IL_SKEL_H_
     35
    3336/** @file
    34  * IP standalone module implementation.
    35  * Contains skeleton module functions mapping.
    36  * The functions are used by the module skeleton as module specific entry
    37  * points.
    38  *
    39  * @see module.c
     37 * Internetwork layer module skeleton.
     38 * The skeleton has to be part of each internetwork layer module.
    4039 */
    4140
    4241#include <async.h>
    43 #include <stdio.h>
    44 #include <ipc/ipc.h>
     42#include <fibril_synch.h>
    4543#include <ipc/services.h>
    46 #include <err.h>
    4744
    48 #include <net/modules.h>
    49 #include <net_interface.h>
     45#include <adt/measured_strings.h>
     46#include <net/device.h>
    5047#include <net/packet.h>
    51 #include <il_local.h>
    5248
    53 #include "ip.h"
    54 #include "ip_module.h"
     49/** Module initialization.
     50 *
     51 * This has to be implemented in user code.
     52 *
     53 * @param[in] net_phone Networking module phone.
     54 *
     55 * @return EOK on success.
     56 * @return Other error codes as defined for each specific module
     57 *         initialize function.
     58 *
     59 */
     60extern int il_initialize(int net_phone);
    5561
    56 /** IP module global data. */
    57 extern ip_globals_t ip_globals;
     62/** Process the internetwork layer module message.
     63 *
     64 * This has to be implemented in user code.
     65 *
     66 * @param[in]  callid Message identifier.
     67 * @param[in]  call   Message parameters.
     68 * @param[out] answer Answer.
     69 * @param[out] count  Number of arguments of the answer.
     70 *
     71 * @return EOK on success.
     72 * @return Other error codes as defined for each specific module.
     73 *
     74 */
     75extern int il_module_message(ipc_callid_t callid, ipc_call_t *call,
     76    ipc_call_t *answer, size_t *answer_count);
    5877
    59 int
    60 il_module_message_standalone(ipc_callid_t callid, ipc_call_t *call,
    61     ipc_call_t *answer, int *answer_count)
    62 {
    63         return ip_message_standalone(callid, call, answer, answer_count);
    64 }
     78extern int il_module_start(int);
    6579
    66 int il_module_start_standalone(async_client_conn_t client_connection)
    67 {
    68         ERROR_DECLARE;
    69        
    70         async_set_client_connection(client_connection);
    71         ip_globals.net_phone = net_connect_module();
    72         ERROR_PROPAGATE(pm_init());
    73        
    74         ipcarg_t phonehash;
    75         if (ERROR_OCCURRED(ip_initialize(client_connection)) ||
    76             ERROR_OCCURRED(REGISTER_ME(SERVICE_IP, &phonehash))) {
    77                 pm_destroy();
    78                 return ERROR_CODE;
    79         }
    80        
    81         async_manager();
    82        
    83         pm_destroy();
    84         return EOK;
    85 }
     80#endif
    8681
    8782/** @}
Note: See TracChangeset for help on using the changeset viewer.