Re-set-ing constants/variables

Maximilian Wilhelm max at rfc2324.org
Wed Jan 18 18:20:53 CET 2017


Hi,

I'm working on a (Freifunk) network setup based on Linux and Bird
using an OSPF/iBGP configuration which basicly works like a charm.

Now I have some setups where multiple prefixes are configured on a
node either for connected networks or for some anycasted ressources.
To be able to enable/disable exporting these prefixes separately base
on different criteria (probaly by different check scripts trigger by
cron or something like this) I thought about options to realize this.

All my configuration is centrally managed by Salt and some mighty
templates.

My first though was to have something like the following in the global
configuration

define SITE_LEGACY_ONLINE = 0;
define SITE_PADCTY_ONLINE = 0;
define SITE_PADUML_ONLINE = 0;
define DRAINED = 0;

an later re-set these values to 0 in separate config files which are
automagically generated by some script of other means. Thereby I can
have useful defaults and only when a check rules for a positive
outcome a SITE would go online (read: the prefix would be announed).
Any I make sure the configuration as a whole is useful all the time.


Now I tried to just reset a value like

SITE_LEGACY_ONLINE = 1;

or

define SITE_LEGACY_ONLINE = 1;

later in the configuration but both raise configuration errors (as I
was afraid they would).

Are there any means to build something like that? Like having some
defaults in the main config and re-set these values later on (in other
config snippets)?  If I would generate the defines by a script I would
have some time where this part might be missing (like on first install)
and my config would fail to load as the defines are referenced but not
defined.

Thanks for any ideas how to build something like that. :)

Best
Max
-- 
"Wer nicht mehr liebt und nicht mehr irrt, der lasse sich begraben."
 -- Johann Wolfgang von Goethe


More information about the Bird-users mailing list