summaryrefslogtreecommitdiffstats
path: root/conf
diff options
context:
space:
mode:
Diffstat (limited to 'conf')
-rw-r--r--conf/cf-lex.l2
-rw-r--r--conf/conf.c15
-rw-r--r--conf/conf.h2
3 files changed, 19 insertions, 0 deletions
diff --git a/conf/cf-lex.l b/conf/cf-lex.l
index 02ba4b3..ddfe8c7 100644
--- a/conf/cf-lex.l
+++ b/conf/cf-lex.l
@@ -533,6 +533,8 @@ cf_symbol_class_name(struct symbol *sym)
return "routing table";
case SYM_IPA:
return "network address";
+ case SYM_TEMPLATE:
+ return "protocol template";
default:
return "unknown type";
}
diff --git a/conf/conf.c b/conf/conf.c
index 5bdeece..4b605b3 100644
--- a/conf/conf.c
+++ b/conf/conf.c
@@ -377,3 +377,18 @@ cfg_strdup(char *c)
memcpy(z, c, l);
return z;
}
+
+
+void
+cfg_copy_list(list *dest, list *src, unsigned node_size)
+{
+ node *dn, *sn;
+
+ init_list(dest);
+ WALK_LIST(sn, *src)
+ {
+ dn = cfg_alloc(node_size);
+ memcpy(dn, sn, node_size);
+ add_tail(dest, dn);
+ }
+}
diff --git a/conf/conf.h b/conf/conf.h
index 142c6ad..8753baf 100644
--- a/conf/conf.h
+++ b/conf/conf.h
@@ -84,6 +84,7 @@ extern linpool *cfg_mem;
#define cfg_allocu(size) lp_allocu(cfg_mem, size)
#define cfg_allocz(size) lp_allocz(cfg_mem, size)
char *cfg_strdup(char *c);
+void cfg_copy_list(list *dest, list *src, unsigned node_size);
/* Lexer */
@@ -108,6 +109,7 @@ struct symbol {
#define SYM_FILTER 4
#define SYM_TABLE 5
#define SYM_IPA 6
+#define SYM_TEMPLATE 7
#define SYM_VARIABLE 0x100 /* 0x100-0x1ff are variable types */