Changes in uspace/srv/net/inetsrv/inetsrv.c [1b20da0:a35b458] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/inetsrv/inetsrv.c
r1b20da0 ra35b458 87 87 { 88 88 log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_init()"); 89 89 90 90 port_id_t port; 91 91 errno_t rc = async_create_port(INTERFACE_INET, … … 93 93 if (rc != EOK) 94 94 return rc; 95 95 96 96 rc = async_create_port(INTERFACE_INETCFG, 97 97 inet_cfg_conn, NULL, &port); 98 98 if (rc != EOK) 99 99 return rc; 100 100 101 101 rc = async_create_port(INTERFACE_INETPING, 102 102 inetping_conn, NULL, &port); 103 103 if (rc != EOK) 104 104 return rc; 105 105 106 106 rc = loc_server_register(NAME); 107 107 if (rc != EOK) { … … 109 109 return EEXIST; 110 110 } 111 111 112 112 service_id_t sid; 113 113 rc = loc_service_register(SERVICE_NAME_INET, &sid); … … 116 116 return EEXIST; 117 117 } 118 118 119 119 return EOK; 120 120 } … … 234 234 { 235 235 log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_get_srcaddr_srv()"); 236 236 237 237 uint8_t tos = IPC_GET_ARG1(*icall); 238 238 239 239 ipc_callid_t callid; 240 240 size_t size; … … 244 244 return; 245 245 } 246 246 247 247 if (size != sizeof(inet_addr_t)) { 248 248 async_answer_0(callid, EINVAL); … … 250 250 return; 251 251 } 252 252 253 253 inet_addr_t remote; 254 254 errno_t rc = async_data_write_finalize(callid, &remote, size); … … 257 257 async_answer_0(iid, rc); 258 258 } 259 259 260 260 inet_addr_t local; 261 261 rc = inet_get_srcaddr(&remote, tos, &local); … … 264 264 return; 265 265 } 266 266 267 267 if (!async_data_read_receive(&callid, &size)) { 268 268 async_answer_0(callid, EREFUSED); … … 270 270 return; 271 271 } 272 272 273 273 if (size != sizeof(inet_addr_t)) { 274 274 async_answer_0(callid, EINVAL); … … 276 276 return; 277 277 } 278 278 279 279 rc = async_data_read_finalize(callid, &local, size); 280 280 if (rc != EOK) { … … 283 283 return; 284 284 } 285 285 286 286 async_answer_0(iid, rc); 287 287 } … … 291 291 { 292 292 log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_send_srv()"); 293 293 294 294 inet_dgram_t dgram; 295 295 296 296 dgram.iplink = IPC_GET_ARG1(*icall); 297 297 dgram.tos = IPC_GET_ARG2(*icall); 298 298 299 299 uint8_t ttl = IPC_GET_ARG3(*icall); 300 300 int df = IPC_GET_ARG4(*icall); 301 301 302 302 ipc_callid_t callid; 303 303 size_t size; … … 307 307 return; 308 308 } 309 309 310 310 if (size != sizeof(inet_addr_t)) { 311 311 async_answer_0(callid, EINVAL); … … 313 313 return; 314 314 } 315 315 316 316 errno_t rc = async_data_write_finalize(callid, &dgram.src, size); 317 317 if (rc != EOK) { … … 319 319 async_answer_0(iid, rc); 320 320 } 321 321 322 322 if (!async_data_write_receive(&callid, &size)) { 323 323 async_answer_0(callid, EREFUSED); … … 325 325 return; 326 326 } 327 327 328 328 if (size != sizeof(inet_addr_t)) { 329 329 async_answer_0(callid, EINVAL); … … 331 331 return; 332 332 } 333 333 334 334 rc = async_data_write_finalize(callid, &dgram.dest, size); 335 335 if (rc != EOK) { … … 337 337 async_answer_0(iid, rc); 338 338 } 339 339 340 340 rc = async_data_write_accept(&dgram.data, false, 0, 0, 0, 341 341 &dgram.size); … … 344 344 return; 345 345 } 346 346 347 347 rc = inet_send(client, &dgram, client->protocol, ttl, df); 348 348 349 349 free(dgram.data); 350 350 async_answer_0(iid, rc);
Note:
See TracChangeset
for help on using the changeset viewer.