Skip to content

Commit 6646a11

Browse files
author
Pavel Siska
committed
ipfixprobe - introduce process QUIC plugin
1 parent 6e0b3ef commit 6646a11

File tree

7 files changed

+71
-37
lines changed

7 files changed

+71
-37
lines changed

src/plugins/process/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ add_subdirectory(dnssd)
2222
add_subdirectory(netbios)
2323
add_subdirectory(passiveDns)
2424
add_subdirectory(smtp)
25+
add_subdirectory(quic)
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
project(ipfixprobe-process-quic VERSION 1.0.0 DESCRIPTION "ipfixprobe-process-quic plugin")
2+
3+
add_library(ipfixprobe-process-quic SHARED
4+
src/quic.cpp
5+
src/quic.hpp
6+
src/quic_parser.cpp
7+
src/quic_parser.hpp
8+
)
9+
10+
set_target_properties(ipfixprobe-process-quic PROPERTIES
11+
CXX_VISIBILITY_PRESET hidden
12+
VISIBILITY_INLINES_HIDDEN YES
13+
)
14+
15+
target_include_directories(ipfixprobe-process-quic PRIVATE
16+
${CMAKE_SOURCE_DIR}/include/
17+
${CMAKE_SOURCE_DIR}/src/plugins/process/common
18+
)
19+
20+
target_link_libraries(ipfixprobe-process-quic PRIVATE
21+
crypto # TODO
22+
ipfixprobe-process-tls-parser
23+
)
24+
25+
install(
26+
TARGETS ipfixprobe-process-quic
27+
LIBRARY DESTINATION "${INSTALL_DIR_LIB}/ipfixprobe/process/"
28+
)

src/plugins/process/quic/README.md

Whitespace-only changes.
Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,41 @@
1-
/* SPDX-License-Identifier: BSD-3-Clause
2-
* Copyright (C) 2021-2022, CESNET z.s.p.o.
3-
*/
4-
51
/**
6-
* \file quic.cpp
7-
* \brief Plugin for enriching flows for quic data.
8-
* \author Andrej Lukacovic [email protected]
9-
* \author Karel Hynek <[email protected]>
10-
* \author Jonas Mücke <[email protected]>
11-
* \date 2023
2+
* @file
3+
* @brief Plugin for parsing basicplus traffic.
4+
* @author Andrej Lukacovic [email protected]
5+
* @author Karel Hynek <[email protected]>
6+
* @author Jonas Mücke <[email protected]>
7+
* @author Pavel Siska <[email protected]>
8+
*
9+
* Copyright (c) 2025 CESNET
10+
*
11+
* SPDX-License-Identifier: BSD-3-Clause
1212
*/
1313

14+
#include "quic.hpp"
15+
1416
#ifdef WITH_NEMEA
1517
#include <unirec/unirec.h>
1618
#endif
1719

18-
#include "quic.hpp"
20+
#include <ipfixprobe/pluginFactory/pluginManifest.hpp>
21+
#include <ipfixprobe/pluginFactory/pluginRegistrar.hpp>
1922

2023
namespace ipxp {
21-
int RecordExtQUIC::REGISTERED_ID = -1;
24+
int RecordExtQUIC::REGISTERED_ID = ProcessPluginIDGenerator::instance().generatePluginID();
2225

23-
__attribute__((constructor)) static void register_this_plugin()
24-
{
25-
static PluginRecord rec = PluginRecord("quic", []() { return new QUICPlugin(); });
26+
static const PluginManifest quicPluginManifest = {
27+
.name = "quic",
28+
.description = "Quic process plugin for parsing quic traffic.",
29+
.pluginVersion = "1.0.0",
30+
.apiVersion = "1.0.0",
31+
.usage = nullptr,
32+
};
2633

27-
register_plugin(&rec);
28-
RecordExtQUIC::REGISTERED_ID = register_extension();
34+
QUICPlugin::QUICPlugin(const std::string& params)
35+
{
36+
(void) params;
2937
}
3038

31-
QUICPlugin::QUICPlugin() {}
32-
3339
QUICPlugin::~QUICPlugin()
3440
{
3541
close();
@@ -535,4 +541,7 @@ void QUICPlugin::finish(bool print_stats)
535541
std::cout << " Parsed SNI: " << parsed_initial << std::endl;
536542
}
537543
}
544+
545+
static const PluginRegistrar<QUICPlugin, ProcessPluginFactory> quicRegistrar(quicPluginManifest);
546+
538547
} // namespace ipxp
Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
/* SPDX-License-Identifier: BSD-3-Clause
2-
* Copyright (C) 2021-2022, CESNET z.s.p.o.
3-
*/
4-
51
/**
6-
* \file quic.hpp
7-
* \brief Plugin for enriching flows for quic data.
8-
* \author Andrej Lukacovic [email protected]
9-
* \author Karel Hynek <[email protected]>
10-
* \author Jonas Mücke <[email protected]>
11-
* \date 2023
2+
* @file
3+
* @brief Plugin for parsing basicplus traffic.
4+
* @author Andrej Lukacovic [email protected]
5+
* @author Karel Hynek <[email protected]>
6+
* @author Jonas Mücke <[email protected]>
7+
* @author Pavel Siska <[email protected]>
8+
*
9+
* Copyright (c) 2025 CESNET
10+
*
11+
* SPDX-License-Identifier: BSD-3-Clause
1212
*/
1313

14-
#ifndef IPXP_PROCESS_QUIC_HPP
15-
#define IPXP_PROCESS_QUIC_HPP
14+
#pragma once
1615

1716
#ifdef WITH_NEMEA
1817
#include "fields.h"
@@ -364,7 +363,7 @@ struct RecordExtQUIC : public RecordExt {
364363
*/
365364
class QUICPlugin : public ProcessPlugin {
366365
public:
367-
QUICPlugin();
366+
QUICPlugin(const std::string& params);
368367
~QUICPlugin();
369368
void init(const char* params);
370369
void close();
@@ -424,5 +423,3 @@ class QUICPlugin : public ProcessPlugin {
424423
};
425424

426425
} // namespace ipxp
427-
428-
#endif /* IPXP_PROCESS_QUIC_HPP */
File renamed without changes.

src/plugins/process/quic_parser.hpp renamed to src/plugins/process/quic/src/quic_parser.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@
1111
* \date 2023
1212
*/
1313

14-
#include "tls_parser.hpp"
15-
1614
#include <ipfixprobe/byte-utils.hpp>
17-
#include <ipfixprobe/process.hpp>
15+
#include <ipfixprobe/processPlugin.hpp>
1816
#include <openssl/evp.h>
1917
#include <openssl/kdf.h>
18+
#include <tlsParser/tls_parser.hpp>
2019

2120
#define HASH_SHA2_256_LENGTH 32
2221
#define TLS13_AEAD_NONCE_LENGTH 12

0 commit comments

Comments
 (0)