Skip to content

Commit

Permalink
optimize imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Consti10 committed Aug 13, 2023
1 parent 1eeaa4d commit 20c2087
Show file tree
Hide file tree
Showing 23 changed files with 75 additions and 64 deletions.
3 changes: 2 additions & 1 deletion WBLib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ target_sources(wifibroadcast PUBLIC
${CMAKE_CURRENT_LIST_DIR}/src/Ieee80211Header.hpp
${CMAKE_CURRENT_LIST_DIR}/src/RadiotapHeader.hpp
${CMAKE_CURRENT_LIST_DIR}/src/RSSIAccumulator.hpp
${CMAKE_CURRENT_LIST_DIR}/src/wifibroadcast-spdlog-fake.cpp
${CMAKE_CURRENT_LIST_DIR}/src/wifibroadcast_spdlog.cpp
${CMAKE_CURRENT_LIST_DIR}/src/wifibroadcast_spdlog_fake.cpp
${CMAKE_CURRENT_LIST_DIR}/src/Encryption.cpp
)
target_include_directories(wifibroadcast PUBLIC
Expand Down
2 changes: 1 addition & 1 deletion executables/example_hello.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "../src/WBStreamRx.h"
#include "../src/WBStreamTx.h"
#include "../src/WBTxRx.h"
#include "../src/wifibroadcast-spdlog.h"
#include "../src/wifibroadcast_spdlog.h"
#include "RandomBufferPot.hpp"

/**
Expand Down
2 changes: 1 addition & 1 deletion executables/example_pollute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "../src/WBStreamRx.h"
#include "../src/WBStreamTx.h"
#include "../src/WBTxRx.h"
#include "../src/wifibroadcast-spdlog.h"
#include "../src/wifibroadcast_spdlog.h"
#include "RandomBufferPot.hpp"

/**
Expand Down
8 changes: 4 additions & 4 deletions executables/example_udp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
// Created by consti10 on 30.06.23.
//

#include "../src/HelperSources/SocketHelper.hpp"
#include "../src/HelperSources/TimeHelper.hpp"
#include "../src/WBStreamRx.h"
#include "../src/WBStreamTx.h"
#include "../src/WBTxRx.h"
#include "../src/wifibroadcast-spdlog.h"
#include "../src/HelperSources/SocketHelper.hpp"
#include "RandomBufferPot.hpp"
#include "../src/HelperSources/TimeHelper.hpp"
#include "../src/legacy/WBStreamRxUDP.h"
#include "../src/legacy/WBStreamTxUDP.h"
#include "../src/wifibroadcast_spdlog.h"
#include "RandomBufferPot.hpp"

/**
* Simple example application that uses UDP as data input / output
Expand Down
2 changes: 1 addition & 1 deletion executables/injection_rate_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "../src/WBStreamRx.h"
#include "../src/WBStreamTx.h"
#include "../src/WBTxRx.h"
#include "../src/wifibroadcast-spdlog.h"
#include "../src/wifibroadcast_spdlog.h"
#include "DummyStreamGenerator.hpp"
#include "RandomBufferPot.hpp"
#include "Rates.hpp"
Expand Down
2 changes: 1 addition & 1 deletion executables/test_txrx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "../src/WBStreamRx.h"
#include "../src/WBStreamTx.h"
#include "../src/WBTxRx.h"
#include "../src/wifibroadcast-spdlog.h"
#include "../src/wifibroadcast_spdlog.h"
#include "RandomBufferPot.hpp"

int main(int argc, char *const *argv) {
Expand Down
2 changes: 1 addition & 1 deletion executables/unit_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include "../src/Encryption.h"
#include "../src/HelperSources/Helper.hpp"
#include "../src/Ieee80211Header.hpp"
#include "../src/wifibroadcast-spdlog.h"
#include "../src/wifibroadcast_spdlog.h"

// Simple unit testing for the FEC lib that doesn't require wifi cards

Expand Down
2 changes: 1 addition & 1 deletion src/Encryption.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <cstring>
#include <iostream>

#include "wifibroadcast-spdlog.h"
#include "wifibroadcast_spdlog.h"

wb::KeyPairTxRx wb::generate_keypair_random() {
KeyPairTxRx ret{};
Expand Down
5 changes: 3 additions & 2 deletions src/FECStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
// Created by consti10 on 30.06.23.
//

#include "FECStream.h"

#include <cmath>

#include "FEC.hpp"
#include "FECStream.h"
#include "wifibroadcast-spdlog.h"
#include "wifibroadcast_spdlog.h"

void FECEncoder::encode_block(
std::vector<std::shared_ptr<std::vector<uint8_t>>> data_packets,
Expand Down
4 changes: 2 additions & 2 deletions src/HelperSources/NonceSeqNrHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
#define WIFIBROADCAST_NONCESEQNRHELPER_H

#include <atomic>
#include <memory>
#include <cmath>
#include <memory>

#include "../wifibroadcast-spdlog.h"
#include "../wifibroadcast_spdlog.h"
#include "StringHelper.hpp"

// Helper for dealing with sequence number
Expand Down
6 changes: 4 additions & 2 deletions src/HelperSources/SchedulingHelper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
#include <pthread.h>
#include <sys/resource.h>
#include <unistd.h>
#include <string>

#include <iostream>
#include "../wifibroadcast-spdlog.h"
#include <string>

#include "../wifibroadcast_spdlog.h"

namespace SchedulingHelper {
static void printCurrentThreadPriority(const std::string& name) {
Expand Down
2 changes: 1 addition & 1 deletion src/HelperSources/SeqNrHelper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <cmath>
#include <memory>

#include "../wifibroadcast-spdlog.h"
#include "../wifibroadcast_spdlog.h"

namespace seq_nr{

Expand Down
7 changes: 4 additions & 3 deletions src/HelperSources/SequenceNumberDebugger.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
#ifndef WIFIBROADCAST_SRC_HELPERSOURCES_SEQUENCENUMBERDEBUGGER_H_
#define WIFIBROADCAST_SRC_HELPERSOURCES_SEQUENCENUMBERDEBUGGER_H_

#include <vector>
#include <chrono>
#include <cstdint>
#include <iostream>
#include <chrono>
#include <vector>

#include "../wifibroadcast_spdlog.h"
#include "StringHelper.hpp"
#include "../wifibroadcast-spdlog.h"

/**
* Debug the n lost packets and the n of packet gaps by for a continuous stream of packets with increasing sequence number.
Expand Down
15 changes: 8 additions & 7 deletions src/HelperSources/SocketHelper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,24 @@
#ifndef WIFIBROADCAST_SOCKETHELPER_HPP
#define WIFIBROADCAST_SOCKETHELPER_HPP

#include <list>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <net/if.h>
#include <netinet/ether.h>
#include <netinet/in.h>
#include <netpacket/packet.h>
#include <termio.h>
#include <sys/ioctl.h>
#include <net/if.h>
#include <optional>
#include <sys/socket.h>
#include <termio.h>
#include <unistd.h>

#include <list>
#include <mutex>
#include <optional>
#include <thread>

#include "../wifibroadcast_spdlog.h"
#include "Helper.hpp"
#include "TimeHelper.hpp"
#include "../wifibroadcast-spdlog.h"

namespace SocketHelper {
struct UDPConfig{
Expand Down
28 changes: 14 additions & 14 deletions src/Ieee80211Header.hpp
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
#ifndef __WIFIBROADCAST_IEEE80211_HEADER_HPP__
#define __WIFIBROADCAST_IEEE80211_HEADER_HPP__

#include <cstdio>
#include <cstdlib>
#include <cerrno>
#include <resolv.h>
#include <cstring>
#include <utime.h>
#include <unistd.h>
#include <getopt.h>
#include <endian.h>
#include <fcntl.h>
#include <getopt.h>
#include <resolv.h>
#include <sys/mman.h>
#include <endian.h>
#include <string>
#include <sstream>
#include <vector>
#include <unistd.h>
#include <utime.h>

#include <array>
#include <iostream>
#include <cassert>
#include <cerrno>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>

#include "wifibroadcast-spdlog.h"
#include "HelperSources/StringHelper.hpp"
#include "wifibroadcast_spdlog.h"

// Helper for dealing with the IEEE80211 header in wifibroadcast / openhd
// Usefully references:
Expand Down
2 changes: 1 addition & 1 deletion src/RSSIAccumulator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <optional>

#include "TimeHelper.hpp"
#include "wifibroadcast-spdlog.h"
#include "wifibroadcast_spdlog.h"

/**
* Helper to accumulate RSSI values
Expand Down
30 changes: 15 additions & 15 deletions src/RadiotapHeader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,28 @@ extern "C" {
#include "external/radiotap/radiotap.h"
};

#include <endian.h>
#include <fcntl.h>
#include <getopt.h>
#include <pcap.h>
#include <resolv.h>
#include <sys/mman.h>
#include <unistd.h>
#include <utime.h>

#include <cassert>
#include <cerrno>
#include <chrono>
#include <cstdio>
#include <cstdlib>
#include <cerrno>
#include <resolv.h>
#include <cstring>
#include <utime.h>
#include <unistd.h>
#include <getopt.h>
#include <pcap.h>
#include <endian.h>
#include <fcntl.h>
#include <ctime>
#include <sys/mman.h>
#include <endian.h>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <chrono>
#include <sstream>
#include <iostream>
#include <cassert>

#include "wifibroadcast-spdlog.h"
#include "wifibroadcast_spdlog.h"

// everything must be in little endian byte order http://www.radiotap.org/
static_assert(__BYTE_ORDER == __LITTLE_ENDIAN, "This code is written for little endian only !");
Expand Down
2 changes: 1 addition & 1 deletion src/SignalQualityAccumulator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <optional>

#include "TimeHelper.hpp"
#include "wifibroadcast-spdlog.h"
#include "wifibroadcast_spdlog.h"

/**
* Helper to accumulate (rtl8812au) signal quality values
Expand Down
2 changes: 1 addition & 1 deletion src/WBStreamRx.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "HelperSources/TimeHelper.hpp"
#include "SimpleStream.hpp"
#include "WBTxRx.h"
#include "wifibroadcast-spdlog.h"
#include "wifibroadcast_spdlog.h"

/**
* Receiver for a (multiplexed) wifbroadcast stream
Expand Down
5 changes: 5 additions & 0 deletions src/wifibroadcast_spdlog.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//
// Created by consti10 on 13.08.23.
//

#include "wifibroadcast_spdlog.h"
6 changes: 3 additions & 3 deletions src/wifibroadcast-spdlog.h → src/wifibroadcast_spdlog.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
#ifndef WIFIBROADCAST_SRC_WIFIBROADCAST_SPDLOG_H_
#define WIFIBROADCAST_SRC_WIFIBROADCAST_SPDLOG_H_

#include "wifibroadcast-spdlog-fake.h"
//#include "wifibroadcast-spdlog-fake.h"

/*#include <spdlog/sinks/stdout_color_sinks.h>
#include <spdlog/sinks/stdout_color_sinks.h>
#include <spdlog/spdlog.h>
#include <mutex>

Expand All @@ -30,5 +30,5 @@ static std::shared_ptr<spdlog::logger> get_default() {
return create_or_get("wifibroadcast");
}

}*/
}
#endif // WIFIBROADCAST_SRC_WIFIBROADCAST_SPDLOG_H_
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Created by consti10 on 13.08.23.
//

#include "wifibroadcast-spdlog-fake.h"
#include "wifibroadcast_spdlog_fake.h"

void spdlog::logger::lool() {

Expand Down
File renamed without changes.

0 comments on commit 20c2087

Please sign in to comment.