Changes in uspace/srv/net/messages.h [3db8889:02d9fec] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/messages.h
r3db8889 r02d9fec 236 236 * @param[in] call The IPC call to be checked. 237 237 */ 238 #define IS_NET_MESSAGE(call) \ 239 IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_FIRST, NET_LAST) 238 #define IS_NET_MESSAGE(call) IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_FIRST, NET_LAST) 240 239 241 240 /** Returns a value indicating whether the IPC call is an ARP message. 242 241 * @param[in] call The IPC call to be checked. 243 242 */ 244 #define IS_NET_ARP_MESSAGE(call) \ 245 IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_ARP_FIRST, NET_ARP_LAST) 243 #define IS_NET_ARP_MESSAGE(call) IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_ARP_FIRST, NET_ARP_LAST) 246 244 247 245 /** Returns a value indicating whether the IPC call is an Ethernet message. 248 246 * @param[in] call The IPC call to be checked. 249 247 */ 250 #define IS_NET_ETH_MESSAGE(call) \ 251 IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_ETH_FIRST, NET_ETH_LAST) 248 #define IS_NET_ETH_MESSAGE(call) IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_ETH_FIRST, NET_ETH_LAST) 252 249 253 250 /** Returns a value indicating whether the IPC call is an ICMP message. 254 251 * @param[in] call The IPC call to be checked. 255 252 */ 256 #define IS_NET_ICMP_MESSAGE(call) \ 257 IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_ICMP_FIRST, NET_ICMP_LAST) 253 #define IS_NET_ICMP_MESSAGE(call) IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_ICMP_FIRST, NET_ICMP_LAST) 258 254 259 255 /** Returns a value indicating whether the IPC call is an inter-network layer message. 260 256 * @param[in] call The IPC call to be checked. 261 257 */ 262 #define IS_NET_IL_MESSAGE(call) \ 263 IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_IL_FIRST, NET_IL_LAST) 258 #define IS_NET_IL_MESSAGE(call) IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_IL_FIRST, NET_IL_LAST) 264 259 265 260 /** Returns a value indicating whether the IPC call is an IP message. 266 261 * @param[in] call The IPC call to be checked. 267 262 */ 268 #define IS_NET_IP_MESSAGE(call) \ 269 IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_IP_FIRST, NET_IP_LAST) 263 #define IS_NET_IP_MESSAGE(call) IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_IP_FIRST, NET_IP_LAST) 270 264 271 265 /** Returns a value indicating whether the IPC call is a generic networking message. 272 266 * @param[in] call The IPC call to be checked. 273 267 */ 274 #define IS_NET_NET_MESSAGE(call) \ 275 IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_NET_FIRST, NET_NET_LAST) 268 #define IS_NET_NET_MESSAGE(call) IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_NET_FIRST, NET_NET_LAST) 276 269 277 270 /** Returns a value indicating whether the IPC call is a network interface layer message. 278 271 * @param[in] call The IPC call to be checked. 279 272 */ 280 #define IS_NET_NIL_MESSAGE(call) \ 281 IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_NIL_FIRST, NET_NIL_LAST) 273 #define IS_NET_NIL_MESSAGE(call) IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_NIL_FIRST, NET_NIL_LAST) 282 274 283 275 /** Returns a value indicating whether the IPC call is a packet manaagement system message. 284 276 * @param[in] call The IPC call to be checked. 285 277 */ 286 #define IS_NET_PACKET_MESSAGE(call) \ 287 IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_PACKET_FIRST, NET_PACKET_LAST) 278 #define IS_NET_PACKET_MESSAGE(call) IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_PACKET_FIRST, NET_PACKET_LAST) 288 279 289 280 /** Returns a value indicating whether the IPC call is a socket message. 290 281 * @param[in] call The IPC call to be checked. 291 282 */ 292 #define IS_NET_SOCKET_MESSAGE(call) \ 293 IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_SOCKET_FIRST, NET_SOCKET_LAST) 283 #define IS_NET_SOCKET_MESSAGE(call) IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_SOCKET_FIRST, NET_SOCKET_LAST) 294 284 295 285 /** Returns a value indicating whether the IPC call is a TCP message. 296 286 * @param[in] call The IPC call to be checked. 297 287 */ 298 #define IS_NET_TCP_MESSAGE(call) \ 299 IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_TCP_FIRST, NET_TCP_LAST) 288 #define IS_NET_TCP_MESSAGE(call) IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_TCP_FIRST, NET_TCP_LAST) 300 289 301 290 /** Returns a value indicating whether the IPC call is a transport layer message. 302 291 * @param[in] call The IPC call to be checked. 303 292 */ 304 #define IS_NET_TL_MESSAGE(call) \ 305 IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_TL_FIRST, NET_TL_LAST) 293 #define IS_NET_TL_MESSAGE(call) IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_TL_FIRST, NET_TL_LAST) 306 294 307 295 /** Returns a value indicating whether the IPC call is a UDP message. 308 296 * @param[in] call The IPC call to be checked. 309 297 */ 310 #define IS_NET_UDP_MESSAGE(call) \ 311 IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_UDP_FIRST, NET_UDP_LAST) 298 #define IS_NET_UDP_MESSAGE(call) IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_UDP_FIRST, NET_UDP_LAST) 312 299 313 300 /*@}*/ … … 324 311 * @param[in] call The message call structure. 325 312 */ 326 #define IPC_GET_DEVICE(call) \ 327 ({device_id_t device_id = (device_id_t) IPC_GET_ARG1(*call); device_id;}) 328 329 /*@;})*/ 313 #define IPC_GET_DEVICE(call) (device_id_t) IPC_GET_ARG1(*call) 314 315 /*@}*/ 330 316 331 317 /** @name Second arguments 332 318 */ 333 /*@ ({*/319 /*@{*/ 334 320 335 321 /** Returns the packet identifier message argument. 336 322 * @param[in] call The message call structure. 337 323 */ 338 #define IPC_GET_PACKET(call) \ 339 ({packet_id_t packet_id = (packet_id_t) IPC_GET_ARG2(*call); packet_id;}) 324 #define IPC_GET_PACKET(call) (packet_id_t) IPC_GET_ARG2(*call) 340 325 341 326 /** Returns the count message argument. 342 327 * @param[in] call The message call structure. 343 328 */ 344 #define IPC_GET_COUNT(call) \ 345 ({size_t size = (size_t) IPC_GET_ARG2(*call); size;}) 329 #define IPC_GET_COUNT(call) (size_t) IPC_GET_ARG2(*call) 346 330 347 331 /** Returns the device state message argument. 348 332 * @param[in] call The message call structure. 349 333 */ 350 #define IPC_GET_STATE(call) \ 351 ({device_state_t device_state = (device_state_t) IPC_GET_ARG2(*call); device_state;}) 334 #define IPC_GET_STATE(call) (device_state_t) IPC_GET_ARG2(*call) 352 335 353 336 /** Returns the maximum transmission unit message argument. 354 337 * @param[in] call The message call structure. 355 338 */ 356 #define IPC_GET_MTU(call) \ 357 ({size_t size = (size_t) IPC_GET_ARG2(*call); size;}) 358 359 /*@;})*/ 339 #define IPC_GET_MTU(call) (size_t) IPC_GET_ARG2(*call) 340 341 /*@}*/ 360 342 361 343 /** @name Third arguments 362 344 */ 363 /*@ ({*/345 /*@{*/ 364 346 365 347 /** Returns the device driver service message argument. 366 348 * @param[in] call The message call structure. 367 349 */ 368 #define IPC_GET_SERVICE(call) \ 369 ({services_t service = (services_t) IPC_GET_ARG3(*call); service;}) 350 #define IPC_GET_SERVICE(call) (services_t) IPC_GET_ARG3(*call) 370 351 371 352 /** Returns the target service message argument. 372 353 * @param[in] call The message call structure. 373 354 */ 374 #define IPC_GET_TARGET(call) \ 375 ({services_t service = (services_t) IPC_GET_ARG3(*call); service;}) 355 #define IPC_GET_TARGET(call) (services_t) IPC_GET_ARG3(*call) 376 356 377 357 /** Returns the sender service message argument. 378 358 * @param[in] call The message call structure. 379 359 */ 380 #define IPC_GET_SENDER(call) \ 381 ({services_t service = (services_t) IPC_GET_ARG3(*call); service;}) 382 383 /*@;})*/ 360 #define IPC_GET_SENDER(call) (services_t) IPC_GET_ARG3(*call) 361 362 /*@}*/ 384 363 385 364 /** @name Fourth arguments 386 365 */ 387 /*@ ({*/366 /*@{*/ 388 367 389 368 /** Returns the error service message argument. 390 369 * @param[in] call The message call structure. 391 370 */ 392 #define IPC_GET_ERROR(call) \ 393 ({services_t service = (services_t) IPC_GET_ARG4(*call); service;}) 394 395 /*@;})*/ 371 #define IPC_GET_ERROR(call) (services_t) IPC_GET_ARG4(*call) 372 373 /*@}*/ 396 374 397 375 /** @name Fifth arguments 398 376 */ 399 /*@ ({*/377 /*@{*/ 400 378 401 379 /** Returns the phone message argument. 402 380 * @param[in] call The message call structure. 403 381 */ 404 #define IPC_GET_PHONE(call) \ 405 ({int phone = (int) IPC_GET_ARG5(*call); phone;}) 382 #define IPC_GET_PHONE(call) (int) IPC_GET_ARG5(*call) 406 383 407 384 /*@}*/ … … 414 391 * @param[out] answer The message answer structure. 415 392 */ 416 #define IPC_SET_DEVICE(answer, value) \ 417 {ipcarg_t argument = (ipcarg_t) (value); IPC_SET_ARG1(*answer, argument);} 393 #define IPC_SET_DEVICE(answer) (&IPC_GET_ARG1(*answer)) 418 394 419 395 /** Sets the minimum address length in the message answer. 420 396 * @param[out] answer The message answer structure. 421 397 */ 422 #define IPC_SET_ADDR(answer, value) \ 423 {ipcarg_t argument = (ipcarg_t) (value); IPC_SET_ARG1(*answer, argument);} 398 #define IPC_SET_ADDR(answer) (&IPC_GET_ARG1(*answer)) 424 399 425 400 /*@}*/ … … 432 407 * @param[out] answer The message answer structure. 433 408 */ 434 #define IPC_SET_PREFIX(answer, value) \ 435 {ipcarg_t argument = (ipcarg_t) (value); IPC_SET_ARG2(*answer, argument);} 409 #define IPC_SET_PREFIX(answer) (&IPC_GET_ARG2(*answer)) 436 410 437 411 /*@}*/ … … 444 418 * @param[out] answer The message answer structure. 445 419 */ 446 #define IPC_SET_CONTENT(answer, value) \ 447 {ipcarg_t argument = (ipcarg_t) (value); IPC_SET_ARG3(*answer, argument);} 420 #define IPC_SET_CONTENT(answer) (&IPC_GET_ARG3(*answer)) 448 421 449 422 /*@}*/ … … 456 429 * @param[out] answer The message answer structure. 457 430 */ 458 #define IPC_SET_SUFFIX(answer, value) \ 459 {ipcarg_t argument = (ipcarg_t) (value); IPC_SET_ARG4(*answer, argument);} 431 #define IPC_SET_SUFFIX(answer) (&IPC_GET_ARG4(*answer)) 460 432 461 433 /*@}*/
Note:
See TracChangeset
for help on using the changeset viewer.