Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
56655d2
update: correct Methods to METHODS
Sobottasgithub Mar 26, 2026
5102ff1
update: remove unnecessary log messages
Sobottasgithub Mar 26, 2026
ab7e853
update: add ttp2 as flake input
TureBentzin May 14, 2026
c1d67ac
flake.lock: Update
TureBentzin May 14, 2026
4dd6a6b
update: add libttp2 to build inputs
TureBentzin May 14, 2026
010c658
update: link tablo against ttp2
TureBentzin May 14, 2026
999b968
update: remove find_library instruction
TureBentzin May 14, 2026
b2bc90e
Merge pull request #17 from Sobottasgithub/ttp2
Sobottasgithub May 14, 2026
cfe0a0a
update: introduce new packages for subfolders
TureBentzin May 14, 2026
8e80ac0
update: introduce tablo default packages and tablo-full support
TureBentzin May 14, 2026
489f77a
Merge pull request #18 from Sobottasgithub/redesign_packages
Sobottasgithub May 14, 2026
c710ecb
update: update README with new build method
Sobottasgithub May 15, 2026
d1bf93f
update: remove tabnet
Sobottasgithub May 15, 2026
0e82457
update: remove old tablo code from TabloClient and TabloMaster
Sobottasgithub May 15, 2026
728e78f
update: update ttp2
Sobottasgithub May 15, 2026
7da90b3
update: implement ttp2 in client networking WIP
Sobottasgithub May 15, 2026
8b23e22
update: fix naming issue
Sobottasgithub May 15, 2026
5e610d4
update: diable TabloNode until it is fixed
Sobottasgithub May 15, 2026
729c525
update: add simple logic to client cli
Sobottasgithub May 15, 2026
ab9642e
update: finish implementation of network manager in client
Sobottasgithub May 15, 2026
73c66d5
update: implement accept client in master
Sobottasgithub May 15, 2026
dd3e1cb
update: fix client crash
Sobottasgithub May 15, 2026
990663c
update: implement simple client response cycle
Sobottasgithub May 15, 2026
f3f7731
update: remove falsely created thread in client
Sobottasgithub May 15, 2026
8f94447
update: fix client network_manager
Sobottasgithub May 16, 2026
199536d
update: use autoID from TTP2
Sobottasgithub May 16, 2026
b14bbe2
update: refactor udpDiscovery
Sobottasgithub May 16, 2026
bbe51d1
update: prepare to test updDiscovery
Sobottasgithub May 17, 2026
221de4e
update: remove unnecessary log messages
Sobottasgithub May 17, 2026
798bb93
update: revert test udpdiscovery
Sobottasgithub May 17, 2026
f22b911
update: implement TTP2 in node
Sobottasgithub May 17, 2026
ea99f47
update: establish conn to node
Sobottasgithub May 18, 2026
4eb962f
update: handle node disconnect
Sobottasgithub May 18, 2026
5958f7c
update: implement distribution logic
Sobottasgithub May 18, 2026
1a4c1ad
update: rename order >> request
Sobottasgithub May 18, 2026
49c1f87
update: rename solution >> response
Sobottasgithub May 18, 2026
45863c3
update: fix node sending back empty packages
Sobottasgithub May 18, 2026
0c01437
update: add --file as commandline argument to cli
Sobottasgithub Jun 1, 2026
346a9a3
update: send file to node
Sobottasgithub Jun 2, 2026
784ee5d
update: improve cli
Sobottasgithub Jun 2, 2026
cdc6943
update: add filetype when sending file WIP
Sobottasgithub Jun 2, 2026
76b48d9
update: ttp2
Sobottasgithub Jun 3, 2026
391325d
update: add TUD to Tablo
Sobottasgithub Jun 5, 2026
c23f767
Merge remote-tracking branch 'refs/remotes/origin/develop' into develop
Sobottasgithub Jun 5, 2026
bd40e72
update: implement tud
Sobottasgithub Jun 5, 2026
4e498f5
update: remove old Udp Discovery
Sobottasgithub Jun 5, 2026
381d25c
update: fixup tud
Sobottasgithub Jun 5, 2026
39c0bb7
update: add supporting libs to readme
Sobottasgithub Jun 5, 2026
556fc44
update: use tud namespace
Sobottasgithub Jun 5, 2026
387c476
update: ttp2
Sobottasgithub Jun 5, 2026
50f44ae
update: use namespace ttp2
Sobottasgithub Jun 5, 2026
8ea06fd
update: add sendFile to client cli
Sobottasgithub Jun 5, 2026
fb58777
update: add sendFile as option to use
Sobottasgithub Jun 5, 2026
94a392b
update: implement set File
Sobottasgithub Jun 7, 2026
912a720
update: add viewport to cli
Sobottasgithub Jun 7, 2026
1f098b4
update: implement viewport
Sobottasgithub Jun 7, 2026
c7e96b4
update: flake ttp2
Sobottasgithub Jun 7, 2026
1bcfbe0
update: add csv_manager
Sobottasgithub Jun 8, 2026
2f1a64a
update: fix typo in cli
Sobottasgithub Jun 8, 2026
f958977
update: add rowCount and columnCount
Sobottasgithub Jun 9, 2026
8bad31a
update: add getRowByIndex
Sobottasgithub Jun 9, 2026
5d48039
update: add getColumnByIndex
Sobottasgithub Jun 10, 2026
4bfacd7
update: fix get first column
Sobottasgithub Jun 10, 2026
0dd6fd4
update: implement Viewport
Sobottasgithub Jun 10, 2026
28f7f35
update: flake
Sobottasgithub Jun 11, 2026
97e6667
update: ttp2
Sobottasgithub Jun 12, 2026
57475d6
update: fixup
Sobottasgithub Jun 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 25 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,35 @@ project(tablo)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Tablo shared libraries
# Build options

# libtabcrypt
add_subdirectory(lib/libtabcrypt)
option(DEF_LIBTABCRYPT "Build libtabcrypt" ON)
option(DEF_LIBTABNET "Build libtabnet" ON)

# libtabnet
add_subdirectory(lib/libtabnet)
option(DEF_CLIENT "Build TabloClient" ON)
option(DEF_MASTER "Build TabloMaster" ON)
option(DEF_NODE "Build TabloNode" ON)

# Test executables
# Shared libraries

add_subdirectory(TCTest)
if(DEF_LIBTABCRYPT)
add_subdirectory(lib/libtabcrypt)
endif()

if(DEF_LIBTABNET)
add_subdirectory(lib/libtabnet)
endif()

# TabloClient, TabloMaster and TabloNode executables (provided by own CMakeLists.txt files)
# Executables

add_subdirectory(TabloClient)
add_subdirectory(TabloMaster)
add_subdirectory(TabloNode)
if(DEF_CLIENT)
add_subdirectory(TabloClient)
endif()

if(DEF_MASTER)
add_subdirectory(TabloMaster)
endif()

if(DEF_NODE)
add_subdirectory(TabloNode)
endif()
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ The following ports are used to establish the network tablo needs:
### 2 Deploy

```cmd
nix shell
./build-image-nix.sh
tablo-master --interface YOURINTERFACE
tablo-node --interface YOURINTERFACE
tablo-client --master YOURMASTERSIP
sudo nix-collect-garbage -d
nix build --log-format bar-with-logs
nix run .#tablo-master -- --interface INTERFACENAME
nix run .#tablo-node -- --interface INTERFACENAME
nix run .#tablo-client -- --master MASTERIPV4
```

## Deploy with DOCKER
Expand All @@ -45,3 +45,7 @@ The flake in this repository allowes you to build minimal docker images that avo

To use this feature, you NEED to use nix. Download available at: https://nixos.org/

# Take a look at Tablos networking libs:
<b>Tablo Transfer Protocol:</b><a href="https://github.com/Sobottasgithub/TTP2">TTP2</a>

<b>Tablo UDP Discovery:</b> <a href="https://github.com/Sobottasgithub/TUD">TUD</a>
14 changes: 0 additions & 14 deletions TCTest/CMakeLists.txt

This file was deleted.

50 changes: 0 additions & 50 deletions TCTest/src/main.cpp

This file was deleted.

13 changes: 0 additions & 13 deletions TCTest/src/tabcrypt_test.h

This file was deleted.

3 changes: 2 additions & 1 deletion TabloClient/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ file(GLOB_RECURSE SOURCES "src/*.cpp" "src/*.h")

add_executable(tablo-client ${SOURCES})

# Link against the tabcrypt library
# Link against libs
target_link_libraries(tablo-client PRIVATE tabcrypt)
target_link_libraries(tablo-client PRIVATE tabnet)
target_link_libraries(tablo-client PRIVATE ttp2)

install(TARGETS tablo-client DESTINATION bin)
13 changes: 11 additions & 2 deletions TabloClient/src/tabloClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,27 @@
#include <cstring>

#include "utils/cli.h"
#include "utils/argv_struct.h"

int main(int argc, char *argv[])
{
if (argc > 0) {
struct Argv commandLineArguments;

for(int index = 0; index < argc; index++) {
if (std::string(argv[index]).rfind("--master", 0) == 0) {
Cli cli(argv[index+1]);
commandLineArguments.tabloMaster = argv[index+1];
} else if (std::string(argv[index]).rfind("--file", 0) == 0) {
commandLineArguments.filePath = argv[index+1];
}
Comment thread
Sobottasgithub marked this conversation as resolved.
}

if (commandLineArguments.tabloMaster.length() != 0) {
Cli cli(commandLineArguments);
}
} else {
// Use config file (TODO)
Cli cli("");
std::wcout << "failed" << std::endl;
}

return 0;
Expand Down
11 changes: 11 additions & 0 deletions TabloClient/src/utils/argv_struct.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#ifndef ARGV_STRUCT_H
#define ARGV_STRUCT_H

#include<string>

struct Argv {
std::string tabloMaster;
std::string filePath;
};

#endif
138 changes: 116 additions & 22 deletions TabloClient/src/utils/cli.cpp
Original file line number Diff line number Diff line change
@@ -1,40 +1,134 @@
#include "cli.h"

#include <ostream>
#include <client_session_controller.h>
#include <string>
#include <iostream>
#include <regex>
#include <fstream>
#include <thread>
#include <variant>

#include "networking.h"
#include "network_manager.h"

Cli::Cli(std::string tabloMaster) {
Cli::Cli(struct Argv argv) {
std::string tabloMaster = argv.tabloMaster;
std::string filePath = argv.filePath;

std::wcout << "Client! Tablo master at: " << tabloMaster.c_str() << std::endl;
Networking networking;

NetworkManager networkManager;

if (networkManager.createSocket(tabloMaster) < 0) {
std::wcout << "Create network manager failed!" << std::endl;
return;
}

std::thread networkingThread(
&Networking::networkingCycle,
&networking,
tabloMaster
);
sendFile(filePath, &networkManager);

while (true) {
int method;
std::wcout << "Method: ";
std::cin >> method;
std::wcout << std::endl;
std::wcout << "Choose option\n(1) send Packet\n(2) read Packets\n(3) send File\n(4) get Viewport\noption:";
std::string option = "";
std::cin >> option;
if (option == "1") {
std::string content;
std::wcout << "Content: ";
std::cin >> content;

std::string content;
std::wcout << "Content: ";
std::cin >> content;
std::wcout << std::endl;
ttp2::Networking::Packet packet;

networking.pushOrder(method, content);
ttp2::Networking::Standard payload;
payload.payload = content;
packet.payload = payload;

std::wcout << "Waiting for solution..." << std::endl;
while (!networking.hasSolution()) {} // Wait for solution
networkManager.pushRequest(packet);
} else if (option == "2") {
if (networkManager.hasResponse()) {
while (networkManager.hasResponse()) {
ttp2::ClientSessionController::Packet response = networkManager.popResponse();

if (std::holds_alternative<ttp2::ClientSessionController::Standard>(response.payload)) {
ttp2::ClientSessionController::Standard responsePayload = std::get<ttp2::ClientSessionController::Standard>(response.payload);
std::wcout << "Response:\nID: " << response.id << "\nPayload: " << responsePayload.payload.c_str() << std::endl;
} else if (std::holds_alternative<ttp2::ClientSessionController::File>(response.payload)) {
ttp2::ClientSessionController::File responsePayload = std::get<ttp2::ClientSessionController::File>(response.payload);
std::wcout << "Response:\nID: " << response.id
<< "\n----payload----\nFilePath: " << responsePayload.filePath.c_str()
<< "\nStart: " << responsePayload.start
<< "\nEnd: " << responsePayload.end
<< "\nPayload: " << responsePayload.payload.c_str()
<< "\n---------------" << std::endl;
} else if (std::holds_alternative<ttp2::ClientSessionController::Viewport>(response.payload)) {
ttp2::ClientSessionController::Viewport responseViewport = std::get<ttp2::ClientSessionController::Viewport>(response.payload);
if (responseViewport.payload.length() > 0) {
std::wcout << responseViewport.payload.c_str() << std::endl;
} else {
std::wcout << "Empty Viewport" << std::endl;
}
Comment thread
Copilot marked this conversation as resolved.
}
}
} else {
std::wcout << "There are currently no packets to read!" << std::endl;
}
} else if (option == "3") {
std::string filePath;
std::wcout << "CSV Filepath:";
std::cin >> filePath;

sendFile(filePath, &networkManager);
} else if (option == "4") {
int xStart;
int xEnd;
int yStart;
int yEnd;

std::wcout << networking.popSolution().c_str() << std::endl;
std::wcout << "xStart:";
std::cin >> xStart;
std::wcout << "xEnd:";
std::cin >> xEnd;
std::wcout << "yStart:";
std::cin >> yStart;
std::wcout << "yEnd:";
std::cin >> yEnd;

ttp2::Networking::Packet packet;
ttp2::Networking::Viewport payload;
payload.xStart = xStart;
payload.xEnd = xEnd;
payload.yStart = yStart;
payload.yEnd = yEnd;
packet.payload = payload;

networkManager.pushRequest(packet);
std::wcout << "Send Viewport request!" << std::endl;
} else {
std::wcout << "invalid" << std::endl;
}
}
}

void Cli::sendFile(std::string filePath, NetworkManager* networkManager) {
if (filePath.length() != 0) {
std::ifstream file(filePath);

if (file.is_open()) {
std::string fileContent;
std::string line;
int lineCount = 0;
while (std::getline(file, line)) {
lineCount++;
fileContent = fileContent + line.c_str() + "\n";
}
file.close();

ttp2::Networking::Packet packet;
ttp2::Networking::File payload;
payload.filePath = filePath;
payload.start = 0;
payload.end = lineCount;
payload.payload = fileContent;
packet.payload = payload;

networkManager->pushRequest(packet);
std::wcout << "Send file with FilePath: " << filePath.c_str() << std::endl;
}
}
}
9 changes: 7 additions & 2 deletions TabloClient/src/utils/cli.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
#ifndef CLI_H
#define CLI_H

#include <string>
#include "network_manager.h"

#include "argv_struct.h"

class Cli
{
public:
Cli(std::string tabloMaster);
Cli(struct Argv argv);

private:
void sendFile(std::string filePath, NetworkManager* networkManager);
};

#endif
Loading