Changeset 774e6d1a in mainline for uspace/lib/c/include/ipc
- Timestamp:
- 2011-01-09T23:24:53Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4b86dac
- Parents:
- 3c106e88
- Location:
- uspace/lib/c/include/ipc
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/ipc/arp.h
r3c106e88 r774e6d1a 69 69 /*@{*/ 70 70 71 /** Returns the protocol service message parameter. 72 * @param[in] call The message call structure. 71 /** Return the protocol service message parameter. 72 * 73 * @param[in] call Message call structure. 74 * 73 75 */ 74 #define ARP_GET_NETIF(call) \ 75 ({ \ 76 services_t service = (services_t) IPC_GET_ARG2(*call); \ 77 service; \ 78 }) 76 #define ARP_GET_NETIF(call) ((services_t) IPC_GET_ARG2(call)) 79 77 80 78 /*@}*/ -
uspace/lib/c/include/ipc/icmp.h
r3c106e88 r774e6d1a 82 82 /*@{*/ 83 83 84 /** Return sthe ICMP code message parameter.84 /** Return the ICMP code message parameter. 85 85 * 86 * @param[in] call The message call structure. 86 * @param[in] call Message call structure. 87 * 87 88 */ 88 #define ICMP_GET_CODE(call) \ 89 ({ \ 90 icmp_code_t code = (icmp_code_t) IPC_GET_ARG1(*call); \ 91 code; \ 92 }) 89 #define ICMP_GET_CODE(call) ((icmp_code_t) IPC_GET_ARG1(call)) 93 90 94 /** Return sthe ICMP link MTU message parameter.91 /** Return the ICMP link MTU message parameter. 95 92 * 96 * @param[in] call The message call structure. 93 * @param[in] call Message call structure. 94 * 97 95 */ 98 #define ICMP_GET_MTU(call) \ 99 ({ \ 100 icmp_param_t mtu = (icmp_param_t) IPC_GET_ARG3(*call); \ 101 mtu; \ 102 }) 96 #define ICMP_GET_MTU(call) ((icmp_param_t) IPC_GET_ARG3(call)) 103 97 104 /** Return sthe pointer message parameter.98 /** Return the pointer message parameter. 105 99 * 106 * @param[in] call The message call structure. 100 * @param[in] call Message call structure. 101 * 107 102 */ 108 #define ICMP_GET_POINTER(call) \ 109 ({ \ 110 icmp_param_t pointer = (icmp_param_t) IPC_GET_ARG3(*call); \ 111 pointer; \ 112 }) 103 #define ICMP_GET_POINTER(call) ((icmp_param_t) IPC_GET_ARG3(call)) 113 104 114 /** Return sthe size message parameter.105 /** Return the size message parameter. 115 106 * 116 * @param[in] call The message call structure. 107 * @param[in] call Message call structure. 108 * 117 109 */ 118 #define ICMP_GET_SIZE(call) \ 119 ({ \ 120 size_t size = (size_t) IPC_GET_ARG1(call); \ 121 size; \ 122 }) 110 #define ICMP_GET_SIZE(call) ((size_t) IPC_GET_ARG1(call)) 123 111 124 /** Return sthe timeout message parameter.112 /** Return the timeout message parameter. 125 113 * 126 * @param[in] call The message call structure. 114 * @param[in] call Message call structure. 115 * 127 116 */ 128 #define ICMP_GET_TIMEOUT(call) \ 129 ({ \ 130 suseconds_t timeout = (suseconds_t) IPC_GET_ARG2(call); \ 131 timeout; \ 132 }) 117 #define ICMP_GET_TIMEOUT(call) ((suseconds_t) IPC_GET_ARG2(call)) 133 118 134 /** Return sthe time to live message parameter.119 /** Return the time to live message parameter. 135 120 * 136 * @param[in] call The message call structure. 121 * @param[in] call Message call structure. 122 * 137 123 */ 138 #define ICMP_GET_TTL(call) \ 139 ({ \ 140 ip_ttl_t ttl = (ip_ttl_t) IPC_GET_ARG3(call); \ 141 ttl; \ 142 }) 124 #define ICMP_GET_TTL(call) ((ip_ttl_t) IPC_GET_ARG3(call)) 143 125 144 /** Return sthe type of service message parameter.126 /** Return the type of service message parameter. 145 127 * 146 * @param[in] call The message call structure. 128 * @param[in] call Message call structure. 129 * 147 130 */ 148 #define ICMP_GET_TOS(call) \ 149 ({ \ 150 ip_tos_t tos = (ip_tos_t) IPC_GET_ARG4(call); \ 151 tos; \ 152 }) 131 #define ICMP_GET_TOS(call) ((ip_tos_t) IPC_GET_ARG4(call)) 153 132 154 /** Return sthe dont fragment message parameter.133 /** Return the dont fragment message parameter. 155 134 * 156 * @param[in] call The message call structure.135 * @param[in] call Message call structure. 157 136 */ 158 #define ICMP_GET_DONT_FRAGMENT(call) \ 159 ({ \ 160 int dont_fragment = (int) IPC_GET_ARG5(call); \ 161 dont_fragment; \ 162 }) 137 #define ICMP_GET_DONT_FRAGMENT(call) ((int) IPC_GET_ARG5(call)) 163 138 164 139 /*@}*/ -
uspace/lib/c/include/ipc/il.h
r3c106e88 r774e6d1a 75 75 76 76 /** Return the protocol number message parameter. 77 * @param[in] call The message call structure. 77 * 78 * @param[in] call Message call structure. 79 * 78 80 */ 79 #define IL_GET_PROTO(call) (int) IPC_GET_ARG1(*call)81 #define IL_GET_PROTO(call) ((int) IPC_GET_ARG1(call)) 80 82 81 83 /** Return the registering service message parameter. 82 * @param[in] call The message call structure. 84 * 85 * @param[in] call Message call structure. 86 * 83 87 */ 84 #define IL_GET_SERVICE(call) (services_t) IPC_GET_ARG2(*call)88 #define IL_GET_SERVICE(call) ((services_t) IPC_GET_ARG2(call)) 85 89 86 90 /*@}*/ -
uspace/lib/c/include/ipc/ip.h
r3c106e88 r774e6d1a 51 51 */ 52 52 NET_IP_ADD_ROUTE = NET_IP_FIRST, 53 53 54 /** Gets the actual route information. 54 55 * @see ip_get_route() 55 56 */ 56 57 NET_IP_GET_ROUTE, 58 57 59 /** Processes the received error notification. 58 60 * @see ip_received_error_msg() 59 61 */ 60 62 NET_IP_RECEIVED_ERROR, 63 61 64 /** Sets the default gateway. 62 65 * @see ip_set_default_gateway() … … 68 71 /*@{*/ 69 72 70 /** Returns the address message parameter. 71 * @param[in] call The message call structure. 73 /** Return the address message parameter. 74 * 75 * @param[in] call Message call structure. 76 * 72 77 */ 73 78 #define IP_GET_ADDRESS(call) \ 74 79 ({ \ 75 80 in_addr_t addr; \ 76 addr.s_addr = IPC_GET_ARG3( *call); \81 addr.s_addr = IPC_GET_ARG3(call); \ 77 82 addr; \ 78 83 }) 79 84 80 /** Returns the gateway message parameter. 81 * @param[in] call The message call structure. 85 /** Return the gateway message parameter. 86 * 87 * @param[in] call Message call structure. 88 * 82 89 */ 83 90 #define IP_GET_GATEWAY(call) \ 84 91 ({ \ 85 92 in_addr_t addr; \ 86 addr.s_addr = IPC_GET_ARG2( *call); \93 addr.s_addr = IPC_GET_ARG2(call); \ 87 94 addr; \ 88 95 }) 89 96 90 /** Sets the header length in the message answer. 91 * @param[out] answer The message answer structure. 97 /** Set the header length in the message answer. 98 * 99 * @param[out] answer Message answer structure. 100 * 92 101 */ 93 #define IP_SET_HEADERLEN(answer, value) \ 94 do { \ 95 sysarg_t argument = (sysarg_t) (value); \ 96 IPC_SET_ARG2(*answer, argument); \ 97 } while (0) 102 #define IP_SET_HEADERLEN(answer, value) IPC_SET_ARG2(answer, (sysarg_t) (value)) 98 103 99 /** Returns the network mask message parameter. 100 * @param[in] call The message call structure. 104 /** Return the network mask message parameter. 105 * 106 * @param[in] call Message call structure. 107 * 101 108 */ 102 109 #define IP_GET_NETMASK(call) \ 103 110 ({ \ 104 111 in_addr_t addr; \ 105 addr.s_addr = IPC_GET_ARG4( *call); \112 addr.s_addr = IPC_GET_ARG4(call); \ 106 113 addr; \ 107 114 }) 108 115 109 /** Returns the protocol message parameter. 110 * @param[in] call The message call structure. 116 /** Return the protocol message parameter. 117 * 118 * @param[in] call Message call structure. 119 * 111 120 */ 112 #define IP_GET_PROTOCOL(call) \ 113 ({ \ 114 ip_protocol_t protocol = (ip_protocol_t) IPC_GET_ARG1(*call); \ 115 protocol; \ 116 }) 121 #define IP_GET_PROTOCOL(call) ((ip_protocol_t) IPC_GET_ARG1(call)) 117 122 118 123 /*@}*/ -
uspace/lib/c/include/ipc/net.h
r3c106e88 r774e6d1a 44 44 #include <net/packet.h> 45 45 46 /** Returns a value indicating whether the value is in the interval. 47 * @param[in] item The value to be checked. 48 * @param[in] first_inclusive The first value in the interval inclusive. 49 * @param[in] last_exclusive The first value after the interval. 46 /** Return a value indicating whether the value is in the interval. 47 * 48 * @param[in] item Value to be checked. 49 * @param[in] first_inclusive First value in the interval inclusive. 50 * @param[in] last_exclusive First value after the interval. 51 * 50 52 */ 51 53 #define IS_IN_INTERVAL(item, first_inclusive, last_exclusive) \ … … 55 57 /*@{*/ 56 58 57 /** The number of ARP messages. */ 58 #define NET_ARP_COUNT 5 59 60 /** The number of Ethernet messages. */ 61 #define NET_ETH_COUNT 0 62 63 /** The number of ICMP messages. */ 64 #define NET_ICMP_COUNT 6 65 66 /** The number of inter-network messages. */ 67 #define NET_IL_COUNT 6 68 69 /** The number of IP messages. */ 70 #define NET_IP_COUNT 4 71 72 /** The number of general networking messages. */ 73 #define NET_NET_COUNT 3 74 75 /** The number of network interface driver messages. */ 76 #define NET_NETIF_COUNT 6 77 78 /** The number of network interface layer messages. */ 79 #define NET_NIL_COUNT 7 80 81 /** The number of packet management system messages. */ 82 #define NET_PACKET_COUNT 5 83 84 /** The number of socket messages. */ 85 #define NET_SOCKET_COUNT 14 86 87 /** The number of TCP messages. */ 88 #define NET_TCP_COUNT 0 89 90 /** The number of transport layer messages. */ 91 #define NET_TL_COUNT 1 92 93 /** The number of UDP messages. */ 94 #define NET_UDP_COUNT 0 59 #define NET_ARP_COUNT 5 /**< Number of ARP messages. */ 60 #define NET_ETH_COUNT 0 /**< Number of Ethernet messages. */ 61 #define NET_ICMP_COUNT 6 /**< Number of ICMP messages. */ 62 #define NET_IL_COUNT 6 /**< Number of inter-network messages. */ 63 #define NET_IP_COUNT 4 /**< Number of IP messages. */ 64 #define NET_NET_COUNT 3 /**< Number of general networking messages. */ 65 #define NET_NETIF_COUNT 6 /**< Number of network interface driver messages. */ 66 #define NET_NIL_COUNT 7 /**< Number of network interface layer messages. */ 67 #define NET_PACKET_COUNT 5 /**< Number of packet management system messages. */ 68 #define NET_SOCKET_COUNT 14 /**< Number of socket messages. */ 69 #define NET_TCP_COUNT 0 /**< Number of TCP messages. */ 70 #define NET_TL_COUNT 1 /**< Number of transport layer messages. */ 71 #define NET_UDP_COUNT 0 /**< Number of UDP messages. */ 95 72 96 73 /*@}*/ … … 100 77 /*@{*/ 101 78 102 /** The first networking message. */ 103 #define NET_FIRST 2000 104 105 /** The first network interface layer message. */ 106 #define NET_NETIF_FIRST NET_FIRST 107 108 /** The last network interface layer message. */ 109 #define NET_NETIF_LAST (NET_NETIF_FIRST + NET_NETIF_COUNT) 110 111 /** The first general networking message. */ 112 #define NET_NET_FIRST (NET_NETIF_LAST + 0) 113 114 /** The last general networking message. */ 115 #define NET_NET_LAST (NET_NET_FIRST + NET_NET_COUNT) 116 117 /** The first network interface layer message. */ 118 #define NET_NIL_FIRST (NET_NET_LAST + 0) 119 120 /** The last network interface layer message. */ 121 #define NET_NIL_LAST (NET_NIL_FIRST + NET_NIL_COUNT) 122 123 /** The first Ethernet message. */ 124 #define NET_ETH_FIRST (NET_NIL_LAST + 0) 125 126 /** The last Ethernet message. */ 127 #define NET_ETH_LAST (NET_ETH_FIRST + NET_ETH_COUNT) 128 129 /** The first inter-network message. */ 130 #define NET_IL_FIRST (NET_ETH_LAST + 0) 131 132 /** The last inter-network message. */ 133 #define NET_IL_LAST (NET_IL_FIRST + NET_IL_COUNT) 134 135 /** The first IP message. */ 136 #define NET_IP_FIRST (NET_IL_LAST + 0) 137 138 /** The last IP message. */ 139 #define NET_IP_LAST (NET_IP_FIRST + NET_IP_COUNT) 140 141 /** The first ARP message. */ 142 #define NET_ARP_FIRST (NET_IP_LAST + 0) 143 144 /** The last ARP message. */ 145 #define NET_ARP_LAST (NET_ARP_FIRST + NET_ARP_COUNT) 146 147 /** The first ICMP message. */ 148 #define NET_ICMP_FIRST (NET_ARP_LAST + 0) 149 150 /** The last ICMP message. */ 151 #define NET_ICMP_LAST (NET_ICMP_FIRST + NET_ICMP_COUNT) 152 153 /** The first ICMP message. */ 154 #define NET_TL_FIRST (NET_ICMP_LAST + 0) 155 156 /** The last ICMP message. */ 157 #define NET_TL_LAST (NET_TL_FIRST + NET_TL_COUNT) 158 159 /** The first UDP message. */ 160 #define NET_UDP_FIRST (NET_TL_LAST + 0) 161 162 /** The last UDP message. */ 163 #define NET_UDP_LAST (NET_UDP_FIRST + NET_UDP_COUNT) 164 165 /** The first TCP message. */ 166 #define NET_TCP_FIRST (NET_UDP_LAST + 0) 167 168 /** The last TCP message. */ 169 #define NET_TCP_LAST (NET_TCP_FIRST + NET_TCP_COUNT) 170 171 /** The first socket message. */ 172 #define NET_SOCKET_FIRST (NET_TCP_LAST + 0) 173 174 /** The last socket message. */ 175 #define NET_SOCKET_LAST (NET_SOCKET_FIRST + NET_SOCKET_COUNT) 176 177 /** The first packet management system message. */ 178 #define NET_PACKET_FIRST (NET_SOCKET_LAST + 0) 179 180 /** The last packet management system message. */ 181 #define NET_PACKET_LAST (NET_PACKET_FIRST + NET_PACKET_COUNT) 182 183 /** The last networking message. */ 184 #define NET_LAST NET_PACKET_LAST 185 186 /** The number of networking messages. */ 187 #define NET_COUNT (NET_LAST - NET_FIRST) 188 189 /** Returns a value indicating whether the IPC call is a generic networking 190 * message. 191 * @param[in] call The IPC call to be checked. 79 80 /** First networking message. */ 81 #define NET_FIRST 2000 82 83 /** First network interface layer message. */ 84 #define NET_NETIF_FIRST NET_FIRST 85 86 /** Last network interface layer message. */ 87 #define NET_NETIF_LAST (NET_NETIF_FIRST + NET_NETIF_COUNT) 88 89 /** First general networking message. */ 90 #define NET_NET_FIRST (NET_NETIF_LAST + 0) 91 92 /** Last general networking message. */ 93 #define NET_NET_LAST (NET_NET_FIRST + NET_NET_COUNT) 94 95 /** First network interface layer message. */ 96 #define NET_NIL_FIRST (NET_NET_LAST + 0) 97 98 /** Last network interface layer message. */ 99 #define NET_NIL_LAST (NET_NIL_FIRST + NET_NIL_COUNT) 100 101 /** First Ethernet message. */ 102 #define NET_ETH_FIRST (NET_NIL_LAST + 0) 103 104 /** Last Ethernet message. */ 105 #define NET_ETH_LAST (NET_ETH_FIRST + NET_ETH_COUNT) 106 107 /** First inter-network message. */ 108 #define NET_IL_FIRST (NET_ETH_LAST + 0) 109 110 /** Last inter-network message. */ 111 #define NET_IL_LAST (NET_IL_FIRST + NET_IL_COUNT) 112 113 /** First IP message. */ 114 #define NET_IP_FIRST (NET_IL_LAST + 0) 115 116 /** Last IP message. */ 117 #define NET_IP_LAST (NET_IP_FIRST + NET_IP_COUNT) 118 119 /** First ARP message. */ 120 #define NET_ARP_FIRST (NET_IP_LAST + 0) 121 122 /** Last ARP message. */ 123 #define NET_ARP_LAST (NET_ARP_FIRST + NET_ARP_COUNT) 124 125 /** First ICMP message. */ 126 #define NET_ICMP_FIRST (NET_ARP_LAST + 0) 127 128 /** Last ICMP message. */ 129 #define NET_ICMP_LAST (NET_ICMP_FIRST + NET_ICMP_COUNT) 130 131 /** First ICMP message. */ 132 #define NET_TL_FIRST (NET_ICMP_LAST + 0) 133 134 /** Last ICMP message. */ 135 #define NET_TL_LAST (NET_TL_FIRST + NET_TL_COUNT) 136 137 /** First UDP message. */ 138 #define NET_UDP_FIRST (NET_TL_LAST + 0) 139 140 /** Last UDP message. */ 141 #define NET_UDP_LAST (NET_UDP_FIRST + NET_UDP_COUNT) 142 143 /** First TCP message. */ 144 #define NET_TCP_FIRST (NET_UDP_LAST + 0) 145 146 /** Last TCP message. */ 147 #define NET_TCP_LAST (NET_TCP_FIRST + NET_TCP_COUNT) 148 149 /** First socket message. */ 150 #define NET_SOCKET_FIRST (NET_TCP_LAST + 0) 151 152 /** Last socket message. */ 153 #define NET_SOCKET_LAST (NET_SOCKET_FIRST + NET_SOCKET_COUNT) 154 155 /** First packet management system message. */ 156 #define NET_PACKET_FIRST (NET_SOCKET_LAST + 0) 157 158 /** Last packet management system message. */ 159 #define NET_PACKET_LAST (NET_PACKET_FIRST + NET_PACKET_COUNT) 160 161 /** Last networking message. */ 162 #define NET_LAST NET_PACKET_LAST 163 164 /** Number of networking messages. */ 165 #define NET_COUNT (NET_LAST - NET_FIRST) 166 167 /** Check if the IPC call is a generic networking message. 168 * 169 * @param[in] call IPC call to be checked. 170 * 192 171 */ 193 172 #define IS_NET_MESSAGE(call) \ 194 IS_IN_INTERVAL(IPC_GET_IMETHOD(*call), NET_FIRST, NET_LAST) 195 196 /** Returns a value indicating whether the IPC call is an ARP message. 197 * @param[in] call The IPC call to be checked. 173 IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_FIRST, NET_LAST) 174 175 /** Check if the IPC call is an ARP message. 176 * 177 * @param[in] call IPC call to be checked. 178 * 198 179 */ 199 180 #define IS_NET_ARP_MESSAGE(call) \ 200 IS_IN_INTERVAL(IPC_GET_IMETHOD(*call), NET_ARP_FIRST, NET_ARP_LAST) 201 202 /** Returns a value indicating whether the IPC call is an Ethernet message. 203 * @param[in] call The IPC call to be checked. 181 IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_ARP_FIRST, NET_ARP_LAST) 182 183 /** Check if the IPC call is an Ethernet message. 184 * 185 * @param[in] call IPC call to be checked. 186 * 204 187 */ 205 188 #define IS_NET_ETH_MESSAGE(call) \ 206 IS_IN_INTERVAL(IPC_GET_IMETHOD(*call), NET_ETH_FIRST, NET_ETH_LAST) 207 208 /** Returns a value indicating whether the IPC call is an ICMP message. 209 * @param[in] call The IPC call to be checked. 189 IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_ETH_FIRST, NET_ETH_LAST) 190 191 /** Check if the IPC call is an ICMP message. 192 * 193 * @param[in] call IPC call to be checked. 194 * 210 195 */ 211 196 #define IS_NET_ICMP_MESSAGE(call) \ 212 IS_IN_INTERVAL(IPC_GET_IMETHOD(*call), NET_ICMP_FIRST, NET_ICMP_LAST) 213 214 /** Returns a value indicating whether the IPC call is an inter-network layer 215 * message. 216 * @param[in] call The IPC call to be checked. 197 IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_ICMP_FIRST, NET_ICMP_LAST) 198 199 /** Check if the IPC call is an inter-network layer message. 200 * 201 * @param[in] call IPC call to be checked. 202 * 217 203 */ 218 204 #define IS_NET_IL_MESSAGE(call) \ 219 IS_IN_INTERVAL(IPC_GET_IMETHOD(*call), NET_IL_FIRST, NET_IL_LAST) 220 221 /** Returns a value indicating whether the IPC call is an IP message. 222 * @param[in] call The IPC call to be checked. 205 IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_IL_FIRST, NET_IL_LAST) 206 207 /** Check if the IPC call is an IP message. 208 * 209 * @param[in] call IPC call to be checked. 210 * 223 211 */ 224 212 #define IS_NET_IP_MESSAGE(call) \ 225 IS_IN_INTERVAL(IPC_GET_IMETHOD(*call), NET_IP_FIRST, NET_IP_LAST) 226 227 /** Returns a value indicating whether the IPC call is a generic networking 228 * message. 229 * @param[in] call The IPC call to be checked. 213 IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_IP_FIRST, NET_IP_LAST) 214 215 /** Check if the IPC call is a generic networking message. 216 * 217 * @param[in] call IPC call to be checked. 218 * 230 219 */ 231 220 #define IS_NET_NET_MESSAGE(call) \ 232 IS_IN_INTERVAL(IPC_GET_IMETHOD(*call), NET_NET_FIRST, NET_NET_LAST) 233 234 /** Returns a value indicating whether the IPC call is a network interface layer 235 * message. 236 * @param[in] call The IPC call to be checked. 221 IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_NET_FIRST, NET_NET_LAST) 222 223 /** Check if the IPC call is a network interface layer message. 224 * 225 * @param[in] call IPC call to be checked. 226 * 237 227 */ 238 228 #define IS_NET_NIL_MESSAGE(call) \ 239 IS_IN_INTERVAL(IPC_GET_IMETHOD(*call), NET_NIL_FIRST, NET_NIL_LAST) 240 241 /** Returns a value indicating whether the IPC call is a packet manaagement 242 * system message. 243 * @param[in] call The IPC call to be checked. 229 IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_NIL_FIRST, NET_NIL_LAST) 230 231 /** Check if the IPC call is a packet manaagement system message. 232 * 233 * @param[in] call IPC call to be checked. 234 * 244 235 */ 245 236 #define IS_NET_PACKET_MESSAGE(call) \ 246 IS_IN_INTERVAL(IPC_GET_IMETHOD(*call), NET_PACKET_FIRST, NET_PACKET_LAST) 247 248 /** Returns a value indicating whether the IPC call is a socket message. 249 * @param[in] call The IPC call to be checked. 237 IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_PACKET_FIRST, NET_PACKET_LAST) 238 239 /** Check if the IPC call is a socket message. 240 * 241 * @param[in] call IPC call to be checked. 242 * 250 243 */ 251 244 #define IS_NET_SOCKET_MESSAGE(call) \ 252 IS_IN_INTERVAL(IPC_GET_IMETHOD(*call), NET_SOCKET_FIRST, NET_SOCKET_LAST) 253 254 /** Returns a value indicating whether the IPC call is a TCP message. 255 * @param[in] call The IPC call to be checked. 245 IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_SOCKET_FIRST, NET_SOCKET_LAST) 246 247 /** Check if the IPC call is a TCP message. 248 * 249 * @param[in] call IPC call to be checked. 250 * 256 251 */ 257 252 #define IS_NET_TCP_MESSAGE(call) \ 258 IS_IN_INTERVAL(IPC_GET_IMETHOD(*call), NET_TCP_FIRST, NET_TCP_LAST) 259 260 /** Returns a value indicating whether the IPC call is a transport layer message. 261 * @param[in] call The IPC call to be checked. 253 IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_TCP_FIRST, NET_TCP_LAST) 254 255 /** Check if the IPC call is a transport layer message. 256 * 257 * @param[in] call IPC call to be checked. 258 * 262 259 */ 263 260 #define IS_NET_TL_MESSAGE(call) \ 264 IS_IN_INTERVAL(IPC_GET_IMETHOD(*call), NET_TL_FIRST, NET_TL_LAST) 265 266 /** Returns a value indicating whether the IPC call is a UDP message. 267 * @param[in] call The IPC call to be checked. 261 IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_TL_FIRST, NET_TL_LAST) 262 263 /** Check if the IPC call is a UDP message. 264 * 265 * @param[in] call IPC call to be checked. 266 * 268 267 */ 269 268 #define IS_NET_UDP_MESSAGE(call) \ 270 IS_IN_INTERVAL(IPC_GET_IMETHOD( *call), NET_UDP_FIRST, NET_UDP_LAST)269 IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_UDP_FIRST, NET_UDP_LAST) 271 270 272 271 /*@}*/ … … 275 274 /*@{*/ 276 275 277 /** Returns the device identifier message argument. 278 * @param[in] call The message call structure. 279 */ 280 #define IPC_GET_DEVICE(call) \ 281 ({ \ 282 device_id_t device_id = (device_id_t) IPC_GET_ARG1(*call); \ 283 device_id; \ 284 }) 285 286 /** Returns the packet identifier message argument. 287 * @param[in] call The message call structure. 288 */ 289 #define IPC_GET_PACKET(call) \ 290 ({ \ 291 packet_id_t packet_id = (packet_id_t) IPC_GET_ARG2(*call); \ 292 packet_id; \ 293 }) 294 295 /** Returns the count message argument. 296 * @param[in] call The message call structure. 297 */ 298 #define IPC_GET_COUNT(call) \ 299 ({ \ 300 size_t size = (size_t) IPC_GET_ARG2(*call); \ 301 size; \ 302 }) 303 304 /** Returns the device state message argument. 305 * @param[in] call The message call structure. 306 */ 307 #define IPC_GET_STATE(call) \ 308 ({ \ 309 device_state_t state = (device_state_t) IPC_GET_ARG2(*call); \ 310 state; \ 311 }) 312 313 /** Returns the maximum transmission unit message argument. 314 * @param[in] call The message call structure. 315 */ 316 #define IPC_GET_MTU(call) \ 317 ({ \ 318 size_t size = (size_t) IPC_GET_ARG2(*call); \ 319 size; \ 320 }) 321 322 /** Returns the device driver service message argument. 323 * @param[in] call The message call structure. 324 */ 325 #define IPC_GET_SERVICE(call) \ 326 ({ \ 327 services_t service = (services_t) IPC_GET_ARG3(*call); \ 328 service; \ 329 }) 330 331 /** Returns the target service message argument. 332 * @param[in] call The message call structure. 333 */ 334 #define IPC_GET_TARGET(call) \ 335 ({ \ 336 services_t service = (services_t) IPC_GET_ARG3(*call); \ 337 service; \ 338 }) 339 340 /** Returns the sender service message argument. 341 * @param[in] call The message call structure. 342 */ 343 #define IPC_GET_SENDER(call) \ 344 ({ \ 345 services_t service = (services_t) IPC_GET_ARG3(*call); \ 346 service; \ 347 }) 348 349 /** Returns the error service message argument. 350 * @param[in] call The message call structure. 351 */ 352 #define IPC_GET_ERROR(call) \ 353 ({ \ 354 services_t service = (services_t) IPC_GET_ARG4(*call); \ 355 service; \ 356 }) 357 358 /** Returns the phone message argument. 359 * @param[in] call The message call structure. 360 */ 361 #define IPC_GET_PHONE(call) \ 362 ({ \ 363 int phone = (int) IPC_GET_ARG5(*call); \ 364 phone; \ 365 }) 366 367 /** Sets the device identifier in the message answer. 368 * @param[out] answer The message answer structure. 369 */ 370 #define IPC_SET_DEVICE(answer, value) \ 371 do { \ 372 sysarg_t argument = (sysarg_t) (value); \ 373 IPC_SET_ARG1(*answer, argument); \ 374 } while (0) 375 376 /** Sets the minimum address length in the message answer. 377 * @param[out] answer The message answer structure. 378 */ 379 #define IPC_SET_ADDR(answer, value) \ 380 do { \ 381 sysarg_t argument = (sysarg_t) (value); \ 382 IPC_SET_ARG1(*answer, argument); \ 383 } while (0) 384 385 /** Sets the minimum prefix size in the message answer. 386 * @param[out] answer The message answer structure. 387 */ 388 #define IPC_SET_PREFIX(answer, value) \ 389 do { \ 390 sysarg_t argument = (sysarg_t) (value); \ 391 IPC_SET_ARG2(*answer, argument); \ 392 } while (0) 393 394 /** Sets the maximum content size in the message answer. 395 * @param[out] answer The message answer structure. 396 */ 397 #define IPC_SET_CONTENT(answer, value) \ 398 do { \ 399 sysarg_t argument = (sysarg_t) (value); \ 400 IPC_SET_ARG3(*answer, argument); \ 401 } while (0) 402 403 /** Sets the minimum suffix size in the message answer. 404 * @param[out] answer The message answer structure. 405 */ 406 #define IPC_SET_SUFFIX(answer, value) \ 407 do { \ 408 sysarg_t argument = (sysarg_t) (value); \ 409 IPC_SET_ARG4(*answer, argument); \ 410 } while (0) 276 /** Return the device identifier message argument. 277 * 278 * @param[in] call Message call structure. 279 * 280 */ 281 #define IPC_GET_DEVICE(call) ((device_id_t) IPC_GET_ARG1(call)) 282 283 /** Return the packet identifier message argument. 284 * 285 * @param[in] call Message call structure. 286 * 287 */ 288 #define IPC_GET_PACKET(call) ((packet_id_t) IPC_GET_ARG2(call)) 289 290 /** Return the count message argument. 291 * 292 * @param[in] call Message call structure. 293 * 294 */ 295 #define IPC_GET_COUNT(call) ((size_t) IPC_GET_ARG2(call)) 296 297 /** Return the device state message argument. 298 * 299 * @param[in] call Message call structure. 300 * 301 */ 302 #define IPC_GET_STATE(call) ((device_state_t) IPC_GET_ARG2(call)) 303 304 /** Return the maximum transmission unit message argument. 305 * 306 * @param[in] call Message call structure. 307 * 308 */ 309 #define IPC_GET_MTU(call) ((size_t) IPC_GET_ARG2(call)) 310 311 /** Return the device driver service message argument. 312 * 313 * @param[in] call Message call structure. 314 * 315 */ 316 #define IPC_GET_SERVICE(call) ((services_t) IPC_GET_ARG3(call)) 317 318 /** Return the target service message argument. 319 * 320 * @param[in] call Message call structure. 321 * 322 */ 323 #define IPC_GET_TARGET(call) ((services_t) IPC_GET_ARG3(call)) 324 325 /** Return the sender service message argument. 326 * 327 * @param[in] call Message call structure. 328 * 329 */ 330 #define IPC_GET_SENDER(call) ((services_t) IPC_GET_ARG3(call)) 331 332 /** Return the error service message argument. 333 & 334 * @param[in] call Message call structure. 335 * 336 */ 337 #define IPC_GET_ERROR(call) ((services_t) IPC_GET_ARG4(call)) 338 339 /** Return the phone message argument. 340 * 341 * @param[in] call Message call structure. 342 * 343 */ 344 #define IPC_GET_PHONE(call) ((int) IPC_GET_ARG5(call)) 345 346 /** Set the device identifier in the message answer. 347 * 348 * @param[out] answer Message answer structure. 349 * @param[in] value Value to set. 350 * 351 */ 352 #define IPC_SET_DEVICE(answer, value) IPC_SET_ARG1(answer, (sysarg_t) (value)) 353 354 /** Set the minimum address length in the message answer. 355 * 356 * @param[out] answer Message answer structure. 357 * @param[in] value Value to set. 358 * 359 */ 360 #define IPC_SET_ADDR(answer, value) IPC_SET_ARG1(answer, (sysarg_t) (value)) 361 362 /** Set the minimum prefix size in the message answer. 363 * 364 * @param[out] answer Message answer structure. 365 * @param[in] value Value to set. 366 * 367 */ 368 #define IPC_SET_PREFIX(answer, value) IPC_SET_ARG2(answer, (sysarg_t) (value)) 369 370 /** Set the maximum content size in the message answer. 371 * 372 * @param[out] answer Message answer structure. 373 * @param[in] value Value to set. 374 * 375 */ 376 #define IPC_SET_CONTENT(answer, value) IPC_SET_ARG3(answer, (sysarg_t) (value)) 377 378 /** Set the minimum suffix size in the message answer. 379 * 380 * @param[out] answer Message answer structure. 381 * @param[in] value Value to set. 382 * 383 */ 384 #define IPC_SET_SUFFIX(answer, value) IPC_SET_ARG4(answer, (sysarg_t) (value)) 411 385 412 386 /*@}*/ -
uspace/lib/c/include/ipc/netif.h
r3c106e88 r774e6d1a 47 47 */ 48 48 NET_NETIF_PROBE = NET_NETIF_FIRST, 49 49 50 /** Send packet message. 50 51 * @see netif_send_msg() 51 52 */ 52 53 NET_NETIF_SEND, 54 53 55 /** Start device message. 54 56 * @see netif_start_req() 55 57 */ 56 58 NET_NETIF_START, 59 57 60 /** Get device usage statistics message. 58 61 * @see netif_stats_req() 59 62 */ 60 63 NET_NETIF_STATS, 64 61 65 /** Stop device message. 62 66 * @see netif_stop_req() 63 67 */ 64 68 NET_NETIF_STOP, 69 65 70 /** Get device address message. 66 71 * @see netif_get_addr_req() … … 73 78 74 79 /** Return the interrupt number message parameter. 75 * @param[in] call The message call structure. 80 * 81 * @param[in] call Mmessage call structure. 82 * 76 83 */ 77 #define NETIF_GET_IRQ(call) \ 78 ({ \ 79 int irq = (int) IPC_GET_ARG2(*call); \ 80 irq; \ 81 }) 84 #define NETIF_GET_IRQ(call) ((int) IPC_GET_ARG2(call)) 82 85 83 86 /** Return the input/output address message parameter. 84 * @param[in] call The message call structure. 87 * 88 * @param[in] call Message call structure. 89 * 85 90 */ 86 #define NETIF_GET_IO(call) \ 87 ({ \ 88 int io = (int) IPC_GET_ARG3(*call); \ 89 io; \ 90 }) 91 #define NETIF_GET_IO(call) ((void *) IPC_GET_ARG3(call)) 91 92 92 93 /*@}*/ -
uspace/lib/c/include/ipc/nil.h
r3c106e88 r774e6d1a 77 77 78 78 /** Return the protocol service message parameter. */ 79 #define NIL_GET_PROTO(call) \ 80 ({ \ 81 services_t service = (services_t) IPC_GET_ARG2(*call); \ 82 service; \ 83 }) 79 #define NIL_GET_PROTO(call) ((services_t) IPC_GET_ARG2(call)) 84 80 85 81 /*@}*/ -
uspace/lib/c/include/ipc/packet.h
r3c106e88 r774e6d1a 70 70 } packet_messages; 71 71 72 /** Return sthe protocol service message parameter. */73 #define ARP_GET_PROTO(call) (services_t) IPC_GET_ARG2(*call)72 /** Return the protocol service message parameter. */ 73 #define ARP_GET_PROTO(call) ((services_t) IPC_GET_ARG2(call)) 74 74 75 /** Return sthe packet identifier message parameter. */76 #define IPC_GET_ID(call) (packet_id_t) IPC_GET_ARG1(*call)75 /** Return the packet identifier message parameter. */ 76 #define IPC_GET_ID(call) ((packet_id_t) IPC_GET_ARG1(call)) 77 77 78 /** Return sthe maximal content length message parameter. */79 #define IPC_GET_CONTENT(call) (size_t) IPC_GET_ARG1(*call)78 /** Return the maximal content length message parameter. */ 79 #define IPC_GET_CONTENT(call) ((size_t) IPC_GET_ARG1(call)) 80 80 81 /** Return sthe maximal address length message parameter. */82 #define IPC_GET_ADDR_LEN(call) (size_t) IPC_GET_ARG2(*call)81 /** Return the maximal address length message parameter. */ 82 #define IPC_GET_ADDR_LEN(call) ((size_t) IPC_GET_ARG2(call)) 83 83 84 /** Return sthe maximal prefix length message parameter. */85 #define IPC_GET_PREFIX(call) (size_t) IPC_GET_ARG3(*call)84 /** Return the maximal prefix length message parameter. */ 85 #define IPC_GET_PREFIX(call) ((size_t) IPC_GET_ARG3(call)) 86 86 87 /** Return sthe maximal suffix length message parameter. */88 #define IPC_GET_SUFFIX(call) (size_t) IPC_GET_ARG4(*call)87 /** Return the maximal suffix length message parameter. */ 88 #define IPC_GET_SUFFIX(call) ((size_t) IPC_GET_ARG4(call)) 89 89 90 90 #endif
Note:
See TracChangeset
for help on using the changeset viewer.