components/tcpdump/patches/10-arphrd-infiniband.patch
changeset 1001 cc349e8980c4
parent 442 d0e244fcfff1
child 1632 fd2ec3291103
equal deleted inserted replaced
1000:2f010ce739be 1001:cc349e8980c4
     1 diff -uN tcpdump-4.1.1/Makefile.in tcpdump-4.1.1.new/Makefile.in
     1 diff -uN tcpdump-4.3.0/Makefile.in tcpdump-4.3.0.new/Makefile.in
     2 --- tcpdump-4.1.1/Makefile.in	2010-04-05 18:18:35.000000000 -0700
     2 --- tcpdump-4.3.0/Makefile.in	2010-04-05 18:18:35.000000000 -0700
     3 +++ tcpdump-4.1.1.new/Makefile.in	2011-07-14 08:43:36.561637014 -0700
     3 +++ tcpdump-4.3.0.new/Makefile.in	2011-07-14 08:43:36.561637014 -0700
     4 @@ -78,6 +78,7 @@
     4 @@ -78,6 +78,7 @@
     5  	print-esp.c print-ether.c print-fddi.c print-fr.c \
     5  	print-esp.c print-ether.c print-fddi.c print-fr.c \
     6  	print-gre.c print-hsrp.c print-icmp.c print-igmp.c \
     6  	print-gre.c print-hsrp.c print-icmp.c print-igmp.c \
     7  	print-igrp.c print-ip.c print-ipcomp.c print-ipfc.c print-ipnet.c \
     7  	print-igrp.c print-ip.c print-ipcomp.c print-ipfc.c print-ipnet.c \
     8 +	print-ipoib.c \
     8 +	print-ipoib.c \
     9  	print-ipx.c print-isoclns.c print-juniper.c print-krb.c \
     9  	print-ipx.c print-isoclns.c print-juniper.c print-krb.c \
    10  	print-l2tp.c print-lane.c print-ldp.c print-lldp.c print-llc.c \
    10  	print-l2tp.c print-lane.c print-ldp.c print-lldp.c print-llc.c \
    11          print-lmp.c print-lspping.c print-lwapp.c \
    11          print-lmp.c print-lspping.c print-lwapp.c \
    12 diff -uN tcpdump-4.1.1/interface.h tcpdump-4.1.1.new/interface.h
    12 diff -uN tcpdump-4.3.0/interface.h tcpdump-4.3.0.new/interface.h
    13 --- tcpdump-4.1.1/interface.h	2010-03-11 17:56:44.000000000 -0800
    13 --- tcpdump-4.3.0/interface.h	2010-03-11 17:56:44.000000000 -0800
    14 +++ tcpdump-4.1.1.new/interface.h	2011-07-14 08:44:55.908614708 -0700
    14 +++ tcpdump-4.3.0.new/interface.h	2011-07-14 08:44:55.908614708 -0700
    15 @@ -192,6 +192,7 @@
    15 @@ -185,6 +185,7 @@
    16  extern void ether_print(const u_char *, u_int, u_int,
    16  extern u_int pflog_if_print(const struct pcap_pkthdr *, const u_char *);
    17      void (*)(const u_char *), const u_char *);
    17  extern u_int arcnet_if_print(const struct pcap_pkthdr *, const u_char *);
    18  extern u_int ether_if_print(const struct pcap_pkthdr *, const u_char *);
    18  extern u_int arcnet_linux_if_print(const struct pcap_pkthdr *, const u_char *);
    19 +extern u_int ipoib_if_print(const struct pcap_pkthdr *, const u_char *);
    19 +extern u_int ipoib_if_print(const struct pcap_pkthdr *, const u_char *);
    20  extern u_int token_print(const u_char *, u_int, u_int);
    20  extern u_int token_print(const u_char *, u_int, u_int);
    21  extern u_int token_if_print(const struct pcap_pkthdr *, const u_char *);
    21  extern u_int token_if_print(const struct pcap_pkthdr *, const u_char *);
    22  extern void fddi_print(const u_char *, u_int, u_int);
    22  extern void fddi_print(const u_char *, u_int, u_int);
    23 Common subdirectories: tcpdump-4.1.1/lbl and tcpdump-4.1.1.new/lbl
    23 Common subdirectories: tcpdump-4.3.0/lbl and tcpdump-4.3.0.new/lbl
    24 Common subdirectories: tcpdump-4.1.1/missing and tcpdump-4.1.1.new/missing
    24 Common subdirectories: tcpdump-4.3.0/missing and tcpdump-4.3.0.new/missing
    25 diff -uN tcpdump-4.1.1/netdissect.h tcpdump-4.1.1.new/netdissect.h
    25 diff -uN tcpdump-4.3.0/netdissect.h tcpdump-4.3.0.new/netdissect.h
    26 --- tcpdump-4.1.1/netdissect.h	2010-03-11 17:56:44.000000000 -0800
    26 --- tcpdump-4.3.0/netdissect.h	2010-03-11 17:56:44.000000000 -0800
    27 +++ tcpdump-4.1.1.new/netdissect.h	2011-07-14 08:44:35.643598462 -0700
    27 +++ tcpdump-4.3.0.new/netdissect.h	2011-07-14 08:44:35.643598462 -0700
    28 @@ -320,6 +320,7 @@
    28 @@ -300,6 +300,7 @@
    29  
    29  
    30  extern void arcnet_if_print(u_char*,const struct pcap_pkthdr *,const u_char *);
    30  extern u_int ether_if_print(netdissect_options *, 
    31  extern void ether_if_print(u_char *,const struct pcap_pkthdr *,const u_char *);
    31                              const struct pcap_pkthdr *,const u_char *);
    32 +extern void ipoib_if_print(u_char *,const struct pcap_pkthdr *,const u_char *);
    32 +extern u_int ipoib_if_print(const struct pcap_pkthdr *, const u_char *);
    33  extern void token_if_print(u_char *,const struct pcap_pkthdr *,const u_char *);
    33  extern u_int netanalyzer_if_print(netdissect_options *, 
    34  extern void fddi_if_print(u_char *,const struct pcap_pkthdr *, const u_char *);
    34                                    const struct pcap_pkthdr *,const u_char *);
    35  
    35  extern u_int netanalyzer_transparent_if_print(netdissect_options *, 
    36 diff -uN tcpdump-4.1.1/print-arp.c tcpdump-4.1.1.new/print-arp.c
    36  
    37 --- tcpdump-4.1.1/print-arp.c	2010-03-11 17:56:44.000000000 -0800
    37 diff -uN tcpdump-4.3.0/print-arp.c tcpdump-4.3.0.new/print-arp.c
    38 +++ tcpdump-4.1.1.new/print-arp.c	2011-07-14 09:01:08.965396346 -0700
    38 --- tcpdump-4.3.0/print-arp.c	2010-03-11 17:56:44.000000000 -0800
       
    39 +++ tcpdump-4.3.0.new/print-arp.c	2011-07-14 09:01:08.965396346 -0700
    39 @@ -62,6 +62,7 @@
    40 @@ -62,6 +62,7 @@
    40          u_char  ar_hln;         /* length of hardware address */
    41          u_char  ar_hln;         /* length of hardware address */
    41          u_char  ar_pln;         /* length of protocol address */
    42          u_char  ar_pln;         /* length of protocol address */
    42          u_short ar_op;          /* one of: */
    43          u_short ar_op;          /* one of: */
    43 +#define ARPHRD_INFINIBAND 32    /* Infiniband RFC 4391 */
    44 +#define ARPHRD_INFINIBAND 32    /* Infiniband RFC 4391 */
    50      { ARPHRD_ATM2225, "ATM" },
    51      { ARPHRD_ATM2225, "ATM" },
    51 +    { ARPHRD_INFINIBAND, "Infiniband" },
    52 +    { ARPHRD_INFINIBAND, "Infiniband" },
    52      { 0, NULL }
    53      { 0, NULL }
    53  };
    54  };
    54  
    55  
    55 diff -uN tcpdump-4.1.1/print-ipoib.c tcpdump-4.1.1.new/print-ipoib.c
    56 diff -uN tcpdump-4.3.0/print-ipoib.c tcpdump-4.3.0.new/print-ipoib.c
    56 --- tcpdump-4.1.1/print-ipoib.c	1969-12-31 16:00:00.000000000 -0800
    57 --- tcpdump-4.3.0/print-ipoib.c	1969-12-31 16:00:00.000000000 -0800
    57 +++ tcpdump-4.1.1.new/print-ipoib.c	2011-07-14 08:46:52.029342720 -0700
    58 +++ tcpdump-4.3.0.new/print-ipoib.c	2011-07-14 08:46:52.029342720 -0700
    58 @@ -0,0 +1,131 @@
    59 @@ -0,0 +1,131 @@
    59 +/*
    60 +/*
    60 + * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000
    61 + * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 
       
    62 + *	1997, 2000, 2011, 2012
    61 + *	The Regents of the University of California.  All rights reserved.
    63 + *	The Regents of the University of California.  All rights reserved.
    62 + *
    64 + *
    63 + * Redistribution and use in source and binary forms, with or without
    65 + * Redistribution and use in source and binary forms, with or without
    64 + * modification, are permitted provided that: (1) source code distributions
    66 + * modification, are permitted provided that: (1) source code distributions
    65 + * retain the above copyright notice and this paragraph in its entirety, (2)
    67 + * retain the above copyright notice and this paragraph in its entirety, (2)
    75 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
    77 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
    76 + * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
    78 + * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
    77 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
    79 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
    78 + */
    80 + */
    79 +/*
    81 +/*
    80 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
    82 + * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
    81 + */
    83 + */
    82 +#ifndef lint
    84 +#ifndef lint
    83 +static const char rcsid[] _U_ =
    85 +static const char rcsid[] _U_ =
    84 +    "@(#) $Header$";
    86 +    "@(#) $Header$";
    85 +#endif
    87 +#endif
    96 +#include "interface.h"
    98 +#include "interface.h"
    97 +#include "extract.h"
    99 +#include "extract.h"
    98 +#include "addrtoname.h"
   100 +#include "addrtoname.h"
    99 +
   101 +
   100 +extern const struct tok ethertype_values[];
   102 +extern const struct tok ethertype_values[];
   101 +extern int ethertype_print(u_short, const u_char *, u_int, u_int );
   103 +extern int ethertype_print(netdissect_options *, u_short, const u_char *, u_int, u_int );
   102 +
   104 +
   103 +#define	IPOIB_HDRLEN	44
   105 +#define	IPOIB_HDRLEN	44
   104 +
   106 +
   105 +static inline void
   107 +static inline void
   106 +ipoib_hdr_print(register const u_char *bp, u_int length)
   108 +ipoib_hdr_print(register const u_char *bp, u_int length)
   151 +	length -= IPOIB_HDRLEN;
   153 +	length -= IPOIB_HDRLEN;
   152 +	caplen -= IPOIB_HDRLEN;
   154 +	caplen -= IPOIB_HDRLEN;
   153 +	ether_type = EXTRACT_16BITS(&p[40]);
   155 +	ether_type = EXTRACT_16BITS(&p[40]);
   154 +	p += IPOIB_HDRLEN;
   156 +	p += IPOIB_HDRLEN;
   155 +
   157 +
   156 +	if (ethertype_print(ether_type, p, length, caplen) == 0) {
   158 +	if (ethertype_print(gndo, ether_type, p, length, caplen) == 0) {
   157 +		/* ether_type not known, print raw packet */
   159 +		/* ether_type not known, print raw packet */
   158 +		if (!eflag) {
   160 +		if (!eflag) {
   159 +			if (print_encap_header != NULL)
   161 +			if (print_encap_header != NULL)
   160 +				(*print_encap_header)(encap_header_arg);
   162 +				(*print_encap_header)(encap_header_arg);
   161 +			ipoib_hdr_print(orig_hdr , orig_length);
   163 +			ipoib_hdr_print(orig_hdr , orig_length);
   185 + * c-style: whitesmith
   187 + * c-style: whitesmith
   186 + * c-basic-offset: 8
   188 + * c-basic-offset: 8
   187 + * End:
   189 + * End:
   188 + */
   190 + */
   189 +
   191 +
   190 diff -uN tcpdump-4.1.1/tcpdump.c tcpdump-4.1.1.new/tcpdump.c
   192 diff -uN tcpdump-4.3.0/tcpdump.c tcpdump-4.3.0.new/tcpdump.c
   191 --- tcpdump-4.1.1/tcpdump.c	2010-03-11 17:56:44.000000000 -0800
   193 --- tcpdump-4.3.0/tcpdump.c	2010-03-11 17:56:44.000000000 -0800
   192 +++ tcpdump-4.1.1.new/tcpdump.c	2011-07-14 08:44:25.329300635 -0700
   194 +++ tcpdump-4.3.0.new/tcpdump.c	2011-07-14 08:44:25.329300635 -0700
   193 @@ -299,6 +299,9 @@
   195 @@ -299,6 +299,9 @@
   194  #ifdef DLT_IPV6
   196  #ifdef DLT_IPV6
   195  	{ raw_if_print,		DLT_IPV6 },
   197  	{ raw_if_print,		DLT_IPV6 },
   196  #endif
   198  #endif
   197 +#ifdef DLT_IPOIB
   199 +#ifdef DLT_IPOIB