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


Ignore:
Timestamp:
2011-01-13T20:58:24Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
87e373b
Parents:
eaef141 (diff), a613fea1 (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

    reaef141 r80cd7cd  
    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>
     42#include <fibril_synch.h>
    4743#include <ipc/ipc.h>
    4844#include <ipc/services.h>
    4945
    50 #include <net/ip_protocols.h>
    51 #include <net/modules.h>
     46#include <adt/measured_strings.h>
     47#include <net/device.h>
    5248#include <net/packet.h>
    53 #include <net_interface.h>
    5449
    55 #include <ip_interface.h>
    56 #include <tl_local.h>
     50/** Module initialization.
     51 *
     52 * This has to be implemented in user code.
     53 *
     54 * @param[in] net_phone Networking module phone.
     55 *
     56 * @return EOK on success.
     57 * @return Other error codes as defined for each specific module
     58 *         initialize function.
     59 *
     60 */
     61extern int il_initialize(int net_phone);
    5762
    58 /** TCP module global data. */
    59 extern tcp_globals_t tcp_globals;
     63/** Process the internetwork layer module message.
     64 *
     65 * This has to be implemented in user code.
     66 *
     67 * @param[in]  callid Message identifier.
     68 * @param[in]  call   Message parameters.
     69 * @param[out] answer Answer.
     70 * @param[out] count  Number of arguments of the answer.
     71 *
     72 * @return EOK on success.
     73 * @return Other error codes as defined for each specific module.
     74 *
     75 */
     76extern int il_module_message(ipc_callid_t callid, ipc_call_t *call,
     77    ipc_call_t *answer, size_t *answer_count);
    6078
    61 int tl_module_start_standalone(async_client_conn_t client_connection)
    62 {
    63         sysarg_t phonehash;
    64         int rc;
     79extern int il_module_start(int);
    6580
    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 }
     81#endif
    9382
    9483/** @}
Note: See TracChangeset for help on using the changeset viewer.