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()
#include <vector>
-#include "stg/common.h"
+#include "stg/common.h"
#include "stg/raw_ip_packet.h"
#include "stg/traffcounter.h"
#include "stg/plugin_creator.h"
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;
}
{
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;
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;
}
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");
- logger("Cannot stop TCP thread.");
+ logger("Cannot stop TCP thread.");
}
}
return 0;
break;
if (res < 0)
- {
- cap->logger("recvfrom error: %s", strerror(errno));
- continue;
- }
+ {
+ cap->logger("recvfrom error: %s", strerror(errno));
+ continue;
+ }
if (res == 0) // EOF
{
if (sd <= 0)
{
if (sd < 0)
- cap->logger("accept error: %s", strerror(errno));
+ cap->logger("accept error: %s", strerror(errno));
continue;
}
#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
//-----------------------------------------------------------------------------
std::string DIVERT_CAP::GetVersion() const
{
-return "Divert_cap v.1.0";
+return "cap_divert v.1.0";
}
//-----------------------------------------------------------------------------
DIVERT_CAP::DIVERT_CAP()
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;
}
*iface = cddiv.iface;
if (!disableForwarding)
- {
+ {
if (sendto(cddiv.sock, buf, bytes, 0, (struct sockaddr*)&divertaddr, divertaddrSize) < 0)
- logger("sendto error: %s", strerror(errno));
- }
+ logger("sendto error: %s", strerror(errno));
+ }
}
else
{
//-----------------------------------------------------------------------------
std::string BPF_CAP::GetVersion() const
{
-return "bpf_cap v.1.0";
+return "cap_bpf v.1.0";
}
//-----------------------------------------------------------------------------
BPF_CAP::BPF_CAP()
capSock(-1),
settings(),
traffCnt(NULL),
- logger(GetPluginLogger(GetStgLogger(), "cap_ether"))
+ logger(GetPluginLogger(GetStgLogger(), "cap_bpf"))
{
}
//-----------------------------------------------------------------------------
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;
}
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;
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
std::string ETHER_CAP::GetVersion() const
{
-return "Ether_cap v.1.2";
+return "cap_ether v.1.2";
}
//-----------------------------------------------------------------------------
ETHER_CAP::ETHER_CAP()
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)
if (isRunning)
{
errorStr = "ETHER_CAP not stopped.";
- logger("Cannot stop thread.");
+ logger("Cannot stop thread.");
printfd(__FILE__, "Cannot stop thread\n");
return -1;
}
//-----------------------------------------------------------------------------
std::string IPQ_CAP::GetVersion() const
{
-return "ipq_cap v.1.2";
+return "cap_ipq v.1.2";
}
//-----------------------------------------------------------------------------
IPQ_CAP::IPQ_CAP()