9,6 → 9,7 |
#include <libadt/hash_table.h> |
|
#include "ipc_desc.h" |
#include "proto.h" |
#include "ipcp.h" |
|
#define IPCP_CALLID_SYNC 0 |
139,8 → 140,10 |
{ |
int phone; |
ipcarg_t method; |
ipcarg_t service; |
int retval; |
static proto_t proto = { .name = "unknown" }; |
static proto_t proto_unknown = { .name = "unknown" }; |
proto_t *proto; |
int cphone; |
|
// printf("parse_answer\n"); |
153,11 → 156,14 |
|
if (phone == 0 && method == IPC_M_CONNECT_ME_TO && retval == 0) { |
/* Connected to a service (through NS) */ |
service = IPC_GET_ARG1(pcall->question); |
proto = proto_get_by_srv(service); |
if (proto == NULL) proto = &proto_unknown; |
|
cphone = IPC_GET_ARG5(*answer); |
printf("registering connection (phone %d)\n", cphone); |
connection_set(cphone, 0, &proto); |
} else { |
printf("unrecognized connection\n"); |
printf("registering connection (phone %d, protocol: %s)\n", cphone, |
proto->name); |
connection_set(cphone, 0, proto); |
} |
} |
|