]> The Tcpdump Group git mirrors - tcpdump/commitdiff
BFD: Update to print optional authentication field
authorFrancois-Xavier Le Bail <[email protected]>
Wed, 17 Aug 2016 09:04:27 +0000 (11:04 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Wed, 17 Aug 2016 09:46:54 +0000 (11:46 +0200)
Moreover:
Add test files with 'Simple Password', 'Keyed MD5' and
'Meticulous Keyed SHA1' authentications.
Update specification from draft to RFC 5881 for BFD_CONTROL_PORT and
BFD_ECHO_PORT in udp.h.
Add specification RFC 5881 in print-bfd.c.

12 files changed:
print-bfd.c
tests/TESTLIST
tests/bfd-raw-auth-md5-v.out [new file with mode: 0644]
tests/bfd-raw-auth-md5.out [new file with mode: 0644]
tests/bfd-raw-auth-md5.pcap [new file with mode: 0644]
tests/bfd-raw-auth-sha1-v.out [new file with mode: 0644]
tests/bfd-raw-auth-sha1.out [new file with mode: 0644]
tests/bfd-raw-auth-sha1.pcap [new file with mode: 0644]
tests/bfd-raw-auth-simple-v.out [new file with mode: 0644]
tests/bfd-raw-auth-simple.out [new file with mode: 0644]
tests/bfd-raw-auth-simple.pcap [new file with mode: 0644]
udp.h

index 04ea6670b941604d253fdd0fba62c121d80b53e9..ad0a4065c11fabfa99adcac95699343131545e3f 100644 (file)
@@ -15,7 +15,7 @@
 
 /* \summary: Bidirectional Forwarding Detection (BFD) printer */
 
-/* specification: RFC 5880 (for version 1) */
+/* specification: RFC 5880 (for version 1) and RFC 5881 */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -94,20 +94,37 @@ struct bfd_auth_header_t {
     uint8_t auth_type;
     uint8_t auth_len;
     uint8_t auth_data;
+    uint8_t dummy; /* minimun 4 bytes */
+};
+
+enum auth_type {
+    AUTH_PASSWORD = 1,
+    AUTH_MD5      = 2,
+    AUTH_MET_MD5  = 3,
+    AUTH_SHA1     = 4,
+    AUTH_MET_SHA1 = 5
 };
 
 static const struct tok bfd_v1_authentication_values[] = {
-    { 0,        "Reserved" },
-    { 1,        "Simple Password" },
-    { 2,        "Keyed MD5" },
-    { 3,        "Meticulous Keyed MD5" },
-    { 4,        "Keyed SHA1" },
-    { 5,        "Meticulous Keyed SHA1" },
+    { AUTH_PASSWORD, "Simple Password" },
+    { AUTH_MD5,      "Keyed MD5" },
+    { AUTH_MET_MD5,  "Meticulous Keyed MD5" },
+    { AUTH_SHA1,     "Keyed SHA1" },
+    { AUTH_MET_SHA1, "Meticulous Keyed SHA1" },
     { 0, NULL }
 };
 
-#define        BFD_EXTRACT_VERSION(x) (((x)&0xe0)>>5)
-#define        BFD_EXTRACT_DIAG(x)     ((x)&0x1f)
+enum auth_length {
+    AUTH_PASSWORD_FIELD_MIN_LEN = 4,  /* header + password min: 3 + 1 */
+    AUTH_PASSWORD_FIELD_MAX_LEN = 19, /* header + password max: 3 + 16 */
+    AUTH_MD5_FIELD_LEN  = 24,
+    AUTH_MD5_HASH_LEN   = 16,
+    AUTH_SHA1_FIELD_LEN = 28,
+    AUTH_SHA1_HASH_LEN  = 20
+};
+
+#define BFD_EXTRACT_VERSION(x) (((x)&0xe0)>>5)
+#define BFD_EXTRACT_DIAG(x)     ((x)&0x1f)
 
 static const struct tok bfd_port_values[] = {
     { BFD_CONTROL_PORT, "Control" },
@@ -115,7 +132,6 @@ static const struct tok bfd_port_values[] = {
     { 0, NULL }
 };
 
-
 static const struct tok bfd_diag_values[] = {
     { 0, "No Diagnostic" },
     { 1, "Control Detection Time Expired" },
@@ -130,14 +146,14 @@ static const struct tok bfd_diag_values[] = {
 };
 
 static const struct tok bfd_v0_flag_values[] = {
-    { 0x80,    "I Hear You" },
-    { 0x40,    "Demand" },
-    { 0x20,    "Poll" },
-    { 0x10,    "Final" },
-    { 0x08,    "Reserved" },
-    { 0x04,    "Reserved" },
-    { 0x02,    "Reserved" },
-    { 0x01,    "Reserved" },
+    { 0x80, "I Hear You" },
+    { 0x40, "Demand" },
+    { 0x20, "Poll" },
+    { 0x10, "Final" },
+    { 0x08, "Reserved" },
+    { 0x04, "Reserved" },
+    { 0x02, "Reserved" },
+    { 0x01, "Reserved" },
     { 0, NULL }
 };
 
@@ -161,12 +177,122 @@ static const struct tok bfd_v1_state_values[] = {
     { 0, NULL }
 };
 
+static int
+auth_print(netdissect_options *ndo, register const u_char *pptr)
+{
+        const struct bfd_auth_header_t *bfd_auth_header;
+        int i;
+
+        pptr += sizeof (const struct bfd_header_t);
+        bfd_auth_header = (const struct bfd_auth_header_t *)pptr;
+        ND_TCHECK(*bfd_auth_header);
+        ND_PRINT((ndo, "\n\tAuthentication: %s (%u), length: %u",
+                 tok2str(bfd_v1_authentication_values,"Unknown",bfd_auth_header->auth_type),
+                 bfd_auth_header->auth_type,
+                 bfd_auth_header->auth_len));
+                pptr += 2;
+                ND_PRINT((ndo, "\n\t  Auth Key ID: %d", *pptr));
+
+        switch(bfd_auth_header->auth_type) {
+            case AUTH_PASSWORD:
+/*
+ *    Simple Password Authentication Section Format
+ *
+ *     0                   1                   2                   3
+ *     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ *    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ *    |   Auth Type   |   Auth Len    |  Auth Key ID  |  Password...  |
+ *    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ *    |                              ...                              |
+ *    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+                if (bfd_auth_header->auth_len < AUTH_PASSWORD_FIELD_MIN_LEN ||
+                    bfd_auth_header->auth_len > AUTH_PASSWORD_FIELD_MAX_LEN) {
+                    ND_PRINT((ndo, "[invalid length %d]",
+                             bfd_auth_header->auth_len));
+                    break;
+                }
+                pptr++;
+                ND_PRINT((ndo, ", Password: "));
+                /* the length is equal to the password length plus three */
+                if (fn_printn(ndo, pptr, bfd_auth_header->auth_len - 3,
+                              ndo->ndo_snapend))
+                    goto trunc;
+                break;
+            case AUTH_MD5:
+            case AUTH_MET_MD5:
+/*
+ *    Keyed MD5 and Meticulous Keyed MD5 Authentication Section Format
+ *
+ *     0                   1                   2                   3
+ *     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ *    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ *    |   Auth Type   |   Auth Len    |  Auth Key ID  |   Reserved    |
+ *    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ *    |                        Sequence Number                        |
+ *    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ *    |                      Auth Key/Digest...                       |
+ *    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ *    |                              ...                              |
+ *    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+                if (bfd_auth_header->auth_len != AUTH_MD5_FIELD_LEN) {
+                    ND_PRINT((ndo, "[invalid length %d]",
+                             bfd_auth_header->auth_len));
+                    break;
+                }
+                pptr += 2;
+                ND_TCHECK2(*pptr, 4);
+                ND_PRINT((ndo, ", Sequence Number: 0x%08x", EXTRACT_32BITS(pptr)));
+                pptr += 4;
+                ND_TCHECK2(*pptr, AUTH_MD5_HASH_LEN);
+                ND_PRINT((ndo, "\n\t  Digest: "));
+                for(i = 0; i < AUTH_MD5_HASH_LEN; i++)
+                    ND_PRINT((ndo, "%02x", pptr[i]));
+                break;
+            case AUTH_SHA1:
+            case AUTH_MET_SHA1:
+/*
+ *    Keyed SHA1 and Meticulous Keyed SHA1 Authentication Section Format
+ *
+ *     0                   1                   2                   3
+ *     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ *    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ *    |   Auth Type   |   Auth Len    |  Auth Key ID  |   Reserved    |
+ *    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ *    |                        Sequence Number                        |
+ *    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ *    |                       Auth Key/Hash...                        |
+ *    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ *    |                              ...                              |
+ *    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+                if (bfd_auth_header->auth_len != AUTH_SHA1_FIELD_LEN) {
+                    ND_PRINT((ndo, "[invalid length %d]",
+                             bfd_auth_header->auth_len));
+                    break;
+                }
+                pptr += 2;
+                ND_TCHECK2(*pptr, 4);
+                ND_PRINT((ndo, ", Sequence Number: 0x%08x", EXTRACT_32BITS(pptr)));
+                pptr += 4;
+                ND_TCHECK2(*pptr, AUTH_SHA1_HASH_LEN);
+                ND_PRINT((ndo, "\n\t  Hash: "));
+                for(i = 0; i < AUTH_SHA1_HASH_LEN; i++)
+                    ND_PRINT((ndo, "%02x", pptr[i]));
+                break;
+        }
+        return 0;
+
+trunc:
+        return 1;
+}
+
 void
 bfd_print(netdissect_options *ndo, register const u_char *pptr,
           register u_int len, register u_int port)
 {
         const struct bfd_header_t *bfd_header;
-        const struct bfd_auth_header_t *bfd_auth_header;
         uint8_t version = 0;
 
         bfd_header = (const struct bfd_header_t *)pptr;
@@ -247,13 +373,8 @@ bfd_print(netdissect_options *ndo, register const u_char *pptr,
             ND_PRINT((ndo, "\n\t  Required min Echo Interval: %4u ms", EXTRACT_32BITS(bfd_header->required_min_echo_interval)/1000));
 
             if (bfd_header->flags & BFD_FLAG_AUTH) {
-                pptr += sizeof (const struct bfd_header_t);
-                bfd_auth_header = (const struct bfd_auth_header_t *)pptr;
-                ND_TCHECK2(*bfd_auth_header, sizeof(const struct bfd_auth_header_t));
-                ND_PRINT((ndo, "\n\t%s (%u) Authentication, length %u present",
-                       tok2str(bfd_v1_authentication_values,"Unknown",bfd_auth_header->auth_type),
-                       bfd_auth_header->auth_type,
-                       bfd_auth_header->auth_len));
+                if (auth_print(ndo, pptr))
+                    goto trunc;
             }
             break;
 
index f787a90109b6a6c6f65089f3e54615a7f82aec8e..12f2d76048682bd06cd42a404a5e142e8f32fa2d 100644 (file)
@@ -350,3 +350,11 @@ resp_3      resp_3_malicious.pcap   resp_3.out      -n -t
 
 # HNCP tests
 hncp        hncp.pcap    hncp.out    -n -vvv -t
+
+# BFD tests with authentication fields
+bfd-raw-auth-simple bfd-raw-auth-simple.pcap bfd-raw-auth-simple.out -t
+bfd-raw-auth-simple-v bfd-raw-auth-simple.pcap bfd-raw-auth-simple-v.out -t -v
+bfd-raw-auth-md5 bfd-raw-auth-md5.pcap bfd-raw-auth-md5.out -t
+bfd-raw-auth-md5-v bfd-raw-auth-md5.pcap bfd-raw-auth-md5-v.out -t -v
+bfd-raw-auth-sha1 bfd-raw-auth-sha1.pcap bfd-raw-auth-sha1.out -t
+bfd-raw-auth-sha1-v bfd-raw-auth-sha1.pcap bfd-raw-auth-sha1-v.out -t -v
diff --git a/tests/bfd-raw-auth-md5-v.out b/tests/bfd-raw-auth-md5-v.out
new file mode 100644 (file)
index 0000000..e6766ff
--- /dev/null
@@ -0,0 +1,341 @@
+IP (tos 0x0, ttl 10, id 1, offset 0, flags [none], proto UDP (17), length 76)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 48
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 48
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Keyed MD5 (2), length: 24
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Digest: 01020304050607080910111213141516
+IP (tos 0x0, ttl 10, id 2, offset 0, flags [none], proto UDP (17), length 76)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 48
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 48
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Keyed MD5 (2), length: 24
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Digest: 01020304050607080910111213141516
+IP (tos 0x0, ttl 10, id 3, offset 0, flags [none], proto UDP (17), length 76)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 48
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 48
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Keyed MD5 (2), length: 24
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Digest: 01020304050607080910111213141516
+IP (tos 0x0, ttl 10, id 4, offset 0, flags [none], proto UDP (17), length 76)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 48
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 48
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Keyed MD5 (2), length: 24
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Digest: 01020304050607080910111213141516
+IP (tos 0x0, ttl 10, id 5, offset 0, flags [none], proto UDP (17), length 76)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 48
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 48
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Keyed MD5 (2), length: 24
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Digest: 01020304050607080910111213141516
+IP (tos 0x0, ttl 10, id 6, offset 0, flags [none], proto UDP (17), length 76)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 48
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 48
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Keyed MD5 (2), length: 24
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Digest: 01020304050607080910111213141516
+IP (tos 0x0, ttl 10, id 7, offset 0, flags [none], proto UDP (17), length 76)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 48
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 48
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Keyed MD5 (2), length: 24
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Digest: 01020304050607080910111213141516
+IP (tos 0x0, ttl 10, id 8, offset 0, flags [none], proto UDP (17), length 76)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 48
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 48
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Keyed MD5 (2), length: 24
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Digest: 01020304050607080910111213141516
+IP (tos 0x0, ttl 10, id 9, offset 0, flags [none], proto UDP (17), length 76)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 48
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 48
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Keyed MD5 (2), length: 24
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Digest: 01020304050607080910111213141516
+IP (tos 0x0, ttl 10, id 10, offset 0, flags [none], proto UDP (17), length 76)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 48
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 48
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Keyed MD5 (2), length: 24
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Digest: 01020304050607080910111213141516
+IP (tos 0x0, ttl 10, id 11, offset 0, flags [none], proto UDP (17), length 76)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 48
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 48
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Keyed MD5 (2), length: 24
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Digest: 01020304050607080910111213141516
+IP (tos 0x0, ttl 10, id 12, offset 0, flags [none], proto UDP (17), length 76)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 48
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 48
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Keyed MD5 (2), length: 24
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Digest: 01020304050607080910111213141516
+IP (tos 0x0, ttl 10, id 13, offset 0, flags [none], proto UDP (17), length 76)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 48
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 48
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Keyed MD5 (2), length: 24
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Digest: 01020304050607080910111213141516
+IP (tos 0x0, ttl 10, id 14, offset 0, flags [none], proto UDP (17), length 76)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 48
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 48
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Keyed MD5 (2), length: 24
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Digest: 01020304050607080910111213141516
+IP (tos 0x0, ttl 10, id 15, offset 0, flags [none], proto UDP (17), length 76)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 48
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 48
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Keyed MD5 (2), length: 24
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Digest: 01020304050607080910111213141516
+IP (tos 0x0, ttl 10, id 16, offset 0, flags [none], proto UDP (17), length 76)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 48
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 48
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Keyed MD5 (2), length: 24
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Digest: 01020304050607080910111213141516
+IP (tos 0x0, ttl 10, id 17, offset 0, flags [none], proto UDP (17), length 76)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 48
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 48
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Keyed MD5 (2), length: 24
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Digest: 01020304050607080910111213141516
+IP (tos 0x0, ttl 10, id 18, offset 0, flags [none], proto UDP (17), length 76)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 48
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 48
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Keyed MD5 (2), length: 24
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Digest: 01020304050607080910111213141516
+IP (tos 0x0, ttl 10, id 19, offset 0, flags [none], proto UDP (17), length 76)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 48
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 48
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Keyed MD5 (2), length: 24
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Digest: 01020304050607080910111213141516
+IP (tos 0x0, ttl 10, id 20, offset 0, flags [none], proto UDP (17), length 76)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 48
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 48
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Keyed MD5 (2), length: 24
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Digest: 01020304050607080910111213141516
+IP (tos 0x0, ttl 10, id 21, offset 0, flags [none], proto UDP (17), length 76)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 48
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 48
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Keyed MD5 (2), length: 24
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Digest: 01020304050607080910111213141516
+IP (tos 0x0, ttl 10, id 22, offset 0, flags [none], proto UDP (17), length 76)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 48
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 48
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Keyed MD5 (2), length: 24
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Digest: 01020304050607080910111213141516
+IP (tos 0x0, ttl 10, id 23, offset 0, flags [none], proto UDP (17), length 76)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 48
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 48
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Keyed MD5 (2), length: 24
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Digest: 01020304050607080910111213141516
+IP (tos 0x0, ttl 10, id 24, offset 0, flags [none], proto UDP (17), length 76)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 48
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 48
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Keyed MD5 (2), length: 24
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Digest: 01020304050607080910111213141516
+IP (tos 0x0, ttl 10, id 25, offset 0, flags [none], proto UDP (17), length 76)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 48
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 48
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Keyed MD5 (2), length: 24
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Digest: 01020304050607080910111213141516
+IP (tos 0x0, ttl 10, id 26, offset 0, flags [none], proto UDP (17), length 76)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 48
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 48
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Keyed MD5 (2), length: 24
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Digest: 01020304050607080910111213141516
+IP (tos 0x0, ttl 10, id 27, offset 0, flags [none], proto UDP (17), length 76)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 48
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 48
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Keyed MD5 (2), length: 24
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Digest: 01020304050607080910111213141516
+IP (tos 0x0, ttl 10, id 28, offset 0, flags [none], proto UDP (17), length 76)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 48
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 48
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Keyed MD5 (2), length: 24
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Digest: 01020304050607080910111213141516
+IP (tos 0x0, ttl 10, id 29, offset 0, flags [none], proto UDP (17), length 76)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 48
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 48
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Keyed MD5 (2), length: 24
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Digest: 01020304050607080910111213141516
+IP (tos 0x0, ttl 10, id 30, offset 0, flags [none], proto UDP (17), length 76)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 48
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 48
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Keyed MD5 (2), length: 24
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Digest: 01020304050607080910111213141516
+IP (tos 0x0, ttl 10, id 31, offset 0, flags [none], proto UDP (17), length 76)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 48
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 48
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Keyed MD5 (2), length: 24
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Digest: 01020304050607080910111213141516
diff --git a/tests/bfd-raw-auth-md5.out b/tests/bfd-raw-auth-md5.out
new file mode 100644 (file)
index 0000000..aee3165
--- /dev/null
@@ -0,0 +1,31 @@
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 48
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 48
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 48
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 48
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 48
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 48
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 48
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 48
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 48
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 48
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 48
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 48
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 48
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 48
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 48
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 48
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 48
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 48
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 48
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 48
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 48
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 48
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 48
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 48
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 48
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 48
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 48
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 48
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 48
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 48
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 48
diff --git a/tests/bfd-raw-auth-md5.pcap b/tests/bfd-raw-auth-md5.pcap
new file mode 100644 (file)
index 0000000..9de6d4a
Binary files /dev/null and b/tests/bfd-raw-auth-md5.pcap differ
diff --git a/tests/bfd-raw-auth-sha1-v.out b/tests/bfd-raw-auth-sha1-v.out
new file mode 100644 (file)
index 0000000..82b4553
--- /dev/null
@@ -0,0 +1,275 @@
+IP (tos 0x0, ttl 10, id 0, offset 0, flags [none], proto UDP (17), length 80)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 52
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 52
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Meticulous Keyed SHA1 (5), length: 28
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Hash: 010203040506070809101112131415161718191a
+IP (tos 0x0, ttl 10, id 1, offset 0, flags [none], proto UDP (17), length 80)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 52
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 52
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Meticulous Keyed SHA1 (5), length: 28
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Hash: 010203040506070809101112131415161718191a
+IP (tos 0x0, ttl 10, id 2, offset 0, flags [none], proto UDP (17), length 80)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 52
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 52
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Meticulous Keyed SHA1 (5), length: 28
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Hash: 010203040506070809101112131415161718191a
+IP (tos 0x0, ttl 10, id 3, offset 0, flags [none], proto UDP (17), length 80)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 52
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 52
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Meticulous Keyed SHA1 (5), length: 28
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Hash: 010203040506070809101112131415161718191a
+IP (tos 0x0, ttl 10, id 4, offset 0, flags [none], proto UDP (17), length 80)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 52
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 52
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Meticulous Keyed SHA1 (5), length: 28
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Hash: 010203040506070809101112131415161718191a
+IP (tos 0x0, ttl 10, id 5, offset 0, flags [none], proto UDP (17), length 80)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 52
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 52
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Meticulous Keyed SHA1 (5), length: 28
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Hash: 010203040506070809101112131415161718191a
+IP (tos 0x0, ttl 10, id 6, offset 0, flags [none], proto UDP (17), length 80)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 52
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 52
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Meticulous Keyed SHA1 (5), length: 28
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Hash: 010203040506070809101112131415161718191a
+IP (tos 0x0, ttl 10, id 7, offset 0, flags [none], proto UDP (17), length 80)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 52
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 52
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Meticulous Keyed SHA1 (5), length: 28
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Hash: 010203040506070809101112131415161718191a
+IP (tos 0x0, ttl 10, id 8, offset 0, flags [none], proto UDP (17), length 80)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 52
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 52
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Meticulous Keyed SHA1 (5), length: 28
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Hash: 010203040506070809101112131415161718191a
+IP (tos 0x0, ttl 10, id 9, offset 0, flags [none], proto UDP (17), length 80)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 52
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 52
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Meticulous Keyed SHA1 (5), length: 28
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Hash: 010203040506070809101112131415161718191a
+IP (tos 0x0, ttl 10, id 10, offset 0, flags [none], proto UDP (17), length 80)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 52
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 52
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Meticulous Keyed SHA1 (5), length: 28
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Hash: 010203040506070809101112131415161718191a
+IP (tos 0x0, ttl 10, id 11, offset 0, flags [none], proto UDP (17), length 80)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 52
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 52
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Meticulous Keyed SHA1 (5), length: 28
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Hash: 010203040506070809101112131415161718191a
+IP (tos 0x0, ttl 10, id 12, offset 0, flags [none], proto UDP (17), length 80)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 52
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 52
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Meticulous Keyed SHA1 (5), length: 28
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Hash: 010203040506070809101112131415161718191a
+IP (tos 0x0, ttl 10, id 13, offset 0, flags [none], proto UDP (17), length 80)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 52
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 52
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Meticulous Keyed SHA1 (5), length: 28
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Hash: 010203040506070809101112131415161718191a
+IP (tos 0x0, ttl 10, id 14, offset 0, flags [none], proto UDP (17), length 80)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 52
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 52
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Meticulous Keyed SHA1 (5), length: 28
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Hash: 010203040506070809101112131415161718191a
+IP (tos 0x0, ttl 10, id 15, offset 0, flags [none], proto UDP (17), length 80)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 52
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 52
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Meticulous Keyed SHA1 (5), length: 28
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Hash: 010203040506070809101112131415161718191a
+IP (tos 0x0, ttl 10, id 16, offset 0, flags [none], proto UDP (17), length 80)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 52
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 52
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Meticulous Keyed SHA1 (5), length: 28
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Hash: 010203040506070809101112131415161718191a
+IP (tos 0x0, ttl 10, id 17, offset 0, flags [none], proto UDP (17), length 80)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 52
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 52
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Meticulous Keyed SHA1 (5), length: 28
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Hash: 010203040506070809101112131415161718191a
+IP (tos 0x0, ttl 10, id 18, offset 0, flags [none], proto UDP (17), length 80)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 52
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 52
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Meticulous Keyed SHA1 (5), length: 28
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Hash: 010203040506070809101112131415161718191a
+IP (tos 0x0, ttl 10, id 19, offset 0, flags [none], proto UDP (17), length 80)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 52
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 52
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Meticulous Keyed SHA1 (5), length: 28
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Hash: 010203040506070809101112131415161718191a
+IP (tos 0x0, ttl 10, id 20, offset 0, flags [none], proto UDP (17), length 80)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 52
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 52
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Meticulous Keyed SHA1 (5), length: 28
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Hash: 010203040506070809101112131415161718191a
+IP (tos 0x0, ttl 10, id 21, offset 0, flags [none], proto UDP (17), length 80)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 52
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 52
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Meticulous Keyed SHA1 (5), length: 28
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Hash: 010203040506070809101112131415161718191a
+IP (tos 0x0, ttl 10, id 22, offset 0, flags [none], proto UDP (17), length 80)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 52
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 52
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Meticulous Keyed SHA1 (5), length: 28
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Hash: 010203040506070809101112131415161718191a
+IP (tos 0x0, ttl 10, id 23, offset 0, flags [none], proto UDP (17), length 80)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 52
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 52
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Meticulous Keyed SHA1 (5), length: 28
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Hash: 010203040506070809101112131415161718191a
+IP (tos 0x0, ttl 10, id 24, offset 0, flags [none], proto UDP (17), length 80)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 52
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 52
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Meticulous Keyed SHA1 (5), length: 28
+         Auth Key ID: 2, Sequence Number: 0x00000005
+         Hash: 010203040506070809101112131415161718191a
diff --git a/tests/bfd-raw-auth-sha1.out b/tests/bfd-raw-auth-sha1.out
new file mode 100644 (file)
index 0000000..6a5ed8a
--- /dev/null
@@ -0,0 +1,25 @@
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 52
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 52
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 52
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 52
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 52
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 52
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 52
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 52
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 52
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 52
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 52
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 52
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 52
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 52
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 52
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 52
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 52
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 52
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 52
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 52
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 52
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 52
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 52
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 52
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 52
diff --git a/tests/bfd-raw-auth-sha1.pcap b/tests/bfd-raw-auth-sha1.pcap
new file mode 100644 (file)
index 0000000..8fafb60
Binary files /dev/null and b/tests/bfd-raw-auth-sha1.pcap differ
diff --git a/tests/bfd-raw-auth-simple-v.out b/tests/bfd-raw-auth-simple-v.out
new file mode 100644 (file)
index 0000000..7276f06
--- /dev/null
@@ -0,0 +1,150 @@
+IP (tos 0x0, ttl 10, id 0, offset 0, flags [none], proto UDP (17), length 61)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 33
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 33
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Simple Password (1), length: 9
+         Auth Key ID: 2, Password: secret
+IP (tos 0x0, ttl 10, id 1, offset 0, flags [none], proto UDP (17), length 61)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 33
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 33
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Simple Password (1), length: 9
+         Auth Key ID: 2, Password: secret
+IP (tos 0x0, ttl 10, id 2, offset 0, flags [none], proto UDP (17), length 61)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 33
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 33
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Simple Password (1), length: 9
+         Auth Key ID: 2, Password: secret
+IP (tos 0x0, ttl 10, id 3, offset 0, flags [none], proto UDP (17), length 61)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 33
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 33
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Simple Password (1), length: 9
+         Auth Key ID: 2, Password: secret
+IP (tos 0x0, ttl 10, id 4, offset 0, flags [none], proto UDP (17), length 61)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 33
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 33
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Simple Password (1), length: 9
+         Auth Key ID: 2, Password: secret
+IP (tos 0x0, ttl 10, id 5, offset 0, flags [none], proto UDP (17), length 61)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 33
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 33
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Simple Password (1), length: 9
+         Auth Key ID: 2, Password: secret
+IP (tos 0x0, ttl 10, id 6, offset 0, flags [none], proto UDP (17), length 61)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 33
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 33
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Simple Password (1), length: 9
+         Auth Key ID: 2, Password: secret
+IP (tos 0x0, ttl 10, id 7, offset 0, flags [none], proto UDP (17), length 61)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 33
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 33
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Simple Password (1), length: 9
+         Auth Key ID: 2, Password: secret
+IP (tos 0x0, ttl 10, id 8, offset 0, flags [none], proto UDP (17), length 61)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 33
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 33
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Simple Password (1), length: 9
+         Auth Key ID: 2, Password: secret
+IP (tos 0x0, ttl 10, id 9, offset 0, flags [none], proto UDP (17), length 61)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 33
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 33
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Simple Password (1), length: 9
+         Auth Key ID: 2, Password: secret
+IP (tos 0x0, ttl 10, id 10, offset 0, flags [none], proto UDP (17), length 61)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 33
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 33
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Simple Password (1), length: 9
+         Auth Key ID: 2, Password: secret
+IP (tos 0x0, ttl 10, id 11, offset 0, flags [none], proto UDP (17), length 61)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 33
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 33
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Simple Password (1), length: 9
+         Auth Key ID: 2, Password: secret
+IP (tos 0x0, ttl 10, id 12, offset 0, flags [none], proto UDP (17), length 61)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 33
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 33
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Simple Password (1), length: 9
+         Auth Key ID: 2, Password: secret
+IP (tos 0x0, ttl 10, id 13, offset 0, flags [none], proto UDP (17), length 61)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 33
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 33
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Simple Password (1), length: 9
+         Auth Key ID: 2, Password: secret
+IP (tos 0x0, ttl 10, id 14, offset 0, flags [none], proto UDP (17), length 61)
+    192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, length: 33
+       Control, State Down, Flags: [Authentication Present], Diagnostic: No Diagnostic (0x00)
+       Detection Timer Multiplier: 5 (5000 ms Detection time), BFD Length: 33
+       My Discriminator: 0x00000001, Your Discriminator: 0x00000000
+         Desired min Tx Interval:    1000 ms
+         Required min Rx Interval:   1000 ms
+         Required min Echo Interval:    0 ms
+       Authentication: Simple Password (1), length: 9
+         Auth Key ID: 2, Password: secret
diff --git a/tests/bfd-raw-auth-simple.out b/tests/bfd-raw-auth-simple.out
new file mode 100644 (file)
index 0000000..40b4f37
--- /dev/null
@@ -0,0 +1,15 @@
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 33
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 33
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 33
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 33
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 33
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 33
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 33
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 33
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 33
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 33
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 33
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 33
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 33
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 33
+IP 192.85.1.2.1024 > 192.0.0.1.3784: BFDv1, Control, State Down, Flags: [Authentication Present], length: 33
diff --git a/tests/bfd-raw-auth-simple.pcap b/tests/bfd-raw-auth-simple.pcap
new file mode 100644 (file)
index 0000000..48cf3ac
Binary files /dev/null and b/tests/bfd-raw-auth-simple.pcap differ
diff --git a/udp.h b/udp.h
index f9647bc6fa8e4206df560c7dc3134a7f8e368e8e..409cc59e45eea976173b2d0ea14a0ac27c4c9871 100644 (file)
--- a/udp.h
+++ b/udp.h
@@ -240,10 +240,10 @@ struct udphdr {
 #define SUBVERSION_PORT                        3690    /*XXX*/
 #endif
 #ifndef BFD_CONTROL_PORT
-#define BFD_CONTROL_PORT               3784    /* draft-katz-ward-bfd-v4v6-1hop-00.txt */
+#define BFD_CONTROL_PORT               3784    /* RFC 5881 */
 #endif
 #ifndef BFD_ECHO_PORT
-#define BFD_ECHO_PORT                  3785    /* draft-katz-ward-bfd-v4v6-1hop-00.txt */
+#define BFD_ECHO_PORT                  3785    /* RFC 5881 */
 #endif
 #ifndef RADIUS_COA_PORT
 #define RADIUS_COA_PORT                        3799    /* RFC 5176 */