Changes in uspace/srv/locsrv/locsrv.c [8a637a4:372df8f] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/locsrv/locsrv.c
r8a637a4 r372df8f 412 412 { 413 413 if (server == NULL) 414 return EEXIST ;414 return EEXISTS; 415 415 416 416 fibril_mutex_lock(&servers_list_mutex); … … 467 467 } 468 468 469 /* Set the interface, if any. */ 470 service->forward_interface = IPC_GET_ARG1(*icall); 471 469 472 /* Get fqsn */ 470 473 char *fqsn; … … 511 514 free(service->name); 512 515 free(service); 513 async_answer_0(iid, EEXIST );516 async_answer_0(iid, EEXISTS); 514 517 return; 515 518 } … … 699 702 * 700 703 */ 701 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) 702 705 { 703 706 fibril_mutex_lock(&services_list_mutex); … … 706 709 * Get ID from request 707 710 */ 708 iface_t iface = IPC_GET_ARG1(*call);709 711 service_id_t id = IPC_GET_ARG2(*call); 710 712 loc_service_t *svc = loc_service_find_id(id); … … 717 719 718 720 async_exch_t *exch = async_exchange_begin(svc->server->sess); 719 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 720 728 async_exchange_end(exch); 721 729 … … 951 959 loc_namespace_find_id(IPC_GET_ARG1(*icall)); 952 960 if (namespace == NULL) 953 async_answer_0(iid, EEXIST );961 async_answer_0(iid, EEXISTS); 954 962 else 955 963 async_answer_1(iid, EOK, namespace->refcnt); … … 1317 1325 categ_dir_add_cat(&cdir, cat); 1318 1326 1327 cat = category_new("disk"); 1328 categ_dir_add_cat(&cdir, cat); 1329 1330 cat = category_new("partition"); 1331 categ_dir_add_cat(&cdir, cat); 1332 1319 1333 cat = category_new("iplink"); 1320 1334 categ_dir_add_cat(&cdir, cat); … … 1368 1382 * 1369 1383 */ 1370 static void loc_connection_supplier(ipc_callid_t iid, ipc_call_t *icall , void *arg)1384 static void loc_connection_supplier(ipc_callid_t iid, ipc_call_t *icall) 1371 1385 { 1372 1386 /* Accept connection */ … … 1426 1440 * 1427 1441 */ 1428 static void loc_connection_consumer(ipc_callid_t iid, ipc_call_t *icall , void *arg)1442 static void loc_connection_consumer(ipc_callid_t iid, ipc_call_t *icall) 1429 1443 { 1430 1444 /* Accept connection */ … … 1493 1507 } 1494 1508 1509 /** Function for handling connections to location service 1510 * 1511 */ 1512 static void loc_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg) 1513 { 1514 /* Select interface */ 1515 switch ((sysarg_t) (IPC_GET_ARG1(*icall))) { 1516 case LOC_PORT_SUPPLIER: 1517 loc_connection_supplier(iid, icall); 1518 break; 1519 case LOC_PORT_CONSUMER: 1520 loc_connection_consumer(iid, icall); 1521 break; 1522 case LOC_CONNECT_TO_SERVICE: 1523 /* Connect client to selected service */ 1524 loc_forward(iid, icall); 1525 break; 1526 default: 1527 /* No such interface */ 1528 async_answer_0(iid, ENOENT); 1529 } 1530 } 1531 1495 1532 /** 1496 1533 * … … 1505 1542 } 1506 1543 1507 port_id_t port; 1508 int rc = async_create_port(INTERFACE_LOC_SUPPLIER, 1509 loc_connection_supplier, NULL, &port); 1544 /* Set a handler of incomming connections */ 1545 async_set_client_connection(loc_connection); 1546 1547 /* Register location service at naming service */ 1548 int rc = service_register(SERVICE_LOC); 1510 1549 if (rc != EOK) 1511 1550 return rc; 1512 1551 1513 rc = async_create_port(INTERFACE_LOC_CONSUMER,1514 loc_connection_consumer, NULL, &port);1515 if (rc != EOK)1516 return rc;1517 1518 /* Set a handler of incomming connections */1519 async_set_fallback_port_handler(loc_forward, NULL);1520 1521 /* Register location service at naming service */1522 rc = service_register(SERVICE_LOC);1523 if (rc != EOK)1524 return rc;1525 1526 1552 printf("%s: Accepting connections\n", NAME); 1527 1553 async_manager();
Note:
See TracChangeset
for help on using the changeset viewer.