Skip to content

Commit dbec72a

Browse files
Zainullin DamirZainullin Damir
authored andcommitted
++
1 parent e5ea52a commit dbec72a

File tree

54 files changed

+591
-1180
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+591
-1180
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ set(CMAKE_C_STANDARD 11)
3535
set(CMAKE_C_STANDARD_REQUIRED ON)
3636
set(CMAKE_C_EXTENSIONS ON)
3737

38-
set(CMAKE_CXX_STANDARD 20)
38+
set(CMAKE_CXX_STANDARD 23)
3939
set(CMAKE_CXX_STANDARD_REQUIRED ON)
4040
set(CMAKE_CXX_EXTENSIONS ON)
4141

include/ipfixprobe/pluginFactory/pluginFactory.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ class PluginFactory {
6565
{
6666
static_assert(std::is_base_of<Base, Derived>::value, "Derived must be a subclass of Base");
6767

68-
std::cout << manifest.name << "=" << std::hex << std::size_t(this) << std::endl;
69-
7068
m_registeredPlugins[manifest] = createGenerators<Base, Derived, Args...>();
7169
}
7270

include/ipfixprobe/processPlugin/fieldManager.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "fieldDescriptor.hpp"
2121
#include "fieldGenericValueGetter.hpp"
2222
#include "fieldHandler.hpp"
23+
#include "../api.hpp"
2324

2425
#include <atomic>
2526
#include <cstdint>
@@ -38,7 +39,7 @@ class FieldGroup;
3839
* Provides methods to register fields, directional field pairs, and biflow pairs.
3940
* Offers access to field descriptors grouped by biflow/uniflow and direction.
4041
*/
41-
class FieldManager {
42+
class IPXP_API FieldManager {
4243
public:
4344
/**
4445
* @brief Creates a FieldGroup for a given name.

include/ipfixprobe/processPlugin/flowKey.hpp

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,20 @@
66

77
namespace ipxp {
88

9+
struct FlowKeyLayout {
10+
std::size_t size;
11+
std::size_t alignment;
12+
};
13+
914
struct FlowKey {
15+
constexpr static FlowKeyLayout getLayout() noexcept
16+
{
17+
return {
18+
.size = sizeof(FlowKey),
19+
.alignment = alignof(FlowKey),
20+
};
21+
};
22+
1023
IPAddress srcIp;
1124
IPAddress dstIp;
1225
uint16_t srcPort;
@@ -20,9 +33,8 @@ struct FlowKey {
2033
}
2134
};
2235

23-
struct FlowKeyLayout {
24-
std::size_t size;
25-
std::size_t alignment;
26-
};
36+
37+
38+
2739

2840
} // namespace ipxp

include/ipfixprobe/processPlugin/processPluginEntry.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#include <memory>
1717
#include <string>
1818

19+
#include "../api.hpp"
20+
1921
namespace ipxp {
2022

2123
class ProcessPlugin;
@@ -27,7 +29,7 @@ class ProcessPlugin;
2729
* and runtime requirements. It contains the plugin's name, context
2830
* memory requirements, and activation state.
2931
*/
30-
struct ProcessPluginEntry {
32+
struct IPXP_API ProcessPluginEntry {
3133
/**< @brief Human-readable plugin name (unique identifier). */
3234
std::string name;
3335

include/ipfixprobe/processPlugin/processPluginManager.hpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
#include "processPluginEntry.hpp"
77
#include "flowRecordBuilder.hpp"
88
#include "../pluginFactory/pluginFactory.hpp"
9+
#include "../api.hpp"
910

1011
namespace ipxp {
1112

12-
class ProcessPluginManager {
13+
class IPXP_API ProcessPluginManager {
1314
public:
1415
ProcessPluginManager(FieldManager& manager)
1516
: m_fieldManager(manager)
@@ -189,7 +190,11 @@ class ProcessPluginManager {
189190
}
190191
#endif
191192

192-
std::shared_ptr<FlowRecordBuilder> rebuild();
193+
std::shared_ptr<FlowRecordBuilder> rebuild()
194+
{
195+
auto builder = std::make_shared<FlowRecordBuilder>(m_processPlugins, FlowKey::DEFAULT_LAYOUT);
196+
return builder;
197+
}
193198

194199
const std::vector<ProcessPluginEntry>& getEntries() { return m_processPlugins; }
195200

src/plugins/output/unirec/src/unirec.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ class UnirecOptParser : public OptionsParser {
228228
/**
229229
* \brief Class for exporting flow records.
230230
*/
231-
class UnirecExporter : public OutputPlugin {
231+
class IPXP_API UnirecExporter : public OutputPlugin {
232232
public:
233233

234234
UnirecExporter(const std::string& params, const FieldManager& manager, const std::vector<ProcessPluginEntry>& plugins)

src/plugins/process/basicPlus/src/basicPlus.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <fieldGroup.hpp>
2525
#include <fieldManager.hpp>
2626
#include <tcpData.hpp>
27+
#include <ipfixprobe/options.hpp>
2728

2829
namespace ipxp {
2930

@@ -34,11 +35,10 @@ static const PluginManifest basicPlusPluginManifest = {
3435
.apiVersion = "1.0.0",
3536
.usage =
3637
[]() {
37-
std::cout << "tes666" << std::endl;
38-
/*OptionsParser parser(
38+
OptionsParser parser(
3939
"basicplus",
4040
"Extend basic fields with TTL, TCP window, options, MSS and SYN size");
41-
parser.usage(std::cout);*/
41+
parser.usage(std::cout);
4242
},
4343
};
4444

src/plugins/process/bstats/src/burstStats.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,19 @@
2525
//#include <pluginFactory.hpp>
2626
#include <fieldGroup.hpp>
2727
//#include <fieldManager.hpp>
28+
#include <ipfixprobe/options.hpp>
2829

2930
namespace ipxp {
3031

31-
3232
static const PluginManifest burstStatsPluginManifest = {
3333
.name = "bstats",
3434
.description = "Bstats process plugin for computing packet bursts stats.",
3535
.pluginVersion = "1.0.0",
3636
.apiVersion = "1.0.0",
3737
.usage =
3838
[]() {
39-
std::cout << "Test" << std::endl;
40-
/*OptionsParser parser("bstats", "Compute packet bursts stats");
41-
parser.usage(std::cout);*/
39+
OptionsParser parser("bstats", "Compute packet bursts stats");
40+
parser.usage(std::cout);
4241
},
4342
};
4443

src/plugins/process/common/dnsParser/dnsRecordPayloadTypes/dnsTXTRecord.hpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,29 @@ namespace ipxp
1313
{
1414

1515
struct DNSTXTRecord {
16-
DNSName content;
16+
//DNSName content;
17+
std::string content;
1718

1819
static std::optional<DNSTXTRecord> createFrom(
1920
std::span<const std::byte> payload,
2021
std::span<const std::byte> fullDNSPayload) noexcept
2122
{
2223
auto res = std::make_optional<DNSTXTRecord>();
2324

24-
const std::optional<DNSName> txt
25+
/*const std::optional<DNSName> txt
2526
= DNSName::createFrom(payload, fullDNSPayload);
2627
if (!txt.has_value() || txt->length() == 0) {
2728
return std::nullopt;
2829
}
2930
res->content = *txt;
30-
31+
*/
32+
res->content = std::string(reinterpret_cast<const char*>(payload.data()), payload.size());
3133
return res;
3234
}
3335

3436
std::string toDNSString() const noexcept
3537
{
36-
std::string res = content.toString();
38+
std::string res = content;
3739
const std::size_t firstPoint = res.find('.');
3840
if (firstPoint != std::string::npos) {
3941
res[firstPoint] = ' ';

0 commit comments

Comments
 (0)