diff options
Diffstat (limited to 'lib/ofp-msgs.c')
-rw-r--r-- | lib/ofp-msgs.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/ofp-msgs.c b/lib/ofp-msgs.c index b67e47a7c..e54918efc 100644 --- a/lib/ofp-msgs.c +++ b/lib/ofp-msgs.c @@ -935,6 +935,31 @@ ofpmp_postappend(struct list *replies, size_t start_ofs) } } +/* Returns the OpenFlow version of the replies being constructed in 'replies', + * which should have been initialized by ofpmp_init(). */ +enum ofp_version +ofpmp_version(struct list *replies) +{ + struct ofpbuf *msg = ofpbuf_from_list(list_back(replies)); + const struct ofp_header *oh = ofpbuf_data(msg); + + return oh->version; +} + +/* Determines the OFPRAW_* type of the OpenFlow messages in 'replies', which + * should have been initialized by ofpmp_init(). */ +enum ofpraw +ofpmp_decode_raw(struct list *replies) +{ + struct ofpbuf *msg = ofpbuf_from_list(list_back(replies)); + enum ofperr error; + enum ofpraw raw; + + error = ofpraw_decode_partial(&raw, ofpbuf_data(msg), ofpbuf_size(msg)); + ovs_assert(!error); + return raw; +} + static ovs_be16 * ofpmp_flags__(const struct ofp_header *oh) { |