Changeset 89c57b6 in mainline for uspace/lib/c/include/net/modules.h
- Timestamp:
- 2011-04-13T14:45:41Z (14 years ago)
- 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. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/net/modules.h
rcefb126 r89c57b6 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 * 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. 36 39 */ 37 40 41 #ifndef LIBC_MODULES_H_ 42 #define LIBC_MODULES_H_ 43 38 44 #include <async.h> 45 #include <ipc/services.h> 46 #include <sys/time.h> 39 47 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 */ 55 typedef int connect_module_t(services_t need); 42 56 43 #include <sys/types.h> 57 extern void answer_call(ipc_callid_t, int, ipc_call_t *, size_t); 58 extern int bind_service(services_t, sysarg_t, sysarg_t, sysarg_t, 59 async_client_conn_t); 60 extern int bind_service_timeout(services_t, sysarg_t, sysarg_t, sysarg_t, 61 async_client_conn_t, suseconds_t); 62 extern int connect_to_service(services_t); 63 extern int connect_to_service_timeout(services_t, suseconds_t); 64 extern int data_reply(void *, size_t); 65 extern void refresh_answer(ipc_call_t *, size_t *); 44 66 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 67 68 68 69 /** @}
Note:
See TracChangeset
for help on using the changeset viewer.