lib/ofp-msgs.c
/* Returns the stats reply that corresponds to 'raw' in the given OpenFlow
 * 'version'. */
Returns the stats reply that corresponds to 'raw' in the given OpenFlow
'version'.
Returns the stats reply that corresponds to ' raw ' in the given OpenFlow ' version ' .
enum ofpraw
ofpraw_stats_request_to_reply(enum ofpraw raw, uint8_t version)
{
    const struct raw_info *info = raw_info_get(raw);
    const struct raw_instance *instance = raw_instance_get(info, version);
    enum ofpraw reply_raw;
    struct ofphdrs hdrs;
    hdrs = instance->hdrs;
    switch ((enum ofp_version)hdrs.version) {
    case OFP10_VERSION:
        ovs_assert(hdrs.type == OFPT10_STATS_REQUEST);
        hdrs.type = OFPT10_STATS_REPLY;
        break;
    case OFP11_VERSION:
    case OFP12_VERSION:
    case OFP13_VERSION:
    case OFP14_VERSION:
    case OFP15_VERSION:
        ovs_assert(hdrs.type == OFPT11_STATS_REQUEST);
        hdrs.type = OFPT11_STATS_REPLY;
        break;
    default:
        OVS_NOT_REACHED();
    }
    ovs_assert(!ofpraw_from_ofphdrs(&reply_raw, &hdrs));
    return reply_raw;
}
enum ofpraw ofpraw_stats_request_to_reply ( enum ofpraw raw , uint8_t version ) { const struct raw_info * info = raw_info_get ( raw ) ; const struct raw_instance * instance = raw_instance_get ( info , version ) ; enum ofpraw reply_raw ; struct ofphdrs hdrs ; hdrs = instance -> hdrs ; switch ( ( enum ofp_version ) hdrs . version ) { case OFP10_VERSION : ovs_assert ( hdrs . type == OFPT10_STATS_REQUEST ) ; hdrs . type = OFPT10_STATS_REPLY ; break ; case OFP11_VERSION : case OFP12_VERSION : case OFP13_VERSION : case OFP14_VERSION : case OFP15_VERSION : ovs_assert ( hdrs . type == OFPT11_STATS_REQUEST ) ; hdrs . type = OFPT11_STATS_REPLY ; break ; default : OVS_NOT_REACHED ( ) ; } ovs_assert ( ! ofpraw_from_ofphdrs ( & reply_raw , & hdrs ) ) ; return reply_raw ; }
Returns the stats reply that corresponds to 'raw' in the given OpenFlow
 'version'.
Returns the stats reply that corresponds to ' raw ' in the given OpenFlow ' version ' .