diff options
author | Denis Ovsienko <denis@ovsienko.info> | 2020-09-30 12:56:43 +0100 |
---|---|---|
committer | Denis Ovsienko <denis@ovsienko.info> | 2020-09-30 14:53:37 +0100 |
commit | e17e42550af9159faf1b27f203797af780de25c1 (patch) | |
tree | 6a434d87d920e0ea62868af728101cdba031d50d /print-openflow.c | |
parent | 0a8c146f78c1cc40f5284ae2dcc52415c5938d49 (diff) | |
download | tcpdump-e17e42550af9159faf1b27f203797af780de25c1.tar.gz |
OpenFlow: Make one more function shared.
Rename of10_bitmap_print() to of_bitmap_print() and make it available
from print-openflow.c.
Diffstat (limited to 'print-openflow.c')
-rw-r--r-- | print-openflow.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/print-openflow.c b/print-openflow.c index 2b821880..699ebe88 100644 --- a/print-openflow.c +++ b/print-openflow.c @@ -82,6 +82,24 @@ of_vendor_name(const uint32_t vendor) } void +of_bitmap_print(netdissect_options *ndo, + const struct tok *t, const uint32_t v, const uint32_t u) +{ + const char *sep = " ("; + + if (v == 0) + return; + /* assigned bits */ + for (; t->s != NULL; t++) + if (v & t->v) { + ND_PRINT("%s%s", sep, t->s); + sep = ", "; + } + /* unassigned bits? */ + ND_PRINT((v & u) ? ") (bogus)" : ")"); +} + +void of_data_print(netdissect_options *ndo, const u_char *cp, const u_int len) { |