Changeset efedee77 in mainline for uspace/lib/net/include/generic.h
- Timestamp:
- 2010-11-02T22:38:46Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- af894a21
- Parents:
- aab02fb (diff), e06ef614 (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/net/include/generic.h
raab02fb refedee77 27 27 */ 28 28 29 /** @addtogroup icmp30 * 29 /** @addtogroup libnet 30 * @{ 31 31 */ 32 32 33 33 /** @file 34 * ICMP application interface implementation. 35 * @see icmp_api.h 34 * Generic communication interfaces for networking. 36 35 */ 37 36 37 #ifndef LIBNET_GENERIC_H_ 38 #define LIBNET_GENERIC_H_ 39 38 40 #include <async.h> 39 40 41 #include <ipc/ipc.h> 41 42 #include <ipc/services.h> 42 43 43 #include <sys/types.h> 44 #include <net/device.h> 45 #include <adt/measured_strings.h> 46 #include <net/packet.h> 44 47 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> 48 extern int generic_device_state_msg_remote(int, int, device_id_t, int, 49 services_t); 50 extern int generic_device_req_remote(int, int, device_id_t, int, services_t); 51 extern int generic_get_addr_req(int, int, device_id_t, measured_string_ref *, 52 char **); 53 extern int generic_packet_size_req_remote(int, int, device_id_t, 54 packet_dimension_ref); 55 extern int generic_received_msg_remote(int, int, device_id_t, packet_id_t, 56 services_t, services_t); 57 extern int generic_send_msg_remote(int, int, device_id_t, packet_id_t, 58 services_t, services_t); 59 extern int generic_translate_req(int, int, device_id_t, services_t, 60 measured_string_ref, size_t, measured_string_ref *, char **); 51 61 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 } 62 #endif 67 63 68 64 /** @}
Note:
See TracChangeset
for help on using the changeset viewer.