head 1.2; access; symbols pkgsrc-2026Q1:1.2.0.166 pkgsrc-2026Q1-base:1.2 pkgsrc-2025Q4:1.2.0.164 pkgsrc-2025Q4-base:1.2 pkgsrc-2025Q3:1.2.0.162 pkgsrc-2025Q3-base:1.2 pkgsrc-2025Q2:1.2.0.160 pkgsrc-2025Q2-base:1.2 pkgsrc-2025Q1:1.2.0.158 pkgsrc-2025Q1-base:1.2 pkgsrc-2024Q4:1.2.0.156 pkgsrc-2024Q4-base:1.2 pkgsrc-2024Q3:1.2.0.154 pkgsrc-2024Q3-base:1.2 pkgsrc-2024Q2:1.2.0.152 pkgsrc-2024Q2-base:1.2 pkgsrc-2024Q1:1.2.0.150 pkgsrc-2024Q1-base:1.2 pkgsrc-2023Q4:1.2.0.148 pkgsrc-2023Q4-base:1.2 pkgsrc-2023Q3:1.2.0.146 pkgsrc-2023Q3-base:1.2 pkgsrc-2023Q2:1.2.0.144 pkgsrc-2023Q2-base:1.2 pkgsrc-2023Q1:1.2.0.142 pkgsrc-2023Q1-base:1.2 pkgsrc-2022Q4:1.2.0.140 pkgsrc-2022Q4-base:1.2 pkgsrc-2022Q3:1.2.0.138 pkgsrc-2022Q3-base:1.2 pkgsrc-2022Q2:1.2.0.136 pkgsrc-2022Q2-base:1.2 pkgsrc-2022Q1:1.2.0.134 pkgsrc-2022Q1-base:1.2 pkgsrc-2021Q4:1.2.0.132 pkgsrc-2021Q4-base:1.2 pkgsrc-2021Q3:1.2.0.130 pkgsrc-2021Q3-base:1.2 pkgsrc-2021Q2:1.2.0.128 pkgsrc-2021Q2-base:1.2 pkgsrc-2021Q1:1.2.0.126 pkgsrc-2021Q1-base:1.2 pkgsrc-2020Q4:1.2.0.124 pkgsrc-2020Q4-base:1.2 pkgsrc-2020Q3:1.2.0.122 pkgsrc-2020Q3-base:1.2 pkgsrc-2020Q2:1.2.0.118 pkgsrc-2020Q2-base:1.2 pkgsrc-2020Q1:1.2.0.98 pkgsrc-2020Q1-base:1.2 pkgsrc-2019Q4:1.2.0.120 pkgsrc-2019Q4-base:1.2 pkgsrc-2019Q3:1.2.0.116 pkgsrc-2019Q3-base:1.2 pkgsrc-2019Q2:1.2.0.114 pkgsrc-2019Q2-base:1.2 pkgsrc-2019Q1:1.2.0.112 pkgsrc-2019Q1-base:1.2 pkgsrc-2018Q4:1.2.0.110 pkgsrc-2018Q4-base:1.2 pkgsrc-2018Q3:1.2.0.108 pkgsrc-2018Q3-base:1.2 pkgsrc-2018Q2:1.2.0.106 pkgsrc-2018Q2-base:1.2 pkgsrc-2018Q1:1.2.0.104 pkgsrc-2018Q1-base:1.2 pkgsrc-2017Q4:1.2.0.102 pkgsrc-2017Q4-base:1.2 pkgsrc-2017Q3:1.2.0.100 pkgsrc-2017Q3-base:1.2 pkgsrc-2017Q2:1.2.0.96 pkgsrc-2017Q2-base:1.2 pkgsrc-2017Q1:1.2.0.94 pkgsrc-2017Q1-base:1.2 pkgsrc-2016Q4:1.2.0.92 pkgsrc-2016Q4-base:1.2 pkgsrc-2016Q3:1.2.0.90 pkgsrc-2016Q3-base:1.2 pkgsrc-2016Q2:1.2.0.88 pkgsrc-2016Q2-base:1.2 pkgsrc-2016Q1:1.2.0.86 pkgsrc-2016Q1-base:1.2 pkgsrc-2015Q4:1.2.0.84 pkgsrc-2015Q4-base:1.2 pkgsrc-2015Q3:1.2.0.82 pkgsrc-2015Q3-base:1.2 pkgsrc-2015Q2:1.2.0.80 pkgsrc-2015Q2-base:1.2 pkgsrc-2015Q1:1.2.0.78 pkgsrc-2015Q1-base:1.2 pkgsrc-2014Q4:1.2.0.76 pkgsrc-2014Q4-base:1.2 pkgsrc-2014Q3:1.2.0.74 pkgsrc-2014Q3-base:1.2 pkgsrc-2014Q2:1.2.0.72 pkgsrc-2014Q2-base:1.2 pkgsrc-2014Q1:1.2.0.70 pkgsrc-2014Q1-base:1.2 pkgsrc-2013Q4:1.2.0.68 pkgsrc-2013Q4-base:1.2 pkgsrc-2013Q3:1.2.0.66 pkgsrc-2013Q3-base:1.2 pkgsrc-2013Q2:1.2.0.64 pkgsrc-2013Q2-base:1.2 pkgsrc-2013Q1:1.2.0.62 pkgsrc-2013Q1-base:1.2 pkgsrc-2012Q4:1.2.0.60 pkgsrc-2012Q4-base:1.2 pkgsrc-2012Q3:1.2.0.58 pkgsrc-2012Q3-base:1.2 pkgsrc-2012Q2:1.2.0.56 pkgsrc-2012Q2-base:1.2 pkgsrc-2012Q1:1.2.0.54 pkgsrc-2012Q1-base:1.2 pkgsrc-2011Q4:1.2.0.52 pkgsrc-2011Q4-base:1.2 pkgsrc-2011Q3:1.2.0.50 pkgsrc-2011Q3-base:1.2 pkgsrc-2011Q2:1.2.0.48 pkgsrc-2011Q2-base:1.2 pkgsrc-2011Q1:1.2.0.46 pkgsrc-2011Q1-base:1.2 pkgsrc-2010Q4:1.2.0.44 pkgsrc-2010Q4-base:1.2 pkgsrc-2010Q3:1.2.0.42 pkgsrc-2010Q3-base:1.2 pkgsrc-2010Q2:1.2.0.40 pkgsrc-2010Q2-base:1.2 pkgsrc-2010Q1:1.2.0.38 pkgsrc-2010Q1-base:1.2 pkgsrc-2009Q4:1.2.0.36 pkgsrc-2009Q4-base:1.2 pkgsrc-2009Q3:1.2.0.34 pkgsrc-2009Q3-base:1.2 pkgsrc-2009Q2:1.2.0.32 pkgsrc-2009Q2-base:1.2 pkgsrc-2009Q1:1.2.0.30 pkgsrc-2009Q1-base:1.2 pkgsrc-2008Q4:1.2.0.28 pkgsrc-2008Q4-base:1.2 pkgsrc-2008Q3:1.2.0.26 pkgsrc-2008Q3-base:1.2 cube-native-xorg:1.2.0.24 cube-native-xorg-base:1.2 pkgsrc-2008Q2:1.2.0.22 pkgsrc-2008Q2-base:1.2 cwrapper:1.2.0.20 pkgsrc-2008Q1:1.2.0.18 pkgsrc-2008Q1-base:1.2 pkgsrc-2007Q4:1.2.0.16 pkgsrc-2007Q4-base:1.2 pkgsrc-2007Q3:1.2.0.14 pkgsrc-2007Q3-base:1.2 pkgsrc-2007Q2:1.2.0.12 pkgsrc-2007Q2-base:1.2 pkgsrc-2007Q1:1.2.0.10 pkgsrc-2007Q1-base:1.2 pkgsrc-2006Q4:1.2.0.8 pkgsrc-2006Q4-base:1.2 pkgsrc-2006Q3:1.2.0.6 pkgsrc-2006Q3-base:1.2 pkgsrc-2006Q2:1.2.0.4 pkgsrc-2006Q2-base:1.2 pkgsrc-2006Q1:1.2.0.2 pkgsrc-2006Q1-base:1.2 pkgsrc-2005Q4:1.1.1.1.0.26 pkgsrc-2005Q4-base:1.1.1.1 pkgsrc-2005Q3:1.1.1.1.0.24 pkgsrc-2005Q3-base:1.1.1.1 pkgsrc-2005Q2:1.1.1.1.0.22 pkgsrc-2005Q2-base:1.1.1.1 pkgsrc-2005Q1:1.1.1.1.0.20 pkgsrc-2005Q1-base:1.1.1.1 pkgsrc-2004Q4:1.1.1.1.0.18 pkgsrc-2004Q4-base:1.1.1.1 pkgsrc-2004Q3:1.1.1.1.0.16 pkgsrc-2004Q3-base:1.1.1.1 pkgsrc-2004Q2:1.1.1.1.0.14 pkgsrc-2004Q2-base:1.1.1.1 pkgsrc-2004Q1:1.1.1.1.0.12 pkgsrc-2004Q1-base:1.1.1.1 pkgsrc-2003Q4:1.1.1.1.0.10 pkgsrc-2003Q4-base:1.1.1.1 netbsd-1-6-1:1.1.1.1.0.6 netbsd-1-6-1-base:1.1.1.1 netbsd-1-6:1.1.1.1.0.8 netbsd-1-6-RELEASE-base:1.1.1.1 pkgviews:1.1.1.1.0.4 pkgviews-base:1.1.1.1 buildlink2:1.1.1.1.0.2 buildlink2-base:1.1.1.1 netbsd-1-5-PATCH003:1.1.1.1 netbsd-1-5-PATCH001:1.1.1.1 netbsd-1-5-RELEASE:1.1.1.1 netbsd-1-4-PATCH003:1.1.1.1 pkgsrc-base:1.1.1.1 TNF:1.1.1; locks; strict; comment @# @; 1.2 date 2006.03.14.13.53.57; author rillig; state Exp; branches; next 1.1; 1.1 date 2000.04.10.01.14.02; author jtk; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2000.04.10.01.14.02; author jtk; state Exp; branches; next ; desc @@ 1.2 log @Updated pptp to 1.7.0. Release 1.7.0: (27th July 2005) - silently discard packets not for the call [Cameron/Jenkins] - adopt sigpipe for use with SIGALRM on control connection [Wolter/Cameron] - fixes known valgrind heap violations in 1.6.0 [Cameron/Thorne] - properly report control connection echo reply loss [Wolter] Release 1.6.0: (18th February 2005) - fix double-free on stop control connection reply [Kivity] - add --idle-wait option [Cameron] - fix segfault on fatal connection error [Kivity] - prevent a possible signal race [Kivity] - prevent kill of init [Shurdeek] - portability fix for non-Linux systems [Quinot] - rename package from pptp-linux to pptp [Cameron] Release 1.5.0: (22nd June 2004) - fix statistics when buffering disabled [Wilson] - do not inherit the GRE socket [Cameron] - fix a case of non-shutdown of call manager [Klazes] - add --nobuffer option to eliminate all buffering of packets [Wilson] - fix corruption of command line as shown by ps [Howarth] - fix CPU loop after pppd killed [Cameron] - fix compile for ARM architecture [Hopf] - add documentation for command-line options [Wilson] - do not hang when a connection is refused [McCurdy] - better describe a cause of EMSGSIZE [Cameron] Release 1.4.0: (2nd January 2004) - support options before hostname [Wilson] - defer OCRQ until after SCCRP [Cameron] - include uninstall target [Pieter] - only issue a warning if sync mode is different to pppd [Klazes] - reformat and tidy code [Klazes] - reduce transmitted ack-only packets from 40% to 0.8% [Klazes] Release 1.3.1: (11th June 2003) - fixed bug introduced since 1.2.0 that prevented simultaneous tunnels. Release 1.3.0: (10th June 2003) - rewrite command usage text. - increase call disconnect notification log message verbosity. - inherit more make command line options. - remove execute permissions on man page. - fixed inefficient acknowledgement immediately followed by data packet. - added statistics for link quality monitoring. - remove include of callmgr, do separate compile. - remove duplicate messages caused by code in header file. - compilation fixes for Apple MacOS X. - support multiple clients on alias IP addresses. Release 1.2.0: (14th February 2003) - subsecond packet timeout to improve performance on fast links. - rewrite INSTALL. - add man page to install target. - fix response to dropped packets. - fix man page, address must be before options. - adopt man page contributed by Thomas Quinot. - close stderr to prevent holding open ssh sessions. - minor hint added in case of EIO on read() of pty. - support synchronous HDLC ppp encoding. Synchronous mode results in an important improvement of the CPU efficiency. - handle out-of-order packets arriving on the GRE socket by buffering. - bind GRE socket early to prevent ICMP Unreachable response by client. Release 1.1.0: (20th March 2002) - New release engineer. - allow activation as a psuedo-tty child process from pppd. This allows on demand pptp links or automatically reconnect. - ADSL modem quirks handler by mulix@@actcom.co.il. Workarounds for Orckit ADSL modem. - workaround for Cisco PIX connection drop after 60 seconds. - enhance bad FCS error message. - ported to FreeBSD and NetBSD. - integrated call manager into pptp binary. - many bugfixes improving stability. Release 1.0.3: (7th May 2001) - New maintaining team. - Various bug fixes from the Debian package and FreeBSD port. - Incorporate patch to support erroneous return code with Alcatel ADSL 1000 modems. - Fix incorrect call id error. - New command line option: --phone (specify phone number). (Needed by the Dutch Mxstream ADSL service.) Contributed by Rein Klazes @ text @$NetBSD: patch-ac,v 1.1.1.1 2000/04/10 01:14:02 jtk Exp $ Added more logging and made its appearance more consistent. --- pptp_ctrl.c.orig 2005-07-28 03:15:11.000000000 +0200 +++ pptp_ctrl.c 2006-03-14 14:26:42.000000000 +0100 @@@@ -291,6 +291,7 @@@@ PPTP_CONN * pptp_conn_open(int inet_sock hton16(PPTP_MAX_CHANNELS), hton16(PPTP_FIRMWARE_VERSION), PPTP_HOSTNAME, PPTP_VENDOR }; + log("sending start ctrl conn rqst"); /* fix this packet, if necessary */ int idx, rc; idx = get_quirk_index(); @@@@ -366,6 +367,7 @@@@ PPTP_CALL * pptp_call_open(PPTP_CONN * c packet.phone_len = sizeof(packet.phone_num); packet.phone_len = hton16 (packet.phone_len); } + log("sending out call rqst"); if (pptp_send_ctrl_packet(conn, &packet, sizeof(packet))) { pptp_reset_timer(); call->state.pns = PNS_WAIT_REPLY; @@@@ -393,6 +395,7 @@@@ void pptp_call_close(PPTP_CONN * conn, P /* don't check state against WAIT_DISCONNECT... allow multiple disconnect * requests to be made. */ + log("sending call clear rqst"); pptp_send_ctrl_packet(conn, &rqst, sizeof(rqst)); pptp_reset_timer(); call->state.pns = PNS_WAIT_DISCONNECT; @@@@ -427,7 +430,7 @@@@ void pptp_conn_close(PPTP_CONN * conn, u for (i = 0; i < vector_size(conn->call); i++) pptp_call_close(conn, vector_get_Nth(conn->call, i)); /* now close connection */ - log("Closing PPTP connection"); + log("Closing PPTP connection (sending stop ctrl conn rqst)"); pptp_send_ctrl_packet(conn, &rqst, sizeof(rqst)); pptp_reset_timer(); /* wait 60 seconds for reply */ conn->conn_state = CONN_WAIT_STOP_REPLY; @@@@ -706,7 +709,17 @@@@ int ctrlp_disp(PPTP_CONN * conn, void * hton16(PPTP_MAX_CHANNELS), hton16(PPTP_FIRMWARE_VERSION), PPTP_HOSTNAME, PPTP_VENDOR }; int idx, rc; - log("Received Start Control Connection Request"); + log("Received Start Control Connection Request: v%d rcode %d ecode %d fcap %x bcap %x chans %d fw %x host `%.64s' vendor `%.64s'", + ntoh16(packet->version), + packet->result_code, + packet->error_code, + ntoh32(packet->framing_cap), + ntoh32(packet->bearer_cap), + ntoh16(packet->max_channels), + ntoh16(packet->firmware_rev), + packet->hostname, + packet->vendor + ); /* fix this packet, if necessary */ idx = get_quirk_index(); if (idx != -1 && pptp_fixups[idx].start_ctrl_conn) { @@@@ -719,9 +732,11 @@@@ int ctrlp_disp(PPTP_CONN * conn, void * reply.version = packet->version; /* protocol version not supported */ reply.result_code = hton8(5); + log("sending start ctrl conn reply (NAK)"); pptp_send_ctrl_packet(conn, &reply, sizeof(reply)); pptp_reset_timer(); /* give sender a chance for a retry */ } else { /* same or greater version */ + log("sending start ctrl conn reply (ACK)"); if (pptp_send_ctrl_packet(conn, &reply, sizeof(reply))) { conn->conn_state = CONN_ESTABLISHED; log("server connection ESTABLISHED."); @@@@ -735,7 +750,18 @@@@ int ctrlp_disp(PPTP_CONN * conn, void * { struct pptp_start_ctrl_conn *packet = (struct pptp_start_ctrl_conn *) buffer; - log("Received Start Control Connection Reply"); + log("Received Start Control Connection Reply: v%d rcode %d ecode %d fcap %x bcap %x chans %d fw %x host `%.64s' vendor `%.64s'", + ntoh16(packet->version), + packet->result_code, + packet->error_code, + ntoh32(packet->framing_cap), + ntoh32(packet->bearer_cap), + ntoh16(packet->max_channels), + ntoh16(packet->firmware_rev), + packet->hostname, + packet->vendor + ); + if (conn->conn_state == CONN_WAIT_CTL_REPLY) { /* XXX handle collision XXX [see rfc] */ if (ntoh16(packet->version) != PPTP_VERSION) { @@@@ -778,14 +804,21 @@@@ int ctrlp_disp(PPTP_CONN * conn, void * /* ----------- STANDARD Stop-Session MESSAGES ------------ */ case PPTP_STOP_CTRL_CONN_RQST: { + struct pptp_stop_ctrl_conn *packet = + (struct pptp_stop_ctrl_conn *) buffer; /* conn_state should be CONN_ESTABLISHED, but it could be * something else */ struct pptp_stop_ctrl_conn reply = { PPTP_HEADER_CTRL(PPTP_STOP_CTRL_CONN_RPLY), hton8(1), hton8(PPTP_GENERAL_ERROR_NONE), 0 }; - log("Received Stop Control Connection Request."); + log("Received Stop Control Connection Request: reason %d err %d reserved %d", + packet->reason_result, + packet->error_code, + ntoh16(packet->reserved1) + ); if (conn->conn_state == CONN_IDLE) break; + log("sending stop ctrl conn reply"); if (pptp_send_ctrl_packet(conn, &reply, sizeof(reply))) { if (conn->callback != NULL) conn->callback(conn, CONN_CLOSE_RQST); @@@@ -796,7 +829,13 @@@@ int ctrlp_disp(PPTP_CONN * conn, void * } case PPTP_STOP_CTRL_CONN_RPLY: { - log("Received Stop Control Connection Reply."); + struct pptp_stop_ctrl_conn *packet = + (struct pptp_stop_ctrl_conn *) buffer; + log("Received Stop Control Connection Reply: reason %d err %d reserved %d", + packet->reason_result, + packet->error_code, + ntoh16(packet->reserved1) + ); /* conn_state should be CONN_WAIT_STOP_REPLY, but it * could be something else */ if (conn->conn_state == CONN_IDLE) break; @@@@ -842,9 +881,23 @@@@ int ctrlp_disp(PPTP_CONN * conn, void * hton32(PPTP_CONNECT_SPEED), hton16(PPTP_WINDOW), hton16(PPTP_DELAY), 0 }; - log("Received Outgoing Call Request."); + log("Received Outgoing Call Request: id %x csn %d minbps %d max %d bearer %x framing %x rsize %d delay %d plen %d rsv1 %d phone `%.64s' sub `%.64s'", + ntoh16(packet->call_id), + ntoh16(packet->call_sernum), + ntoh32(packet->bps_min), + ntoh32(packet->bps_max), + ntoh32(packet->bearer), + ntoh32(packet->framing), + ntoh16(packet->recv_size), + ntoh16(packet->delay), + ntoh16(packet->phone_len), + ntoh16(packet->reserved1), + packet->phone_num, + packet->subaddress + ); /* XXX PAC: eventually this should make an outgoing call. XXX */ reply.result_code = hton8(7); /* outgoing calls verboten */ + log("sending out call reply (NAK)"); pptp_send_ctrl_packet(conn, &reply, sizeof(reply)); break; } @@@@ -854,7 +907,17 @@@@ int ctrlp_disp(PPTP_CONN * conn, void * (struct pptp_out_call_rply *)buffer; PPTP_CALL * call; u_int16_t callid = ntoh16(packet->call_id_peer); - log("Received Outgoing Call Reply."); + log("Received Outgoing Call Reply: id %x peer %d result %d err %d cause %x speed %d rsize %d delay %d channel %x", + ntoh16(packet->call_id), + ntoh16(packet->call_id_peer), + packet->result_code, + packet->error_code, + ntoh16(packet->cause_code), + ntoh32(packet->speed), + ntoh16(packet->recv_size), + ntoh16(packet->delay), + ntoh32(packet->channel) + ); if (!vector_search(conn->call, (int) callid, &call)) { log("PPTP_OUT_CALL_RPLY received for non-existant call: " "peer call ID (us) %d call ID (them) %d.", @@@@ -908,12 +971,16 @@@@ int ctrlp_disp(PPTP_CONN * conn, void * PPTP_HEADER_CTRL(PPTP_CALL_CLEAR_NTFY), packet->call_id, 1, PPTP_GENERAL_ERROR_NONE, 0, 0, {0} }; - log("Received Call Clear Request."); + log("Received Call Clear Request: cid %d reserved %d", + ntoh16(packet->call_id), + ntoh16(packet->reserved1) + ); if (vector_contains(conn->call, ntoh16(packet->call_id))) { PPTP_CALL * call; vector_search(conn->call, ntoh16(packet->call_id), &call); if (call->callback != NULL) call->callback(conn, call, CALL_CLOSE_RQST); + log("sending call clear ntfy"); pptp_send_ctrl_packet(conn, &reply, sizeof(reply)); pptp_call_destroy(conn, call); log("Call closed (RQST) (call id %d)", (int) call->call_id); @@@@ -924,8 +991,13 @@@@ int ctrlp_disp(PPTP_CONN * conn, void * { struct pptp_call_clear_ntfy *packet = (struct pptp_call_clear_ntfy *)buffer; - log("Call disconnect notification received (call id %d)", - ntoh16(packet->call_id)); + log("received call clear ntfy: cid %d result %d err %d cause %x reserved %d", + ntoh16(packet->call_id), + packet->result_code, + packet->error_code, + ntoh16(packet->cause_code), + ntoh16(packet->reserved1) + ); if (vector_contains(conn->call, ntoh16(packet->call_id))) { PPTP_CALL * call; ctrlp_error(packet->result_code, packet->error_code, @@@@ -944,12 +1016,12 @@@@ int ctrlp_disp(PPTP_CONN * conn, void * /* this is really dealt with in the HDLC deencapsulation, anyway. */ struct pptp_set_link_info *packet = (struct pptp_set_link_info *)buffer; - /* log it. */ - log("PPTP_SET_LINK_INFO received from peer_callid %u", - (unsigned int) ntoh16(packet->call_id_peer)); - log(" send_accm is %08lX, recv_accm is %08lX", - (unsigned long) ntoh32(packet->send_accm), - (unsigned long) ntoh32(packet->recv_accm)); + log("received set link info: peer %x res %d send %x recv %x\n", + ntoh16(packet->call_id_peer), + ntoh16(packet->reserved1), + ntoh32(packet->send_accm), + ntoh32(packet->recv_accm) + ); if (!(ntoh32(packet->send_accm) == 0 && ntoh32(packet->recv_accm) == 0)) warn("Non-zero Async Control Character Maps are not supported!"); @@@@ -1051,6 +1123,7 @@@@ static void pptp_handle_timer() } else { /* ka_state == NONE */ /* send keep-alive */ struct pptp_echo_rqst rqst = { PPTP_HEADER_CTRL(PPTP_ECHO_RQST), hton32(global.conn->ka_id) }; + log("sending echo request: %d", global.conn->ka_id); pptp_send_ctrl_packet(global.conn, &rqst, sizeof(rqst)); global.conn->ka_state = KA_OUTSTANDING; } @ 1.1 log @Initial revision @ text @d1 1 a1 1 $NetBSD$ d3 16 a18 15 Index: pptp_ctrl.c --- pptp_ctrl.c.orig 1998/09/02 14:40:54 +++ pptp_ctrl.c 1999/02/12 14:23:29 @@@@ -159,6 +159,7 @@@@ hton16(PPTP_MAX_CHANNELS), hton16(PPTP_FIRMWARE_VERSION), PPTP_HOSTNAME, PPTP_VENDOR }; + log("sending start ctrl conn rqst"); if (pptp_send_ctrl_packet(conn, &packet, sizeof(packet))) conn->conn_state = CONN_WAIT_CTL_REPLY; else return NULL; /* could not send initial start request. */ @@@@ -211,6 +212,7 @@@@ hton32(PPTP_BEARER_CAP), hton32(PPTP_FRAME_CAP), hton16(PPTP_WINDOW), 0, 0, 0, {0}, {0} }; d21 66 a86 74 pptp_reset_timer(); call->state.pns = PNS_WAIT_REPLY; @@@@ -238,6 +240,7 @@@@ * requests to be made. */ + log("sending call clear rqst"); pptp_send_ctrl_packet(conn, &rqst, sizeof(rqst)); pptp_reset_timer(); call->state.pns = PNS_WAIT_DISCONNECT; @@@@ -272,7 +275,7 @@@@ pptp_call_close(conn, vector_get_Nth(conn->call, i)); /* now close connection */ - log("Closing PPTP connection"); + log("Closing PPTP connection (sending stop ctrl conn rqst)"); pptp_send_ctrl_packet(conn, &rqst, sizeof(rqst)); pptp_reset_timer(); /* wait 60 seconds for reply */ conn->conn_state = CONN_WAIT_STOP_REPLY; @@@@ -485,14 +488,27 @@@@ hton32(PPTP_FRAME_CAP), hton32(PPTP_BEARER_CAP), hton16(PPTP_MAX_CHANNELS), hton16(PPTP_FIRMWARE_VERSION), PPTP_HOSTNAME, PPTP_VENDOR }; + log("received start conn rqst: v%d rcode %d ecode %d fcap %x bcap %x chans %d fw %x host `%.64s' vendor `%.64s'", + ntoh16(packet->version), + packet->result_code, + packet->error_code, + ntoh32(packet->framing_cap), + ntoh32(packet->bearer_cap), + ntoh16(packet->max_channels), + ntoh16(packet->firmware_rev), + packet->hostname, + packet->vendor + ); if (conn->conn_state == CONN_IDLE) { if (ntoh16(packet->version) < PPTP_VERSION) { /* Can't support this (earlier) PPTP_VERSION */ reply.version = packet->version; reply.result_code = hton8(5); /* protocol version not supported */ + log("sending start ctrl conn reply (NAK)"); pptp_send_ctrl_packet(conn, &reply, sizeof(reply)); pptp_reset_timer(); /* give sender a chance for a retry */ } else { /* same or greater version */ + log("sending start ctrl conn reply (ACK)"); if (pptp_send_ctrl_packet(conn, &reply, sizeof(reply))) { conn->conn_state=CONN_ESTABLISHED; log("server connection ESTABLISHED."); @@@@ -506,6 +522,17 @@@@ { struct pptp_start_ctrl_conn *packet = (struct pptp_start_ctrl_conn *) buffer; + log("received start conn reply: v%d rcode %d ecode %d fcap %x bcap %x chans %d fw %x host `%.64s' vendor `%.64s'", + ntoh16(packet->version), + packet->result_code, + packet->error_code, + ntoh32(packet->framing_cap), + ntoh32(packet->bearer_cap), + ntoh16(packet->max_channels), + ntoh16(packet->firmware_rev), + packet->hostname, + packet->vendor + ); if (conn->conn_state == CONN_WAIT_CTL_REPLY) { /* XXX handle collision XXX [see rfc] */ if (ntoh16(packet->version) != PPTP_VERSION) { @@@@ -545,7 +572,14 @@@@ PPTP_HEADER_CTRL(PPTP_STOP_CTRL_CONN_RPLY), hton8(1), hton8(PPTP_GENERAL_ERROR_NONE), 0}; + log("received stop conn rqst: reason %d err %d reserved %d", + packet->reason_result, + packet->error_code, + ntoh16(packet->reserved1) + ); d88 145 a232 64 if (conn->conn_state==CONN_IDLE) break; + log("sending stop ctrl conn reply"); if (pptp_send_ctrl_packet(conn, &reply, sizeof(reply))) { if (conn->callback!=NULL) conn->callback(conn, CONN_CLOSE_RQST); conn->conn_state=CONN_IDLE; @@@@ -560,6 +594,11 @@@@ /* conn_state should be CONN_WAIT_STOP_REPLY, but it * could be something else */ + log("received stop conn reply: reason %d err %d reserved %d", + packet->reason_result, + packet->error_code, + ntoh16(packet->reserved1) + ); if (conn->conn_state == CONN_IDLE) break; conn->conn_state=CONN_IDLE; pptp_conn_destroy(conn); @@@@ -570,6 +609,12 @@@@ { struct pptp_echo_rply *packet = (struct pptp_echo_rply *) buffer; + log("received echo rply: id %x result %d err %d reserved %d", + ntoh32(packet->identifier), + packet->result_code, + packet->error_code, + ntoh16(packet->reserved1) + ); if ((conn->ka_state == KA_OUTSTANDING) && (ntoh32(packet->identifier)==conn->ka_id)) { conn->ka_id++; @@@@ -586,6 +631,10 @@@@ PPTP_HEADER_CTRL(PPTP_ECHO_RPLY), packet->identifier, /* skip hton32(ntoh32(id)) */ hton8(1), hton8(PPTP_GENERAL_ERROR_NONE), 0}; + log("received echo rqst: id %x", + ntoh32(packet->identifier) + ); + log("sending echo reply"); pptp_send_ctrl_packet(conn, &reply, sizeof(reply)); pptp_reset_timer(); break; @@@@ -600,8 +649,23 @@@@ 0 /* callid */, packet->call_id, 1, PPTP_GENERAL_ERROR_NONE, 0, hton32(PPTP_CONNECT_SPEED), hton16(PPTP_WINDOW), hton16(PPTP_DELAY), 0 }; + log("received out call rqst: id %x csn %d minbps %d max %d bearer %x framing %x rsize %d delay %d plen %d rsv1 %d phone `%.64s' sub `%.64s'", + ntoh16(packet->call_id), + ntoh16(packet->call_sernum), + ntoh32(packet->bps_min), + ntoh32(packet->bps_max), + ntoh32(packet->bearer), + ntoh32(packet->framing), + ntoh16(packet->recv_size), + ntoh16(packet->delay), + ntoh16(packet->phone_len), + ntoh16(packet->reserved1), + packet->phone_num, + packet->subaddress + ); /* XXX PAC: eventually this should make an outgoing call. XXX */ reply.result_code = hton8(7); /* outgoing calls verboten */ + log("sending out call reply (NAK)"); pptp_send_ctrl_packet(conn, &reply, sizeof(reply)); break; a233 82 @@@@ -611,6 +675,18 @@@@ (struct pptp_out_call_rply *)buffer; PPTP_CALL * call; u_int16_t callid = ntoh16(packet->call_id_peer); + + log("received out call reply: id %x peer %d result %d err %d cause %x speed %d rsize %d delay %d channel %x", + ntoh16(packet->call_id), + ntoh16(packet->call_id_peer), + packet->result_code, + packet->error_code, + ntoh16(packet->cause_code), + ntoh32(packet->speed), + ntoh16(packet->recv_size), + ntoh16(packet->delay), + ntoh32(packet->channel) + ); if (!vector_search(conn->call, (int) callid, &call)) { log("PPTP_OUT_CALL_RPLY received for non-existant call."); break; @@@@ -634,7 +710,9 @@@@ call->speed = ntoh32(packet->speed); pptp_reset_timer(); if (call->callback!=NULL) call->callback(conn, call, CALL_OPEN_DONE); - log("Outgoing call established.\n"); + log("Outgoing call established: cid %d @@ %d bps.\n", + call->peer_call_id, + call->speed); } } break; @@@@ -650,10 +728,15 @@@@ PPTP_HEADER_CTRL(PPTP_CALL_CLEAR_NTFY), packet->call_id, 1, PPTP_GENERAL_ERROR_NONE, 0, 0, {0} }; + log("received call clear rqst: cid %d reserved %d", + ntoh16(packet->call_id), + ntoh16(packet->reserved1) + ); if (vector_contains(conn->call, ntoh16(packet->call_id))) { PPTP_CALL * call; vector_search(conn->call, ntoh16(packet->call_id), &call); if (call->callback!=NULL) call->callback(conn, call, CALL_CLOSE_RQST); + log("sending call clear ntfy"); pptp_send_ctrl_packet(conn, &reply, sizeof(reply)); pptp_call_destroy(conn, call); log("Call closed (RQST) (call id %d)", (int) call->call_id); @@@@ -664,6 +747,14 @@@@ { struct pptp_call_clear_ntfy *packet = (struct pptp_call_clear_ntfy *)buffer; + log("received call clear ntfy: cid %d result %d err %d cause %x reserved %d", + ntoh16(packet->call_id), + packet->result_code, + packet->error_code, + ntoh16(packet->cause_code), + ntoh16(packet->reserved1) + ); + if (vector_contains(conn->call, ntoh16(packet->call_id))) { PPTP_CALL * call; vector_search(conn->call, ntoh16(packet->call_id), &call); @@@@ -679,6 +770,12 @@@@ /* this is really dealt with in the HDLC deencapsulation, anyway. */ struct pptp_set_link_info *packet = (struct pptp_set_link_info *)buffer; + log("received set link info: peer %x res %d send %x recv %x\n", + ntoh16(packet->call_id_peer), + ntoh16(packet->reserved1), + ntoh32(packet->send_accm), + ntoh32(packet->recv_accm) + ); if (ntoh32(packet->send_accm)==0 && ntoh32(packet->recv_accm)==0) break; /* this is what we expect. */ /* log it, otherwise. */ @@@@ -752,6 +849,7 @@@@ else { /* ka_state == NONE */ /* send keep-alive */ struct pptp_echo_rqst rqst = { PPTP_HEADER_CTRL(PPTP_ECHO_RQST), hton32(global.conn->ka_id) }; + log("sending echo request: %d", global.conn->ka_id); pptp_send_ctrl_packet(global.conn, &rqst, sizeof(rqst)); global.conn->ka_state = KA_OUTSTANDING; /* XXX FIXME: wake up ctrl thread -- or will the SIGALRM do that @ 1.1.1.1 log @PPTP (Point-to-Point Tunneling Protocol) client package, from linux-pptp-1.0.2 No encryption (yet). Tested with one Microsoft PPTP server, YMMV? @ text @@