Date: Wed, 26 Aug 1998 08:10:00 -0700 (PDT) From: hm@hcs.de (Hellmuth Michaelis) To: freebsd-bugs@FreeBSD.ORG Subject: Re: misc/7741: enhancement to tcpdump to print LCP/PAP/CHAP/IPCP frames Message-ID: <199808261510.IAA20254@freefall.freebsd.org>
index | next in thread | raw e-mail
The following reply was made to PR misc/7741; it has been noted by GNATS.
From: hm@hcs.de (Hellmuth Michaelis)
To: freebsd-gnats-submit@freebsd.org
Cc: Subject: Re: misc/7741: enhancement to tcpdump to print LCP/PAP/CHAP/IPCP frames
Date: Wed, 26 Aug 1998 17:03:56 +0200 (METDST)
This is a patch to the print_ppp.c from PR 7741. It now displays in addition
the IPCP codes in addition to the IP addresses:
*** print-ppp.c-PR Wed Aug 26 09:31:04 1998
--- print-ppp.c Wed Aug 26 09:51:31 1998
***************
*** 186,191 ****
--- 186,202 ----
/* IPCP */
+ #define IPCP_CODE_CFG_REQ 1
+ #define IPCP_CODE_CFG_ACK 2
+ #define IPCP_CODE_CFG_NAK 3
+ #define IPCP_CODE_CFG_REJ 4
+ #define IPCP_CODE_TRM_REQ 5
+ #define IPCP_CODE_TRM_ACK 6
+ #define IPCP_CODE_COD_REJ 7
+
+ #define IPCP_CODE_MIN IPCP_CODE_CFG_REQ
+ #define IPCP_CODE_MAX IPCP_CODE_COD_REJ
+
#define IPCP_2ADDR 1
#define IPCP_CP 2
#define IPCP_ADDR 3
***************
*** 453,482 ****
}
/* IPCP */
!
static int
handle_ipcp(const u_char *p, int length)
{
int x, j;
! x = *(p+8);
length -= 4;
! switch(x)
{
case IPCP_2ADDR:
! printf("IP-Addresses");
printf(", Src=%d.%d.%d.%d", *(p+10), *(p+11), *(p+12), *(p+13));
printf(", Dst=%d.%d.%d.%d", *(p+14), *(p+15), *(p+16), *(p+17));
break;
case IPCP_CP:
! printf("IP-Compression-Protocol");
break;
case IPCP_ADDR:
! printf("IP-Address=%d.%d.%d.%d", *(p+10), *(p+11), *(p+12), *(p+13));
break;
}
}
--- 464,507 ----
}
/* IPCP */
!
static int
handle_ipcp(const u_char *p, int length)
{
int x, j;
+ u_char *ptr;
! x = *(p+4);
!
! if((x >= IPCP_CODE_MIN) && (x <= IPCP_CODE_MAX))
! {
! printf("%s", lcpcodes[x-1]); /* share table with LCP */
! }
! else
! {
! printf("0x%02x", x);
! return;
! }
length -= 4;
! switch(*(p+8))
{
case IPCP_2ADDR:
! printf(", IP-Addresses");
printf(", Src=%d.%d.%d.%d", *(p+10), *(p+11), *(p+12), *(p+13));
printf(", Dst=%d.%d.%d.%d", *(p+14), *(p+15), *(p+16), *(p+17));
break;
case IPCP_CP:
! printf(", IP-Compression-Protocol");
break;
case IPCP_ADDR:
! printf(", IP-Address=%d.%d.%d.%d", *(p+10), *(p+11), *(p+12), *(p+13));
! break;
! default:
! printf(", Unknown IPCP code 0x%x", *(p+8));
break;
}
}
hellmuth
--
Hellmuth Michaelis Tel +49 40 559747-70
HCS Hanseatischer Computerservice GmbH Fax +49 40 559747-77
Oldesloer Strasse 97-99 Mail hm [at] hcs.de
22457 Hamburg WWW http://www.hcs.de
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
home |
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199808261510.IAA20254>
