Skip to content

Commit

Permalink
switch to MPL (#30)
Browse files Browse the repository at this point in the history
Switch license to MPL. Build tweaks including switch to bullseye base image.
  • Loading branch information
weyrick authored Feb 28, 2021
1 parent 0392e49 commit 4d5f105
Show file tree
Hide file tree
Showing 47 changed files with 560 additions and 207 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
working-directory: ${{github.workspace}}/PcapPlusPlus
run: |
make libs
make install
make install -j 2
- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
Expand All @@ -100,7 +100,7 @@ jobs:
working-directory: ${{github.workspace}}/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config $BUILD_TYPE
run: cmake --build . --config $BUILD_TYPE -- -j 2

# - name: Test
# working-directory: ${{github.workspace}}/build
Expand Down
574 changes: 373 additions & 201 deletions LICENSE

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions cmd/pktvisor-pcap/main.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#include <csignal>
#include <functional>
#include <map>
Expand Down
4 changes: 4 additions & 0 deletions cmd/pktvisord/main.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#include <csignal>
#include <functional>

Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:buster-slim AS cppbuild
FROM debian:bullseye-slim AS cppbuild

ENV BUILD_DEPS "g++ cmake make git libpcap-dev pkgconf libmaxminddb-dev jq python3-pip python3-setuptools"

Expand Down Expand Up @@ -32,7 +32,7 @@ COPY golang/ /src/
WORKDIR /src/
RUN go build -o pktvisor-cli cmd/pktvisor-cli/main.go

FROM debian:buster-slim AS runtime
FROM debian:bullseye-slim AS runtime

ENV RUNTIME_DEPS "curl libpcap0.8 libmaxminddb0"

Expand Down
4 changes: 4 additions & 0 deletions golang/cmd/pktvisor-cli/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

package main

import (
Expand Down
4 changes: 4 additions & 0 deletions golang/pkg/client/types.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

package client

// NameCount represents the count of a unique domain name
Expand Down
4 changes: 4 additions & 0 deletions src/AbstractManager.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#pragma once

#include "AbstractModule.h"
Expand Down
4 changes: 4 additions & 0 deletions src/AbstractMetricsManager.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#pragma once

#include <timer.hpp>
Expand Down
4 changes: 4 additions & 0 deletions src/AbstractModule.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#pragma once

#include <atomic>
Expand Down
4 changes: 4 additions & 0 deletions src/AbstractPlugin.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#include "AbstractPlugin.h"
#include <regex>
#include <sstream>
Expand Down
4 changes: 4 additions & 0 deletions src/AbstractPlugin.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#pragma once

#include "HttpServer.h"
Expand Down
4 changes: 4 additions & 0 deletions src/CoreServer.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#include "CoreServer.h"
#include "vizer_config.h"
#include <chrono>
Expand Down
4 changes: 4 additions & 0 deletions src/CoreServer.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#pragma once

#include "HandlerManager.h"
Expand Down
4 changes: 4 additions & 0 deletions src/GeoDB.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#include "GeoDB.h"
#include <cstring>
#include <stdexcept>
Expand Down
4 changes: 4 additions & 0 deletions src/GeoDB.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#pragma once

#include <maxminddb.h>
Expand Down
4 changes: 4 additions & 0 deletions src/HandlerManager.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#pragma once

#include "AbstractManager.h"
Expand Down
4 changes: 4 additions & 0 deletions src/HandlerModulePlugin.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#include "HandlerModulePlugin.h"
#include <Corrade/Utility/Format.h>
#include <Corrade/Utility/FormatStl.h>
Expand Down
4 changes: 4 additions & 0 deletions src/HandlerModulePlugin.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#pragma once

#include "AbstractPlugin.h"
Expand Down
4 changes: 4 additions & 0 deletions src/HttpServer.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#pragma once

#include <httplib.h>
Expand Down
4 changes: 4 additions & 0 deletions src/InputModulePlugin.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#include "InputModulePlugin.h"
#include <Corrade/Utility/Format.h>
#include <Corrade/Utility/FormatStl.h>
Expand Down
4 changes: 4 additions & 0 deletions src/InputModulePlugin.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#pragma once

#include "AbstractPlugin.h"
Expand Down
4 changes: 4 additions & 0 deletions src/InputStream.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#pragma once

#include "AbstractModule.h"
Expand Down
4 changes: 4 additions & 0 deletions src/InputStreamManager.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#pragma once

#include "AbstractManager.h"
Expand Down
4 changes: 4 additions & 0 deletions src/StreamHandler.cpp
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#include "StreamHandler.h"
4 changes: 4 additions & 0 deletions src/StreamHandler.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#pragma once

#include "AbstractMetricsManager.h"
Expand Down
4 changes: 4 additions & 0 deletions src/handlers/dns/DnsHandlerModulePlugin.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#include "DnsHandlerModulePlugin.h"
#include "DnsStreamHandler.h"
#include "PcapInputStream.h"
Expand Down
4 changes: 4 additions & 0 deletions src/handlers/dns/DnsHandlerModulePlugin.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#pragma once

#include "HandlerModulePlugin.h"
Expand Down
4 changes: 4 additions & 0 deletions src/handlers/dns/DnsStreamHandler.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#include "DnsStreamHandler.h"
#include "GeoDB.h"
#include "utils.h"
Expand Down
4 changes: 4 additions & 0 deletions src/handlers/dns/DnsStreamHandler.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#pragma once

#include "AbstractMetricsManager.h"
Expand Down
4 changes: 4 additions & 0 deletions src/handlers/dns/dns.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#include "dns.h"

namespace vizer::handler::dns {
Expand Down
8 changes: 6 additions & 2 deletions src/handlers/dns/dns.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#pragma once

#include <string>
#include <unordered_map>
#include "DnsLayer.h"
#include "DnsResource.h"
#include "DnsResourceData.h"
#include <string>
#include <unordered_map>

namespace vizer::handler::dns {

Expand Down
4 changes: 4 additions & 0 deletions src/handlers/dns/querypairmgr.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#include "querypairmgr.h"
#include <sys/time.h>
#include <vector>
Expand Down
4 changes: 4 additions & 0 deletions src/handlers/dns/querypairmgr.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#pragma once

#include <chrono>
Expand Down
4 changes: 4 additions & 0 deletions src/handlers/net/NetHandlerModulePlugin.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#include "NetHandlerModulePlugin.h"
#include "NetStreamHandler.h"
#include "PcapInputStream.h"
Expand Down
5 changes: 5 additions & 0 deletions src/handlers/net/NetHandlerModulePlugin.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#pragma once


#include "HandlerModulePlugin.h"

namespace vizer::handler::net {
Expand Down
4 changes: 4 additions & 0 deletions src/handlers/net/NetStreamHandler.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#include "NetStreamHandler.h"
#include "GeoDB.h"
#include "utils.h"
Expand Down
5 changes: 5 additions & 0 deletions src/handlers/net/NetStreamHandler.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#pragma once


#include "AbstractMetricsManager.h"
#include "PcapInputStream.h"
#include "StreamHandler.h"
Expand Down
4 changes: 4 additions & 0 deletions src/inputs/pcap/PcapInputModulePlugin.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#include "PcapInputModulePlugin.h"
#include <Corrade/PluginManager/AbstractManager.h>
#include <Corrade/Utility/FormatStl.h>
Expand Down
5 changes: 5 additions & 0 deletions src/inputs/pcap/PcapInputModulePlugin.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#pragma once


#include "InputModulePlugin.h"
#include "PcapInputStream.h"

Expand Down
4 changes: 4 additions & 0 deletions src/inputs/pcap/PcapInputStream.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#include "PcapInputStream.h"
#include <timer.hpp>
#include <pcap.h>
Expand Down
5 changes: 5 additions & 0 deletions src/inputs/pcap/PcapInputStream.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#pragma once


#include "InputStream.h"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wold-style-cast"
Expand Down
4 changes: 4 additions & 0 deletions src/inputs/pcap/afpacket.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#ifdef __linux__
#include "afpacket.h"

Expand Down
6 changes: 6 additions & 0 deletions src/inputs/pcap/afpacket.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#pragma once

#include <PcapLiveDevice.h>
#include <atomic>
#include <cstdint>
Expand Down
3 changes: 3 additions & 0 deletions src/inputs/pcap/utils.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#include "utils.h"
#include <IpUtils.h>
Expand Down
4 changes: 4 additions & 0 deletions src/inputs/pcap/utils.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

#pragma once

#include <IpAddress.h>
Expand Down
Loading

0 comments on commit 4d5f105

Please sign in to comment.