}
}
+static void
+switch_status_reply(struct ds *string, const void *body, size_t len,
+ int verbosity UNUSED)
+{
+ char *save_ptr = NULL;
+ char *s, *line;
+
+ s = xmemdup0(body, len);
+ for (line = strtok_r(s, "\n\n", &save_ptr); line != NULL;
+ line = strtok_r(NULL, "\n\n", &save_ptr)) {
+ ds_put_printable(string, line, strlen(line));
+ ds_put_char(string, '\n');
+ }
+ free(s);
+}
+
enum stats_direction {
REQUEST,
REPLY
{ 0, 0, NULL, },
{ 0, SIZE_MAX, ofp_port_stats_reply },
},
+ [OFPST_SWITCH] = {
+ "switch status",
+ { 0, 0, NULL, },
+ { 0, SIZE_MAX, switch_status_reply },
+ },
};
const struct stats_type *s;