Add support for understanding ICMP type and code in flow entries.
[sliver-openvswitch.git] / include / openflow / openflow.h
index 15c73ad..e7da0d1 100644 (file)
@@ -469,6 +469,11 @@ enum ofp_flow_wildcards {
     OFPFW_ALL = ((1 << 20) - 1)
 };
 
+/* The wildcards for ICMP type and code fields use the transport source 
+ * and destination port fields, respectively. */
+#define OFPFW_ICMP_TYPE OFPFW_TP_SRC
+#define OFPFW_ICMP_CODE OFPFW_TP_DST
+
 /* Values below this cutoff are 802.3 packets and the two bytes
  * following MAC addresses are used as a frame length.  Otherwise, the
  * two bytes are used as the Ethernet type.
@@ -502,6 +507,11 @@ struct ofp_match {
 };
 OFP_ASSERT(sizeof(struct ofp_match) == 36);
 
+/* The match fields for ICMP type and code use the transport source and 
+ * destination port fields, respectively. */
+#define icmp_type tp_src
+#define icmp_code tp_dst
+
 /* Value used in "idle_timeout" and "hard_timeout" to indicate that the entry
  * is permanent. */
 #define OFP_FLOW_PERMANENT 0