Subversion Repositories HelenOS-historic

Rev

Rev 1061 | Rev 1089 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1061 Rev 1073
Line 15... Line 15...
15
    ipcarg_t retval, arg1, arg2;
15
    ipcarg_t retval, arg1, arg2;
16
 
16
 
17
    printf("Name service started.\n");
17
    printf("Name service started.\n");
18
    while (1) {
18
    while (1) {
19
        callid = ipc_wait_for_call(&call, 0);
19
        callid = ipc_wait_for_call(&call, 0);
20
        printf("Received call from: %P..%Q\n", &call.taskid,call.taskid);
20
        printf("Received call from: %P..%llX\n", &call.taskid,call.taskid);
21
        switch (IPC_GET_METHOD(call.data)) {
21
        switch (IPC_GET_METHOD(call.data)) {
22
        case IPC_M_CONNECTTOME:
22
        case IPC_M_CONNECTTOME:
23
            printf("Somebody wants to connect with phoneid %d...accepting\n", IPC_GET_ARG3(call.data));
23
            printf("Somebody wants to connect with phoneid %zd...accepting\n", IPC_GET_ARG3(call.data));
24
            service = IPC_GET_ARG3(call.data);
24
            service = IPC_GET_ARG3(call.data);
25
            retval = 0;
25
            retval = 0;
26
            break;
26
            break;
27
        case IPC_M_CONNECTMETO:
27
        case IPC_M_CONNECTMETO:
28
            printf("Somebody wants to connect to: %d\n",
28
            printf("Somebody wants to connect to: %zd\n",
29
                   IPC_GET_ARG1(call.data));
29
                   IPC_GET_ARG1(call.data));
30
            retval = 0;
30
            retval = 0;
31
            break;
31
            break;
32
        case NS_PING:
32
        case NS_PING:
33
            printf("Ping...%P %P\n", IPC_GET_ARG1(call.data),
33
            printf("Ping...%P %P\n", IPC_GET_ARG1(call.data),
Line 40... Line 40...
40
            printf("Pinging service %d\n", service);
40
            printf("Pinging service %d\n", service);
41
            ipc_call_sync(service, NS_PING, 0xbeef, 0);
41
            ipc_call_sync(service, NS_PING, 0xbeef, 0);
42
            printf("Got pong\n");
42
            printf("Got pong\n");
43
            break;
43
            break;
44
        default:
44
        default:
45
            printf("Unknown method: %d\n", IPC_GET_METHOD(call.data));
45
            printf("Unknown method: %zd\n", IPC_GET_METHOD(call.data));
46
            retval = ENOENT;
46
            retval = ENOENT;
47
            break;
47
            break;
48
        }
48
        }
49
        ipc_answer(callid, retval, arg1, arg2);
49
        ipc_answer(callid, retval, arg1, arg2);
50
    }
50
    }