]>
Commit | Line | Data |
---|---|---|
064af421 BP |
1 | --- tcpdump/interface.h 2007-06-13 18:03:20.000000000 -0700 |
2 | +++ tcpdump/interface.h 2008-04-15 18:28:55.000000000 -0700 | |
e0f3585d | 3 | @@ -130,7 +130,8 @@ |
064af421 BP |
4 | |
5 | extern const char *dnaddr_string(u_short); | |
6 | ||
7 | -extern void error(const char *, ...) | |
8 | +#define error(fmt, args...) tcpdump_error(fmt, ## args) | |
9 | +extern void tcpdump_error(const char *, ...) | |
10 | __attribute__((noreturn, format (printf, 1, 2))); | |
11 | extern void warning(const char *, ...) __attribute__ ((format (printf, 1, 2))); | |
12 | ||
e0f3585d | 13 | @@ -163,6 +164,7 @@ |
064af421 BP |
14 | extern void hex_print_with_offset(const char *, const u_char *, u_int, u_int); |
15 | extern void hex_print(const char *, const u_char *, u_int); | |
16 | extern void telnet_print(const u_char *, u_int); | |
17 | +extern void openflow_print(const u_char *, u_int); | |
064af421 BP |
18 | extern int llc_print(const u_char *, u_int, u_int, const u_char *, |
19 | const u_char *, u_short *); | |
e0f3585d JS |
20 | extern int snap_print(const u_char *, u_int, u_int, u_int); |
21 | --- tcpdump/Makefile.in 2012-06-13 04:56:20.000000000 +1200 | |
22 | +++ tcpdump/Makefile.in 2012-08-29 21:36:37.000000000 +1200 | |
23 | @@ -43,7 +43,7 @@ | |
24 | CC = @CC@ | |
25 | PROG = tcpdump | |
26 | CCOPT = @V_CCOPT@ | |
27 | -INCLS = -I. @V_INCLS@ | |
28 | +INCLS = -I. @V_INCLS@ -I../../include | |
29 | DEFS = @DEFS@ @CPPFLAGS@ @V_DEFS@ | |
30 | ||
31 | # Standard CFLAGS | |
32 | @@ -51,10 +51,10 @@ | |
33 | FULL_CFLAGS = $(CCOPT) $(DEFS) $(INCLS) $(CFLAGS) | |
064af421 BP |
34 | |
35 | # Standard LDFLAGS | |
36 | -LDFLAGS = @LDFLAGS@ | |
37 | +LDFLAGS = @LDFLAGS@ -L../../lib | |
38 | ||
39 | # Standard LIBS | |
40 | -LIBS = @LIBS@ | |
e0f3585d | 41 | +LIBS = @LIBS@ -lopenvswitch -lssl -lrt -lm |
064af421 BP |
42 | |
43 | INSTALL = @INSTALL@ | |
44 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | |
e0f3585d | 45 | @@ -93,7 +93,8 @@ |
064af421 | 46 | print-symantec.c print-syslog.c print-tcp.c print-telnet.c print-tftp.c \ |
e0f3585d JS |
47 | print-timed.c print-tipc.c print-token.c print-udld.c print-udp.c \ |
48 | print-usb.c print-vjc.c print-vqp.c print-vrrp.c print-vtp.c \ | |
49 | - print-wb.c print-zephyr.c signature.c setsignal.c tcpdump.c util.c | |
50 | + print-wb.c print-zephyr.c signature.c setsignal.c tcpdump.c util.c \ | |
064af421 BP |
51 | + print-openflow.c |
52 | ||
e0f3585d JS |
53 | LIBNETDISSECT_SRC=print-isakmp.c |
54 | LIBNETDISSECT_OBJ=$(LIBNETDISSECT_SRC:.c=.o) | |
bb1329ec BP |
55 | @@ -363,7 +364,7 @@ all: $(PROG) |
56 | ||
57 | $(PROG): $(OBJ) | |
58 | @rm -f $@ | |
59 | - $(CC) $(FULL_CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS) | |
60 | + libtool --mode=link $(CC) $(FULL_CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS) | |
61 | ||
62 | $(LIBNETDISSECT): $(LIBNETDISSECT_OBJ) | |
63 | @rm -f $@ | |
064af421 BP |
64 | --- tcpdump/print-openflow.c 1969-12-31 16:00:00.000000000 -0800 |
65 | +++ tcpdump/print-openflow.c 2009-05-11 15:38:41.000000000 -0700 | |
e0f3585d | 66 | @@ -0,0 +1,45 @@ |
e0edde6f | 67 | +/* Copyright (C) 2007, 2008, 2009 Nicira, Inc. |
a14bc59f BP |
68 | + |
69 | + Redistribution and use in source and binary forms, with or without | |
70 | + modification, are permitted provided that the following conditions | |
71 | + are met: | |
72 | + | |
73 | + 1. Redistributions of source code must retain the above copyright | |
74 | + notice, this list of conditions and the following disclaimer. | |
75 | + 2. Redistributions in binary form must reproduce the above copyright | |
76 | + notice, this list of conditions and the following disclaimer in | |
77 | + the documentation and/or other materials provided with the | |
78 | + distribution. | |
79 | + 3. The names of the authors may not be used to endorse or promote | |
80 | + products derived from this software without specific prior | |
81 | + written permission. | |
82 | + | |
83 | + THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR | |
84 | + IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED | |
85 | + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
064af421 | 86 | + */ |
064af421 BP |
87 | + |
88 | +#ifdef HAVE_CONFIG_H | |
89 | +#include "config.h" | |
90 | +#endif | |
91 | + | |
92 | +#include <stdlib.h> | |
93 | + | |
94 | +#include "interface.h" | |
e0f3585d | 95 | +#include "openflow/openflow.h" |
25d436fb | 96 | +#include "openvswitch/ofp-print.h" |
064af421 BP |
97 | + |
98 | +void | |
99 | +openflow_print(const u_char *sp, u_int length) | |
100 | +{ | |
101 | + const struct ofp_header *ofp = (struct ofp_header *)sp; | |
102 | + | |
103 | + if (!TTEST2(*sp, ntohs(ofp->length))) | |
104 | + goto trunc; | |
105 | + | |
106 | + ofp_print(stdout, sp, length, vflag); | |
107 | + return; | |
108 | + | |
109 | +trunc: | |
110 | + printf("[|openflow]"); | |
111 | +} | |
112 | --- tcpdump/print-tcp.c 2006-09-19 12:07:57.000000000 -0700 | |
113 | +++ tcpdump/print-tcp.c 2009-05-11 15:38:25.000000000 -0700 | |
e0f3585d | 114 | @@ -56,6 +56,8 @@ |
064af421 BP |
115 | |
116 | #include "nameser.h" | |
117 | ||
e0f3585d | 118 | +#include "openflow/openflow.h" |
064af421 BP |
119 | + |
120 | #ifdef HAVE_LIBCRYPTO | |
121 | #include <openssl/md5.h> | |
e0f3585d JS |
122 | #include <signature.h> |
123 | @@ -669,7 +672,9 @@ | |
124 | } | |
125 | else if (length > 0 && (sport == LDP_PORT || dport == LDP_PORT)) { | |
126 | ldp_print(bp, length); | |
127 | - } | |
d4763d1d | 128 | + } else if (sport == OFP_PORT || dport == OFP_PORT) { |
e0f3585d JS |
129 | + openflow_print(bp, length); |
130 | + } | |
064af421 | 131 | |
e0f3585d JS |
132 | return; |
133 | bad: |