~mdw
/
hippotat
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
introduce c. etc.
[hippotat]
/
hippotat
/
__init__.py
diff --git
a/hippotat/__init__.py
b/hippotat/__init__.py
index
6af49b6
..
8219238
100644
(file)
--- a/
hippotat/__init__.py
+++ b/
hippotat/__init__.py
@@
-18,9
+18,18
@@
from configparser import NoOptionError
import collections
import collections
+# these need to be defined here so that they can be imported by import *
cfg = ConfigParser()
optparser = OptionParser()
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):
#---------- 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))
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):
#---------- startup ----------
def common_startup(defcfg):