odp-util: Use proper formatting for ODP port number.
[sliver-openvswitch.git] / lib / ofp-util.h
index 4d0d8ad..1c8d6cd 100644 (file)
@@ -27,6 +27,7 @@
 #include "netdev.h"
 #include "openflow/nicira-ext.h"
 #include "openvswitch/types.h"
+#include "type-props.h"
 
 struct ofpbuf;
 
@@ -334,7 +335,10 @@ struct ofpbuf *ofputil_encode_packet_in(const struct ofputil_packet_in *,
                                         enum ofputil_protocol protocol,
                                         enum nx_packet_in_format);
 
-const char *ofputil_packet_in_reason_to_string(enum ofp_packet_in_reason);
+enum { OFPUTIL_PACKET_IN_REASON_BUFSIZE = INT_STRLEN(int) + 1 };
+const char *ofputil_packet_in_reason_to_string(enum ofp_packet_in_reason,
+                                               char *reasonbuf,
+                                               size_t bufsize);
 bool ofputil_packet_in_reason_from_string(const char *,
                                           enum ofp_packet_in_reason *);
 
@@ -689,6 +693,8 @@ bool ofputil_parse_key_value(char **stringp, char **keyp, char **valuep);
 struct ofputil_port_stats {
     uint16_t port_no;
     struct netdev_stats stats;
+    uint32_t duration_sec;      /* UINT32_MAX if unknown. */
+    uint32_t duration_nsec;
 };
 
 struct ofpbuf *ofputil_encode_dump_ports_request(enum ofp_version ofp_version,