summaryrefslogtreecommitdiffstats
path: root/src/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common.c')
-rw-r--r--src/common.c74
1 files changed, 0 insertions, 74 deletions
diff --git a/src/common.c b/src/common.c
index 561c954..feb13b2 100644
--- a/src/common.c
+++ b/src/common.c
@@ -91,80 +91,6 @@ int nftnl_parse_perror(const char *msg, struct nftnl_parse_err *err)
}
}
-int nftnl_cmd_header_snprintf(char *buf, size_t size, uint32_t cmd, uint32_t type,
- uint32_t flags)
-{
- NFTNL_BUF_INIT(b, buf, size);
-
- if (cmd == NFTNL_CMD_UNSPEC)
- return 0;
-
- switch (type) {
- case NFTNL_OUTPUT_XML:
- case NFTNL_OUTPUT_JSON:
- nftnl_buf_open_array(&b, type, nftnl_cmd2tag(cmd));
- break;
- default:
- switch (cmd) {
- case NFTNL_CMD_ADD:
- return snprintf(buf, size, "%9s", "[ADD] ");
- case NFTNL_CMD_DELETE:
- return snprintf(buf, size, "%9s", "[DELETE] ");
- default:
- return snprintf(buf, size, "%9s", "[unknown] ");
- }
- break;
- }
- return nftnl_buf_done(&b);
-}
-
-static int nftnl_cmd_header_fprintf_cb(char *buf, size_t size, const void *obj,
- uint32_t cmd, uint32_t type,
- uint32_t flags)
-{
- return nftnl_cmd_header_snprintf(buf, size, cmd, type, flags);
-}
-
-int nftnl_cmd_header_fprintf(FILE *fp, uint32_t cmd, uint32_t type,
- uint32_t flags)
-{
- return nftnl_fprintf(fp, NULL, cmd, type, flags,
- nftnl_cmd_header_fprintf_cb);
-}
-
-int nftnl_cmd_footer_snprintf(char *buf, size_t size, uint32_t cmd, uint32_t type,
- uint32_t flags)
-{
- NFTNL_BUF_INIT(b, buf, size);
-
- if (cmd == NFTNL_CMD_UNSPEC)
- return 0;
-
- switch (type) {
- case NFTNL_OUTPUT_XML:
- case NFTNL_OUTPUT_JSON:
- nftnl_buf_close_array(&b, type, nftnl_cmd2tag(cmd));
- break;
- default:
- return 0;
- }
- return nftnl_buf_done(&b);
-}
-
-static int nftnl_cmd_footer_fprintf_cb(char *buf, size_t size, const void *obj,
- uint32_t cmd, uint32_t type,
- uint32_t flags)
-{
- return nftnl_cmd_footer_snprintf(buf, size, cmd, type, flags);
-}
-
-int nftnl_cmd_footer_fprintf(FILE *fp, uint32_t cmd, uint32_t type,
- uint32_t flags)
-{
- return nftnl_fprintf(fp, NULL, cmd, type, flags,
- nftnl_cmd_footer_fprintf_cb);
-}
-
EXPORT_SYMBOL(nftnl_batch_begin);
struct nlmsghdr *nftnl_batch_begin(char *buf, uint32_t seq)
{