Changeset f14291b in mainline for uspace/lib/c/include/ipc/ip.h
- Timestamp:
- 2010-10-19T20:55:53Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a93d79a
- Parents:
- 1882525 (diff), a7a85d16 (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/c/include/ipc/ip.h
r1882525 rf14291b 27 27 */ 28 28 29 /** @addtogroup ip30 * 29 /** @addtogroup libc 30 * @{ 31 31 */ 32 32 33 33 /** @file 34 * 35 * 34 * IP module messages. 35 * @see ip_interface.h 36 36 */ 37 37 38 #ifndef __NET_IP_MESSAGES_H__39 #define __NET_IP_MESSAGES_H__38 #ifndef LIBC_IP_MESSAGES_H_ 39 #define LIBC_IP_MESSAGES_H_ 40 40 41 41 #include <ipc/ipc.h> 42 #include <ipc/net.h> 42 43 43 #include < in.h>44 #include < ip_codes.h>44 #include <net/in.h> 45 #include <net/ip_codes.h> 45 46 46 /** IP module messages. 47 */ 48 typedef enum{ 47 /** IP module messages. */ 48 typedef enum { 49 49 /** Adds the routing entry. 50 * 50 * @see ip_add_route() 51 51 */ 52 52 NET_IP_ADD_ROUTE = NET_IP_FIRST, 53 53 /** Gets the actual route information. 54 * 54 * @see ip_get_route() 55 55 */ 56 56 NET_IP_GET_ROUTE, 57 57 /** Processes the received error notification. 58 * 58 * @see ip_received_error_msg() 59 59 */ 60 60 NET_IP_RECEIVED_ERROR, 61 61 /** Sets the default gateway. 62 * 62 * @see ip_set_default_gateway() 63 63 */ 64 64 NET_IP_SET_GATEWAY 65 65 } ip_messages; 66 66 67 /** @name IP specific message parameters definitions 68 */ 67 /** @name IP specific message parameters definitions */ 69 68 /*@{*/ 70 69 71 70 /** Returns the address message parameter. 72 * 71 * @param[in] call The message call structure. 73 72 */ 74 73 #define IP_GET_ADDRESS(call) \ 75 ({in_addr_t addr; addr.s_addr = IPC_GET_ARG3(*call); addr;}) 74 ({ \ 75 in_addr_t addr; \ 76 addr.s_addr = IPC_GET_ARG3(*call); \ 77 addr; \ 78 }) 76 79 77 80 /** Returns the gateway message parameter. 78 * 81 * @param[in] call The message call structure. 79 82 */ 80 83 #define IP_GET_GATEWAY(call) \ 81 ({in_addr_t addr; addr.s_addr = IPC_GET_ARG2(*call); addr;}) 84 ({ \ 85 in_addr_t addr; \ 86 addr.s_addr = IPC_GET_ARG2(*call); \ 87 addr; \ 88 }) 82 89 83 90 /** Sets the header length in the message answer. 84 * 91 * @param[out] answer The message answer structure. 85 92 */ 86 93 #define IP_SET_HEADERLEN(answer, value) \ 87 {ipcarg_t argument = (ipcarg_t) (value); IPC_SET_ARG2(*answer, argument);} 94 do { \ 95 ipcarg_t argument = (ipcarg_t) (value); \ 96 IPC_SET_ARG2(*answer, argument); \ 97 } while (0) 88 98 89 99 /** Returns the network mask message parameter. 90 * 100 * @param[in] call The message call structure. 91 101 */ 92 102 #define IP_GET_NETMASK(call) \ 93 ({in_addr_t addr; addr.s_addr = IPC_GET_ARG4(*call); addr;}) 103 ({ \ 104 in_addr_t addr; \ 105 addr.s_addr = IPC_GET_ARG4(*call); \ 106 addr; \ 107 }) 94 108 95 109 /** Returns the protocol message parameter. 96 * 110 * @param[in] call The message call structure. 97 111 */ 98 112 #define IP_GET_PROTOCOL(call) \ 99 ({ip_protocol_t protocol = (ip_protocol_t) IPC_GET_ARG1(*call); protocol;}) 113 ({ \ 114 ip_protocol_t protocol = (ip_protocol_t) IPC_GET_ARG1(*call); \ 115 protocol; \ 116 }) 100 117 101 118 /*@}*/
Note:
See TracChangeset
for help on using the changeset viewer.