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