Changeset f9b2cb4c in mainline for uspace/srv/net/inetsrv/inetsrv.c
- Timestamp:
- 2015-08-23T12:50:23Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9ef495f
- Parents:
- 0dd16778
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/inetsrv/inetsrv.c
r0dd16778 rf9b2cb4c 77 77 }; 78 78 79 static void inet_client_conn(ipc_callid_t iid, ipc_call_t *icall, void *arg);80 81 79 static FIBRIL_MUTEX_INITIALIZE(client_list_lock); 82 80 static LIST_INITIALIZE(client_list); 83 81 82 static void inet_default_conn(ipc_callid_t, ipc_call_t *, void *); 83 84 84 static int inet_init(void) 85 85 { 86 86 log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_init()"); 87 87 88 async_set_fallback_port_handler(inet_client_conn, NULL); 89 90 int rc = loc_server_register(NAME); 88 port_id_t port; 89 int rc = async_create_port(INTERFACE_INET, 90 inet_default_conn, NULL, &port); 91 if (rc != EOK) 92 return rc; 93 94 rc = async_create_port(INTERFACE_INETCFG, 95 inet_cfg_conn, NULL, &port); 96 if (rc != EOK) 97 return rc; 98 99 rc = async_create_port(INTERFACE_INETPING, 100 inetping_conn, NULL, &port); 101 if (rc != EOK) 102 return rc; 103 104 rc = loc_server_register(NAME); 91 105 if (rc != EOK) { 92 106 log_msg(LOG_DEFAULT, LVL_ERROR, "Failed registering server (%d).", rc); … … 95 109 96 110 service_id_t sid; 97 rc = loc_service_register_with_iface(SERVICE_NAME_INET, &sid, 98 INET_PORT_DEFAULT); 99 if (rc != EOK) { 100 log_msg(LOG_DEFAULT, LVL_ERROR, "Failed registering service (%d).", rc); 101 return EEXIST; 102 } 103 104 rc = loc_service_register_with_iface(SERVICE_NAME_INETCFG, &sid, 105 INET_PORT_CFG); 106 if (rc != EOK) { 107 log_msg(LOG_DEFAULT, LVL_ERROR, "Failed registering service (%d).", rc); 108 return EEXIST; 109 } 110 111 rc = loc_service_register_with_iface(SERVICE_NAME_INETPING, &sid, 112 INET_PORT_PING); 111 rc = loc_service_register(SERVICE_NAME_INET, &sid); 113 112 if (rc != EOK) { 114 113 log_msg(LOG_DEFAULT, LVL_ERROR, "Failed registering service (%d).", rc); … … 429 428 } 430 429 431 static void inet_client_conn(ipc_callid_t iid, ipc_call_t *icall, void *arg)432 {433 sysarg_t port;434 435 port = IPC_GET_ARG1(*icall);436 437 switch (port) {438 case INET_PORT_DEFAULT:439 inet_default_conn(iid, icall, arg);440 break;441 case INET_PORT_CFG:442 inet_cfg_conn(iid, icall, arg);443 break;444 case INET_PORT_PING:445 inetping_conn(iid, icall, arg);446 break;447 default:448 async_answer_0(iid, ENOTSUP);449 break;450 }451 }452 453 430 static inet_client_t *inet_client_find(uint8_t proto) 454 431 {
Note:
See TracChangeset
for help on using the changeset viewer.