• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/pptp/

Lines Matching refs:call

77     VECTOR *call;
247 * sent in a signal handler. This may dead lock as the syslog call
265 if ((conn->call = vector_create()) == NULL) { free(conn); return NULL; }
283 vector_destroy(conn->call); free(conn); return NULL;
323 /* This currently *only* works for client call requests.
329 PPTP_CALL * call;
332 /* Send off the call request */
340 assert(conn && conn->call);
342 /* Assign call id */
343 if (!vector_scan(conn->call, 0, PPTP_MAX_CHANNELS - 1, &i))
347 if ((call = malloc(sizeof(*call))) == NULL) return NULL;
348 /* Initialize call structure */
349 call->call_type = PPTP_CALL_PNS;
350 call->state.pns = PNS_IDLE;
351 call->call_id = (u_int16_t) i;
352 call->sernum = conn->call_serial_number++;
353 call->callback = callback;
354 call->closure = NULL;
355 packet.call_id = htons(call->call_id);
356 packet.call_sernum = htons(call->sernum);
373 call->state.pns = PNS_WAIT_REPLY;
374 /* and add it to the call vector */
375 vector_insert(conn->call, i, call);
376 return call;
378 free(call);
384 void pptp_call_close(PPTP_CONN * conn, PPTP_CALL * call)
389 assert(conn && conn->call); assert(call);
390 assert(vector_contains(conn->call, call->call_id));
392 assert(call->call_type == PPTP_CALL_PNS);
393 assert(call->state.pns != PNS_IDLE);
394 rqst.call_id = hton16(call->call_id);
400 call->state.pns = PNS_WAIT_DISCONNECT;
401 /* call structure will be freed when we have confirmation of disconnect. */
405 void pptp_call_destroy(PPTP_CONN *conn, PPTP_CALL *call)
407 assert(conn && conn->call); assert(call);
408 assert(vector_contains(conn->call, call->call_id));
410 if (call->callback != NULL) call->callback(conn, call, CALL_CLOSE_DONE);
412 vector_remove(conn->call, call->call_id);
413 free(call);
424 assert(conn && conn->call);
429 for (i = 0; i < vector_size(conn->call); i++)
430 pptp_call_close(conn, vector_get_Nth(conn->call, i));
443 assert(conn != NULL); assert(conn->call != NULL);
445 for (i = 0; i < vector_size(conn->call); i++)
446 pptp_call_destroy(conn, vector_get_Nth(conn->call, i));
452 vector_destroy(conn->call);
462 assert(conn && conn->call);
479 assert(conn && conn->call);
511 assert(conn && conn->call);
532 assert(conn && conn->call);
566 assert(conn && conn->call); assert(buf != NULL); assert(size != NULL);
613 assert(conn && conn->call); assert(buffer);
653 assert(conn && conn->call); assert(buffer);
689 assert(conn && conn->call); assert(buffer);
848 /* XXX PAC: eventually this should make an outgoing call. XXX */
857 PPTP_CALL * call;
860 if (!vector_search(conn->call, (int) callid, &call)) {
861 log("PPTP_OUT_CALL_RPLY received for non-existant call: "
862 "peer call ID (us) %d call ID (them) %d.",
866 if (call->call_type != PPTP_CALL_PNS) {
870 if (call->state.pns != PNS_WAIT_REPLY) {
877 log("Our outgoing call request [callid %d] has not been "
882 call->state.pns = PNS_IDLE;
883 if (call->callback != NULL)
884 call->callback(conn, call, CALL_OPEN_FAIL);
885 pptp_call_destroy(conn, call);
888 call->state.pns = PNS_ESTABLISHED;
889 call->peer_call_id = ntoh16(packet->call_id);
890 call->speed = ntoh32(packet->speed);
892 /* call pptp_set_link. unless the user specified a quirk
894 pptp_set_link(conn, call->peer_call_id);
895 if (call->callback != NULL)
896 call->callback(conn, call, CALL_OPEN_DONE);
897 log("Outgoing call established (call ID %u, peer's "
898 "call ID %u).\n", call->call_id, call->peer_call_id);
914 if (vector_contains(conn->call, ntoh16(packet->call_id))) {
915 PPTP_CALL * call;
916 vector_search(conn->call, ntoh16(packet->call_id), &call);
917 if (call->callback != NULL)
918 call->callback(conn, call, CALL_CLOSE_RQST);
920 pptp_call_destroy(conn, call);
921 log("Call closed (RQST) (call id %d)", (int) call->call_id);
929 log("Call disconnect notification received (call id %d)",
931 if (vector_contains(conn->call, ntoh16(packet->call_id))) {
932 PPTP_CALL * call;
936 vector_search(conn->call, ntoh16(packet->call_id), &call);
937 pptp_call_destroy(conn, call);
939 /* XXX we could log call stats here XXX */
989 /*** Get info from call structure *********************************************/
991 void pptp_call_get_ids(PPTP_CONN * conn, PPTP_CALL * call,
994 assert(conn != NULL); assert(call != NULL);
995 *call_id = call->call_id;
996 *peer_call_id = call->peer_call_id;
1000 void pptp_call_closure_put(PPTP_CONN * conn, PPTP_CALL * call, void *cl)
1002 assert(conn != NULL); assert(call != NULL);
1003 call->closure = cl;
1007 void * pptp_call_closure_get(PPTP_CONN * conn, PPTP_CALL * call)
1009 assert(conn != NULL); assert(call != NULL);
1010 return call->closure;
1059 /* check incoming/outgoing call states for !IDLE && !ESTABLISHED */
1060 for (i = 0; i < vector_size(global.conn->call); i++) {
1061 PPTP_CALL * call = vector_get_Nth(global.conn->call, i);
1062 if (call->call_type == PPTP_CALL_PNS) {
1063 if (call->state.pns == PNS_WAIT_REPLY) {
1065 pptp_call_close(global.conn, call);
1066 assert(call->state.pns == PNS_WAIT_DISCONNECT);
1067 } else if (call->state.pns == PNS_WAIT_DISCONNECT) {
1068 /* hard-close the call */
1069 pptp_call_destroy(global.conn, call);
1071 } else if (call->call_type == PPTP_CALL_PAC) {
1072 if (call->state.pac == PAC_WAIT_REPLY) {
1074 } else if (call->state.pac == PAC_WAIT_CS_ANS) {