Conflicts:
projects/stargazer/plugins/capture/pcap/pcap_cap.cpp
uint16_t len);
std::string DEBUG_CAP::GetVersion() const
{
uint16_t len);
std::string DEBUG_CAP::GetVersion() const
{
-return "Debug_cap v.0.01a";
+return "cap_debug v.0.01a";
}
//-----------------------------------------------------------------------------
DEBUG_CAP::DEBUG_CAP()
}
//-----------------------------------------------------------------------------
DEBUG_CAP::DEBUG_CAP()
#include "stg/raw_ip_packet.h"
#include "stg/traffcounter.h"
#include "stg/plugin_creator.h"
#include "stg/raw_ip_packet.h"
#include "stg/traffcounter.h"
#include "stg/plugin_creator.h"
runningUDP = false;
CloseUDP();
errorStr = "Cannot create UDP thread";
runningUDP = false;
CloseUDP();
errorStr = "Cannot create UDP thread";
- logger("Cannot create UDP thread.");
+ logger("Cannot create UDP thread.");
printfd(__FILE__, "Error: Cannot create UDP thread\n");
return -1;
}
printfd(__FILE__, "Error: Cannot create UDP thread\n");
return -1;
}
{
runningTCP = false;
CloseTCP();
{
runningTCP = false;
CloseTCP();
- logger("Cannot create TCP thread.");
+ logger("Cannot create TCP thread.");
errorStr = "Cannot create TCP thread";
printfd(__FILE__, "Error: Cannot create TCP thread\n");
return -1;
errorStr = "Cannot create TCP thread";
printfd(__FILE__, "Error: Cannot create TCP thread\n");
return -1;
if (pthread_kill(tidUDP, SIGUSR1))
{
errorStr = "Error sending signal to UDP thread";
if (pthread_kill(tidUDP, SIGUSR1))
{
errorStr = "Error sending signal to UDP thread";
- logger("Error sending sugnal to UDP thread.");
+ logger("Error sending sugnal to UDP thread.");
printfd(__FILE__, "Error: Error sending signal to UDP thread\n");
return -1;
}
printfd(__FILE__, "Error: Error sending signal to UDP thread\n");
return -1;
}
if (pthread_kill(tidTCP, SIGUSR1))
{
errorStr = "Error sending signal to TCP thread";
if (pthread_kill(tidTCP, SIGUSR1))
{
errorStr = "Error sending signal to TCP thread";
- logger("Error sending signal to TCP thread.");
+ logger("Error sending signal to TCP thread.");
printfd(__FILE__, "Error: Error sending signal to TCP thread\n");
return -1;
}
printfd(__FILE__, "TCP thread NOT stopped\n");
printfd(__FILE__, "Error: Error sending signal to TCP thread\n");
return -1;
}
printfd(__FILE__, "TCP thread NOT stopped\n");
- logger("Cannot stop TCP thread.");
+ logger("Cannot stop TCP thread.");
- {
- cap->logger("recvfrom error: %s", strerror(errno));
- continue;
- }
+ {
+ cap->logger("recvfrom error: %s", strerror(errno));
+ continue;
+ }
if (sd <= 0)
{
if (sd < 0)
if (sd <= 0)
{
if (sd < 0)
- cap->logger("accept error: %s", strerror(errno));
+ cap->logger("accept error: %s", strerror(errno));
#include "stg/module_settings.h"
#include "stg/logger.h"
#include "stg/module_settings.h"
#include "stg/logger.h"
-#define VERSION "CAP_NF v. 0.4"
+#define VERSION "cap_nf v. 0.4"
#define START_POS 40
#define STOP_POS 40
#define START_POS 40
#define STOP_POS 40
//-----------------------------------------------------------------------------
std::string DIVERT_CAP::GetVersion() const
{
//-----------------------------------------------------------------------------
std::string DIVERT_CAP::GetVersion() const
{
-return "Divert_cap v.1.0";
+return "cap_divert v.1.0";
}
//-----------------------------------------------------------------------------
DIVERT_CAP::DIVERT_CAP()
}
//-----------------------------------------------------------------------------
DIVERT_CAP::DIVERT_CAP()
if (pthread_kill(thread, SIGINT))
{
errorStr = "Cannot kill thread.";
if (pthread_kill(thread, SIGINT))
{
errorStr = "Cannot kill thread.";
- logger("Cannot send signal to thread.");
+ logger("Cannot send signal to thread.");
printfd(__FILE__, "Cannot kill thread\n");
return -1;
}
printfd(__FILE__, "Cannot kill thread\n");
return -1;
}
*iface = cddiv.iface;
if (!disableForwarding)
*iface = cddiv.iface;
if (!disableForwarding)
if (sendto(cddiv.sock, buf, bytes, 0, (struct sockaddr*)&divertaddr, divertaddrSize) < 0)
if (sendto(cddiv.sock, buf, bytes, 0, (struct sockaddr*)&divertaddr, divertaddrSize) < 0)
- logger("sendto error: %s", strerror(errno));
- }
+ logger("sendto error: %s", strerror(errno));
+ }
//-----------------------------------------------------------------------------
std::string BPF_CAP::GetVersion() const
{
//-----------------------------------------------------------------------------
std::string BPF_CAP::GetVersion() const
{
}
//-----------------------------------------------------------------------------
BPF_CAP::BPF_CAP()
}
//-----------------------------------------------------------------------------
BPF_CAP::BPF_CAP()
capSock(-1),
settings(),
traffCnt(NULL),
capSock(-1),
settings(),
traffCnt(NULL),
- logger(GetPluginLogger(GetStgLogger(), "cap_ether"))
+ logger(GetPluginLogger(GetStgLogger(), "cap_bpf"))
{
}
//-----------------------------------------------------------------------------
{
}
//-----------------------------------------------------------------------------
if (pthread_kill(thread, SIGINT))
{
errorStr = "Cannot kill thread.";
if (pthread_kill(thread, SIGINT))
{
errorStr = "Cannot kill thread.";
- logger("Cannot send signal to thread.");
+ logger("Cannot send signal to thread.");
printfd(__FILE__, "Cannot kill thread\n");
return -1;
}
printfd(__FILE__, "Cannot kill thread\n");
return -1;
}
bd->r = read(bd->fd, bd->buffer, BUFF_LEN);
if (bd->r < 0)
{
bd->r = read(bd->fd, bd->buffer, BUFF_LEN);
if (bd->r < 0)
{
- logger("read error: %s", strerror(errno));
+ logger("read error: %s", strerror(errno));
struct timespec ts = {0, 20000000};
nanosleep(&ts, NULL);
return -1;
struct timespec ts = {0, 20000000};
nanosleep(&ts, NULL);
return -1;
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
std::string ETHER_CAP::GetVersion() const
{
std::string ETHER_CAP::GetVersion() const
{
-return "Ether_cap v.1.2";
+return "cap_ether v.1.2";
}
//-----------------------------------------------------------------------------
ETHER_CAP::ETHER_CAP()
}
//-----------------------------------------------------------------------------
ETHER_CAP::ETHER_CAP()
if (pthread_kill(thread, SIGUSR1))
{
errorStr = "Cannot kill thread.";
if (pthread_kill(thread, SIGUSR1))
{
errorStr = "Cannot kill thread.";
- logger("Cannot send signal to thread.");
+ logger("Cannot send signal to thread.");
return -1;
}
for (int i = 0; i < 25 && isRunning; ++i)
return -1;
}
for (int i = 0; i < 25 && isRunning; ++i)
if (isRunning)
{
errorStr = "ETHER_CAP not stopped.";
if (isRunning)
{
errorStr = "ETHER_CAP not stopped.";
- logger("Cannot stop thread.");
+ logger("Cannot stop thread.");
printfd(__FILE__, "Cannot stop thread\n");
return -1;
}
printfd(__FILE__, "Cannot stop thread\n");
return -1;
}
//-----------------------------------------------------------------------------
std::string IPQ_CAP::GetVersion() const
{
//-----------------------------------------------------------------------------
std::string IPQ_CAP::GetVersion() const
{
}
//-----------------------------------------------------------------------------
IPQ_CAP::IPQ_CAP()
}
//-----------------------------------------------------------------------------
IPQ_CAP::IPQ_CAP()