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


Ignore:
Timestamp:
2011-02-03T05:11:01Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ba38f72c
Parents:
22027b6e (diff), 86d7bfa (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

    r22027b6e r8b5690f  
    11/*
    2  * Copyright (c) 2008 Lukas Mejdrech
     2 * Copyright (c) 2010 Martin Decky
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup tcp
     29/** @addtogroup libnet
    3030 * @{
    3131 */
    3232
     33#ifndef LIBNET_IL_SKEL_H_
     34#define LIBNET_IL_SKEL_H_
     35
    3336/** @file
    34  * TCP 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  * @see module.c
     37 * Internetwork layer module skeleton.
     38 * The skeleton has to be part of each internetwork layer module.
    3939 */
    4040
    41 #include "tcp.h"
    42 #include "tcp_module.h"
    43 
    4441#include <async.h>
    45 #include <stdio.h>
    46 #include <errno.h>
    47 #include <ipc/ipc.h>
     42#include <fibril_synch.h>
    4843#include <ipc/services.h>
    4944
    50 #include <net/ip_protocols.h>
    51 #include <net/modules.h>
     45#include <adt/measured_strings.h>
     46#include <net/device.h>
    5247#include <net/packet.h>
    53 #include <net_interface.h>
    5448
    55 #include <ip_interface.h>
    56 #include <tl_local.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);
    5761
    58 /** TCP module global data. */
    59 extern tcp_globals_t tcp_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);
    6077
    61 int tl_module_start_standalone(async_client_conn_t client_connection)
    62 {
    63         sysarg_t phonehash;
    64         int rc;
     78extern int il_module_start(int);
    6579
    66         async_set_client_connection(client_connection);
    67         tcp_globals.net_phone = net_connect_module();
    68 
    69         rc = pm_init();
    70         if (rc != EOK)
    71                 return rc;
    72 
    73         rc = tcp_initialize(client_connection);
    74         if (rc != EOK)
    75                 goto out;
    76 
    77         rc = ipc_connect_to_me(PHONE_NS, SERVICE_TCP, 0, 0, &phonehash);
    78         if (rc != EOK)
    79                 goto out;
    80        
    81         async_manager();
    82        
    83 out:
    84         pm_destroy();
    85         return rc;
    86 }
    87 
    88 int tl_module_message_standalone(ipc_callid_t callid, ipc_call_t *call,
    89     ipc_call_t *answer, int *answer_count)
    90 {
    91         return tcp_message_standalone(callid, call, answer, answer_count);
    92 }
     80#endif
    9381
    9482/** @}
Note: See TracChangeset for help on using the changeset viewer.