summaryrefslogtreecommitdiffstats
path: root/src/table.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/table.c')
-rw-r--r--src/table.c33
1 files changed, 3 insertions, 30 deletions
diff --git a/src/table.c b/src/table.c
index 1d17d3b..1f4fe76 100644
--- a/src/table.c
+++ b/src/table.c
@@ -223,8 +223,6 @@ static int nft_table_xml_parse(struct nft_table *t, char *xml)
#ifdef XML_PARSING
mxml_node_t *tree = NULL;
mxml_node_t *node = NULL;
- char *endptr = NULL;
- int64_t stmp;
int family;
/* NOTE: all XML nodes are mandatory */
@@ -234,18 +232,6 @@ static int nft_table_xml_parse(struct nft_table *t, char *xml)
if (tree == NULL)
return -1;
- /* Check the version of the XML */
- if (mxmlElementGetAttr(tree, "version") == NULL) {
- mxmlDelete(tree);
- return -1;
- }
-
- stmp = strtoll(mxmlElementGetAttr(tree, "version"), &endptr, 10);
- if (stmp == LLONG_MAX || *endptr || stmp != NFT_TABLE_XML_VERSION) {
- mxmlDelete(tree);
- return -1;
- }
-
/* Get and set the name of the table */
if (mxmlElementGetAttr(tree, "name") == NULL) {
mxmlDelete(tree);
@@ -300,7 +286,6 @@ static int nft_table_json_parse(struct nft_table *t, char *json)
#ifdef JSON_PARSING
json_t *root;
json_error_t error;
- uint64_t version;
uint32_t table_flag;
const char *str;
int family;
@@ -317,15 +302,6 @@ static int nft_table_json_parse(struct nft_table *t, char *json)
goto err;
}
- if (nft_jansson_value_parse_val(root, "version",
- NFT_TYPE_U64, &version) == -1)
- goto err;
-
- if (version != NFT_TABLE_JSON_VERSION) {
- errno = EINVAL;
- goto err;
- }
-
str = nft_jansson_value_parse_str(root, "name");
if (str == NULL)
goto err;
@@ -392,27 +368,24 @@ static int nft_table_snprintf_json(char *buf, size_t size, struct nft_table *t)
return snprintf(buf, size,
"{\"table\" : {"
"\"name\" : \"%s\","
- "\"version\" : %d,"
"\"properties\" : {"
"\"family\" : \"%s\","
"\"table_flags\" : %d"
"}"
"}"
"}" ,
- t->name, NFT_TABLE_JSON_VERSION,
- nft_family2str(t->family), t->table_flags);
+ t->name, nft_family2str(t->family), t->table_flags);
}
static int nft_table_snprintf_xml(char *buf, size_t size, struct nft_table *t)
{
- return snprintf(buf, size, "<table name=\"%s\" version=\"%d\">"
+ return snprintf(buf, size, "<table name=\"%s\">"
"<properties>"
"<family>%s</family>"
"<table_flags>%d</table_flags>"
"</properties>"
"</table>",
- t->name, NFT_TABLE_XML_VERSION,
- nft_family2str(t->family), t->table_flags);
+ t->name, nft_family2str(t->family), t->table_flags);
}
static int nft_table_snprintf_default(char *buf, size_t size, struct nft_table *t)