Changeset 753bca3 in mainline for uspace/lib/c/include/net/icmp_api.h
- Timestamp:
- 2010-10-13T22:38:16Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 10056483, b2a109d9
- Parents:
- f3b4051
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/net/icmp_api.h
rf3b4051 r753bca3 27 27 */ 28 28 29 /** @addtogroup icmp30 * 29 /** @addtogroup libc 30 * @{ 31 31 */ 32 32 33 33 /** @file 34 * ICMP application interface implementation. 35 * @see icmp_api.h 34 * ICMP module application interface. 36 35 */ 36 37 #ifndef LIBC_ICMP_API_H_ 38 #define LIBC_ICMP_API_H_ 37 39 38 40 #include <net/socket_codes.h> 39 41 #include <net/inet.h> 40 #include <async.h> 42 #include <sys/types.h> 43 #include <sys/time.h> 41 44 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> 44 50 45 #include <sys/types.h> 51 /** @name ICMP module application interface 52 * This interface is used by other application modules. 53 */ 54 /*@{*/ 46 55 47 #include <net/modules.h> 48 #include <icmp_api.h> 49 #include <net/ip_codes.h> 50 #include <icmp_messages.h> 56 extern int icmp_echo_msg(int, size_t, mseconds_t, ip_ttl_t, ip_tos_t, int, 57 const struct sockaddr *, socklen_t); 51 58 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 /*@}*/ 55 60 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 67 62 68 63 /** @}
Note:
See TracChangeset
for help on using the changeset viewer.