Rev 4743 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 4743 | Rev 4756 | ||
|---|---|---|---|
| Line 31... | Line 31... | ||
| 31 | */ |
31 | */ |
| 32 | 32 | ||
| 33 | /** @file |
33 | /** @file |
| 34 | * Socket messages. |
34 | * Socket messages. |
| 35 | * @see socket.h |
35 | * @see socket.h |
| 36 | * \todo |
- | |
| 37 | */ |
36 | */ |
| 38 | 37 | ||
| 39 | 38 | ||
| 40 | #ifndef __NET_SOCKET_MESSAGES_H__ |
39 | #ifndef __NET_SOCKET_MESSAGES_H__ |
| 41 | #define __NET_SOCKET_MESSAGES_H__ |
40 | #define __NET_SOCKET_MESSAGES_H__ |
| Line 44... | Line 43... | ||
| 44 | 43 | ||
| 45 | #include "../messages.h" |
44 | #include "../messages.h" |
| 46 | 45 | ||
| 47 | #include "../include/socket_codes.h" |
46 | #include "../include/socket_codes.h" |
| 48 | 47 | ||
| - | 48 | /** Socket client messages. |
|
| - | 49 | */ |
|
| 49 | typedef enum{ |
50 | typedef enum{ |
| - | 51 | /** Creates a new socket. |
|
| - | 52 | * @see socket() |
|
| - | 53 | */ |
|
| 50 | NET_SOCKET = NET_SOCKET_FIRST, |
54 | NET_SOCKET = NET_SOCKET_FIRST, |
| - | 55 | /** Binds the socket. |
|
| - | 56 | * @see bind() |
|
| - | 57 | */ |
|
| 51 | NET_SOCKET_BIND, |
58 | NET_SOCKET_BIND, |
| - | 59 | /** Creates a new socket. |
|
| - | 60 | * @see socket() |
|
| - | 61 | */ |
|
| 52 | NET_SOCKET_LISTEN, |
62 | NET_SOCKET_LISTEN, |
| - | 63 | /** Accepts an incomming connection. |
|
| - | 64 | * @see accept() |
|
| - | 65 | */ |
|
| 53 | NET_SOCKET_ACCEPT, |
66 | NET_SOCKET_ACCEPT, |
| - | 67 | /** Connects the socket. |
|
| - | 68 | * @see connect() |
|
| - | 69 | */ |
|
| 54 | NET_SOCKET_CONNECT, |
70 | NET_SOCKET_CONNECT, |
| - | 71 | /** Closes the socket. |
|
| - | 72 | * @see closesocket() |
|
| - | 73 | */ |
|
| 55 | NET_SOCKET_CLOSE, |
74 | NET_SOCKET_CLOSE, |
| - | 75 | /** Sends data via the stream socket. |
|
| - | 76 | * @see send() |
|
| - | 77 | */ |
|
| 56 | NET_SOCKET_SEND, |
78 | NET_SOCKET_SEND, |
| - | 79 | /** Sends data via the datagram socket. |
|
| - | 80 | * @see sendto() |
|
| - | 81 | */ |
|
| 57 | NET_SOCKET_SENDTO, |
82 | NET_SOCKET_SENDTO, |
| - | 83 | /** Receives data from the stream socket. |
|
| - | 84 | * @see socket() |
|
| - | 85 | */ |
|
| 58 | NET_SOCKET_RECV, |
86 | NET_SOCKET_RECV, |
| - | 87 | /** Receives data from the datagram socket. |
|
| - | 88 | * @see socket() |
|
| - | 89 | */ |
|
| 59 | NET_SOCKET_RECVFROM, |
90 | NET_SOCKET_RECVFROM, |
| - | 91 | /** Gets the socket option. |
|
| - | 92 | * @see getsockopt() |
|
| - | 93 | */ |
|
| 60 | NET_SOCKET_GETSOCKOPT, |
94 | NET_SOCKET_GETSOCKOPT, |
| - | 95 | /** Sets the socket option. |
|
| - | 96 | * @see setsockopt() |
|
| - | 97 | */ |
|
| 61 | NET_SOCKET_SETSOCKOPT, |
98 | NET_SOCKET_SETSOCKOPT, |
| - | 99 | /** New socket for acceptence notification message. |
|
| - | 100 | */ |
|
| 62 | NET_SOCKET_ACCEPTED, |
101 | NET_SOCKET_ACCEPTED, |
| - | 102 | /** New data received notification message. |
|
| - | 103 | */ |
|
| 63 | NET_SOCKET_RECEIVED, |
104 | NET_SOCKET_RECEIVED, |
| - | 105 | /** New socket data fragment size notification message. |
|
| - | 106 | */ |
|
| 64 | NET_SOCKET_DATA_FRAGMENT_SIZE |
107 | NET_SOCKET_DATA_FRAGMENT_SIZE |
| 65 | } socket_messages; |
108 | } socket_messages; |
| 66 | 109 | ||
| 67 | /** @name Socket specific message parameters definitions |
110 | /** @name Socket specific message parameters definitions |
| 68 | */ |
111 | */ |
| 69 | /*@{*/ |
112 | /*@{*/ |
| 70 | 113 | ||
| - | 114 | /** Sets the socket identifier in the message answer. |
|
| - | 115 | * @param[out] answer The message answer structure. |
|
| - | 116 | */ |
|
| 71 | #define SOCKET_SET_SOCKET_ID( call ) ( int * ) & IPC_GET_ARG1( call ) |
117 | #define SOCKET_SET_SOCKET_ID( answer ) ( int * ) & IPC_GET_ARG1( answer ) |
| - | 118 | ||
| - | 119 | /** Returns the socket identifier message parameter. |
|
| - | 120 | * @param[in] call The message call structure. |
|
| - | 121 | */ |
|
| 72 | #define SOCKET_GET_SOCKET_ID( call ) ( int ) IPC_GET_ARG1( call ) |
122 | #define SOCKET_GET_SOCKET_ID( call ) ( int ) IPC_GET_ARG1( call ) |
| - | 123 | ||
| - | 124 | /** Sets the read data length in the message answer. |
|
| - | 125 | * @param[out] answer The message answer structure. |
|
| - | 126 | */ |
|
| 73 | #define SOCKET_SET_READ_DATA_LENGTH( call ) ( int * ) & IPC_GET_ARG1( call ) |
127 | #define SOCKET_SET_READ_DATA_LENGTH( answer ) ( int * ) & IPC_GET_ARG1( answer ) |
| - | 128 | ||
| - | 129 | /** Returns the read data length message parameter. |
|
| - | 130 | * @param[in] call The message call structure. |
|
| - | 131 | */ |
|
| 74 | #define SOCKET_GET_READ_DATA_LENGTH( call ) ( int ) IPC_GET_ARG1( call ) |
132 | #define SOCKET_GET_READ_DATA_LENGTH( call ) ( int ) IPC_GET_ARG1( call ) |
| 75 | 133 | ||
| - | 134 | /** Returns the backlog message parameter. |
|
| - | 135 | * @param[in] call The message call structure. |
|
| - | 136 | */ |
|
| 76 | #define SOCKET_GET_BACKLOG( call ) ( int ) IPC_GET_ARG2( call ) |
137 | #define SOCKET_GET_BACKLOG( call ) ( int ) IPC_GET_ARG2( call ) |
| - | 138 | ||
| - | 139 | /** Returns the option level message parameter. |
|
| - | 140 | * @param[in] call The message call structure. |
|
| - | 141 | */ |
|
| 77 | #define SOCKET_GET_OPT_LEVEL( call ) ( int ) IPC_GET_ARG2( call ) |
142 | #define SOCKET_GET_OPT_LEVEL( call ) ( int ) IPC_GET_ARG2( call ) |
| - | 143 | ||
| - | 144 | /** Sets the address length in the message answer. |
|
| - | 145 | * @param[out] answer The message answer structure. |
|
| - | 146 | */ |
|
| 78 | #define SOCKET_SET_ADDRESS_LENGTH( call ) ( socklen_t * ) & IPC_GET_ARG2( call ) |
147 | #define SOCKET_SET_ADDRESS_LENGTH( answer ) ( socklen_t * ) & IPC_GET_ARG2( answer ) |
| - | 148 | ||
| - | 149 | /** Returns the address length message parameter. |
|
| - | 150 | * @param[in] call The message call structure. |
|
| - | 151 | */ |
|
| 79 | #define SOCKET_GET_ADDRESS_LENGTH( call ) ( socklen_t ) IPC_GET_ARG2( call ) |
152 | #define SOCKET_GET_ADDRESS_LENGTH( call ) ( socklen_t ) IPC_GET_ARG2( call ) |
| - | 153 | ||
| - | 154 | /** Returns the data fragment size message parameter. |
|
| - | 155 | * @param[in] call The message call structure. |
|
| - | 156 | */ |
|
| 80 | #define SOCKET_GET_DATA_FRAGMENT_SIZE( call ) ( size_t ) IPC_GET_ARG2( call ) |
157 | #define SOCKET_GET_DATA_FRAGMENT_SIZE( call ) ( size_t ) IPC_GET_ARG2( call ) |
| 81 | #define SOCKET_SET_DATA_FRAGMENT_SIZE( call ) ( size_t * ) & IPC_GET_ARG2( call ) |
- | |
| 82 | 158 | ||
| - | 159 | /** Sets the data fragment size in the message answer. |
|
| - | 160 | * @param[out] answer The message answer structure. |
|
| - | 161 | */ |
|
| - | 162 | #define SOCKET_SET_DATA_FRAGMENT_SIZE( answer ) ( size_t * ) & IPC_GET_ARG2( answer ) |
|
| - | 163 | ||
| - | 164 | /** Sets the header size in the message answer. |
|
| - | 165 | * @param[out] answer The message answer structure. |
|
| - | 166 | */ |
|
| 83 | #define SOCKET_SET_HEADER_SIZE( call ) ( int * ) & IPC_GET_ARG3( call ) |
167 | #define SOCKET_SET_HEADER_SIZE( answer ) ( int * ) & IPC_GET_ARG3( answer ) |
| - | 168 | ||
| - | 169 | /** Returns the header size message parameter. |
|
| - | 170 | * @param[in] call The message call structure. |
|
| - | 171 | */ |
|
| 84 | #define SOCKET_GET_HEADER_SIZE( call ) ( int ) IPC_GET_ARG3( call ) |
172 | #define SOCKET_GET_HEADER_SIZE( call ) ( int ) IPC_GET_ARG3( call ) |
| - | 173 | ||
| - | 174 | /** Returns the flags message parameter. |
|
| - | 175 | * @param[in] call The message call structure. |
|
| - | 176 | */ |
|
| - | 177 | #define SOCKET_GET_FLAGS( call ) ( int ) IPC_GET_ARG4( call ) |
|
| 85 | 178 | ||
| - | 179 | /** Returns the option name message parameter. |
|
| 86 | #define SOCKET_GET_FLAGS( call ) ( int ) IPC_GET_ARG4( call ) |
180 | * @param[in] call The message call structure. |
| - | 181 | */ |
|
| 87 | #define SOCKET_GET_OPT_NAME( call ) ( int ) IPC_GET_ARG4( call ) |
182 | #define SOCKET_GET_OPT_NAME( call ) ( int ) IPC_GET_ARG4( call ) |
| 88 | 183 | ||
| - | 184 | /** Returns the data fragments message parameter. |
|
| - | 185 | * @param[in] call The message call structure. |
|
| - | 186 | */ |
|
| 89 | #define SOCKET_GET_DATA_FRAGMENTS( call ) ( int ) IPC_GET_ARG5( call ) |
187 | #define SOCKET_GET_DATA_FRAGMENTS( call ) ( int ) IPC_GET_ARG5( call ) |
| - | 188 | ||
| - | 189 | /** Returns the new socket identifier message parameter. |
|
| - | 190 | * @param[in] call The message call structure. |
|
| - | 191 | */ |
|
| 90 | #define SOCKET_GET_NEW_SOCKET_ID( call ) ( int ) IPC_GET_ARG5( call ) |
192 | #define SOCKET_GET_NEW_SOCKET_ID( call ) ( int ) IPC_GET_ARG5( call ) |
| 91 | 193 | ||
| 92 | /*@}*/ |
194 | /*@}*/ |
| 93 | 195 | ||
| 94 | #endif |
196 | #endif |
| 95 | 197 | ||