Changes in uspace/srv/locsrv/locsrv.c [3a9cf35:864762a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/locsrv/locsrv.c
r3a9cf35 r864762a 412 412 { 413 413 if (server == NULL) 414 return EEXIST ;414 return EEXISTS; 415 415 416 416 fibril_mutex_lock(&servers_list_mutex); … … 445 445 free(server); 446 446 447 loc_category_change_event();448 447 return EOK; 449 448 } … … 468 467 } 469 468 469 /* Set the interface, if any. */ 470 service->forward_interface = IPC_GET_ARG1(*icall); 471 470 472 /* Get fqsn */ 471 473 char *fqsn; … … 512 514 free(service->name); 513 515 free(service); 514 async_answer_0(iid, EEXIST );516 async_answer_0(iid, EEXISTS); 515 517 return; 516 518 } … … 558 560 fibril_mutex_unlock(&services_list_mutex); 559 561 async_answer_0(iid, EOK); 560 561 loc_category_change_event();562 562 } 563 563 … … 702 702 * 703 703 */ 704 static void loc_forward(ipc_callid_t callid, ipc_call_t *call , void *arg)704 static void loc_forward(ipc_callid_t callid, ipc_call_t *call) 705 705 { 706 706 fibril_mutex_lock(&services_list_mutex); … … 709 709 * Get ID from request 710 710 */ 711 iface_t iface = IPC_GET_ARG1(*call);712 711 service_id_t id = IPC_GET_ARG2(*call); 713 712 loc_service_t *svc = loc_service_find_id(id); … … 720 719 721 720 async_exch_t *exch = async_exchange_begin(svc->server->sess); 722 async_forward_fast(callid, exch, iface, svc->id, 0, IPC_FF_NONE); 721 722 if (svc->forward_interface == 0) 723 async_forward_fast(callid, exch, svc->id, 0, 0, IPC_FF_NONE); 724 else 725 async_forward_fast(callid, exch, svc->forward_interface, 726 svc->id, 0, IPC_FF_NONE); 727 723 728 async_exchange_end(exch); 724 729 … … 954 959 loc_namespace_find_id(IPC_GET_ARG1(*icall)); 955 960 if (namespace == NULL) 956 async_answer_0(iid, EEXIST );961 async_answer_0(iid, EEXISTS); 957 962 else 958 963 async_answer_1(iid, EOK, namespace->refcnt); … … 1317 1322 categ_dir_init(&cdir); 1318 1323 1319 cat = category_new("disk"); 1320 categ_dir_add_cat(&cdir, cat); 1321 1322 cat = category_new("partition"); 1324 cat = category_new("bd"); 1323 1325 categ_dir_add_cat(&cdir, cat); 1324 1326 … … 1374 1376 * 1375 1377 */ 1376 static void loc_connection_supplier(ipc_callid_t iid, ipc_call_t *icall , void *arg)1378 static void loc_connection_supplier(ipc_callid_t iid, ipc_call_t *icall) 1377 1379 { 1378 1380 /* Accept connection */ … … 1432 1434 * 1433 1435 */ 1434 static void loc_connection_consumer(ipc_callid_t iid, ipc_call_t *icall , void *arg)1436 static void loc_connection_consumer(ipc_callid_t iid, ipc_call_t *icall) 1435 1437 { 1436 1438 /* Accept connection */ … … 1499 1501 } 1500 1502 1503 /** Function for handling connections to location service 1504 * 1505 */ 1506 static void loc_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg) 1507 { 1508 /* Select interface */ 1509 switch ((sysarg_t) (IPC_GET_ARG1(*icall))) { 1510 case LOC_PORT_SUPPLIER: 1511 loc_connection_supplier(iid, icall); 1512 break; 1513 case LOC_PORT_CONSUMER: 1514 loc_connection_consumer(iid, icall); 1515 break; 1516 case LOC_CONNECT_TO_SERVICE: 1517 /* Connect client to selected service */ 1518 loc_forward(iid, icall); 1519 break; 1520 default: 1521 /* No such interface */ 1522 async_answer_0(iid, ENOENT); 1523 } 1524 } 1525 1501 1526 /** 1502 1527 * … … 1511 1536 } 1512 1537 1513 port_id_t port; 1514 int rc = async_create_port(INTERFACE_LOC_SUPPLIER, 1515 loc_connection_supplier, NULL, &port); 1538 /* Set a handler of incomming connections */ 1539 async_set_client_connection(loc_connection); 1540 1541 /* Register location service at naming service */ 1542 int rc = service_register(SERVICE_LOC); 1516 1543 if (rc != EOK) 1517 1544 return rc; 1518 1545 1519 rc = async_create_port(INTERFACE_LOC_CONSUMER,1520 loc_connection_consumer, NULL, &port);1521 if (rc != EOK)1522 return rc;1523 1524 /* Set a handler of incomming connections */1525 async_set_fallback_port_handler(loc_forward, NULL);1526 1527 /* Register location service at naming service */1528 rc = service_register(SERVICE_LOC);1529 if (rc != EOK)1530 return rc;1531 1532 1546 printf("%s: Accepting connections\n", NAME); 1533 1547 async_manager();
Note:
See TracChangeset
for help on using the changeset viewer.