summaryrefslogtreecommitdiff
path: root/conf/conf.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2011-11-07 00:31:23 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2011-11-07 00:31:23 +0100
commita7f23f581f5e3efe92ec97dfca7d01c66f31ab04 (patch)
tree3a8f7cffb7abce83b7bce8be87d21be8a2fbff72 /conf/conf.c
parent74add5df17c386bd109ebea7b1dac04d1651ae51 (diff)
Implements protocol templates.
Based on the patch from Alexander V. Chernikov. Extended to support almost all protocols. Uses 'protocol bgp NAME from TEMPLATE { ... }' syntax.
Diffstat (limited to 'conf/conf.c')
-rw-r--r--conf/conf.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/conf/conf.c b/conf/conf.c
index 5bdeece2..4b605b36 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);
+ }
+}