Changeset 753bca3 in mainline for uspace/lib/c/include/net/icmp_api.h


Ignore:
Timestamp:
2010-10-13T22:38:16Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
10056483, b2a109d9
Parents:
f3b4051
Message:

Move ICMP client stuff from libsocket to standard library.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/net/icmp_api.h

    rf3b4051 r753bca3  
    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 * ICMP module application interface.
    3635 */
     36
     37#ifndef LIBC_ICMP_API_H_
     38#define LIBC_ICMP_API_H_
    3739
    3840#include <net/socket_codes.h>
    3941#include <net/inet.h>
    40 #include <async.h>
     42#include <sys/types.h>
     43#include <sys/time.h>
    4144
    42 #include <ipc/ipc.h>
    43 #include <ipc/services.h>
     45#include <adt/measured_strings.h>
     46#include <net/packet.h>
     47#include <net/ip_codes.h>
     48#include <net/icmp_codes.h>
     49#include <net/icmp_common.h>
    4450
    45 #include <sys/types.h>
     51/** @name ICMP module application interface
     52 * This interface is used by other application modules.
     53 */
     54/*@{*/
    4655
    47 #include <net/modules.h>
    48 #include <icmp_api.h>
    49 #include <net/ip_codes.h>
    50 #include <icmp_messages.h>
     56extern int icmp_echo_msg(int, size_t, mseconds_t, ip_ttl_t, ip_tos_t, int,
     57    const struct sockaddr *, socklen_t);
    5158
    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;
     59/*@}*/
    5560
    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 }
     61#endif
    6762
    6863/** @}
Note: See TracChangeset for help on using the changeset viewer.