1 diff -rNu tcpdump/interface.h tcpdump/interface.h
2 --- tcpdump/interface.h 2007-06-13 18:03:20.000000000 -0700
3 +++ tcpdump/interface.h 2008-02-06 15:06:30.000000000 -0800
6 extern const char *dnaddr_string(u_short);
8 -extern void error(const char *, ...)
9 +#define error(fmt, args...) tcpdump_error(fmt, ## args)
10 +extern void tcpdump_error(const char *, ...)
11 __attribute__((noreturn, format (printf, 1, 2)));
12 extern void warning(const char *, ...) __attribute__ ((format (printf, 1, 2)));
15 extern void hex_print_with_offset(const char *, const u_char *, u_int, u_int);
16 extern void hex_print(const char *, const u_char *, u_int);
17 extern void telnet_print(const u_char *, u_int);
18 +extern void openflow_print(const u_char *, u_int);
19 extern int ether_encap_print(u_short, const u_char *, u_int, u_int, u_short *);
20 extern int llc_print(const u_char *, u_int, u_int, const u_char *,
21 const u_char *, u_short *);
22 diff -rNu tcpdump/Makefile.in tcpdump/Makefile.in
23 --- tcpdump/Makefile.in 2007-09-25 18:59:52.000000000 -0700
24 +++ tcpdump/Makefile.in 2008-02-07 11:46:03.000000000 -0800
26 CFLAGS = $(CCOPT) $(DEFS) $(INCLS)
30 +LDFLAGS = @LDFLAGS@ -L../../lib
34 +LIBS = @LIBS@ -lopenflow
37 INSTALL_PROGRAM = @INSTALL_PROGRAM@
39 print-slow.c print-snmp.c print-stp.c print-sunatm.c print-sunrpc.c \
40 print-symantec.c print-syslog.c print-tcp.c print-telnet.c print-tftp.c \
41 print-timed.c print-token.c print-udp.c print-vjc.c print-vrrp.c \
42 - print-wb.c print-zephyr.c setsignal.c tcpdump.c util.c
43 + print-wb.c print-zephyr.c setsignal.c tcpdump.c util.c \
48 diff -rNu tcpdump/print-openflow.c tcpdump/print-openflow.c
49 --- tcpdump/print-openflow.c 1969-12-31 16:00:00.000000000 -0800
50 +++ tcpdump/print-openflow.c 2008-02-07 11:29:01.000000000 -0800
52 +/* Copyright (C) 2007, 2008 Board of Trustees, Leland Stanford Jr. University.
54 + * Permission is hereby granted, free of charge, to any person obtaining a copy
55 + * of this software and associated documentation files (the "Software"), to
56 + * deal in the Software without restriction, including without limitation the
57 + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
58 + * sell copies of the Software, and to permit persons to whom the Software is
59 + * furnished to do so, subject to the following conditions:
61 + * The above copyright notice and this permission notice shall be included in
62 + * all copies or substantial portions of the Software.
64 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
65 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
66 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
67 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
68 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
69 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
80 +#include "interface.h"
81 +#include "../../include/openflow.h"
82 +#include "../../include/ofp-print.h"
85 +openflow_print(const u_char *sp, u_int length)
87 + const struct ofp_header *ofp = (struct ofp_header *)sp;
89 + if (!TTEST2(*sp, ntohs(ofp->length)))
92 + ofp_print(stdout, sp, length, vflag);
96 + printf("[|openflow]");
98 diff -rNu tcpdump/print-tcp.c tcpdump/print-tcp.c
99 --- tcpdump/print-tcp.c 2006-09-19 12:07:57.000000000 -0700
100 +++ tcpdump/print-tcp.c 2008-02-07 13:07:58.000000000 -0800
105 +#include "../../include/openflow.h"
107 #ifdef HAVE_LIBCRYPTO
108 #include <openssl/md5.h>
112 else if (length > 0 && (sport == LDP_PORT || dport == LDP_PORT)) {
113 ldp_print(bp, length);
115 + } else if (sport == OFP_TCP_PORT || dport == OFP_TCP_PORT)
116 + openflow_print(bp, length);