X-Git-Url: https://git.distorted.org.uk/~mdw/hippotat/blobdiff_plain/c55f394eb74d593bd5535ba3dc639473db69784d..87a7c0c717c2bd9380e93e4ab25baebbc1e3aa6a:/hippotat/__init__.py diff --git a/hippotat/__init__.py b/hippotat/__init__.py index 6af49b6..8219238 100644 --- a/hippotat/__init__.py +++ b/hippotat/__init__.py @@ -18,9 +18,18 @@ from configparser import NoOptionError import collections +# these need to be defined here so that they can be imported by import * cfg = ConfigParser() optparser = OptionParser() +class ConfigResults: + def __init__(self, d = { }): + self.__dict__ = d + def __repr__(self): + return 'ConfigResults('+repr(self.__dict__)+')' + +c = ConfigResults() + #---------- packet parsing ---------- def packet_addrs(packet): @@ -129,6 +138,12 @@ def crash_on_critical(event): if event.get('log_level') >= LogLevel.critical: crash(twisted.logger.formatEvent(event)) +#---------- config processing ---------- + +def process_cfg_common_always(): + global mtu + c.mtu = cfg.get('virtual','mtu') + #---------- startup ---------- def common_startup(defcfg):