Changeset 5d2e976 in mainline
- Timestamp:
- 2010-03-15T19:43:12Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6e81d04
- Parents:
- 4684368 (diff), 6092b56e (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. - Location:
- uspace/srv/net
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/socket/socket_messages.h
r4684368 r5d2e976 115 115 * @param[out] answer The message answer structure. 116 116 */ 117 #define SOCKET_SET_SOCKET_ID(answer) (int *)&IPC_GET_ARG1(answer)117 #define SOCKET_SET_SOCKET_ID(answer) &IPC_GET_ARG1(answer) 118 118 119 119 /** Returns the socket identifier message parameter. 120 120 * @param[in] call The message call structure. 121 121 */ 122 #define SOCKET_GET_SOCKET_ID(call) 122 #define SOCKET_GET_SOCKET_ID(call) (int) IPC_GET_ARG1(call) 123 123 124 124 /** Sets the read data length in the message answer. 125 125 * @param[out] answer The message answer structure. 126 126 */ 127 #define SOCKET_SET_READ_DATA_LENGTH(answer) (int *)&IPC_GET_ARG1(answer)127 #define SOCKET_SET_READ_DATA_LENGTH(answer) &IPC_GET_ARG1(answer) 128 128 129 129 /** Returns the read data length message parameter. 130 130 * @param[in] call The message call structure. 131 131 */ 132 #define SOCKET_GET_READ_DATA_LENGTH(call) 132 #define SOCKET_GET_READ_DATA_LENGTH(call) (int) IPC_GET_ARG1(call) 133 133 134 134 /** Returns the backlog message parameter. 135 135 * @param[in] call The message call structure. 136 136 */ 137 #define SOCKET_GET_BACKLOG(call) 137 #define SOCKET_GET_BACKLOG(call) (int) IPC_GET_ARG2(call) 138 138 139 139 /** Returns the option level message parameter. 140 140 * @param[in] call The message call structure. 141 141 */ 142 #define SOCKET_GET_OPT_LEVEL(call) 142 #define SOCKET_GET_OPT_LEVEL(call) (int) IPC_GET_ARG2(call) 143 143 144 144 /** Returns the data fragment size message parameter. … … 150 150 * @param[out] answer The message answer structure. 151 151 */ 152 #define SOCKET_SET_DATA_FRAGMENT_SIZE(answer) (size_t *)&IPC_GET_ARG2(answer)152 #define SOCKET_SET_DATA_FRAGMENT_SIZE(answer) &IPC_GET_ARG2(answer) 153 153 154 154 /** Sets the address length in the message answer. 155 155 * @param[out] answer The message answer structure. 156 156 */ 157 #define SOCKET_SET_ADDRESS_LENGTH(answer) (socklen_t *)&IPC_GET_ARG3(answer)157 #define SOCKET_SET_ADDRESS_LENGTH(answer) &IPC_GET_ARG3(answer) 158 158 159 159 /** Returns the address length message parameter. … … 165 165 * @param[out] answer The message answer structure. 166 166 */ 167 #define SOCKET_SET_HEADER_SIZE(answer) (int *)&IPC_GET_ARG3(answer)167 #define SOCKET_SET_HEADER_SIZE(answer) &IPC_GET_ARG3(answer) 168 168 169 169 /** Returns the header size message parameter. 170 170 * @param[in] call The message call structure. 171 171 */ 172 #define SOCKET_GET_HEADER_SIZE(call) (int) IPC_GET_ARG3(call)172 #define SOCKET_GET_HEADER_SIZE(call) (size_t) IPC_GET_ARG3(call) 173 173 174 174 /** Returns the flags message parameter. 175 175 * @param[in] call The message call structure. 176 176 */ 177 #define SOCKET_GET_FLAGS(call) 177 #define SOCKET_GET_FLAGS(call) (int) IPC_GET_ARG4(call) 178 178 179 179 /** Returns the option name message parameter. 180 180 * @param[in] call The message call structure. 181 181 */ 182 #define SOCKET_GET_OPT_NAME(call) 182 #define SOCKET_GET_OPT_NAME(call) (int) IPC_GET_ARG4(call) 183 183 184 184 /** Returns the data fragments message parameter. -
uspace/srv/net/tl/tcp/tcp.c
r4684368 r5d2e976 1060 1060 int app_phone = IPC_GET_PHONE(&call); 1061 1061 struct sockaddr * addr; 1062 int socket_id; 1062 1063 size_t addrlen; 1063 1064 fibril_rwlock_t lock; … … 1104 1105 socket_data->local_sockets = &local_sockets; 1105 1106 fibril_rwlock_write_lock(&lock); 1106 *SOCKET_SET_SOCKET_ID(answer) = SOCKET_GET_SOCKET_ID(call); 1107 res = socket_create(&local_sockets, app_phone, socket_data, SOCKET_SET_SOCKET_ID(answer)); 1107 socket_id = SOCKET_GET_SOCKET_ID(call); 1108 res = socket_create(&local_sockets, app_phone, socket_data, &socket_id); 1109 *SOCKET_SET_SOCKET_ID(answer) = socket_id; 1108 1110 fibril_rwlock_write_unlock(&lock); 1109 1111 if(res == EOK){ -
uspace/srv/net/tl/udp/udp.c
r4684368 r5d2e976 417 417 int app_phone = IPC_GET_PHONE(&call); 418 418 struct sockaddr * addr; 419 int socket_id; 419 420 size_t addrlen; 420 421 ipc_call_t answer; … … 451 452 break; 452 453 case NET_SOCKET: 453 *SOCKET_SET_SOCKET_ID(answer) = SOCKET_GET_SOCKET_ID(call); 454 res = socket_create(&local_sockets, app_phone, NULL, SOCKET_SET_SOCKET_ID(answer)); 454 socket_id = SOCKET_GET_SOCKET_ID(call); 455 res = socket_create(&local_sockets, app_phone, NULL, &socket_id); 456 *SOCKET_SET_SOCKET_ID(answer) = socket_id; 457 455 458 if(res == EOK){ 456 459 if(tl_get_ip_packet_dimension(udp_globals.ip_phone, &udp_globals.dimensions, DEVICE_INVALID_ID, &packet_dimension) == EOK){
Note:
See TracChangeset
for help on using the changeset viewer.