summaryrefslogtreecommitdiffstats
path: root/src/expr/nat.c
diff options
context:
space:
mode:
authorArturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>2013-09-13 14:05:51 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2013-09-16 12:47:41 +0200
commitf4befc129827632209779c71d804f6139ac03541 (patch)
treea6eee54267a676aed33de92089102cba694d2415 /src/expr/nat.c
parent8281648cab5a9189fdb0806c0f3801d6ffebef9a (diff)
src: xml: add parsing optional/mandatory flag
Add an optional/mandatory flag to XML parsing. In some elements (ie regs), no flag is used because is always mandatory. DATA_NONE is created to indicate a non-parsed data_reg. Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/expr/nat.c')
-rw-r--r--src/expr/nat.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/expr/nat.c b/src/expr/nat.c
index 1ebecda..da28ede 100644
--- a/src/expr/nat.c
+++ b/src/expr/nat.c
@@ -262,7 +262,8 @@ static int nft_rule_expr_nat_xml_parse(struct nft_rule_expr *e, mxml_node_t *tre
int32_t reg;
int family, nat_type_value;
- nat_type = nft_mxml_str_parse(tree, "type", MXML_DESCEND_FIRST);
+ nat_type = nft_mxml_str_parse(tree, "type", MXML_DESCEND_FIRST,
+ NFT_XML_MAND);
if (nat_type == NULL)
return -1;
@@ -273,7 +274,8 @@ static int nft_rule_expr_nat_xml_parse(struct nft_rule_expr *e, mxml_node_t *tre
nat->type = nat_type_value;
e->flags |= (1 << NFT_EXPR_NAT_TYPE);
- family = nft_mxml_family_parse(tree, "family", MXML_DESCEND_FIRST);
+ family = nft_mxml_family_parse(tree, "family", MXML_DESCEND_FIRST,
+ NFT_XML_MAND);
if (family < 0) {
mxmlDelete(tree);
return -1;