lib/ofp-port.c
/* Returns the number of port stats elements in OFPTYPE_PORT_STATS_REPLY
 * message 'oh'. */
Returns the number of port stats elements in OFPTYPE_PORT_STATS_REPLY
message 'oh'.
Returns the number of port stats elements in OFPTYPE_PORT_STATS_REPLY message ' oh ' .
size_t
ofputil_count_port_stats(const struct ofp_header *oh)
{
    struct ofpbuf b = ofpbuf_const_initializer(oh, ntohs(oh->length));
    ofpraw_pull_assert(&b);
    for (size_t n = 0; ; n++) {
        struct ofputil_port_stats ps;
        if (ofputil_decode_port_stats(&ps, &b)) {
            return n;
        }
        netdev_free_custom_stats_counters(&ps.custom_stats);
    }
}
size_t ofputil_count_port_stats ( const struct ofp_header * oh ) { struct ofpbuf b = ofpbuf_const_initializer ( oh , ntohs ( oh -> length ) ) ; ofpraw_pull_assert ( & b ) ; for ( size_t n = 0 ; ; n ++ ) { struct ofputil_port_stats ps ; if ( ofputil_decode_port_stats ( & ps , & b ) ) { return n ; } netdev_free_custom_stats_counters ( & ps . custom_stats ) ; } }
Returns the number of port stats elements in OFPTYPE_PORT_STATS_REPLY
 message 'oh'.
Returns the number of port stats elements in OFPTYPE_PORT_STATS_REPLY message ' oh ' .