Changes in uspace/srv/net/inetsrv/inetsrv.c [b7fd2a0:ac415d50] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/inetsrv/inetsrv.c
rb7fd2a0 rac415d50 38 38 #include <async.h> 39 39 #include <errno.h> 40 #include <str_error.h>41 40 #include <fibril_synch.h> 42 41 #include <io/log.h> … … 84 83 static void inet_default_conn(ipc_callid_t, ipc_call_t *, void *); 85 84 86 static errno_t inet_init(void)85 static int inet_init(void) 87 86 { 88 87 log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_init()"); 89 88 90 89 port_id_t port; 91 errno_t rc = async_create_port(INTERFACE_INET,90 int rc = async_create_port(INTERFACE_INET, 92 91 inet_default_conn, NULL, &port); 93 92 if (rc != EOK) … … 106 105 rc = loc_server_register(NAME); 107 106 if (rc != EOK) { 108 log_msg(LOG_DEFAULT, LVL_ERROR, "Failed registering server : %s.", str_error(rc));107 log_msg(LOG_DEFAULT, LVL_ERROR, "Failed registering server (%d).", rc); 109 108 return EEXIST; 110 109 } … … 113 112 rc = loc_service_register(SERVICE_NAME_INET, &sid); 114 113 if (rc != EOK) { 115 log_msg(LOG_DEFAULT, LVL_ERROR, "Failed registering service : %s.", str_error(rc));114 log_msg(LOG_DEFAULT, LVL_ERROR, "Failed registering service (%d).", rc); 116 115 return EEXIST; 117 116 } … … 135 134 } 136 135 137 static errno_t inet_find_dir(inet_addr_t *src, inet_addr_t *dest, uint8_t tos,136 static int inet_find_dir(inet_addr_t *src, inet_addr_t *dest, uint8_t tos, 138 137 inet_dir_t *dir) 139 138 { … … 165 164 } 166 165 167 errno_t inet_route_packet(inet_dgram_t *dgram, uint8_t proto, uint8_t ttl,166 int inet_route_packet(inet_dgram_t *dgram, uint8_t proto, uint8_t ttl, 168 167 int df) 169 168 { 170 169 inet_dir_t dir; 171 170 inet_link_t *ilink; 172 errno_t rc;171 int rc; 173 172 174 173 if (dgram->iplink != 0) { … … 201 200 } 202 201 203 static errno_t inet_send(inet_client_t *client, inet_dgram_t *dgram,202 static int inet_send(inet_client_t *client, inet_dgram_t *dgram, 204 203 uint8_t proto, uint8_t ttl, int df) 205 204 { … … 207 206 } 208 207 209 errno_t inet_get_srcaddr(inet_addr_t *remote, uint8_t tos, inet_addr_t *local)208 int inet_get_srcaddr(inet_addr_t *remote, uint8_t tos, inet_addr_t *local) 210 209 { 211 210 inet_dir_t dir; 212 errno_t rc;211 int rc; 213 212 214 213 rc = inet_find_dir(NULL, remote, tos, &dir); … … 252 251 253 252 inet_addr_t remote; 254 errno_t rc = async_data_write_finalize(callid, &remote, size);253 int rc = async_data_write_finalize(callid, &remote, size); 255 254 if (rc != EOK) { 256 255 async_answer_0(callid, rc); … … 314 313 } 315 314 316 errno_t rc = async_data_write_finalize(callid, &dgram.src, size);315 int rc = async_data_write_finalize(callid, &dgram.src, size); 317 316 if (rc != EOK) { 318 317 async_answer_0(callid, rc); … … 445 444 } 446 445 447 errno_t inet_ev_recv(inet_client_t *client, inet_dgram_t *dgram)446 int inet_ev_recv(inet_client_t *client, inet_dgram_t *dgram) 448 447 { 449 448 async_exch_t *exch = async_exchange_begin(client->sess); … … 457 456 dgram->iplink, &answer); 458 457 459 errno_t rc = async_data_write_start(exch, &dgram->src, sizeof(inet_addr_t));458 int rc = async_data_write_start(exch, &dgram->src, sizeof(inet_addr_t)); 460 459 if (rc != EOK) { 461 460 async_exchange_end(exch); … … 480 479 } 481 480 482 errno_t retval;481 sysarg_t retval; 483 482 async_wait_for(req, &retval); 484 483 485 return retval;486 } 487 488 errno_t inet_recv_dgram_local(inet_dgram_t *dgram, uint8_t proto)484 return (int) retval; 485 } 486 487 int inet_recv_dgram_local(inet_dgram_t *dgram, uint8_t proto) 489 488 { 490 489 inet_client_t *client; … … 509 508 } 510 509 511 errno_t inet_recv_packet(inet_packet_t *packet)510 int inet_recv_packet(inet_packet_t *packet) 512 511 { 513 512 inet_addrobj_t *addr; … … 543 542 int main(int argc, char *argv[]) 544 543 { 545 errno_t rc;544 int rc; 546 545 547 546 printf(NAME ": HelenOS Internet Protocol service\n");
Note:
See TracChangeset
for help on using the changeset viewer.