]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/other/radius/config.h
Apply owner/group/mode settings to a UNIX socket.
[stg.git] / projects / stargazer / plugins / other / radius / config.h
index 8e5055d8c11dd5589efd9575c9808254c729d76d..c70c7b0f2c94d67663bfb0a3d00e3850c56947c8 100644 (file)
 #include <map>
 #include <string>
 
+#include <unistd.h> // uid_t, gid_t
+#include <sys/stat.h> // mode_t
+
 namespace STG
 {
 
 struct Config
 {
     typedef std::map<std::string, std::string> Pairs;
-    typedef Pairs::value_type Pair;
+    typedef std::pair<std::string, std::string> Pair;
+    enum Type { UNIX, TCP };
+
+    struct Section
+    {
+        Section() {}
+        Section(const Pairs& ma, const Pairs& mo, const Pairs& re)
+            : match(ma), modify(mo), reply(re) {}
+        Pairs match;
+        Pairs modify;
+        Pairs reply;
+    };
 
+    Config() {}
     Config(const MODULE_SETTINGS& settings);
 
-    Pairs match;
-    Pairs modify;
-    Pairs reply;
+    Section autz;
+    Section auth;
+    Section postauth;
+    Section preacct;
+    Section acct;
 
     bool verbose;
 
+    std::string address;
     std::string bindAddress;
+    Type connectionType;
+    std::string portStr;
     uint16_t port;
     std::string key;
+
+    uid_t sockUID;
+    gid_t sockGID;
+    mode_t sockMode;
 };
 
 } // namespace STG