ofproto: Move hton_ofp_phy_port() to ofp-util.
[sliver-openvswitch.git] / lib / ofp-util.c
index e42abc5..d91fbb1 100644 (file)
@@ -1863,6 +1863,19 @@ make_echo_reply(const struct ofp_header *rq)
     return out;
 }
 
+/* Converts the members of 'opp' from host to network byte order. */
+void
+hton_ofp_phy_port(struct ofp_phy_port *opp)
+{
+    opp->port_no = htons(opp->port_no);
+    opp->config = htonl(opp->config);
+    opp->state = htonl(opp->state);
+    opp->curr = htonl(opp->curr);
+    opp->advertised = htonl(opp->advertised);
+    opp->supported = htonl(opp->supported);
+    opp->peer = htonl(opp->peer);
+}
+
 const struct ofp_flow_stats *
 flow_stats_first(struct flow_stats_iterator *iter,
                  const struct ofp_stats_reply *osr)