X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/1ac47641c5766875f0c02fa3ace8b6a1786a61ed..dcae3b01d76f9a040f2a6e3d2c861c25c2d60a73:/print-mptcp.c diff --git a/print-mptcp.c b/print-mptcp.c index b8af92db..de12f30e 100644 --- a/print-mptcp.c +++ b/print-mptcp.c @@ -66,6 +66,20 @@ struct mptcp_option { #define MPTCP_OPT_SUBTYPE(sub_etc) (((sub_etc) >> 4) & 0xF) +#define MP_CAPABLE_A 0x80 + +static const struct tok mp_capable_flags[] = { + { MP_CAPABLE_A, "A" }, + { 0x40, "B" }, + { 0x20, "C" }, + { 0x10, "D" }, + { 0x08, "E" }, + { 0x04, "F" }, + { 0x02, "G" }, + { 0x01, "H" }, + { 0, NULL } +}; + struct mp_capable { nd_uint8_t kind; nd_uint8_t len; @@ -77,8 +91,6 @@ struct mp_capable { }; #define MP_CAPABLE_OPT_VERSION(sub_ver) (((sub_ver) >> 0) & 0xF) -#define MP_CAPABLE_C 0x80 -#define MP_CAPABLE_S 0x01 struct mp_join { nd_uint8_t kind; @@ -238,8 +250,11 @@ mp_capable_print(netdissect_options *ndo, ND_PRINT(" Unknown Version (%u)", version); return 1; } + + ND_PRINT(" flags [%s]", bittok2str_nosep(mp_capable_flags, "none", + GET_U_1(mpc->flags))); - csum_enabled = GET_U_1(mpc->flags) & MP_CAPABLE_C; + csum_enabled = GET_U_1(mpc->flags) & MP_CAPABLE_A; if (csum_enabled) ND_PRINT(" csum"); if (opt_len == 12 || opt_len >= 20) {