Rev 2479 | Rev 2637 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2479 | Rev 2619 | ||
---|---|---|---|
Line 27... | Line 27... | ||
27 | */ |
27 | */ |
28 | 28 | ||
29 | #include <stdio.h> |
29 | #include <stdio.h> |
30 | #include <unistd.h> |
30 | #include <unistd.h> |
31 | #include <async.h> |
31 | #include <async.h> |
- | 32 | #include <errno.h> |
|
32 | #include "../tester.h" |
33 | #include "../tester.h" |
33 | 34 | ||
34 | static void client_connection(ipc_callid_t iid, ipc_call_t *icall) |
35 | static void client_connection(ipc_callid_t iid, ipc_call_t *icall) |
35 | { |
36 | { |
36 | ipc_callid_t callid; |
37 | ipc_callid_t callid; |
Line 38... | Line 39... | ||
38 | ipcarg_t phonehash = icall->in_phone_hash; |
39 | ipcarg_t phonehash = icall->in_phone_hash; |
39 | int retval; |
40 | int retval; |
40 | int i; |
41 | int i; |
41 | 42 | ||
42 | printf("Connected phone: %P, accepting\n", icall->in_phone_hash); |
43 | printf("Connected phone: %P, accepting\n", icall->in_phone_hash); |
43 | ipc_answer_fast(iid, 0, 0, 0); |
44 | ipc_answer_0(iid, EOK); |
44 | for (i = 0; i < 1024; i++) |
45 | for (i = 0; i < 1024; i++) |
45 | if (!connections[i]) { |
46 | if (!connections[i]) { |
46 | connections[i] = phonehash; |
47 | connections[i] = phonehash; |
47 | break; |
48 | break; |
48 | } |
49 | } |
Line 53... | Line 54... | ||
53 | case IPC_M_PHONE_HUNGUP: |
54 | case IPC_M_PHONE_HUNGUP: |
54 | printf("Phone (%P) hung up.\n", phonehash); |
55 | printf("Phone (%P) hung up.\n", phonehash); |
55 | retval = 0; |
56 | retval = 0; |
56 | break; |
57 | break; |
57 | default: |
58 | default: |
58 | printf("Received message from %P: %X\n", phonehash,callid); |
59 | printf("Received message from %P: %X\n", phonehash, |
- | 60 | callid); |
|
59 | for (i = 0; i < 1024; i++) |
61 | for (i = 0; i < 1024; i++) |
60 | if (!callids[i]) { |
62 | if (!callids[i]) { |
61 | callids[i] = callid; |
63 | callids[i] = callid; |
62 | break; |
64 | break; |
63 | } |
65 | } |
64 | continue; |
66 | continue; |
65 | } |
67 | } |
66 | ipc_answer_fast(callid, retval, 0, 0); |
68 | ipc_answer_0(callid, retval); |
67 | } |
69 | } |
68 | } |
70 | } |
69 | 71 | ||
70 | char * test_register(bool quiet) |
72 | char * test_register(bool quiet) |
71 | { |
73 | { |