|
- //////////////////////////////////////////////////////////////////////
- // IP traffic analyzer - configuration file
- // Written by Jonathan A. Foster <jon@jfpossibilities.com>
- // Started May 14th, 2021
- // Copyright JF Possibilities, Inc. All rights reserved.
- //
- // This class reads and holds configuration data for "iptraffic". The
- // file is basically an INI format with '#' for remarks instead of ';'
- // and sections can be lists, not just name/value pairs. In fact this
- // first version is strictly only lists.
- //////////////////////////////////////////////////////////////////////
- #ifndef __JFP_IPTRAFFIC_CONF_H__
- #define __JFP_IPTRAFFIC_CONF_H__
- #include <string>
- #include <ostream>
- #include "data.h"
- #include "miniini.h"
- #include "strutil.h"
-
-
-
- //////////////////////////////////////////////////////////////////////
- // INI group parser for "us" records
- //
- // This is mostly "raw lines" but we need to throw out remarks and WS.
- //////////////////////////////////////////////////////////////////////
-
- struct INIusList: public MiniINIlines {
- void add(const std::string &in);
- };
-
-
-
- //////////////////////////////////////////////////////////////////////
- // INI group parser for "ignore" records
- //////////////////////////////////////////////////////////////////////
-
- struct INIconnList: public MiniINIgroup {
- ConnList vals;
- // Read records
- void add(const std::string &in);
- // Write records
- std::ostream &save(std::ostream &out) const;
- };
-
-
-
- //////////////////////////////////////////////////////////////////////
- // INI based Configuration container for IPtraffic
- //////////////////////////////////////////////////////////////////////
-
- struct Config: public MiniINI {
- INIusList us;
- INIconnList ignores;
- Config();
- };
-
-
-
- #endif
|