aboutsummaryrefslogtreecommitdiff
path: root/lib/ofp-util.h
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2013-10-22 16:38:46 -0700
committerBen Pfaff <blp@nicira.com>2013-10-22 21:12:06 -0700
commit22ee3544769ae9e9d35e8efa92b4b50468badf09 (patch)
treea79b6282ea8c66b7bafd78e8715c7c11243ae92c /lib/ofp-util.h
parentd38a3c7b8eb5d341c9e27b74b4a459dee284f770 (diff)
ofp-util: Improve comments on struct ofputil_packet_in.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib/ofp-util.h')
-rw-r--r--lib/ofp-util.h30
1 files changed, 23 insertions, 7 deletions
diff --git a/lib/ofp-util.h b/lib/ofp-util.h
index b1275d7d..edf7ad2e 100644
--- a/lib/ofp-util.h
+++ b/lib/ofp-util.h
@@ -376,17 +376,33 @@ struct ofpbuf *ofputil_encode_flow_removed(const struct ofputil_flow_removed *,
/* Abstract packet-in message. */
struct ofputil_packet_in {
+ /* Packet data and metadata.
+ *
+ * To save bandwidth, in some cases a switch may send only the first
+ * several bytes of a packet, indicated by 'packet_len < total_len'. When
+ * the full packet is included, 'packet_len == total_len'. */
const void *packet;
- size_t packet_len;
-
- enum ofp_packet_in_reason reason; /* One of OFPR_*. */
- uint8_t table_id;
- ovs_be64 cookie;
+ size_t packet_len; /* Number of bytes in 'packet'. */
+ size_t total_len; /* Size of packet, pre-truncation. */
+ struct flow_metadata fmd;
+ /* Identifies a buffer in the switch that contains the full packet, to
+ * allow the controller to reference it later without having to send the
+ * entire packet back to the switch.
+ *
+ * UINT32_MAX indicates that the packet is not buffered in the switch. A
+ * switch should only use UINT32_MAX when it sends the entire packet. */
uint32_t buffer_id;
- uint16_t total_len; /* Full length of frame. */
- struct flow_metadata fmd; /* Metadata at creation time. */
+ /* Reason that the packet-in is being sent. */
+ enum ofp_packet_in_reason reason; /* One of OFPR_*. */
+
+ /* Information about the OpenFlow flow that triggered the packet-in.
+ *
+ * A packet-in triggered by a flow table miss has no associated flow. In
+ * that case, 'cookie' is 0. */
+ uint8_t table_id; /* OpenFlow table ID. */
+ ovs_be64 cookie; /* Flow's cookie. */
};
enum ofperr ofputil_decode_packet_in(struct ofputil_packet_in *,