1
0
Fork 0
mirror of https://github.com/pavel-odintsov/fastnetmon synced 2024-06-08 16:46:06 +02:00

Add stub for pcap pluging

This commit is contained in:
Pavel Odintsov 2015-01-26 16:37:12 +03:00
parent c658d8d90c
commit 89ab55b706
3 changed files with 41 additions and 0 deletions

View File

@ -53,6 +53,9 @@ add_library(sflow_plugin STATIC sflow_plugin/sflow_collector.cpp)
# netflow plugin
add_library(netflow_plugin STATIC netflow_plugin/netflow_collector.cpp)
# pcap plugin
add_library(pcap_plugin STATIC pcap_plugin/pcap_collector.cpp)
# example plugin
add_library(example_plugin STATIC example_plugin/example_collector.cpp)
@ -97,6 +100,7 @@ target_link_libraries(fastnetmon patricia)
# Our plugins
target_link_libraries(fastnetmon sflow_plugin)
target_link_libraries(fastnetmon netflow_plugin)
target_link_libraries(fastnetmon pcap_plugin)
target_link_libraries(fastnetmon example_plugin)
if (ENABLE_PFRING_SUPPORT)

View File

@ -0,0 +1,29 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#include <inttypes.h>
// log4cpp logging facility
#include "log4cpp/Category.hh"
#include "log4cpp/Appender.hh"
#include "log4cpp/FileAppender.hh"
#include "log4cpp/OstreamAppender.hh"
#include "log4cpp/Layout.hh"
#include "log4cpp/BasicLayout.hh"
#include "log4cpp/PatternLayout.hh"
#include "log4cpp/Priority.hh"
extern log4cpp::Category& logger;
#include "pcap_collector.h"
// This variable name should be uniq for every plugin!
process_packet_pointer pcap_process_func_ptr = NULL;
void start_pcap_collection(process_packet_pointer func_ptr) {
logger<< log4cpp::Priority::INFO<<"pcap plugin started";
}

View File

@ -0,0 +1,8 @@
#ifndef _PCAP_PLUGIN_H
#define _PCAP_PLUGIN_H
#include "../fastnetmon_types.h"
void start_pcap_collection(process_packet_pointer func_ptr);
#endif