Changeset 89c57b6 in mainline for uspace/lib/c/include/net/modules.h


Ignore:
Timestamp:
2011-04-13T14:45:41Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
88634420
Parents:
cefb126 (diff), 17279ead (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/c/include/net/modules.h

    rcefb126 r89c57b6  
    2727 */
    2828
    29 /** @addtogroup icmp
    30  *  @{
     29/** @addtogroup libc
     30 * @{
    3131 */
    3232
    3333/** @file
    34  *  ICMP application interface implementation.
    35  *  @see icmp_api.h
     34 * Generic module functions.
     35 *
     36 * @todo MAKE IT POSSIBLE TO REMOVE THIS FILE VIA EITHER REPLACING PART OF ITS
     37 * FUNCTIONALITY OR VIA INTEGRATING ITS FUNCTIONALITY MORE TIGHTLY WITH THE REST
     38 * OF THE SYSTEM.
    3639 */
    3740
     41#ifndef LIBC_MODULES_H_
     42#define LIBC_MODULES_H_
     43
    3844#include <async.h>
     45#include <ipc/services.h>
     46#include <sys/time.h>
    3947
    40 #include <ipc/ipc.h>
    41 #include <ipc/services.h>
     48/** Connect to the needed module function type definition.
     49 *
     50 * @param[in] need The needed module service.
     51 *
     52 * @return The phone of the needed service.
     53 *
     54 */
     55typedef int connect_module_t(services_t need);
    4256
    43 #include <sys/types.h>
     57extern void answer_call(ipc_callid_t, int, ipc_call_t *, size_t);
     58extern int bind_service(services_t, sysarg_t, sysarg_t, sysarg_t,
     59    async_client_conn_t);
     60extern int bind_service_timeout(services_t, sysarg_t, sysarg_t, sysarg_t,
     61    async_client_conn_t, suseconds_t);
     62extern int connect_to_service(services_t);
     63extern int connect_to_service_timeout(services_t, suseconds_t);
     64extern int data_reply(void *, size_t);
     65extern void refresh_answer(ipc_call_t *, size_t *);
    4466
    45 #include <net_modules.h>
    46 #include <icmp_api.h>
    47 #include <inet.h>
    48 #include <ip_codes.h>
    49 #include <socket_codes.h>
    50 #include <icmp_messages.h>
    51 
    52 int icmp_echo_msg(int icmp_phone, size_t size, mseconds_t timeout, ip_ttl_t ttl, ip_tos_t tos, int dont_fragment, const struct sockaddr * addr, socklen_t addrlen){
    53         aid_t message_id;
    54         ipcarg_t result;
    55 
    56         if(addrlen <= 0){
    57                 return EINVAL;
    58         }
    59         message_id = async_send_5(icmp_phone, NET_ICMP_ECHO, size, timeout, ttl, tos, (ipcarg_t) dont_fragment, NULL);
    60         // send the address
    61         async_data_write_start(icmp_phone, addr, (size_t) addrlen);
    62         // timeout version may cause inconsistency - there is also an inner timer
    63         // return async_wait_timeout(message_id, &result, timeout);
    64         async_wait_for(message_id, &result);
    65         return (int) result;
    66 }
     67#endif
    6768
    6869/** @}
Note: See TracChangeset for help on using the changeset viewer.