The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 1989, 1990, 1991, 1993, 1994, 1996 |
| 3 | * The Regents of the University of California. All rights reserved. |
| 4 | * |
| 5 | * Redistribution and use in source and binary forms, with or without |
| 6 | * modification, are permitted provided that: (1) source code distributions |
| 7 | * retain the above copyright notice and this paragraph in its entirety, (2) |
| 8 | * distributions including binary code include the above copyright notice and |
| 9 | * this paragraph in its entirety in the documentation or other materials |
| 10 | * provided with the distribution, and (3) all advertising materials mentioning |
| 11 | * features or use of this software display the following acknowledgement: |
| 12 | * ``This product includes software developed by the University of California, |
| 13 | * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of |
| 14 | * the University nor the names of its contributors may be used to endorse |
| 15 | * or promote products derived from this software without specific prior |
| 16 | * written permission. |
| 17 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED |
| 18 | * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF |
| 19 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
| 20 | */ |
| 21 | |
Elliott Hughes | e2e3bd1 | 2017-05-15 10:59:29 -0700 | [diff] [blame] | 22 | /* \summary: Routing Information Protocol (RIP) printer */ |
| 23 | |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 24 | #ifdef HAVE_CONFIG_H |
| 25 | #include "config.h" |
| 26 | #endif |
| 27 | |
Elliott Hughes | e2e3bd1 | 2017-05-15 10:59:29 -0700 | [diff] [blame] | 28 | #include <netdissect-stdinc.h> |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 29 | |
| 30 | #include <stdio.h> |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 31 | |
Elliott Hughes | e2e3bd1 | 2017-05-15 10:59:29 -0700 | [diff] [blame] | 32 | #include "netdissect.h" |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 33 | #include "addrtoname.h" |
Elliott Hughes | e2e3bd1 | 2017-05-15 10:59:29 -0700 | [diff] [blame] | 34 | #include "extract.h" |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 35 | |
JP Abgrall | 53f17a9 | 2014-02-12 14:02:41 -0800 | [diff] [blame] | 36 | #include "af.h" |
| 37 | |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 38 | static const char tstr[] = "[|rip]"; |
| 39 | |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 40 | struct rip { |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 41 | uint8_t rip_cmd; /* request/response */ |
| 42 | uint8_t rip_vers; /* protocol version # */ |
| 43 | uint8_t unused[2]; /* unused */ |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 44 | }; |
| 45 | |
| 46 | #define RIPCMD_REQUEST 1 /* want info */ |
| 47 | #define RIPCMD_RESPONSE 2 /* responding to request */ |
| 48 | #define RIPCMD_TRACEON 3 /* turn tracing on */ |
| 49 | #define RIPCMD_TRACEOFF 4 /* turn it off */ |
| 50 | #define RIPCMD_POLL 5 /* want info from everybody */ |
| 51 | #define RIPCMD_POLLENTRY 6 /* poll for entry */ |
| 52 | |
| 53 | static const struct tok rip_cmd_values[] = { |
| 54 | { RIPCMD_REQUEST, "Request" }, |
| 55 | { RIPCMD_RESPONSE, "Response" }, |
| 56 | { RIPCMD_TRACEON, "Trace on" }, |
| 57 | { RIPCMD_TRACEOFF, "Trace off" }, |
| 58 | { RIPCMD_POLL, "Poll" }, |
| 59 | { RIPCMD_POLLENTRY, "Poll Entry" }, |
| 60 | { 0, NULL} |
| 61 | }; |
| 62 | |
| 63 | #define RIP_AUTHLEN 16 |
| 64 | #define RIP_ROUTELEN 20 |
| 65 | |
| 66 | /* |
| 67 | * rfc 1723 |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 68 | * |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 69 | * 0 1 2 3 3 |
| 70 | * 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 |
| 71 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 72 | * | Command (1) | Version (1) | unused | |
| 73 | * +---------------+---------------+-------------------------------+ |
| 74 | * | Address Family Identifier (2) | Route Tag (2) | |
| 75 | * +-------------------------------+-------------------------------+ |
| 76 | * | IP Address (4) | |
| 77 | * +---------------------------------------------------------------+ |
| 78 | * | Subnet Mask (4) | |
| 79 | * +---------------------------------------------------------------+ |
| 80 | * | Next Hop (4) | |
| 81 | * +---------------------------------------------------------------+ |
| 82 | * | Metric (4) | |
| 83 | * +---------------------------------------------------------------+ |
| 84 | * |
| 85 | */ |
| 86 | |
| 87 | struct rip_netinfo { |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 88 | uint16_t rip_family; |
| 89 | uint16_t rip_tag; |
| 90 | uint32_t rip_dest; |
| 91 | uint32_t rip_dest_mask; |
| 92 | uint32_t rip_router; |
| 93 | uint32_t rip_metric; /* cost of route */ |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 94 | }; |
| 95 | |
| 96 | static void |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 97 | rip_entry_print_v1(netdissect_options *ndo, |
| 98 | register const struct rip_netinfo *ni) |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 99 | { |
| 100 | register u_short family; |
| 101 | |
| 102 | /* RFC 1058 */ |
| 103 | family = EXTRACT_16BITS(&ni->rip_family); |
JP Abgrall | 53f17a9 | 2014-02-12 14:02:41 -0800 | [diff] [blame] | 104 | if (family != BSD_AFNUM_INET && family != 0) { |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 105 | ND_PRINT((ndo, "\n\t AFI %s, ", tok2str(bsd_af_values, "Unknown (%u)", family))); |
Elliott Hughes | e2e3bd1 | 2017-05-15 10:59:29 -0700 | [diff] [blame] | 106 | print_unknown_data(ndo, (const uint8_t *)&ni->rip_family, "\n\t ", RIP_ROUTELEN); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 107 | return; |
| 108 | } |
| 109 | if (EXTRACT_16BITS(&ni->rip_tag) || |
| 110 | EXTRACT_32BITS(&ni->rip_dest_mask) || |
| 111 | EXTRACT_32BITS(&ni->rip_router)) { |
| 112 | /* MBZ fields not zero */ |
Elliott Hughes | e2e3bd1 | 2017-05-15 10:59:29 -0700 | [diff] [blame] | 113 | print_unknown_data(ndo, (const uint8_t *)&ni->rip_family, "\n\t ", RIP_ROUTELEN); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 114 | return; |
JP Abgrall | 53f17a9 | 2014-02-12 14:02:41 -0800 | [diff] [blame] | 115 | } |
| 116 | if (family == 0) { |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 117 | ND_PRINT((ndo, "\n\t AFI 0, %s, metric: %u", |
| 118 | ipaddr_string(ndo, &ni->rip_dest), |
| 119 | EXTRACT_32BITS(&ni->rip_metric))); |
JP Abgrall | 53f17a9 | 2014-02-12 14:02:41 -0800 | [diff] [blame] | 120 | return; |
| 121 | } /* BSD_AFNUM_INET */ |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 122 | ND_PRINT((ndo, "\n\t %s, metric: %u", |
| 123 | ipaddr_string(ndo, &ni->rip_dest), |
| 124 | EXTRACT_32BITS(&ni->rip_metric))); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 125 | } |
| 126 | |
JP Abgrall | 53f17a9 | 2014-02-12 14:02:41 -0800 | [diff] [blame] | 127 | static unsigned |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 128 | rip_entry_print_v2(netdissect_options *ndo, |
| 129 | register const struct rip_netinfo *ni, const unsigned remaining) |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 130 | { |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 131 | register u_short family; |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 132 | |
| 133 | family = EXTRACT_16BITS(&ni->rip_family); |
JP Abgrall | 53f17a9 | 2014-02-12 14:02:41 -0800 | [diff] [blame] | 134 | if (family == 0xFFFF) { /* variable-sized authentication structures */ |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 135 | uint16_t auth_type = EXTRACT_16BITS(&ni->rip_tag); |
JP Abgrall | 53f17a9 | 2014-02-12 14:02:41 -0800 | [diff] [blame] | 136 | if (auth_type == 2) { |
Elliott Hughes | e2e3bd1 | 2017-05-15 10:59:29 -0700 | [diff] [blame] | 137 | register const u_char *p = (const u_char *)&ni->rip_dest; |
JP Abgrall | 53f17a9 | 2014-02-12 14:02:41 -0800 | [diff] [blame] | 138 | u_int i = 0; |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 139 | ND_PRINT((ndo, "\n\t Simple Text Authentication data: ")); |
JP Abgrall | 53f17a9 | 2014-02-12 14:02:41 -0800 | [diff] [blame] | 140 | for (; i < RIP_AUTHLEN; p++, i++) |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 141 | ND_PRINT((ndo, "%c", ND_ISPRINT(*p) ? *p : '.')); |
JP Abgrall | 53f17a9 | 2014-02-12 14:02:41 -0800 | [diff] [blame] | 142 | } else if (auth_type == 3) { |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 143 | ND_PRINT((ndo, "\n\t Auth header:")); |
Elliott Hughes | e2e3bd1 | 2017-05-15 10:59:29 -0700 | [diff] [blame] | 144 | ND_PRINT((ndo, " Packet Len %u,", EXTRACT_16BITS((const uint8_t *)ni + 4))); |
| 145 | ND_PRINT((ndo, " Key-ID %u,", *((const uint8_t *)ni + 6))); |
| 146 | ND_PRINT((ndo, " Auth Data Len %u,", *((const uint8_t *)ni + 7))); |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 147 | ND_PRINT((ndo, " SeqNo %u,", EXTRACT_32BITS(&ni->rip_dest_mask))); |
| 148 | ND_PRINT((ndo, " MBZ %u,", EXTRACT_32BITS(&ni->rip_router))); |
| 149 | ND_PRINT((ndo, " MBZ %u", EXTRACT_32BITS(&ni->rip_metric))); |
JP Abgrall | 53f17a9 | 2014-02-12 14:02:41 -0800 | [diff] [blame] | 150 | } else if (auth_type == 1) { |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 151 | ND_PRINT((ndo, "\n\t Auth trailer:")); |
Elliott Hughes | e2e3bd1 | 2017-05-15 10:59:29 -0700 | [diff] [blame] | 152 | print_unknown_data(ndo, (const uint8_t *)&ni->rip_dest, "\n\t ", remaining); |
JP Abgrall | 53f17a9 | 2014-02-12 14:02:41 -0800 | [diff] [blame] | 153 | return remaining; /* AT spans till the packet end */ |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 154 | } else { |
| 155 | ND_PRINT((ndo, "\n\t Unknown (%u) Authentication data:", |
| 156 | EXTRACT_16BITS(&ni->rip_tag))); |
Elliott Hughes | e2e3bd1 | 2017-05-15 10:59:29 -0700 | [diff] [blame] | 157 | print_unknown_data(ndo, (const uint8_t *)&ni->rip_dest, "\n\t ", remaining); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 158 | } |
JP Abgrall | 53f17a9 | 2014-02-12 14:02:41 -0800 | [diff] [blame] | 159 | } else if (family != BSD_AFNUM_INET && family != 0) { |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 160 | ND_PRINT((ndo, "\n\t AFI %s", tok2str(bsd_af_values, "Unknown (%u)", family))); |
Elliott Hughes | e2e3bd1 | 2017-05-15 10:59:29 -0700 | [diff] [blame] | 161 | print_unknown_data(ndo, (const uint8_t *)&ni->rip_tag, "\n\t ", RIP_ROUTELEN-2); |
JP Abgrall | 53f17a9 | 2014-02-12 14:02:41 -0800 | [diff] [blame] | 162 | } else { /* BSD_AFNUM_INET or AFI 0 */ |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 163 | ND_PRINT((ndo, "\n\t AFI %s, %15s/%-2d, tag 0x%04x, metric: %u, next-hop: ", |
JP Abgrall | 53f17a9 | 2014-02-12 14:02:41 -0800 | [diff] [blame] | 164 | tok2str(bsd_af_values, "%u", family), |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 165 | ipaddr_string(ndo, &ni->rip_dest), |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 166 | mask2plen(EXTRACT_32BITS(&ni->rip_dest_mask)), |
| 167 | EXTRACT_16BITS(&ni->rip_tag), |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 168 | EXTRACT_32BITS(&ni->rip_metric))); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 169 | if (EXTRACT_32BITS(&ni->rip_router)) |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 170 | ND_PRINT((ndo, "%s", ipaddr_string(ndo, &ni->rip_router))); |
| 171 | else |
| 172 | ND_PRINT((ndo, "self")); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 173 | } |
JP Abgrall | 53f17a9 | 2014-02-12 14:02:41 -0800 | [diff] [blame] | 174 | return sizeof (*ni); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 175 | } |
| 176 | |
| 177 | void |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 178 | rip_print(netdissect_options *ndo, |
| 179 | const u_char *dat, u_int length) |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 180 | { |
| 181 | register const struct rip *rp; |
| 182 | register const struct rip_netinfo *ni; |
| 183 | register u_int i, j; |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 184 | |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 185 | if (ndo->ndo_snapend < dat) { |
| 186 | ND_PRINT((ndo, " %s", tstr)); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 187 | return; |
| 188 | } |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 189 | i = ndo->ndo_snapend - dat; |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 190 | if (i > length) |
| 191 | i = length; |
| 192 | if (i < sizeof(*rp)) { |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 193 | ND_PRINT((ndo, " %s", tstr)); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 194 | return; |
| 195 | } |
| 196 | i -= sizeof(*rp); |
| 197 | |
Elliott Hughes | e2e3bd1 | 2017-05-15 10:59:29 -0700 | [diff] [blame] | 198 | rp = (const struct rip *)dat; |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 199 | |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 200 | ND_PRINT((ndo, "%sRIPv%u", |
| 201 | (ndo->ndo_vflag >= 1) ? "\n\t" : "", |
| 202 | rp->rip_vers)); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 203 | |
| 204 | switch (rp->rip_vers) { |
| 205 | case 0: |
| 206 | /* |
| 207 | * RFC 1058. |
| 208 | * |
| 209 | * XXX - RFC 1058 says |
| 210 | * |
| 211 | * 0 Datagrams whose version number is zero are to be ignored. |
| 212 | * These are from a previous version of the protocol, whose |
| 213 | * packet format was machine-specific. |
| 214 | * |
| 215 | * so perhaps we should just dump the packet, in hex. |
| 216 | */ |
Elliott Hughes | e2e3bd1 | 2017-05-15 10:59:29 -0700 | [diff] [blame] | 217 | print_unknown_data(ndo, (const uint8_t *)&rp->rip_cmd, "\n\t", length); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 218 | break; |
| 219 | default: |
| 220 | /* dump version and lets see if we know the commands name*/ |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 221 | ND_PRINT((ndo, ", %s, length: %u", |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 222 | tok2str(rip_cmd_values, |
| 223 | "unknown command (%u)", |
| 224 | rp->rip_cmd), |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 225 | length)); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 226 | |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 227 | if (ndo->ndo_vflag < 1) |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 228 | return; |
| 229 | |
| 230 | switch (rp->rip_cmd) { |
JP Abgrall | 53f17a9 | 2014-02-12 14:02:41 -0800 | [diff] [blame] | 231 | case RIPCMD_REQUEST: |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 232 | case RIPCMD_RESPONSE: |
| 233 | j = length / sizeof(*ni); |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 234 | ND_PRINT((ndo, ", routes: %u%s", j, rp->rip_vers == 2 ? " or less" : "")); |
Elliott Hughes | e2e3bd1 | 2017-05-15 10:59:29 -0700 | [diff] [blame] | 235 | ni = (const struct rip_netinfo *)(rp + 1); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 236 | for (; i >= sizeof(*ni); ++ni) { |
| 237 | if (rp->rip_vers == 1) |
JP Abgrall | 53f17a9 | 2014-02-12 14:02:41 -0800 | [diff] [blame] | 238 | { |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 239 | rip_entry_print_v1(ndo, ni); |
JP Abgrall | 53f17a9 | 2014-02-12 14:02:41 -0800 | [diff] [blame] | 240 | i -= sizeof(*ni); |
| 241 | } |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 242 | else if (rp->rip_vers == 2) |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 243 | i -= rip_entry_print_v2(ndo, ni, i); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 244 | else |
| 245 | break; |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 246 | } |
JP Abgrall | 53f17a9 | 2014-02-12 14:02:41 -0800 | [diff] [blame] | 247 | if (i) |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 248 | ND_PRINT((ndo, "%s", tstr)); |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 249 | break; |
| 250 | |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 251 | case RIPCMD_TRACEOFF: |
| 252 | case RIPCMD_POLL: |
| 253 | case RIPCMD_POLLENTRY: |
| 254 | break; |
| 255 | |
| 256 | case RIPCMD_TRACEON: |
| 257 | /* fall through */ |
| 258 | default: |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 259 | if (ndo->ndo_vflag <= 1) { |
Elliott Hughes | e2e3bd1 | 2017-05-15 10:59:29 -0700 | [diff] [blame] | 260 | if(!print_unknown_data(ndo, (const uint8_t *)rp, "\n\t", length)) |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 261 | return; |
| 262 | } |
| 263 | break; |
| 264 | } |
| 265 | /* do we want to see an additionally hexdump ? */ |
Elliott Hughes | 892a68b | 2015-10-19 14:43:53 -0700 | [diff] [blame] | 266 | if (ndo->ndo_vflag> 1) { |
Elliott Hughes | e2e3bd1 | 2017-05-15 10:59:29 -0700 | [diff] [blame] | 267 | if(!print_unknown_data(ndo, (const uint8_t *)rp, "\n\t", length)) |
The Android Open Source Project | 2949f58 | 2009-03-03 19:30:46 -0800 | [diff] [blame] | 268 | return; |
| 269 | } |
| 270 | } |
| 271 | } |
| 272 | |
| 273 | |