]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/capture/cap_debug/debug_cap.h
Fixed problem running plugin in non-debug mode.
[stg.git] / projects / stargazer / plugins / capture / cap_debug / debug_cap.h
index 35bcec4737cb7dbdd790eac20b7880b8cda13fcd..6bea457fbe79d4d4a41944aba10b5e933bda02ff 100644 (file)
@@ -28,19 +28,16 @@ $Date: 2009/06/23 11:32:27 $
 $Author: faust $
 */
 
 $Author: faust $
 */
 
-#include <string>
 #include <pthread.h>
 
 #include <pthread.h>
 
-#include "os_int.h"
-#include "base_plugin.h"
-#include "base_settings.h"
+#include <string>
 
 
-using namespace std;
-extern "C" BASE_PLUGIN * GetPlugin();
+#include "stg/os_int.h"
+#include "stg/plugin.h"
+#include "stg/module_settings.h"
 
 //-----------------------------------------------------------------------------
 
 //-----------------------------------------------------------------------------
-struct iphdr_eth
-{
+struct iphdr_eth {
     uint8_t     ihl:4,
                 version:4;
     uint8_t     tos;
     uint8_t     ihl:4,
                 version:4;
     uint8_t     tos;
@@ -56,41 +53,34 @@ struct iphdr_eth
     char        iface[10];
 };
 //-----------------------------------------------------------------------------
     char        iface[10];
 };
 //-----------------------------------------------------------------------------
-class CAP_SETTINGS//: public BASE_SETTINGS
-{
+class CAP_SETTINGS {
 public:
 public:
-    const string& GetStrError() const { static string s; return s; }
-    int             ParseSettings(const MODULE_SETTINGS & s) { return 0; };
+    const std::string & GetStrError() const { static std::string s; return s; }
+    int                 ParseSettings(const MODULE_SETTINGS & s) { return 0; }
 };
 //-----------------------------------------------------------------------------
 };
 //-----------------------------------------------------------------------------
-class DEBUG_CAP :public BASE_PLUGIN
+class DEBUG_CAP :public PLUGIN
 {
 public:
     DEBUG_CAP();
 {
 public:
     DEBUG_CAP();
-    virtual ~DEBUG_CAP(){};
+    virtual ~DEBUG_CAP() {}
 
 
-    void                SetUsers(USERS * u){};
-    void                SetTariffs(TARIFFS * t){};
-    void                SetAdmins(ADMINS * a){};
     void                SetTraffcounter(TRAFFCOUNTER * tc);
     void                SetTraffcounter(TRAFFCOUNTER * tc);
-    void                SetStore(BASE_STORE *){};
-    void                SetStgSettings(const SETTINGS *){};
 
     int                 Start();
     int                 Stop();
 
     int                 Start();
     int                 Stop();
-    int                 Reload() { return 0; };
-    int                 ParseSettings() { return 0; };
-    void                SetSettings(const MODULE_SETTINGS & s){};
+    int                 Reload() { return 0; }
+    int                 ParseSettings() { return 0; }
     bool                IsRunning();
     bool                IsRunning();
-    const string &      GetStrError() const;
-    const string        GetVersion() const;
+    const std::string & GetStrError() const;
+    std::string         GetVersion() const;
     uint16_t            GetStartPosition() const;
     uint16_t            GetStopPosition() const;
 private:
     static void *       Run1(void *);
     static void *       Run2(void *);
     static void *       Run3(void *);
     uint16_t            GetStartPosition() const;
     uint16_t            GetStopPosition() const;
 private:
     static void *       Run1(void *);
     static void *       Run2(void *);
     static void *       Run3(void *);
-    mutable string      errorStr;
+    mutable std::string errorStr;
     CAP_SETTINGS        capSettings;
     pthread_t           thread;
     bool                nonstop;
     CAP_SETTINGS        capSettings;
     pthread_t           thread;
     bool                nonstop;
@@ -99,4 +89,3 @@ private:
     TRAFFCOUNTER *      traffCnt;
 };
 //-----------------------------------------------------------------------------
     TRAFFCOUNTER *      traffCnt;
 };
 //-----------------------------------------------------------------------------
-