break;
case NFTNL_OUTPUT_XML:
case NFTNL_OUTPUT_JSON:
- nftnl_table_fprintf(stdout, nlt, monh->format,
- netlink_msg2nftnl_of(type));
- fprintf(stdout, "\n");
+ nftnl_table_fprintf(monh->ctx->octx->output_fp, nlt,
+ monh->format, netlink_msg2nftnl_of(type));
+ nft_mon_print(monh, "\n");
break;
}
break;
case NFTNL_OUTPUT_XML:
case NFTNL_OUTPUT_JSON:
- nftnl_chain_fprintf(stdout, nlc, monh->format,
- netlink_msg2nftnl_of(type));
- fprintf(stdout, "\n");
+ nftnl_chain_fprintf(monh->ctx->octx->output_fp, nlc,
+ monh->format, netlink_msg2nftnl_of(type));
+ nft_mon_print(monh, "\n");
break;
}
break;
case NFTNL_OUTPUT_XML:
case NFTNL_OUTPUT_JSON:
- nftnl_set_fprintf(stdout, nls, monh->format,
- netlink_msg2nftnl_of(type));
- fprintf(stdout, "\n");
+ nftnl_set_fprintf(monh->ctx->octx->output_fp, nls,
+ monh->format, netlink_msg2nftnl_of(type));
+ nft_mon_print(monh, "\n");
break;
}
out:
break;
case NFTNL_OUTPUT_XML:
case NFTNL_OUTPUT_JSON:
- nftnl_set_fprintf(stdout, nls, monh->format,
- netlink_msg2nftnl_of(type));
- fprintf(stdout, "\n");
+ nftnl_set_fprintf(monh->ctx->octx->output_fp, nls,
+ monh->format, netlink_msg2nftnl_of(type));
+ nft_mon_print(monh, "\n");
break;
}
out:
break;
case NFTNL_OUTPUT_XML:
case NFTNL_OUTPUT_JSON:
- nftnl_obj_fprintf(stdout, nlo, monh->format,
- netlink_msg2nftnl_of(type));
- fprintf(stdout, "\n");
+ nftnl_obj_fprintf(monh->ctx->octx->output_fp, nlo,
+ monh->format, netlink_msg2nftnl_of(type));
+ nft_mon_print(monh, "\n");
break;
}
break;
case NFTNL_OUTPUT_XML:
case NFTNL_OUTPUT_JSON:
- nftnl_rule_fprintf(stdout, nlr, monh->format,
- netlink_msg2nftnl_of(type));
- fprintf(stdout, "\n");
+ nftnl_rule_fprintf(monh->ctx->octx->output_fp, nlr,
+ monh->format, netlink_msg2nftnl_of(type));
+ nft_mon_print(monh, "\n");
break;
}
ret = netlink_events_newgen_cb(nlh, type, monh);
break;
}
- fflush(stdout);
return ret;
}