2 * Routines for the Point-to-Point Tunnelling Protocol (PPTP) (RFC 2637)
3 * Brad Robel-Forrest <brad.robel-forrest@watchguard.com>
5 * $Id: packet-pptp.c,v 1.8 2000/01/20 07:31:29 guy Exp $
7 * Ethereal - Network traffic analyzer
8 * By Gerald Combs <gerald@zing.org>
9 * Copyright 1998 Gerald Combs
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
31 #ifdef HAVE_SYS_TYPES_H
32 # include <sys/types.h>
37 #ifdef HAVE_NETINET_IN_H
38 #include <netinet/in.h>
44 static gint ett_pptp = -1;
46 #define NUM_MSG_TYPES 3
47 #define msgtype2str(t) \
48 ((t < NUM_MSG_TYPES) ? msgtypestr[t] : "UNKNOWN-MESSAGES-TYPE")
50 static const char *msgtypestr[NUM_MSG_TYPES] = {
51 "UNKNOWN-MESSAGE-TYPE",
56 #define NUM_FRAME_TYPES 4
57 #define frametype2str(t) \
58 ((t < NUM_FRAME_TYPES) ? frametypestr[t] : "UNKNOWN-FRAMING-TYPE")
60 static const char *frametypestr[NUM_FRAME_TYPES] = {
61 "UNKNOWN-FRAMING-TYPE",
67 #define NUM_BEARER_TYPES 4
68 #define bearertype2str(t) \
69 ((t < NUM_BEARER_TYPES) ? bearertypestr[t] : "UNKNOWN-BEARER-TYPE")
71 static const char *bearertypestr[NUM_BEARER_TYPES] = {
72 "UNKNOWN-BEARER-TYPE",
78 #define NUM_CNTRLRESULT_TYPES 6
79 #define cntrlresulttype2str(t) \
80 ((t < NUM_CNTRLRESULT_TYPES) ? cntrlresulttypestr[t] : "UNKNOWN-CNTRLRESULT-TYPE")
82 static const char *cntrlresulttypestr[NUM_CNTRLRESULT_TYPES] = {
83 "UNKNOWN-CNTRLRESULT-TYPE",
86 "COMMAND-CHANNEL-EXISTS",
88 "VERSION-NOT-SUPPORTED"
91 #define NUM_ERROR_TYPES 7
92 #define errortype2str(t) \
93 ((t < NUM_ERROR_TYPES) ? errortypestr[t] : "UNKNOWN-ERROR-TYPE")
95 static const char *errortypestr[NUM_ERROR_TYPES] = {
105 #define NUM_REASON_TYPES 4
106 #define reasontype2str(t) \
107 ((t < NUM_REASON_TYPES) ? reasontypestr[t] : "UNKNOWN-REASON-TYPE")
109 static const char *reasontypestr[NUM_REASON_TYPES] = {
110 "UNKNOWN-REASON-TYPE",
113 "STOP-LOCAL-SHUTDOWN"
116 #define NUM_STOPRESULT_TYPES 3
117 #define stopresulttype2str(t) \
118 ((t < NUM_STOPRESULT_TYPES) ? stopresulttypestr[t] : "UNKNOWN-STOPRESULT-TYPE")
120 static const char *stopresulttypestr[NUM_STOPRESULT_TYPES] = {
121 "UNKNOWN-STOPRESULT-TYPE",
126 #define NUM_ECHORESULT_TYPES 3
127 #define echoresulttype2str(t) \
128 ((t < NUM_ECHORESULT_TYPES) ? echoresulttypestr[t] : "UNKNOWN-ECHORESULT-TYPE")
130 static const char *echoresulttypestr[NUM_ECHORESULT_TYPES] = {
131 "UNKNOWN-ECHORESULT-TYPE",
136 #define NUM_OUTRESULT_TYPES 8
137 #define outresulttype2str(t) \
138 ((t < NUM_OUTRESULT_TYPES) ? outresulttypestr[t] : "UNKNOWN-OUTRESULT-TYPE")
140 static const char *outresulttypestr[NUM_OUTRESULT_TYPES] = {
141 "UNKNOWN-OUTRESULT-TYPE",
151 #define NUM_INRESULT_TYPES 4
152 #define inresulttype2str(t) \
153 ((t < NUM_INRESULT_TYPES) ? inresulttypestr[t] : "UNKNOWN-INRESULT-TYPE")
155 static const char *inresulttypestr[NUM_INRESULT_TYPES] = {
156 "UNKNOWN-INRESULT-TYPE",
162 #define NUM_DISCRESULT_TYPES 5
163 #define discresulttype2str(t) \
164 ((t < NUM_DISCRESULT_TYPES) ? discresulttypestr[t] : "UNKNOWN-DISCRESULT-TYPE")
166 static const char *discresulttypestr[NUM_DISCRESULT_TYPES] = {
167 "UNKNOWN-DISCRESULT-TYPE",
174 static void dissect_unknown(const u_char *, int, frame_data *, proto_tree *);
175 static void dissect_cntrl_req(const u_char *, int, frame_data *, proto_tree *);
176 static void dissect_cntrl_reply(const u_char *, int, frame_data *, proto_tree *);
177 static void dissect_stop_req(const u_char *, int, frame_data *, proto_tree *);
178 static void dissect_stop_reply(const u_char *, int, frame_data *, proto_tree *);
179 static void dissect_echo_req(const u_char *, int, frame_data *, proto_tree *);
180 static void dissect_echo_reply(const u_char *, int, frame_data *, proto_tree *);
181 static void dissect_out_req(const u_char *, int, frame_data *, proto_tree *);
182 static void dissect_out_reply(const u_char *, int, frame_data *, proto_tree *);
183 static void dissect_in_req(const u_char *, int, frame_data *, proto_tree *);
184 static void dissect_in_reply(const u_char *, int, frame_data *, proto_tree *);
185 static void dissect_in_connected(const u_char *, int, frame_data *, proto_tree *);
186 static void dissect_clear_req(const u_char *, int, frame_data *, proto_tree *);
187 static void dissect_disc_notify(const u_char *, int, frame_data *, proto_tree *);
188 static void dissect_error_notify(const u_char *, int, frame_data *, proto_tree *);
189 static void dissect_set_link(const u_char *, int, frame_data *, proto_tree *);
191 #define NUM_CNTRL_TYPES 16
192 #define cntrltype2str(t) \
193 ((t < NUM_CNTRL_TYPES) ? strfuncs[t].str : "UNKNOWN-CONTROL-TYPE")
195 static struct strfunc {
197 void (*func)(const u_char *, int, frame_data *, proto_tree *);
198 } strfuncs[NUM_CNTRL_TYPES] = {
199 {"UNKNOWN-CONTROL-TYPE", dissect_unknown },
200 {"START-CONTROL-REQUEST", dissect_cntrl_req },
201 {"START-CONTROL-REPLY", dissect_cntrl_reply },
202 {"STOP-CONTROL-REQUEST", dissect_stop_req },
203 {"STOP-CONTROL-REPLY", dissect_stop_reply },
204 {"ECHO-REQUEST", dissect_echo_req },
205 {"ECHO-REPLY", dissect_echo_reply },
206 {"OUTGOING-CALL-REQUEST", dissect_out_req },
207 {"OUTGOING-CALL-REPLY", dissect_out_reply },
208 {"INCOMING-CALL-REQUEST", dissect_in_req },
209 {"INCOMING-CALL-REPLY", dissect_in_reply },
210 {"INCOMING-CALL-CONNECTED", dissect_in_connected },
211 {"CLEAR-CALL-REQUEST", dissect_clear_req },
212 {"DISCONNECT-NOTIFY", dissect_disc_notify },
213 {"ERROR-NOTIFY", dissect_error_notify },
214 {"SET-LINK", dissect_set_link }
380 dissect_pptp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
382 struct pptp_hdr * hdr = (struct pptp_hdr *)(pd + offset);
386 if (check_col(fd, COL_PROTOCOL))
387 col_add_str(fd, COL_PROTOCOL, "PPTP");
389 len = pntohs(&hdr->len);
390 cntrl_type = pntohs(&hdr->cntrl_type);
392 if (check_col(fd, COL_INFO))
393 col_add_fstr(fd, COL_INFO, "%s", cntrltype2str(cntrl_type));
395 if (IS_DATA_IN_FRAME(offset) && tree) {
398 proto_tree * pptp_tree;
400 ti = proto_tree_add_text(tree, offset, len, "PPTP Control Channel");
401 pptp_tree = proto_item_add_subtree(ti, ett_pptp);
403 proto_tree_add_text(pptp_tree, offset, sizeof(hdr->len),
405 offset += sizeof(hdr->len);
407 msg_type = pntohs(&hdr->type);
408 proto_tree_add_text(pptp_tree, offset, sizeof(hdr->type),
409 "Message type: %s (%u)", msgtype2str(msg_type), msg_type);
410 offset += sizeof(hdr->type);
412 proto_tree_add_text(pptp_tree, offset, sizeof(hdr->cookie),
413 "Cookie: %#08x", pntohl(&hdr->cookie));
414 offset += sizeof(hdr->cookie);
416 proto_tree_add_text(pptp_tree, offset, sizeof(hdr->cntrl_type),
417 "Control type: %s (%u)", cntrltype2str(cntrl_type), cntrl_type);
418 offset += sizeof(hdr->cntrl_type);
420 proto_tree_add_text(pptp_tree, offset, sizeof(hdr->resv),
421 "Reserved: %u", pntohs(&hdr->resv));
422 offset += sizeof(hdr->resv);
424 if (cntrl_type < NUM_CNTRL_TYPES)
425 ( *(strfuncs[cntrl_type].func))(pd, offset, fd, pptp_tree);
427 dissect_data(pd, offset, fd, pptp_tree);
432 dissect_unknown(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
433 dissect_data(pd, offset, fd, tree);
437 dissect_cntrl_req(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
439 struct cntrl_req * hdr = (struct cntrl_req *)(pd + offset);
443 proto_tree_add_text(tree, offset, sizeof(hdr->major_ver) + sizeof(hdr->minor_ver),
444 "Protocol version: %u.%u", hdr->major_ver, hdr->minor_ver );
445 offset += sizeof(hdr->major_ver) + sizeof(hdr->minor_ver);
447 proto_tree_add_text(tree, offset, sizeof(hdr->resv),
448 "Reserved: %u", pntohs(&hdr->resv));
449 offset += sizeof(hdr->resv);
451 frame = pntohl(&hdr->frame);
452 proto_tree_add_text(tree, offset, sizeof(hdr->frame),
453 "Framing capabilities: %s (%u)", frametype2str(frame), frame);
454 offset += sizeof(hdr->frame);
456 bearer = pntohl(&hdr->bearer);
457 proto_tree_add_text(tree, offset, sizeof(hdr->bearer),
458 "Bearer capabilities: %s (%u)", bearertype2str(bearer), bearer);
459 offset += sizeof(hdr->bearer);
461 proto_tree_add_text(tree, offset, sizeof(hdr->max_chan),
462 "Maximum channels: %u", pntohs(&hdr->max_chan));
463 offset += sizeof(hdr->max_chan);
465 proto_tree_add_text(tree, offset, sizeof(hdr->firm_rev),
466 "Firmware revision: %u", pntohs(&hdr->firm_rev));
467 offset += sizeof(hdr->firm_rev);
469 proto_tree_add_text(tree, offset, sizeof(hdr->host),
470 "Hostname: %s", hdr->host);
471 offset += sizeof(hdr->host);
473 proto_tree_add_text(tree, offset, sizeof(hdr->vendor),
474 "Vendor: %s", hdr->vendor);
478 dissect_cntrl_reply(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
479 struct cntrl_reply * hdr = (struct cntrl_reply *)(pd + offset);
483 proto_tree_add_text(tree, offset, sizeof(hdr->major_ver) + sizeof(hdr->minor_ver),
484 "Protocol version: %u.%u", hdr->major_ver, hdr->minor_ver );
485 offset += sizeof(hdr->major_ver) + sizeof(hdr->minor_ver);
487 proto_tree_add_text(tree, offset, sizeof(hdr->result),
488 "Result: %s (%u)", cntrlresulttype2str(hdr->result), hdr->result);
489 offset += sizeof(hdr->result);
491 proto_tree_add_text(tree, offset, sizeof(hdr->error),
492 "Error: %s (%u)", errortype2str(hdr->error), hdr->error);
493 offset += sizeof(hdr->error);
495 frame = pntohl(&hdr->frame);
496 proto_tree_add_text(tree, offset, sizeof(hdr->frame),
497 "Framing capabilities: %s (%u)", frametype2str(frame), frame);
498 offset += sizeof(hdr->frame);
500 bearer = pntohl(&hdr->bearer);
501 proto_tree_add_text(tree, offset, sizeof(hdr->bearer),
502 "Bearer capabilities: %s (%u)", bearertype2str(bearer), bearer);
503 offset += sizeof(hdr->bearer);
505 proto_tree_add_text(tree, offset, sizeof(hdr->max_chan),
506 "Maximum channels: %u", pntohs(&hdr->max_chan));
507 offset += sizeof(hdr->max_chan);
509 proto_tree_add_text(tree, offset, sizeof(hdr->firm_rev),
510 "Firmware revision: %u", pntohs(&hdr->firm_rev));
511 offset += sizeof(hdr->firm_rev);
513 proto_tree_add_text(tree, offset, sizeof(hdr->host),
514 "Hostname: %s", hdr->host);
515 offset += sizeof(hdr->host);
517 proto_tree_add_text(tree, offset, sizeof(hdr->vendor),
518 "Vendor: %s", hdr->vendor);
522 dissect_stop_req(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
523 struct stop_req * hdr = (struct stop_req *)(pd + offset);
525 proto_tree_add_text(tree, offset, sizeof(hdr->reason),
526 "Reason: %s (%u)", reasontype2str(hdr->reason), hdr->reason);
527 offset += sizeof(hdr->reason);
529 proto_tree_add_text(tree, offset, sizeof(hdr->resv0),
530 "Reserved: %u", hdr->resv0);
531 offset += sizeof(hdr->resv0);
533 proto_tree_add_text(tree, offset, sizeof(hdr->resv1),
534 "Reserved: %u", pntohs(&hdr->resv1));
535 offset += sizeof(hdr->resv1);
539 dissect_stop_reply(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
540 struct stop_reply * hdr = (struct stop_reply *)(pd + offset);
542 proto_tree_add_text(tree, offset, sizeof(hdr->result),
543 "Result: %s (%u)", stopresulttype2str(hdr->result), hdr->result);
544 offset += sizeof(hdr->result);
546 proto_tree_add_text(tree, offset, sizeof(hdr->error),
547 "Error: %s (%u)", errortype2str(hdr->error), hdr->error);
548 offset += sizeof(hdr->error);
550 proto_tree_add_text(tree, offset, sizeof(hdr->resv),
551 "Reserved: %u", pntohs(&hdr->resv));
552 offset += sizeof(hdr->resv);
556 dissect_echo_req(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
557 struct echo_req * hdr = (struct echo_req *)(pd + offset);
559 proto_tree_add_text(tree, offset, sizeof(hdr->ident),
560 "Identifier: %u", pntohl(&hdr->ident));
561 offset += sizeof(hdr->ident);
565 dissect_echo_reply(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
566 struct echo_reply * hdr = (struct echo_reply *)(pd + offset);
568 proto_tree_add_text(tree, offset, sizeof(hdr->ident),
569 "Identifier: %u", pntohl(&hdr->ident));
570 offset += sizeof(hdr->ident);
572 proto_tree_add_text(tree, offset, sizeof(hdr->result),
573 "Result: %s (%u)", echoresulttype2str(hdr->result), hdr->result);
574 offset += sizeof(hdr->result);
576 proto_tree_add_text(tree, offset, sizeof(hdr->error),
577 "Error: %s (%u)", errortype2str(hdr->error), hdr->error);
578 offset += sizeof(hdr->error);
580 proto_tree_add_text(tree, offset, sizeof(hdr->resv),
581 "Reserved: %u", pntohs(&hdr->resv));
582 offset += sizeof(hdr->resv);
586 dissect_out_req(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
587 struct out_req * hdr = (struct out_req *)(pd + offset);
591 proto_tree_add_text(tree, offset, sizeof(hdr->call_id),
592 "Call ID: %u", pntohs(&hdr->call_id));
593 offset += sizeof(hdr->call_id);
595 proto_tree_add_text(tree, offset, sizeof(hdr->call_serial),
596 "Call Serial Number: %u", pntohs(&hdr->call_serial));
597 offset += sizeof(hdr->call_serial);
599 proto_tree_add_text(tree, offset, sizeof(hdr->min_bps),
600 "Minimum BPS: %u", pntohl(&hdr->min_bps));
601 offset += sizeof(hdr->min_bps);
603 proto_tree_add_text(tree, offset, sizeof(hdr->max_bps),
604 "Maximum BPS: %u", pntohl(&hdr->max_bps));
605 offset += sizeof(hdr->max_bps);
607 bearer = pntohl(&hdr->bearer);
608 proto_tree_add_text(tree, offset, sizeof(hdr->bearer),
609 "Bearer capabilities: %s (%u)", bearertype2str(bearer), bearer);
610 offset += sizeof(hdr->bearer);
612 frame = pntohl(&hdr->frame);
613 proto_tree_add_text(tree, offset, sizeof(hdr->frame),
614 "Framing capabilities: %s (%u)", frametype2str(frame), frame);
615 offset += sizeof(hdr->frame);
617 proto_tree_add_text(tree, offset, sizeof(hdr->win_size),
618 "Receive window size: %u", pntohs(&hdr->win_size));
619 offset += sizeof(hdr->win_size);
621 proto_tree_add_text(tree, offset, sizeof(hdr->delay),
622 "Processing delay: %u", pntohs(&hdr->delay));
623 offset += sizeof(hdr->delay);
625 proto_tree_add_text(tree, offset, sizeof(hdr->phone_len),
626 "Phone number length: %u", pntohs(&hdr->phone_len));
627 offset += sizeof(hdr->phone_len);
629 proto_tree_add_text(tree, offset, sizeof(hdr->resv),
630 "Reserved: %u", pntohs(&hdr->resv));
631 offset += sizeof(hdr->resv);
633 proto_tree_add_text(tree, offset, sizeof(hdr->phone),
634 "Phone number: %s", hdr->phone);
635 offset += sizeof(hdr->phone);
637 proto_tree_add_text(tree, offset, sizeof(hdr->subaddr),
638 "Subaddress: %s", hdr->subaddr);
639 offset += sizeof(hdr->subaddr);
643 dissect_out_reply(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
644 struct out_reply * hdr = (struct out_reply *)(pd + offset);
646 proto_tree_add_text(tree, offset, sizeof(hdr->call_id),
647 "Call ID: %u", pntohs(&hdr->call_id));
648 offset += sizeof(hdr->call_id);
650 proto_tree_add_text(tree, offset, sizeof(hdr->peer_id),
651 "Peer's call ID: %u", pntohs(&hdr->peer_id));
652 offset += sizeof(hdr->peer_id);
654 proto_tree_add_text(tree, offset, sizeof(hdr->result),
655 "Result: %s (%u)", outresulttype2str(hdr->result), hdr->result);
656 offset += sizeof(hdr->result);
658 proto_tree_add_text(tree, offset, sizeof(hdr->error),
659 "Error: %s (%u)", errortype2str(hdr->error), hdr->error);
660 offset += sizeof(hdr->error);
662 proto_tree_add_text(tree, offset, sizeof(hdr->cause),
663 "Cause code: %u", pntohs(&hdr->cause));
664 offset += sizeof(hdr->cause);
666 proto_tree_add_text(tree, offset, sizeof(hdr->speed),
667 "Connect speed: %u", pntohl(&hdr->speed));
668 offset += sizeof(hdr->speed);
670 proto_tree_add_text(tree, offset, sizeof(hdr->win_size),
671 "Receive window size: %u", pntohs(&hdr->win_size));
672 offset += sizeof(hdr->win_size);
674 proto_tree_add_text(tree, offset, sizeof(hdr->delay),
675 "Processing delay: %u", pntohs(&hdr->delay));
676 offset += sizeof(hdr->delay);
678 proto_tree_add_text(tree, offset, sizeof(hdr->channel_id),
679 "Physical channel ID: %u", pntohl(&hdr->channel_id));
680 offset += sizeof(hdr->channel_id);
685 dissect_in_req(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
686 struct in_req * hdr = (struct in_req *)(pd + offset);
689 proto_tree_add_text(tree, offset, sizeof(hdr->call_id),
690 "Call ID: %u", pntohs(&hdr->call_id));
691 offset += sizeof(hdr->call_id);
693 proto_tree_add_text(tree, offset, sizeof(hdr->call_serial),
694 "Call serial number: %u", pntohs(&hdr->call_serial));
695 offset += sizeof(hdr->call_serial);
697 bearer = pntohl(&hdr->bearer);
698 proto_tree_add_text(tree, offset, sizeof(hdr->bearer),
699 "Bearer capabilities: %s (%u)", bearertype2str(bearer), bearer);
700 offset += sizeof(hdr->bearer);
702 proto_tree_add_text(tree, offset, sizeof(hdr->channel_id),
703 "Physical channel ID: %u", pntohl(&hdr->channel_id));
704 offset += sizeof(hdr->channel_id);
706 proto_tree_add_text(tree, offset, sizeof(hdr->dialed_len),
707 "Dialed number length: %u", pntohs(&hdr->dialed_len));
708 offset += sizeof(hdr->dialed_len);
710 proto_tree_add_text(tree, offset, sizeof(hdr->dialing_len),
711 "Dialing number length: %u", pntohs(&hdr->dialing_len));
712 offset += sizeof(hdr->dialing_len);
714 proto_tree_add_text(tree, offset, sizeof(hdr->dialed),
715 "Dialed number: %s", hdr->dialed);
716 offset += sizeof(hdr->dialed);
718 proto_tree_add_text(tree, offset, sizeof(hdr->dialing),
719 "Dialing number: %s", hdr->dialing);
720 offset += sizeof(hdr->dialing);
722 proto_tree_add_text(tree, offset, sizeof(hdr->subaddr),
723 "Subaddress: %s", hdr->subaddr);
724 offset += sizeof(hdr->subaddr);
728 dissect_in_reply(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
729 struct in_reply * hdr = (struct in_reply *)(pd + offset);
731 proto_tree_add_text(tree, offset, sizeof(hdr->call_id),
732 "Call ID: %u", pntohs(&hdr->call_id));
733 offset += sizeof(hdr->call_id);
735 proto_tree_add_text(tree, offset, sizeof(hdr->peer_id),
736 "Peer's call ID: %u", pntohs(&hdr->peer_id));
737 offset += sizeof(hdr->peer_id);
739 proto_tree_add_text(tree, offset, sizeof(hdr->result),
740 "Result: %s (%u)", inresulttype2str(hdr->result), hdr->result);
741 offset += sizeof(hdr->result);
743 proto_tree_add_text(tree, offset, sizeof(hdr->error),
744 "Error: %s (%u)", errortype2str(hdr->error), hdr->error);
745 offset += sizeof(hdr->error);
747 proto_tree_add_text(tree, offset, sizeof(hdr->win_size),
748 "Receive window size: %u", pntohs(&hdr->win_size));
749 offset += sizeof(hdr->win_size);
751 proto_tree_add_text(tree, offset, sizeof(hdr->delay),
752 "Processing delay: %u", pntohs(&hdr->delay));
753 offset += sizeof(hdr->delay);
755 proto_tree_add_text(tree, offset, sizeof(hdr->resv),
756 "Reserved: %u", hdr->resv);
757 offset += sizeof(hdr->resv);
761 dissect_in_connected(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
762 struct in_connected * hdr = (struct in_connected *)(pd + offset);
765 proto_tree_add_text(tree, offset, sizeof(hdr->peer_id),
766 "Peer's call ID: %u", pntohs(&hdr->peer_id));
767 offset += sizeof(hdr->peer_id);
769 proto_tree_add_text(tree, offset, sizeof(hdr->resv),
770 "Reserved: %u", pntohs(&hdr->resv));
771 offset += sizeof(hdr->resv);
773 proto_tree_add_text(tree, offset, sizeof(hdr->speed),
774 "Connect speed: %u", pntohl(&hdr->speed));
775 offset += sizeof(hdr->speed);
777 proto_tree_add_text(tree, offset, sizeof(hdr->win_size),
778 "Receive window size: %u", pntohs(&hdr->win_size));
779 offset += sizeof(hdr->win_size);
781 proto_tree_add_text(tree, offset, sizeof(hdr->delay),
782 "Processing delay: %u", pntohs(&hdr->delay));
783 offset += sizeof(hdr->delay);
785 frame = pntohl(&hdr->frame);
786 proto_tree_add_text(tree, offset, sizeof(hdr->frame),
787 "Framing capabilities: %s (%u)", frametype2str(frame), frame);
788 offset += sizeof(hdr->frame);
792 dissect_clear_req(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
793 struct clear_req * hdr = (struct clear_req *)(pd + offset);
795 proto_tree_add_text(tree, offset, sizeof(hdr->call_id),
796 "Call ID: %u", pntohs(&hdr->call_id));
797 offset += sizeof(hdr->call_id);
799 proto_tree_add_text(tree, offset, sizeof(hdr->resv),
800 "Reserved: %u", pntohs(&hdr->resv));
801 offset += sizeof(hdr->resv);
805 dissect_disc_notify(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
806 struct disc_notify * hdr = (struct disc_notify *)(pd + offset);
808 proto_tree_add_text(tree, offset, sizeof(hdr->call_id),
809 "Call ID: %u", pntohs(&hdr->call_id));
810 offset += sizeof(hdr->call_id);
812 proto_tree_add_text(tree, offset, sizeof(hdr->result),
813 "Result: %s (%u)", discresulttype2str(hdr->result), hdr->result);
814 offset += sizeof(hdr->result);
816 proto_tree_add_text(tree, offset, sizeof(hdr->error),
817 "Error: %s (%u)", errortype2str(hdr->error), hdr->error);
818 offset += sizeof(hdr->error);
820 proto_tree_add_text(tree, offset, sizeof(hdr->cause),
821 "Cause code: %u", pntohs(&hdr->cause));
822 offset += sizeof(hdr->cause);
824 proto_tree_add_text(tree, offset, sizeof(hdr->resv),
825 "Reserved: %u", pntohs(&hdr->resv));
826 offset += sizeof(hdr->resv);
828 proto_tree_add_text(tree, offset, sizeof(hdr->stats),
829 "Call statistics: %s", hdr->stats);
830 offset += sizeof(hdr->stats);
834 dissect_error_notify(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
835 struct error_notify * hdr = (struct error_notify *)(pd + offset);
837 proto_tree_add_text(tree, offset, sizeof(hdr->peer_id),
838 "Peer's call ID: %u", pntohs(&hdr->peer_id));
839 offset += sizeof(hdr->peer_id);
841 proto_tree_add_text(tree, offset, sizeof(hdr->resv),
842 "Reserved: %u", pntohs(&hdr->resv));
843 offset += sizeof(hdr->resv);
845 proto_tree_add_text(tree, offset, sizeof(hdr->crc),
846 "CRC errors: %u", pntohl(&hdr->crc));
847 offset += sizeof(hdr->crc);
849 proto_tree_add_text(tree, offset, sizeof(hdr->frame),
850 "Framing errors: %u", pntohl(&hdr->frame));
851 offset += sizeof(hdr->frame);
853 proto_tree_add_text(tree, offset, sizeof(hdr->hardware),
854 "Hardware overruns: %u", pntohl(&hdr->hardware));
855 offset += sizeof(hdr->hardware);
857 proto_tree_add_text(tree, offset, sizeof(hdr->buffer),
858 "Buffer overruns: %u", pntohl(&hdr->buffer));
859 offset += sizeof(hdr->buffer);
861 proto_tree_add_text(tree, offset, sizeof(hdr->timeout),
862 "Time-out errors: %u", pntohl(&hdr->timeout));
863 offset += sizeof(hdr->timeout);
865 proto_tree_add_text(tree, offset, sizeof(hdr->alignment),
866 "Alignment errors: %u", pntohl(&hdr->alignment));
867 offset += sizeof(hdr->alignment);
871 dissect_set_link(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
872 struct set_link * hdr = (struct set_link *)(pd + offset);
874 proto_tree_add_text(tree, offset, sizeof(hdr->peer_id),
875 "Peer's call ID: %u", pntohs(&hdr->peer_id));
876 offset += sizeof(hdr->peer_id);
878 proto_tree_add_text(tree, offset, sizeof(hdr->resv),
879 "Reserved: %u", pntohs(&hdr->resv));
880 offset += sizeof(hdr->resv);
882 proto_tree_add_text(tree, offset, sizeof(hdr->send_acm),
883 "Send ACCM: %#08x", pntohl(&hdr->send_acm));
884 offset += sizeof(hdr->send_acm);
886 proto_tree_add_text(tree, offset, sizeof(hdr->recv_acm),
887 "Recv ACCM: %#08x", pntohl(&hdr->recv_acm));
888 offset += sizeof(hdr->recv_acm);
892 proto_register_pptp(void)
894 static gint *ett[] = {
898 proto_register_subtree_array(ett, array_length(ett));