static void
ofl_msg_print_error(struct ofl_msg_error *msg, FILE *stream) {
    fprintf(stream, "{type=\"");
    ofl_error_type_print(stream, msg->type);
    fprintf(stream, "\", code=\"");
    ofl_error_code_print(stream, msg->type, msg->code);
    fprintf(stream, "\", dlen=\"%zu\"}", msg->data_length);
}
Example #2
0
char *
ofl_error_type_to_string(uint16_t type) {
    char *str;
    size_t str_size;
    FILE *stream = open_memstream(&str, &str_size);

    ofl_error_type_print(stream, type);
    fclose(stream);
    return str;
}