]> The Tcpdump Group git mirrors - tcpdump/commitdiff
RIP: Make a couple trivial protocol updates.
authorDenis Ovsienko <[email protected]>
Thu, 14 Jan 2021 03:31:50 +0000 (03:31 +0000)
committerDenis Ovsienko <[email protected]>
Thu, 14 Jan 2021 03:33:11 +0000 (03:33 +0000)
Synchronize with the RIP Commands IANA registry and treat version 0 as
invalid.

CHANGES
print-rip.c

diff --git a/CHANGES b/CHANGES
index 7263f80ec9b376a7d209cfaf317fe6266a842f62..e22bd5081b42d3441761072f038b7b07560832c9 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -8,6 +8,7 @@ Monthday, Month DD, YYYY by gharris and denis
       UDP: Clean up address and port printing.
       AppleTalk: Declutter appletalk.h.
       OpenFlow 1.0: Fix indentation of PORT_MOD.
       UDP: Clean up address and port printing.
       AppleTalk: Declutter appletalk.h.
       OpenFlow 1.0: Fix indentation of PORT_MOD.
+      RIP: Make a couple trivial protocol updates.
 
 Monthday, Month DD, YYYY by gharris
   Summary for 4.99.1 tcpdump release (so far!)
 
 Monthday, Month DD, YYYY by gharris
   Summary for 4.99.1 tcpdump release (so far!)
index fca534fb100b4c41a094f61567f78e53bce2ea36..0a2bef3e6874537e4cec17c57b9671c4d8d6da94 100644 (file)
@@ -55,16 +55,25 @@ struct rip {
 #define        RIPCMD_RESPONSE         2       /* responding to request */
 #define        RIPCMD_TRACEON          3       /* turn tracing on */
 #define        RIPCMD_TRACEOFF         4       /* turn it off */
 #define        RIPCMD_RESPONSE         2       /* responding to request */
 #define        RIPCMD_TRACEON          3       /* turn tracing on */
 #define        RIPCMD_TRACEOFF         4       /* turn it off */
-#define        RIPCMD_POLL             5       /* want info from everybody */
-#define        RIPCMD_POLLENTRY        6       /* poll for entry */
+/* 5 is reserved */
+#define RIPCMD_TRIGREQ         6
+#define RIPCMD_TRIGRESP                7
+#define RIPCMD_TRIGACK         8
+#define RIPCMD_UPDREQ          9
+#define RIPCMD_UPDRESP         10
+#define RIPCMD_UPDACK          11
 
 static const struct tok rip_cmd_values[] = {
     { RIPCMD_REQUEST,          "Request" },
     { RIPCMD_RESPONSE,         "Response" },
     { RIPCMD_TRACEON,          "Trace on" },
     { RIPCMD_TRACEOFF,         "Trace off" },
 
 static const struct tok rip_cmd_values[] = {
     { RIPCMD_REQUEST,          "Request" },
     { RIPCMD_RESPONSE,         "Response" },
     { RIPCMD_TRACEON,          "Trace on" },
     { RIPCMD_TRACEOFF,         "Trace off" },
-    { RIPCMD_POLL,             "Poll" },
-    { RIPCMD_POLLENTRY,                "Poll Entry" },
+    { RIPCMD_TRIGREQ,          "Triggered Request" },
+    { RIPCMD_TRIGRESP,         "Triggered Response" },
+    { RIPCMD_TRIGACK,          "Triggered Acknowledgement" },
+    { RIPCMD_UPDREQ,           "Update Request" },
+    { RIPCMD_UPDRESP,          "Update Response" },
+    { RIPCMD_UPDACK,           "Update Acknowledge" },
     { 0, NULL}
 };
 
     { 0, NULL}
 };
 
@@ -317,22 +326,6 @@ rip_print(netdissect_options *ndo,
                 (ndo->ndo_vflag >= 1) ? "\n\t" : "",
                 vers);
 
                 (ndo->ndo_vflag >= 1) ? "\n\t" : "",
                 vers);
 
-       if (vers == 0) {
-               /*
-                * RFC 1058.
-                *
-                * XXX - RFC 1058 says
-                *
-                * 0  Datagrams whose version number is zero are to be ignored.
-                *    These are from a previous version of the protocol, whose
-                *    packet format was machine-specific.
-                *
-                * so perhaps we should just dump the packet, in hex.
-                */
-               print_unknown_data(ndo, (const uint8_t *)&rp->rip_cmd, "\n\t", length);
-               return;
-       }
-
        /* dump version and lets see if we know the commands name*/
        cmd = GET_U_1(rp->rip_cmd);
        ND_PRINT(", %s, length: %u",
        /* dump version and lets see if we know the commands name*/
        cmd = GET_U_1(rp->rip_cmd);
        ND_PRINT(", %s, length: %u",
@@ -398,13 +391,16 @@ rip_print(netdissect_options *ndo,
                }
                break;
 
                }
                break;
 
+       case RIPCMD_TRACEON:
        case RIPCMD_TRACEOFF:
        case RIPCMD_TRACEOFF:
-       case RIPCMD_POLL:
-       case RIPCMD_POLLENTRY:
+       case RIPCMD_TRIGREQ:
+       case RIPCMD_TRIGRESP:
+       case RIPCMD_TRIGACK:
+       case RIPCMD_UPDREQ:
+       case RIPCMD_UPDRESP:
+       case RIPCMD_UPDACK:
                break;
 
                break;
 
-       case RIPCMD_TRACEON:
-               /* fall through */
        default:
                if (ndo->ndo_vflag <= 1) {
                        if (!print_unknown_data(ndo, (const uint8_t *)rp, "\n\t", length))
        default:
                if (ndo->ndo_vflag <= 1) {
                        if (!print_unknown_data(ndo, (const uint8_t *)rp, "\n\t", length))