]> The Tcpdump Group git mirrors - tcpdump/commit
OpenFlow: Improve the common header dissection.
authorDenis Ovsienko <[email protected]>
Sun, 27 Sep 2020 22:07:40 +0000 (23:07 +0100)
committerDenis Ovsienko <[email protected]>
Mon, 28 Sep 2020 12:58:12 +0000 (13:58 +0100)
commitafb9acd6bcbfc37d6977ac850e422f7374a69684
treee439dde85b5d9ac3f3f6898d01a1c41166f72507
parent8bd8cb7c591feb05ced9b078d900d6102ebf55f4
OpenFlow: Improve the common header dissection.

of_header_print() printed any version as "unknown", always printed the
type in hex only and printed the length with no remarks. If the header
was not good enough to proceed, openflow_print() would just print
"(invalid)" after it and be done with it.

Introduce of10_msgtype_str(). Rename of10_header_body_print() to
of10_message_print() and unburden it of all common header details. Add a
registry of all known OpenFlow version numbers. Merge of_header_print()
into openflow_print() and take the header apart one field at a time with
the captured and the declared lengths in mind, and indicate any anomalies
in version, type and length independently. Try to print the transaction
ID too before giving up on the header.

Among other changes, the header now shows the type as "unknown" when the
decoder does not know which types are valid for the version, and as
"invalid" when the type is definitely not valid for the version. Update
two tests.
openflow.h
print-openflow-1.0.c
print-openflow.c
tests/of10_p3295-vv.out
tests/of10_s4810-vvvv.out