Changeset 89c57b6 in mainline for uspace/lib/c/include/ipc/ip.h
- Timestamp:
- 2011-04-13T14:45:41Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 88634420
- Parents:
- cefb126 (diff), 17279ead (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
rcefb126 r89c57b6 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 #include <ipc/ipc.h> 41 #include <ipc/net.h> 42 #include <net/in.h> 43 #include <net/ip_codes.h> 42 44 43 #include <in.h> 44 #include <ip_codes.h> 45 46 /** IP module messages. 47 */ 48 typedef enum{ 45 /** IP module messages. */ 46 typedef enum { 47 /** New device message. 48 * @see ip_device_req() 49 */ 50 NET_IP_DEVICE = NET_IP_FIRST, 51 49 52 /** Adds the routing entry. 50 * 53 * @see ip_add_route() 51 54 */ 52 NET_IP_ADD_ROUTE = NET_IP_FIRST, 55 NET_IP_ADD_ROUTE, 56 53 57 /** Gets the actual route information. 54 * 58 * @see ip_get_route() 55 59 */ 56 60 NET_IP_GET_ROUTE, 61 57 62 /** Processes the received error notification. 58 * 63 * @see ip_received_error_msg() 59 64 */ 60 65 NET_IP_RECEIVED_ERROR, 66 61 67 /** Sets the default gateway. 62 * 68 * @see ip_set_default_gateway() 63 69 */ 64 NET_IP_SET_GATEWAY 70 NET_IP_SET_GATEWAY, 71 72 /** Packet size message. 73 * @see ip_packet_size_req() 74 */ 75 NET_IP_PACKET_SPACE, 76 77 /** Packet send message. 78 * @see ip_send_msg() 79 */ 80 NET_IP_SEND 65 81 } ip_messages; 66 82 67 /** @name IP specific message parameters definitions 68 */ 83 /** @name IP specific message parameters definitions */ 69 84 /*@{*/ 70 85 71 /** Returns the address message parameter. 72 * @param[in] call The message call structure. 86 /** Return the address message parameter. 87 * 88 * @param[in] call Message call structure. 89 * 73 90 */ 74 91 #define IP_GET_ADDRESS(call) \ 75 ({in_addr_t addr; addr.s_addr = IPC_GET_ARG3(*call); addr;}) 92 ({ \ 93 in_addr_t addr; \ 94 addr.s_addr = IPC_GET_ARG3(call); \ 95 addr; \ 96 }) 76 97 77 /** Returns the gateway message parameter. 78 * @param[in] call The message call structure. 98 /** Return the gateway message parameter. 99 * 100 * @param[in] call Message call structure. 101 * 79 102 */ 80 103 #define IP_GET_GATEWAY(call) \ 81 ({in_addr_t addr; addr.s_addr = IPC_GET_ARG2(*call); addr;}) 104 ({ \ 105 in_addr_t addr; \ 106 addr.s_addr = IPC_GET_ARG2(call); \ 107 addr; \ 108 }) 82 109 83 /** Sets the header length in the message answer. 84 * @param[out] answer The message answer structure. 110 /** Set the header length in the message answer. 111 * 112 * @param[out] answer Message answer structure. 113 * 85 114 */ 86 #define IP_SET_HEADERLEN(answer, value) \ 87 {ipcarg_t argument = (ipcarg_t) (value); IPC_SET_ARG2(*answer, argument);} 115 #define IP_SET_HEADERLEN(answer, value) IPC_SET_ARG2(answer, (sysarg_t) (value)) 88 116 89 /** Returns the network mask message parameter. 90 * @param[in] call The message call structure. 117 /** Return the network mask message parameter. 118 * 119 * @param[in] call Message call structure. 120 * 91 121 */ 92 122 #define IP_GET_NETMASK(call) \ 93 ({in_addr_t addr; addr.s_addr = IPC_GET_ARG4(*call); addr;}) 123 ({ \ 124 in_addr_t addr; \ 125 addr.s_addr = IPC_GET_ARG4(call); \ 126 addr; \ 127 }) 94 128 95 /** Returns the protocol message parameter. 96 * @param[in] call The message call structure. 129 /** Return the protocol message parameter. 130 * 131 * @param[in] call Message call structure. 132 * 97 133 */ 98 #define IP_GET_PROTOCOL(call) \ 99 ({ip_protocol_t protocol = (ip_protocol_t) IPC_GET_ARG1(*call); protocol;}) 134 #define IP_GET_PROTOCOL(call) ((ip_protocol_t) IPC_GET_ARG1(call)) 100 135 101 136 /*@}*/
Note:
See TracChangeset
for help on using the changeset viewer.