From: Denis Ovsienko Date: Thu, 1 Jan 2015 15:09:25 +0000 (+0000) Subject: add a comment to print-openflow-1.0.c X-Git-Tag: tcpdump-4.7.2~1^2~54 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/af7c82332e79d9f019ef344f714b0860783e8af6 add a comment to print-openflow-1.0.c --- diff --git a/print-openflow-1.0.c b/print-openflow-1.0.c index 4751f3c8..590caba4 100644 --- a/print-openflow-1.0.c +++ b/print-openflow-1.0.c @@ -8,6 +8,16 @@ * * [OF10] http://www.openflow.org/documents/openflow-spec-v1.0.0.pdf * + * Most functions in this file take 3 arguments into account: + * * cp -- the pointer to the first octet to decode + * * len -- the length of the current structure as declared on the wire + * * ep -- the pointer to the end of the captured frame + * They return either the pointer to the next not-yet-decoded part of the frame + * or the value of ep, which means the current frame processing is over as it + * has been fully decoded or is malformed or truncated. This way it is possible + * to chain and nest such functions uniformly to decode an OF1.0 message, which + * consists of several layers of nested structures. + * * Decoding of Ethernet frames nested in OFPT_PACKET_IN and OFPT_PACKET_OUT * messages is done only when the verbosity level set by command-line argument * is "-vvv" or higher. In that case the verbosity level is temporarily