summaryrefslogtreecommitdiff
path: root/conf/gen_keywords.m4
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2019-11-03 20:26:54 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2019-11-03 22:25:44 +0100
commit0edf0c8cd919a8b3fbf5bc036f27ea0b4ed0b91a (patch)
tree07ae1b48e392992e58ad0f1a230ea180739a29b3 /conf/gen_keywords.m4
parent08c4c9a30b7ed61be39ddc71aebd69a0fea6a55a (diff)
Support for address family constants
We already had them defined on BGP level, but they are more general.
Diffstat (limited to 'conf/gen_keywords.m4')
-rw-r--r--conf/gen_keywords.m46
1 files changed, 4 insertions, 2 deletions
diff --git a/conf/gen_keywords.m4 b/conf/gen_keywords.m4
index cf3fb58e..0c1dc545 100644
--- a/conf/gen_keywords.m4
+++ b/conf/gen_keywords.m4
@@ -34,9 +34,11 @@ m4_define(CF_CLI, `CF_KEYWORDS(m4_translit($1, [[ ]], [[,]]))
')
# Enums are translated to C initializers: use CF_ENUM(typename, prefix, values)
-m4_define(CF_enum, `m4_divert(1){ "CF_enum_prefix[[]]$1", -((CF_enum_type<<16) | CF_enum_prefix[[]]$1), NULL },
+# For different prefix: CF_ENUM_PX(typename, external prefix, C prefix, values)
+m4_define(CF_enum, `m4_divert(1){ "CF_enum_prefix_ext[[]]$1", -((CF_enum_type<<16) | CF_enum_prefix_int[[]]$1), NULL },
m4_divert(-1)')
-m4_define(CF_ENUM, `m4_define([[CF_enum_type]],$1)m4_define([[CF_enum_prefix]],$2)CF_iterate([[CF_enum]], [[m4_shift(m4_shift($@))]])DNL')
+m4_define(CF_ENUM, `m4_define([[CF_enum_type]],$1)m4_define([[CF_enum_prefix_ext]],$2)m4_define([[CF_enum_prefix_int]],$2)CF_iterate([[CF_enum]], [[m4_shift(m4_shift($@))]])DNL')
+m4_define(CF_ENUM_PX, `m4_define([[CF_enum_type]],$1)m4_define([[CF_enum_prefix_ext]],$2)m4_define([[CF_enum_prefix_int]],$3)CF_iterate([[CF_enum]], [[m4_shift(m4_shift(m4_shift($@)))]])DNL')
# After all configuration templates end, we generate the
m4_m4wrap(`