print-ip.c (26183) | print-ip.c (39300) |
---|---|
1/* | 1/* |
2 * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996 | 2 * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 |
3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that: (1) source code distributions 7 * retain the above copyright notice and this paragraph in its entirety, (2) 8 * distributions including binary code include the above copyright notice and 9 * this paragraph in its entirety in the documentation or other materials 10 * provided with the distribution, and (3) all advertising materials mentioning --- 5 unchanged lines hidden (view full) --- 16 * written permission. 17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED 18 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 20 */ 21 22#ifndef lint 23static const char rcsid[] = | 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that: (1) source code distributions 7 * retain the above copyright notice and this paragraph in its entirety, (2) 8 * distributions including binary code include the above copyright notice and 9 * this paragraph in its entirety in the documentation or other materials 10 * provided with the distribution, and (3) all advertising materials mentioning --- 5 unchanged lines hidden (view full) --- 16 * written permission. 17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED 18 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 20 */ 21 22#ifndef lint 23static const char rcsid[] = |
24 "@(#) $Header: print-ip.c,v 1.62 96/12/10 23:20:31 leres Exp $ (LBL)"; | 24 "@(#) $Header: print-ip.c,v 1.66 97/05/28 12:51:43 leres Exp $ (LBL)"; |
25#endif 26 27#include <sys/param.h> 28#include <sys/time.h> 29#include <sys/socket.h> 30 31#include <netinet/in.h> 32#include <netinet/in_systm.h> 33#include <netinet/ip.h> 34#include <netinet/ip_var.h> 35#include <netinet/udp.h> 36#include <netinet/udp_var.h> 37#include <netinet/tcp.h> 38#include <netinet/tcpip.h> 39 | 25#endif 26 27#include <sys/param.h> 28#include <sys/time.h> 29#include <sys/socket.h> 30 31#include <netinet/in.h> 32#include <netinet/in_systm.h> 33#include <netinet/ip.h> 34#include <netinet/ip_var.h> 35#include <netinet/udp.h> 36#include <netinet/udp_var.h> 37#include <netinet/tcp.h> 38#include <netinet/tcpip.h> 39 |
40#ifdef HAVE_MALLOC_H 41#include <malloc.h> 42#endif |
|
40#include <stdio.h> 41#include <stdlib.h> 42#include <string.h> 43#include <unistd.h> 44 45#include "addrtoname.h" 46#include "interface.h" 47#include "extract.h" /* must come after interface.h */ --- 392 unchanged lines hidden (view full) --- 440 441#ifndef IPPROTO_IGMP 442#define IPPROTO_IGMP 2 443#endif 444 case IPPROTO_IGMP: 445 igmp_print(cp, len, (const u_char *)ip); 446 break; 447 | 43#include <stdio.h> 44#include <stdlib.h> 45#include <string.h> 46#include <unistd.h> 47 48#include "addrtoname.h" 49#include "interface.h" 50#include "extract.h" /* must come after interface.h */ --- 392 unchanged lines hidden (view full) --- 443 444#ifndef IPPROTO_IGMP 445#define IPPROTO_IGMP 2 446#endif 447 case IPPROTO_IGMP: 448 igmp_print(cp, len, (const u_char *)ip); 449 break; 450 |
448#ifndef IPPROTO_IPIP 449#define IPPROTO_IPIP 4 450#endif 451 case IPPROTO_IPIP: 452 /* ip-in-ip encapsulation */ | 451 case 4: 452 /* DVMRP multicast tunnel (ip-in-ip encapsulation) */ |
453 if (vflag) 454 (void)printf("%s > %s: ", 455 ipaddr_string(&ip->ip_src), 456 ipaddr_string(&ip->ip_dst)); 457 ip_print(cp, len); 458 if (! vflag) { | 453 if (vflag) 454 (void)printf("%s > %s: ", 455 ipaddr_string(&ip->ip_src), 456 ipaddr_string(&ip->ip_dst)); 457 ip_print(cp, len); 458 if (! vflag) { |
459 printf(" (encap)"); | 459 printf(" (ipip)"); |
460 return; 461 } 462 break; 463 464#ifndef IPPROTO_GRE 465#define IPPROTO_GRE 47 466#endif 467 case IPPROTO_GRE: --- 71 unchanged lines hidden --- | 460 return; 461 } 462 break; 463 464#ifndef IPPROTO_GRE 465#define IPPROTO_GRE 47 466#endif 467 case IPPROTO_GRE: --- 71 unchanged lines hidden --- |