Rev 2880 | Rev 2894 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2880 | Rev 2882 | ||
---|---|---|---|
Line 61... | Line 61... | ||
61 | .hash = pending_call_hash, |
61 | .hash = pending_call_hash, |
62 | .compare = pending_call_compare, |
62 | .compare = pending_call_compare, |
63 | .remove_callback = pending_call_remove_callback |
63 | .remove_callback = pending_call_remove_callback |
64 | }; |
64 | }; |
65 | 65 | ||
66 | static void connection_set(int phone, int server, proto_t *proto) |
66 | void ipcp_connection_set(int phone, int server, proto_t *proto) |
67 | { |
67 | { |
68 | if (phone <0 || phone >= MAX_PHONE) return; |
68 | if (phone <0 || phone >= MAX_PHONE) return; |
69 | connections[phone].server = server; |
69 | connections[phone].server = server; |
70 | connections[phone].proto = proto; |
70 | connections[phone].proto = proto; |
71 | have_conn[phone] = 1; |
71 | have_conn[phone] = 1; |
72 | } |
72 | } |
73 | 73 | ||
74 | static void connection_clear(int phone) |
74 | void ipcp_connection_clear(int phone) |
75 | { |
75 | { |
76 | have_conn[phone] = 0; |
76 | have_conn[phone] = 0; |
77 | connections[phone].server = 0; |
77 | connections[phone].server = 0; |
78 | connections[phone].proto = NULL; |
78 | connections[phone].proto = NULL; |
79 | } |
79 | } |
Line 170... | Line 170... | ||
170 | if (proto == NULL) proto = &proto_unknown; |
170 | if (proto == NULL) proto = &proto_unknown; |
171 | 171 | ||
172 | cphone = IPC_GET_ARG5(*answer); |
172 | cphone = IPC_GET_ARG5(*answer); |
173 | printf("registering connection (phone %d, protocol: %s)\n", cphone, |
173 | printf("registering connection (phone %d, protocol: %s)\n", cphone, |
174 | proto->name); |
174 | proto->name); |
175 | connection_set(cphone, 0, proto); |
175 | ipcp_connection_set(cphone, 0, proto); |
176 | } |
176 | } |
177 | } |
177 | } |
178 | 178 | ||
179 | void ipcp_call_in(ipc_call_t *call, ipc_callid_t hash) |
179 | void ipcp_call_in(ipc_call_t *call, ipc_callid_t hash) |
180 | { |
180 | { |
Line 219... | Line 219... | ||
219 | } |
219 | } |
220 | 220 | ||
221 | void ipcp_hangup(int phone, int rc) |
221 | void ipcp_hangup(int phone, int rc) |
222 | { |
222 | { |
223 | printf("hangup phone %d -> %d\n", phone, rc); |
223 | printf("hangup phone %d -> %d\n", phone, rc); |
224 | connection_clear(phone); |
224 | ipcp_connection_clear(phone); |
225 | } |
225 | } |
226 | 226 | ||
227 | /** @} |
227 | /** @} |
228 | */ |
228 | */ |