Copied TCP impl from other project, basic Block implementation, randomx pow, signing via secp256k1

This commit is contained in:
2026-03-29 17:18:23 +02:00
commit 57bfe61c13
26 changed files with 1775 additions and 0 deletions

29
include/tcpd/tcpclient.h Normal file
View File

@@ -0,0 +1,29 @@
#ifndef TCPCLIENT_H
#define TCPCLIENT_H
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <pthread.h>
#include <stdint.h>
#include <dynarr.h>
#define MTU 1500
struct TcpClient {
int clientFd;
struct sockaddr_in clientAddr;
uint32_t clientId;
unsigned char dataBuf[MTU];
ssize_t dataBufLen;
void (*on_data)(struct TcpClient* client);
void (*on_disconnect)(struct TcpClient* client);
pthread_t clientThread;
};
typedef struct TcpClient TcpClient;
#endif