diff options
| author | Ben Pfaff <blp@nicira.com> | 2011-03-15 10:08:54 -0700 |
|---|---|---|
| committer | Ben Pfaff <blp@nicira.com> | 2011-03-29 12:28:10 -0700 |
| commit | 4093ec5979ce09b2cdbaa2960dfc472fad139637 (patch) | |
| tree | 0c73d6c0612b057c5705a03bc96c067e09aea9d4 /lib | |
| parent | ebb57021a9827b59997a00defc32bf761bc16148 (diff) | |
| download | openvswitch-4093ec5979ce09b2cdbaa2960dfc472fad139637.tar.gz | |
ofproto: Move hton_ofp_phy_port() to ofp-util.
This removes some code from ofproto.c that doesn't really seem to
belong there to begin with.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/ofp-util.c | 13 | ||||
| -rw-r--r-- | lib/ofp-util.h | 2 |
2 files changed, 15 insertions, 0 deletions
diff --git a/lib/ofp-util.c b/lib/ofp-util.c index e42abc50f..d91fbb11f 100644 --- a/lib/ofp-util.c +++ b/lib/ofp-util.c @@ -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) diff --git a/lib/ofp-util.h b/lib/ofp-util.h index b4fe64238..75e76e24c 100644 --- a/lib/ofp-util.h +++ b/lib/ofp-util.h @@ -257,6 +257,8 @@ struct ofpbuf *make_unbuffered_packet_out(const struct ofpbuf *packet, struct ofpbuf *make_echo_request(void); struct ofpbuf *make_echo_reply(const struct ofp_header *rq); +void hton_ofp_phy_port(struct ofp_phy_port *); + struct flow_stats_iterator { const uint8_t *pos, *end; }; |
