]> git.stg.codes - stg.git/commitdiff
Merge branch 'master' into full-month-stats
authorMaxim Mamontov <faust.madf@gmail.com>
Fri, 2 Aug 2013 19:25:08 +0000 (22:25 +0300)
committerMaxim Mamontov <faust.madf@gmail.com>
Fri, 2 Aug 2013 19:25:08 +0000 (22:25 +0300)
projects/sgconf/Makefile
projects/sgconf/build
projects/stargazer/plugins/capture/ether_freebsd/ether_cap.cpp
projects/stargazer/plugins/other/rscript/rscript.cpp
projects/stargazer/plugins/other/smux/smux.cpp
projects/stargazer/traffcounter_impl.cpp

index 297d3e206983bb40c96ce9e9d5ab51e5b4051732..096991221d761977ddd36c10897a4ff922d8ac55 100644 (file)
@@ -41,7 +41,11 @@ OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS))))
 
 CXXFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
 CFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS)
-LDFLAGS += -Wl,-E $(STGLIBS_LIBS)
+LDFLAGS += $(STGLIBS_LIBS)
+
+ifneq ($(OS),darwin)
+LDFLAGS += -Wl,-E
+endif
 
 .PHONY: all clean distclean libs install uninstall install-bin install-data uninstall-bin uninstall-data
 all: libs $(PROG) ../../Makefile.conf
index 47706a94f0b9d8cd35a52b96128313a532ed6c1b..d7b72363cdc6dc8f23f931c637195989d292b6dd 100755 (executable)
@@ -51,6 +51,13 @@ then
     MAKE="gmake"
 fi
 
+if [ "$sys" = "Darwin" ]
+then
+    OS=darwin
+    ETC_DIR="./inst/freebsd/etc/stargazer"
+    MAKE="gmake"
+fi
+
 if [ "$OS" = "unknown" ]
 then 
     printf "#############################################################################\n"
@@ -77,12 +84,18 @@ else
     then
         DEFS="$DEFS -DFREE_BSD"
     else
-        DEFS="$DEFS -DFREE_BSD5"
         if [ "$OS" = "bsd7" ]
         then
+            DEFS="$DEFS -DFREE_BSD5"
             LIB_THREAD=-lpthread
         else
-            LIB_THREAD=-lc_r
+            if [ "$OS" == "darwin" ]
+            then
+                DEFS="$DEFS -DDARWIN"
+                LIB_THREAD=-lpthread
+            else
+                LIB_THREAD=-lc_r
+            fi
         fi
     fi
 fi
index 12d35aa696e4fe9b9ea6abcafbb70fe14397dcb4..72e7f73bdcad694183f5cb94c03fe9dd33d1e241 100644 (file)
@@ -289,7 +289,7 @@ strncpy(ifr.ifr_name, bd->iface.c_str(), sizeof(ifr.ifr_name));
 if (ioctl(bd->fd, BIOCSBLEN, (caddr_t)&l) < 0)
     {
     errorStr = bd->iface + " BIOCSBLEN " + std::string(strerror(errno));
-    logger("ioctl (BIOCSBLEN) error for interface '%s': %s", bd->iface, strerror(errno));
+    logger("ioctl (BIOCSBLEN) error for interface '%s': %s", bd->iface.c_str(), strerror(errno));
     printfd(__FILE__, "ioctl failed: '%s'\n", errorStr.c_str());
     return -1;
     }
@@ -297,7 +297,7 @@ if (ioctl(bd->fd, BIOCSBLEN, (caddr_t)&l) < 0)
 if (ioctl(bd->fd, BIOCSETIF, (caddr_t)&ifr) < 0)
     {
     errorStr = bd->iface + " BIOCSETIF " + std::string(strerror(errno));
-    logger("ioctl (BIOCSETIF) error for interface '%s': %s", bd->iface, strerror(errno));
+    logger("ioctl (BIOCSETIF) error for interface '%s': %s", bd->iface.c_str(), strerror(errno));
     printfd(__FILE__, "ioctl failed: '%s'\n", errorStr.c_str());
     return -1;
     }
@@ -305,7 +305,7 @@ if (ioctl(bd->fd, BIOCSETIF, (caddr_t)&ifr) < 0)
 if (ioctl(bd->fd, BIOCIMMEDIATE, &im) < 0)
     {
     errorStr = bd->iface + " BIOCIMMEDIATE " + std::string(strerror(errno));
-    logger("ioctl (BIOCIMMEDIATE) error for interface '%s': %s", bd->iface, strerror(errno));
+    logger("ioctl (BIOCIMMEDIATE) error for interface '%s': %s", bd->iface.c_str(), strerror(errno));
     printfd(__FILE__, "ioctl failed: '%s'\n", errorStr.c_str());
     return -1;
     }
index d5fab22243ef3b88f832d287ff7bf1d40e3b9fb1..fb8cb57c1fd9bd53d3efa852ec16b3de13ef0d1c 100644 (file)
@@ -324,6 +324,9 @@ std::for_each(authorizedUsers.begin(),
               authorizedUsers.end(),
               UpdateRouter(*this));
 
+logger("%s reloaded successfully.", rsSettings.GetMapFileName().c_str());
+printfd(__FILE__, "REMOTE_SCRIPT::Reload() %s reloaded successfully.\n");
+
 return 0;
 }
 //-----------------------------------------------------------------------------
index 31b91bb390ee431b7caf1e732832012586d5bb89..09cb4636795b1f72d567dc6274e2d74f788a2fad 100644 (file)
@@ -278,6 +278,11 @@ if (Stop())
     return -1;
 if (Start())
     return -1;
+if (!needReconnect)
+    {
+    printfd(__FILE__, "SMUX reconnected succesfully.\n");
+    logger("Reconnected successfully.");
+    }
 return 0;
 }
 
index 17a786ff0a9697f7c9ccc0aa99eb247695950df3..fce475952537b598d5f39864d6975fe863d3be67 100644 (file)
@@ -738,8 +738,8 @@ if (ReadRules(true))
 
 FreeRules();
 ReadRules();
-printfd(__FILE__, "TRAFFCOUNTER_IMPL::Reload() -  Reload rules successfull.\n");
-WriteServLog("TRAFFCOUNTER: Reload rules successfull.");
+printfd(__FILE__, "TRAFFCOUNTER_IMPL::Reload() -  Reloaded rules successfully.\n");
+WriteServLog("TRAFFCOUNTER: Reloaded rules successfully.");
 return 0;
 }
 //-----------------------------------------------------------------------------