diff options
Diffstat (limited to 'freebsd/contrib/tcpdump/print-icmp6.c')
-rw-r--r-- | freebsd/contrib/tcpdump/print-icmp6.c | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/freebsd/contrib/tcpdump/print-icmp6.c b/freebsd/contrib/tcpdump/print-icmp6.c index 33f36ddd..f66d4f86 100644 --- a/freebsd/contrib/tcpdump/print-icmp6.c +++ b/freebsd/contrib/tcpdump/print-icmp6.c @@ -47,6 +47,10 @@ #include "udp.h" #include "ah.h" +static const char icmp6_tstr[] = " [|icmp6]"; +static const char rpl_tstr[] = " [|rpl]"; +static const char mldv2_tstr[] = " [|mldv2]"; + /* NetBSD: icmp6.h,v 1.13 2000/08/03 16:30:37 itojun Exp */ /* $KAME: icmp6.h,v 1.22 2000/08/03 15:25:16 jinmei Exp $ */ @@ -689,10 +693,11 @@ rpl_dio_printopt(netdissect_options *ndo, } opt = (const struct rpl_dio_genoption *)(((const char *)opt) + optlen); length -= optlen; + ND_TCHECK(opt->rpl_dio_len); } return; trunc: - ND_PRINT((ndo," [|truncated]")); + ND_PRINT((ndo, "%s", rpl_tstr)); return; } @@ -721,7 +726,7 @@ rpl_dio_print(netdissect_options *ndo, } return; trunc: - ND_PRINT((ndo," [|truncated]")); + ND_PRINT((ndo, "%s", rpl_tstr)); return; } @@ -762,7 +767,7 @@ rpl_dao_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo," [|truncated]")); + ND_PRINT((ndo, "%s", rpl_tstr)); return; tooshort: @@ -806,7 +811,7 @@ rpl_daoack_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo," [|dao-truncated]")); + ND_PRINT((ndo, "%s", rpl_tstr)); return; tooshort: @@ -865,7 +870,7 @@ rpl_print(netdissect_options *ndo, #if 0 trunc: - ND_PRINT((ndo," [|truncated]")); + ND_PRINT((ndo, "%s", rpl_tstr)); return; #endif @@ -1040,7 +1045,7 @@ icmp6_print(netdissect_options *ndo, p = (const struct nd_router_advert *)dp; ND_TCHECK(p->nd_ra_retransmit); ND_PRINT((ndo,"\n\thop limit %u, Flags [%s]" \ - ", pref %s, router lifetime %us, reachable time %us, retrans time %us", + ", pref %s, router lifetime %us, reachable time %ums, retrans timer %ums", (u_int)p->nd_ra_curhoplimit, bittok2str(icmp6_opt_ra_flag_values,"none",(p->nd_ra_flags_reserved)), get_rtpref(p->nd_ra_flags_reserved), @@ -1163,7 +1168,7 @@ icmp6_print(netdissect_options *ndo, ND_PRINT((ndo,", length %u", length)); return; trunc: - ND_PRINT((ndo, "[|icmp6]")); + ND_PRINT((ndo, "%s", icmp6_tstr)); } static const struct udphdr * @@ -1387,8 +1392,8 @@ icmp6_opt_print(netdissect_options *ndo, const u_char *bp, int resid) } return; - trunc: - ND_PRINT((ndo, "[ndp opt]")); +trunc: + ND_PRINT((ndo, "%s", icmp6_tstr)); return; #undef ECHECK } @@ -1463,7 +1468,7 @@ mldv2_report_print(netdissect_options *ndo, const u_char *bp, u_int len) } return; trunc: - ND_PRINT((ndo,"[|icmp6]")); + ND_PRINT((ndo, "%s", mldv2_tstr)); return; } @@ -1529,7 +1534,7 @@ mldv2_query_print(netdissect_options *ndo, const u_char *bp, u_int len) ND_PRINT((ndo,"]")); return; trunc: - ND_PRINT((ndo,"[|icmp6]")); + ND_PRINT((ndo, "%s", mldv2_tstr)); return; } @@ -1816,7 +1821,7 @@ icmp6_nodeinfo_print(netdissect_options *ndo, u_int icmp6len, const u_char *bp, return; trunc: - ND_PRINT((ndo, "[|icmp6]")); + ND_PRINT((ndo, "%s", icmp6_tstr)); } static void @@ -1951,7 +1956,7 @@ icmp6_rrenum_print(netdissect_options *ndo, const u_char *bp, const u_char *ep) return; trunc: - ND_PRINT((ndo,"[|icmp6]")); + ND_PRINT((ndo, "%s", icmp6_tstr)); } /* |