Other parts of OVS have moved on since the tcpdump patch was created. This
commit brings the patch up to date and will compile cleanly against
tcpdump-4.3.0.
Signed-off-by: Joe Stringer <joe@wand.net.nz>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
tcpdump
-------
The "ofp-tcpdump.patch" patch adds the ability to parse OpenFlow
tcpdump
-------
The "ofp-tcpdump.patch" patch adds the ability to parse OpenFlow
-messages to tcpdump. These instructions assume that tcpdump 3.9.8
+messages to tcpdump. These instructions assume that tcpdump 4.3.0
is going to be used, but it should work with other versions that are not
substantially different. To begin, download tcpdump and apply the
patch:
is going to be used, but it should work with other versions that are not
substantially different. To begin, download tcpdump and apply the
patch:
- wget http://www.tcpdump.org/release/tcpdump-3.9.8.tar.gz
- tar xzf tcpdump-3.9.8.tar.gz
- ln -s tcpdump-3.9.8 tcpdump
+ wget http://www.tcpdump.org/release/tcpdump-4.3.0.tar.gz
+ tar xzf tcpdump-4.3.0.tar.gz
+ ln -s tcpdump-4.3.0 tcpdump
patch -p0 < ofp-tcpdump.patch
Then build the new version of tcpdump:
patch -p0 < ofp-tcpdump.patch
Then build the new version of tcpdump:
--- tcpdump/interface.h 2007-06-13 18:03:20.000000000 -0700
+++ tcpdump/interface.h 2008-04-15 18:28:55.000000000 -0700
--- tcpdump/interface.h 2007-06-13 18:03:20.000000000 -0700
+++ tcpdump/interface.h 2008-04-15 18:28:55.000000000 -0700
extern const char *dnaddr_string(u_short);
extern const char *dnaddr_string(u_short);
__attribute__((noreturn, format (printf, 1, 2)));
extern void warning(const char *, ...) __attribute__ ((format (printf, 1, 2)));
__attribute__((noreturn, format (printf, 1, 2)));
extern void warning(const char *, ...) __attribute__ ((format (printf, 1, 2)));
extern void hex_print_with_offset(const char *, const u_char *, u_int, u_int);
extern void hex_print(const char *, const u_char *, u_int);
extern void telnet_print(const u_char *, u_int);
+extern void openflow_print(const u_char *, u_int);
extern void hex_print_with_offset(const char *, const u_char *, u_int, u_int);
extern void hex_print(const char *, const u_char *, u_int);
extern void telnet_print(const u_char *, u_int);
+extern void openflow_print(const u_char *, u_int);
- extern int ether_encap_print(u_short, const u_char *, u_int, u_int, u_short *);
extern int llc_print(const u_char *, u_int, u_int, const u_char *,
const u_char *, u_short *);
extern int llc_print(const u_char *, u_int, u_int, const u_char *,
const u_char *, u_short *);
---- tcpdump/Makefile.in 2007-09-25 18:59:52.000000000 -0700
-+++ tcpdump/Makefile.in 2009-05-11 15:59:28.000000000 -0700
-@@ -49,10 +49,10 @@
- CFLAGS = $(CCOPT) $(DEFS) $(INCLS)
+ extern int snap_print(const u_char *, u_int, u_int, u_int);
+--- tcpdump/Makefile.in 2012-06-13 04:56:20.000000000 +1200
++++ tcpdump/Makefile.in 2012-08-29 21:36:37.000000000 +1200
+@@ -43,7 +43,7 @@
+ CC = @CC@
+ PROG = tcpdump
+ CCOPT = @V_CCOPT@
+-INCLS = -I. @V_INCLS@
++INCLS = -I. @V_INCLS@ -I../../include
+ DEFS = @DEFS@ @CPPFLAGS@ @V_DEFS@
+
+ # Standard CFLAGS
+@@ -51,10 +51,10 @@
+ FULL_CFLAGS = $(CCOPT) $(DEFS) $(INCLS) $(CFLAGS)
# Standard LDFLAGS
-LDFLAGS = @LDFLAGS@
# Standard LDFLAGS
-LDFLAGS = @LDFLAGS@
# Standard LIBS
-LIBS = @LIBS@
# Standard LIBS
-LIBS = @LIBS@
-+LIBS = @LIBS@ -lopenvswitch
++LIBS = @LIBS@ -lopenvswitch -lssl -lrt -lm
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
-@@ -87,7 +87,8 @@
- print-slow.c print-snmp.c print-stp.c print-sunatm.c print-sunrpc.c \
print-symantec.c print-syslog.c print-tcp.c print-telnet.c print-tftp.c \
print-symantec.c print-syslog.c print-tcp.c print-telnet.c print-tftp.c \
- print-timed.c print-token.c print-udp.c print-vjc.c print-vrrp.c \
-- print-wb.c print-zephyr.c setsignal.c tcpdump.c util.c
-+ print-wb.c print-zephyr.c setsignal.c tcpdump.c util.c \
+ print-timed.c print-tipc.c print-token.c print-udld.c print-udp.c \
+ print-usb.c print-vjc.c print-vqp.c print-vrrp.c print-vtp.c \
+- print-wb.c print-zephyr.c signature.c setsignal.c tcpdump.c util.c
++ print-wb.c print-zephyr.c signature.c setsignal.c tcpdump.c util.c \
- LOCALSRC = @LOCALSRC@
- GENSRC = version.c
+ LIBNETDISSECT_SRC=print-isakmp.c
+ LIBNETDISSECT_OBJ=$(LIBNETDISSECT_SRC:.c=.o)
--- tcpdump/print-openflow.c 1969-12-31 16:00:00.000000000 -0800
+++ tcpdump/print-openflow.c 2009-05-11 15:38:41.000000000 -0700
--- tcpdump/print-openflow.c 1969-12-31 16:00:00.000000000 -0800
+++ tcpdump/print-openflow.c 2009-05-11 15:38:41.000000000 -0700
+/* Copyright (C) 2007, 2008, 2009 Nicira, Inc.
+
+ Redistribution and use in source and binary forms, with or without
+/* Copyright (C) 2007, 2008, 2009 Nicira, Inc.
+
+ Redistribution and use in source and binary forms, with or without
+ IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ */
+ IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#include <stdlib.h>
+
+#include "interface.h"
+#include <stdlib.h>
+
+#include "interface.h"
-+#include "../../include/openflow/openflow.h"
++#include "openflow/openflow.h"
+#include "../../lib/ofp-print.h"
+
+void
+#include "../../lib/ofp-print.h"
+
+void
+}
--- tcpdump/print-tcp.c 2006-09-19 12:07:57.000000000 -0700
+++ tcpdump/print-tcp.c 2009-05-11 15:38:25.000000000 -0700
+}
--- tcpdump/print-tcp.c 2006-09-19 12:07:57.000000000 -0700
+++ tcpdump/print-tcp.c 2009-05-11 15:38:25.000000000 -0700
-+#include "../../include/openflow/openflow.h"
++#include "openflow/openflow.h"
+
#ifdef HAVE_LIBCRYPTO
#include <openssl/md5.h>
+
#ifdef HAVE_LIBCRYPTO
#include <openssl/md5.h>
+ #include <signature.h>
+@@ -669,7 +672,9 @@
+ }
+ else if (length > 0 && (sport == LDP_PORT || dport == LDP_PORT)) {
+ ldp_print(bp, length);
+- }
++ } else if (sport == OFP_TCP_PORT || dport == OFP_TCP_PORT) {
++ openflow_print(bp, length);
++ }
-@@ -680,7 +682,8 @@
- }
- else if (length > 0 && (sport == LDP_PORT || dport == LDP_PORT)) {
- ldp_print(bp, length);
-- }
-+ } else if (sport == OFP_TCP_PORT || dport == OFP_TCP_PORT)
-+ openflow_print(bp, length);
- }
- return;
- bad: