]> The Tcpdump Group git mirrors - tcpdump/commitdiff
gre: add support for WCCP redirects over GRE.
authorGuy Harris <[email protected]>
Sun, 9 Apr 2023 05:11:28 +0000 (22:11 -0700)
committerGuy Harris <[email protected]>
Sun, 9 Apr 2023 05:11:28 +0000 (22:11 -0700)
Add a test capture for it - and for GRE keepalives.

Both this and the previous GRE keepalive changes are based on OpenBSD
code.

print-gre.c
tests/TESTLIST
tests/various_gre.out [new file with mode: 0644]
tests/various_gre.pcap [new file with mode: 0644]
tests/wccp_redirect_gre.out [new file with mode: 0644]
tests/wccp_redirect_gre.pcap [new file with mode: 0644]

index f1efa0f241b0be8f67e4e335d0707c1ef5179a3e..afac03ac2e27dd09181bf7d02496528d716f513b 100644 (file)
@@ -81,6 +81,21 @@ static const struct tok gre_flag_values[] = {
 #define        GRESRE_IP       0x0800          /* IP */
 #define        GRESRE_ASN      0xfffe          /* ASN */
 
+/*
+ * Ethertype values used for GRE (but not elsewhere?).
+ */
+#define GRE_WCCP               0x883e  /* Web Cache C* Protocol */
+
+struct wccp_redirect {
+       nd_uint8_t      flags;
+#define WCCP_T                 (1 << 7)
+#define WCCP_A                 (1 << 6)
+#define WCCP_U                 (1 << 5)
+       nd_uint8_t      ServiceId;
+       nd_uint8_t      AltBucket;
+       nd_uint8_t      PriBucket;
+};
+
 static void gre_print_0(netdissect_options *, const u_char *, u_int);
 static void gre_print_1(netdissect_options *, const u_char *, u_int);
 static int gre_sre_print(netdissect_options *, uint16_t, uint8_t, uint8_t, const u_char *, u_int);
@@ -221,6 +236,52 @@ gre_print_0(netdissect_options *ndo, const u_char *bp, u_int length)
                 */
                printf("keep-alive");
                break;
+       case GRE_WCCP:
+               /*
+                * This is a bit weird.
+                *
+                * This may either just mean "IPv4" or it may mean
+                * "IPv4 preceded by a WCCP redirect header".  We
+                * check to seeif the first octet looks like the
+                * beginning of an IPv4 header and, if not, dissect
+                * it "IPv4 preceded by a WCCP redirect header",
+                * otherwise we dissect it as just IPv4.
+                *
+                * See "Packet redirection" in draft-forster-wrec-wccp-v1-00,
+                * scetion 4.12 "Traffic Forwarding" in
+                * draft-wilson-wrec-wccp-v2-01, and section 3.12.1
+                * "Forwarding using GRE Encapsulation" in
+                * draft-param-wccp-v2rev1-01.
+                */
+               ND_PRINT("wccp ");
+
+               ND_ICHECK_U(len, <, 1);
+               if (GET_U_1(bp) >> 4 != 4) {
+                       /*
+                        * First octet isn't 0x4*, so it's not IPv4.
+                        */
+                       const struct wccp_redirect *wccp;
+                       uint8_t wccp_flags;
+
+                       ND_ICHECK_ZU(len, <, sizeof(*wccp));
+                       wccp = (const struct wccp_redirect *)bp;
+                       wccp_flags = GET_U_1(wccp->flags);
+
+                       ND_PRINT("T:%c A:%c U:%c SId:%u Alt:%u Pri:%u",
+                           (wccp_flags & WCCP_T) ? '1' : '0',
+                           (wccp_flags & WCCP_A) ? '1' : '0',
+                           (wccp_flags & WCCP_U) ? '1' : '0',
+                           GET_U_1(wccp->ServiceId),
+                           GET_U_1(wccp->AltBucket),
+                           GET_U_1(wccp->PriBucket));
+
+                       bp += sizeof(*wccp);
+                       len -= sizeof(*wccp);
+
+                       printf(": ");
+               }
+               /* FALLTHROUGH */
+               break;
        case ETHERTYPE_IP:
                ip_print(ndo, bp, len);
                break;
index f8d6ab63da10347c67e349595687f35f4ba7b0e4..ab96c8dbf98f3329928d683865c5d53ff3c1f7a1 100644 (file)
@@ -901,3 +901,9 @@ quic_handshake                      quic_handshake.pcap             quic_handshake.out      -v
 quic_handshake_truncated       quic_handshake_truncated.pcap   quic_handshake_truncated.out    -v
 quic_retry                     quic_retry.pcap                 quic_retry.out  -v
 gquic                          gquic.pcap                      gquic.out       -v
+
+# GRE keepalives, CDP over GRE
+various_gre                    various_gre.pcap                various_gre.out -v
+
+# WCCP redirect over GRE
+wccp_redirect_gre              wccp_redirect_gre.pcap          wccp_redirect_gre.out   -v
diff --git a/tests/various_gre.out b/tests/various_gre.out
new file mode 100644 (file)
index 0000000..3363768
--- /dev/null
@@ -0,0 +1,306 @@
+    1  09:45:01.394037 Loopback, skipCount 0, Reply, receipt number 0, data (44 octets)
+    2  09:45:01.623859 STP 802.1d, Config, Flags [none], bridge-id 84bd.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 84bd.aa:bb:cc:00:03:00, root-pathcost 0
+    3  09:45:02.038883 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 35
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
+    4  09:45:02.038987 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
+    5  09:45:03.624965 STP 802.1d, Config, Flags [none], bridge-id 84bd.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 84bd.aa:bb:cc:00:03:00, root-pathcost 0
+    6  09:45:04.045591 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 35
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
+    7  09:45:04.045722 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
+    8  09:45:05.624960 STP 802.1d, Config, Flags [none], bridge-id 84bd.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 84bd.aa:bb:cc:00:03:00, root-pathcost 0
+    9  09:45:06.048563 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 35
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
+   10  09:45:06.048815 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
+   11  09:45:07.471682 IP (tos 0xc0, ttl 255, id 164, offset 0, flags [none], proto GRE (47), length 64)
+    10.172.64.7 > 10.172.64.6: GREv0, Flags [key present], key=0x28, length 44
+       gre-proto-0x8909
+   12  09:45:07.472073 IP (tos 0xc0, ttl 254, id 163, offset 0, flags [none], proto GRE (47), length 28)
+    10.172.64.6 > 10.172.64.7: GREv0, Flags [key present], key=0x28, length 8
+       keep-alive
+   13  09:45:07.629913 STP 802.1d, Config, Flags [none], bridge-id 84bd.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 84bd.aa:bb:cc:00:03:00, root-pathcost 0
+   14  09:45:08.055445 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 35
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
+   15  09:45:08.055695 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
+   16  09:45:09.443471 IP (tos 0xc0, ttl 255, id 144, offset 0, flags [none], proto GRE (47), length 64)
+    10.172.64.6 > 10.172.64.7: GREv0, Flags [key present], key=0x28, length 44
+       gre-proto-0x8909
+   17  09:45:09.443550 IP (tos 0xc0, ttl 254, id 143, offset 0, flags [none], proto GRE (47), length 28)
+    10.172.64.7 > 10.172.64.6: GREv0, Flags [key present], key=0x28, length 8
+       keep-alive
+   18  09:45:09.634332 STP 802.1d, Config, Flags [none], bridge-id 84bd.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 84bd.aa:bb:cc:00:03:00, root-pathcost 0
+   19  09:45:10.062882 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 35
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
+   20  09:45:10.062952 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
+   21  09:45:11.394321 Loopback, skipCount 0, Reply, receipt number 0, data (44 octets)
+   22  09:45:11.642760 STP 802.1d, Config, Flags [none], bridge-id 84bd.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 84bd.aa:bb:cc:00:03:00, root-pathcost 0
+   23  09:45:12.063595 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 35
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
+   24  09:45:12.063843 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
+   25  09:45:13.293327 IP (tos 0x0, ttl 255, id 145, offset 0, flags [none], proto GRE (47), length 136)
+    10.172.64.6 > 10.172.64.7: GREv0, Flags [key present], key=0x28, length 116
+       gre-proto-0x8909
+   26  09:45:13.293583 IP (tos 0x0, ttl 255, id 165, offset 0, flags [none], proto GRE (47), length 136)
+    10.172.64.7 > 10.172.64.6: GREv0, Flags [key present], key=0x28, length 116
+       gre-proto-0x8909
+   27  09:45:13.294084 IP (tos 0x0, ttl 255, id 146, offset 0, flags [none], proto GRE (47), length 136)
+    10.172.64.6 > 10.172.64.7: GREv0, Flags [key present], key=0x28, length 116
+       gre-proto-0x8909
+   28  09:45:13.294279 IP (tos 0x0, ttl 255, id 166, offset 0, flags [none], proto GRE (47), length 136)
+    10.172.64.7 > 10.172.64.6: GREv0, Flags [key present], key=0x28, length 116
+       gre-proto-0x8909
+   29  09:45:13.294690 IP (tos 0x0, ttl 255, id 147, offset 0, flags [none], proto GRE (47), length 136)
+    10.172.64.6 > 10.172.64.7: GREv0, Flags [key present], key=0x28, length 116
+       gre-proto-0x8909
+   30  09:45:13.294884 IP (tos 0x0, ttl 255, id 167, offset 0, flags [none], proto GRE (47), length 136)
+    10.172.64.7 > 10.172.64.6: GREv0, Flags [key present], key=0x28, length 116
+       gre-proto-0x8909
+   31  09:45:13.295325 IP (tos 0x0, ttl 255, id 148, offset 0, flags [none], proto GRE (47), length 136)
+    10.172.64.6 > 10.172.64.7: GREv0, Flags [key present], key=0x28, length 116
+       gre-proto-0x8909
+   32  09:45:13.295522 IP (tos 0x0, ttl 255, id 168, offset 0, flags [none], proto GRE (47), length 136)
+    10.172.64.7 > 10.172.64.6: GREv0, Flags [key present], key=0x28, length 116
+       gre-proto-0x8909
+   33  09:45:13.295933 IP (tos 0x0, ttl 255, id 149, offset 0, flags [none], proto GRE (47), length 136)
+    10.172.64.6 > 10.172.64.7: GREv0, Flags [key present], key=0x28, length 116
+       gre-proto-0x8909
+   34  09:45:13.296143 IP (tos 0x0, ttl 255, id 169, offset 0, flags [none], proto GRE (47), length 136)
+    10.172.64.7 > 10.172.64.6: GREv0, Flags [key present], key=0x28, length 116
+       gre-proto-0x8909
+   35  09:45:13.647378 STP 802.1d, Config, Flags [none], bridge-id 84bd.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 84bd.aa:bb:cc:00:03:00, root-pathcost 0
+   36  09:45:14.074294 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 35
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
+   37  09:45:14.074542 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
+   38  09:45:15.651238 STP 802.1d, Config, Flags [none], bridge-id 84bd.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 84bd.aa:bb:cc:00:03:00, root-pathcost 0
+   39  09:45:16.079934 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 35
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
+   40  09:45:16.080011 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
+   41  09:45:17.471330 IP (tos 0xc0, ttl 255, id 171, offset 0, flags [none], proto GRE (47), length 64)
+    10.172.64.7 > 10.172.64.6: GREv0, Flags [key present], key=0x28, length 44
+       gre-proto-0x8909
+   42  09:45:17.471625 IP (tos 0xc0, ttl 254, id 170, offset 0, flags [none], proto GRE (47), length 28)
+    10.172.64.6 > 10.172.64.7: GREv0, Flags [key present], key=0x28, length 8
+       keep-alive
+   43  09:45:17.654754 STP 802.1d, Config, Flags [none], bridge-id 84bd.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 84bd.aa:bb:cc:00:03:00, root-pathcost 0
+   44  09:45:18.081824 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 35
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
+   45  09:45:18.082117 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
+   46  09:45:19.444985 IP (tos 0xc0, ttl 255, id 151, offset 0, flags [none], proto GRE (47), length 64)
+    10.172.64.6 > 10.172.64.7: GREv0, Flags [key present], key=0x28, length 44
+       gre-proto-0x8909
+   47  09:45:19.445057 IP (tos 0xc0, ttl 254, id 150, offset 0, flags [none], proto GRE (47), length 28)
+    10.172.64.7 > 10.172.64.6: GREv0, Flags [key present], key=0x28, length 8
+       keep-alive
+   48  09:45:19.663320 STP 802.1d, Config, Flags [none], bridge-id 84bd.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 84bd.aa:bb:cc:00:03:00, root-pathcost 0
+   49  09:45:19.766290 IP (tos 0x0, ttl 255, id 152, offset 0, flags [none], proto GRE (47), length 381)
+    10.172.64.6 > 10.172.64.7: GREv0, Flags [key present], key=0x28, length 361
+       gre-proto-0x2000
+   50  09:45:20.096783 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 35
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
+   51  09:45:20.097040 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
+   52  09:45:21.399232 Loopback, skipCount 0, Reply, receipt number 0, data (44 octets)
+   53  09:45:21.663581 STP 802.1d, Config, Flags [none], bridge-id 84bd.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 84bd.aa:bb:cc:00:03:00, root-pathcost 0
+   54  09:45:22.097069 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 35
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
+   55  09:45:22.097311 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
+   56  09:45:23.667223 STP 802.1d, Config, Flags [none], bridge-id 84bd.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 84bd.aa:bb:cc:00:03:00, root-pathcost 0
+   57  09:45:24.106329 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 35
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
+   58  09:45:24.106567 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
+   59  09:45:25.674039 STP 802.1d, Config, Flags [none], bridge-id 84bd.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 84bd.aa:bb:cc:00:03:00, root-pathcost 0
+   60  09:45:26.116487 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 35
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
+   61  09:45:26.116589 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
+   62  09:45:26.681769 DTPv1, length 26
+       Domain (0x0001) TLV, length 5, 
+       Status (0x0002) TLV, length 5, 0x81
+       DTP type (0x0003) TLV, length 5, 0xa5
+       Neighbor (0x0004) TLV, length 10, aa:bb:cc:00:03:10
+   63  09:45:27.181709 IP (tos 0x0, ttl 255, id 172, offset 0, flags [none], proto GRE (47), length 381)
+    10.172.64.7 > 10.172.64.6: GREv0, Flags [key present], key=0x28, length 361
+       gre-proto-0x2000
+   64  09:45:27.478420 IP (tos 0xc0, ttl 255, id 174, offset 0, flags [none], proto GRE (47), length 64)
+    10.172.64.7 > 10.172.64.6: GREv0, Flags [key present], key=0x28, length 44
+       gre-proto-0x8909
+   65  09:45:27.478740 IP (tos 0xc0, ttl 254, id 173, offset 0, flags [none], proto GRE (47), length 28)
+    10.172.64.6 > 10.172.64.7: GREv0, Flags [key present], key=0x28, length 8
+       keep-alive
+   66  09:45:27.674617 STP 802.1d, Config, Flags [none], bridge-id 84bd.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 84bd.aa:bb:cc:00:03:00, root-pathcost 0
+   67  09:45:28.056866 IP (tos 0xc0, ttl 255, id 153, offset 0, flags [none], proto GRE (47), length 94)
+    10.172.64.6 > 10.172.64.7: GREv0, Flags [key present], key=0x28, length 74
+       gre-proto-0x8909
+   68  09:45:28.124258 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 35
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
+   69  09:45:28.124503 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
+   70  09:45:29.444561 IP (tos 0xc0, ttl 255, id 155, offset 0, flags [none], proto GRE (47), length 64)
+    10.172.64.6 > 10.172.64.7: GREv0, Flags [key present], key=0x28, length 44
+       gre-proto-0x8909
+   71  09:45:29.444644 IP (tos 0xc0, ttl 254, id 154, offset 0, flags [none], proto GRE (47), length 28)
+    10.172.64.7 > 10.172.64.6: GREv0, Flags [key present], key=0x28, length 8
+       keep-alive
+   72  09:45:29.677306 STP 802.1d, Config, Flags [none], bridge-id 84bd.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 84bd.aa:bb:cc:00:03:00, root-pathcost 0
+   73  09:45:30.055654 IP (tos 0xc0, ttl 255, id 175, offset 0, flags [none], proto GRE (47), length 94)
+    10.172.64.7 > 10.172.64.6: GREv0, Flags [key present], key=0x28, length 74
+       gre-proto-0x8909
+   74  09:45:30.132613 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 35
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
+   75  09:45:30.132668 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
+   76  09:45:31.400394 Loopback, skipCount 0, Reply, receipt number 0, data (44 octets)
+   77  09:45:31.686543 STP 802.1d, Config, Flags [none], bridge-id 84bd.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 84bd.aa:bb:cc:00:03:00, root-pathcost 0
+   78  09:45:32.146972 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 35
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
+   79  09:45:32.147122 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
+   80  09:45:33.695258 STP 802.1d, Config, Flags [none], bridge-id 84bd.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 84bd.aa:bb:cc:00:03:00, root-pathcost 0
+   81  09:45:34.147364 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 35
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
+   82  09:45:34.147449 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
+   83  09:45:35.703305 STP 802.1d, Config, Flags [none], bridge-id 84bd.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 84bd.aa:bb:cc:00:03:00, root-pathcost 0
+   84  09:45:36.153211 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 35
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
+   85  09:45:36.153297 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
+   86  09:45:37.371888 CDPv2, ttl: 180s, checksum: 0x2005 (unverified), length 424
+       Device-ID (0x01), value length: 3 bytes: 'SW1'
+       Version String (0x05), value length: 331 bytes: 
+         Cisco IOS Software, Linux Software (I86BI_LINUXL2-ADVENTERPRISEK9-M), Version 15.2(HI_20170202)FLO_DSGS7, EARLY DEPLOYMENT DEVELOPMENT BUILD, synced to  FLO_DSGS7_POSTCOLLAPSE_TEAM_TRACK_DSGS_PI5
+         Technical Support: http://www.cisco.com/techsupport
+         Copyright (c) 1986-2017 by Cisco Systems, Inc.
+         Compiled Thu 02-Feb-17 03:37 by mmen
+       Platform (0x06), value length: 10 bytes: 'Linux Unix'
+       Address (0x02), value length: 4 bytes: 
+       Port-ID (0x03), value length: 11 bytes: 'Ethernet0/1'
+       Capability (0x04), value length: 4 bytes: (0x00000029): Router, L2 Switch, IGMP snooping
+       VTP Management Domain (0x09), value length: 0 bytes: ''
+       Native VLAN ID (0x0a), value length: 2 bytes: 1
+       Duplex (0x0b), value length: 1 byte: full
+       AVVID trust bitmap (0x12), value length: 1 byte: 0x00
+       AVVID untrusted ports CoS (0x13), value length: 1 byte: 0x00
+       Management Addresses (0x16), value length: 4 bytes: 
+   87  09:45:37.479185 IP (tos 0xc0, ttl 255, id 177, offset 0, flags [none], proto GRE (47), length 64)
+    10.172.64.7 > 10.172.64.6: GREv0, Flags [key present], key=0x28, length 44
+       gre-proto-0x8909
+   88  09:45:37.479491 IP (tos 0xc0, ttl 254, id 176, offset 0, flags [none], proto GRE (47), length 28)
+    10.172.64.6 > 10.172.64.7: GREv0, Flags [key present], key=0x28, length 8
+       keep-alive
+   89  09:45:37.711799 STP 802.1d, Config, Flags [none], bridge-id 84bd.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 84bd.aa:bb:cc:00:03:00, root-pathcost 0
+   90  09:45:38.163467 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 35
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
+   91  09:45:38.163598 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
+   92  09:45:39.450836 IP (tos 0xc0, ttl 255, id 157, offset 0, flags [none], proto GRE (47), length 64)
+    10.172.64.6 > 10.172.64.7: GREv0, Flags [key present], key=0x28, length 44
+       gre-proto-0x8909
+   93  09:45:39.450920 IP (tos 0xc0, ttl 254, id 156, offset 0, flags [none], proto GRE (47), length 28)
+    10.172.64.7 > 10.172.64.6: GREv0, Flags [key present], key=0x28, length 8
+       keep-alive
+   94  09:45:39.715820 STP 802.1d, Config, Flags [none], bridge-id 84bd.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 84bd.aa:bb:cc:00:03:00, root-pathcost 0
+   95  09:45:40.166239 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 35
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
+   96  09:45:40.166355 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
+   97  09:45:41.401880 Loopback, skipCount 0, Reply, receipt number 0, data (44 octets)
+   98  09:45:41.729147 STP 802.1d, Config, Flags [none], bridge-id 84bd.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 84bd.aa:bb:cc:00:03:00, root-pathcost 0
+   99  09:45:42.185565 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 35
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
+  100  09:45:42.185807 STP 802.1d, Config, Flags [none], bridge-id 8001.aa:bb:cc:00:03:00.8002, length 42
+       message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
+       root-id 8001.aa:bb:cc:00:03:00, root-pathcost 0
diff --git a/tests/various_gre.pcap b/tests/various_gre.pcap
new file mode 100644 (file)
index 0000000..f2ede49
Binary files /dev/null and b/tests/various_gre.pcap differ
diff --git a/tests/wccp_redirect_gre.out b/tests/wccp_redirect_gre.out
new file mode 100644 (file)
index 0000000..51620b1
--- /dev/null
@@ -0,0 +1,3 @@
+    1  08:50:26.794117 IP (tos 0x0, ttl 253, id 44163, offset 0, flags [none], proto GRE (47), length 268)
+    10.254.127.194 > 10.254.214.82: GREv0, Flags [none], length 248
+       wccp T:0 A:0 U:0 SId:89 Alt:0 Pri:72: 
diff --git a/tests/wccp_redirect_gre.pcap b/tests/wccp_redirect_gre.pcap
new file mode 100644 (file)
index 0000000..a05b5ab
Binary files /dev/null and b/tests/wccp_redirect_gre.pcap differ