Changeset 753bca3 in mainline for uspace/lib/c/include/ipc/icmp.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/ipc/icmp.h
rf3b4051 r753bca3 27 27 */ 28 28 29 /** @addtogroup icmp30 * 29 /** @addtogroup libc 30 * @{ 31 31 */ 32 32 33 33 /** @file 34 * 35 * 34 * ICMP module messages. 35 * @see icmp_interface.h 36 36 */ 37 37 38 #ifndef __NET_ICMP_MESSAGES__39 #define __NET_ICMP_MESSAGES__38 #ifndef LIBC_ICMP_MESSAGES_ 39 #define LIBC_ICMP_MESSAGES_ 40 40 41 41 #include <ipc/ipc.h> 42 42 #include <ipc/net.h> 43 43 #include <sys/types.h> 44 #include <sys/time.h> 44 45 45 #include < icmp_codes.h>46 #include <net/icmp_codes.h> 46 47 47 /** ICMP module messages. 48 */ 49 typedef enum{ 50 /** Sends echo request. 51 * @see icmp_echo() 52 */ 48 /** ICMP module messages. */ 49 typedef enum { 50 /** Sends echo request. @see icmp_echo() */ 53 51 NET_ICMP_ECHO = NET_ICMP_FIRST, 54 /** Sends destination unreachable error message. 55 * @see icmp_destination_unreachable_msg() 52 53 /** 54 * Sends destination unreachable error message. 55 * @see icmp_destination_unreachable_msg() 56 56 */ 57 57 NET_ICMP_DEST_UNREACH, 58 /** Sends source quench error message. 59 * @see icmp_source_quench_msg() 58 59 /** 60 * Sends source quench error message. 61 * @see icmp_source_quench_msg() 60 62 */ 61 63 NET_ICMP_SOURCE_QUENCH, 62 /** Sends time exceeded error message. 63 * @see icmp_time_exceeded_msg() 64 65 /** 66 * Sends time exceeded error message. 67 * @see icmp_time_exceeded_msg() 64 68 */ 65 69 NET_ICMP_TIME_EXCEEDED, 66 /** Sends parameter problem error message. 67 * @see icmp_parameter_problem_msg() 70 71 /** 72 * Sends parameter problem error message. 73 * @see icmp_parameter_problem_msg() 68 74 */ 69 75 NET_ICMP_PARAMETERPROB, 70 /** Initializes new connection.71 */76 77 /** Initializes new connection. */ 72 78 NET_ICMP_INIT 73 79 } icmp_messages; 74 80 75 /** @name ICMP specific message parameters definitions 76 */ 81 /** @name ICMP specific message parameters definitions */ 77 82 /*@{*/ 78 83 79 84 /** Returns the ICMP code message parameter. 80 * @param[in] call The message call structure. 85 * 86 * @param[in] call The message call structure. 81 87 */ 82 88 #define ICMP_GET_CODE(call) \ 83 ({icmp_code_t code = (icmp_code_t) IPC_GET_ARG1(*call); code;}) 89 ({ \ 90 icmp_code_t code = (icmp_code_t) IPC_GET_ARG1(*call); \ 91 code; \ 92 }) 84 93 85 94 /** Returns the ICMP link MTU message parameter. 86 * @param[in] call The message call structure. 95 * 96 * @param[in] call The message call structure. 87 97 */ 88 98 #define ICMP_GET_MTU(call) \ 89 ({icmp_param_t mtu = (icmp_param_t) IPC_GET_ARG3(*call); mtu;}) 99 ({ \ 100 icmp_param_t mtu = (icmp_param_t) IPC_GET_ARG3(*call); \ 101 mtu; \ 102 }) 90 103 91 104 /** Returns the pointer message parameter. 92 * @param[in] call The message call structure. 105 * 106 * @param[in] call The message call structure. 93 107 */ 94 108 #define ICMP_GET_POINTER(call) \ 95 ({icmp_param_t pointer = (icmp_param_t) IPC_GET_ARG3(*call); pointer;}) 109 ({ \ 110 icmp_param_t pointer = (icmp_param_t) IPC_GET_ARG3(*call); \ 111 pointer; \ 112 }) 96 113 97 114 /** Returns the size message parameter. 98 * @param[in] call The message call structure. 115 * 116 * @param[in] call The message call structure. 99 117 */ 100 118 #define ICMP_GET_SIZE(call) \ 101 ({size_t size = (size_t) IPC_GET_ARG1(call); size;}) 119 ({ \ 120 size_t size = (size_t) IPC_GET_ARG1(call); \ 121 size; \ 122 }) 102 123 103 124 /** Returns the timeout message parameter. 104 * @param[in] call The message call structure. 125 * 126 * @param[in] call The message call structure. 105 127 */ 106 128 #define ICMP_GET_TIMEOUT(call) \ 107 (({suseconds_t timeout = (suseconds_t) IPC_GET_ARG2(call); timeout;})) 129 ({ \ 130 suseconds_t timeout = (suseconds_t) IPC_GET_ARG2(call); \ 131 timeout; \ 132 }) 108 133 109 134 /** Returns the time to live message parameter. 110 * @param[in] call The message call structure. 135 * 136 * @param[in] call The message call structure. 111 137 */ 112 138 #define ICMP_GET_TTL(call) \ 113 ({ip_ttl_t ttl = (ip_ttl_t) IPC_GET_ARG3(call); ttl;}) 139 ({ \ 140 ip_ttl_t ttl = (ip_ttl_t) IPC_GET_ARG3(call); \ 141 ttl; \ 142 }) 114 143 115 144 /** Returns the type of service message parameter. 116 * @param[in] call The message call structure. 145 * 146 * @param[in] call The message call structure. 117 147 */ 118 148 #define ICMP_GET_TOS(call) \ 119 ({ip_tos_t tos = (ip_tos_t) IPC_GET_ARG4(call); tos;}) 149 ({ \ 150 ip_tos_t tos = (ip_tos_t) IPC_GET_ARG4(call); \ 151 tos; \ 152 }) 120 153 121 154 /** Returns the dont fragment message parameter. 122 * @param[in] call The message call structure. 155 * 156 * @param[in] call The message call structure. 123 157 */ 124 158 #define ICMP_GET_DONT_FRAGMENT(call) \ 125 ({int dont_fragment = (int) IPC_GET_ARG5(call); dont_fragment;}) 159 ({ \ 160 int dont_fragment = (int) IPC_GET_ARG5(call); \ 161 dont_fragment; \ 162 }) 126 163 127 164 /*@}*/
Note:
See TracChangeset
for help on using the changeset viewer.