Files
FastSync/src/shared/transport_tcp.h
T
TapTap 23b1d6660c
CI / lint (push) Failing after 16s
CI / build-and-test (push) Has been skipped
CI / sanitizers (address) (push) Has been skipped
CI / sanitizers (thread) (push) Has been skipped
CI / lint (pull_request) Failing after 44s
CI / build-and-test (pull_request) Has been skipped
CI / sanitizers (address) (pull_request) Has been skipped
CI / sanitizers (thread) (pull_request) Has been skipped
fix: reformat codebase and fix const-correctness for CI lint
- Reformat all C/H files to match .clang-format (LLVM style)
- Fix 26 cppcheck const-correctness warnings (constParameterPointer,
  constVariablePointer, constVariable)
- Update function declarations in headers to match const parameters
2026-07-19 15:57:31 +02:00

35 lines
871 B
C

#ifndef TRANSPORT_TCP_H
#define TRANSPORT_TCP_H
#include <netinet/in.h>
#include <stdbool.h>
#include <sys/types.h>
typedef struct Server {
struct sockaddr_in address;
unsigned int address_length;
int file_descriptor;
void* ssl_ctx;
} Server;
typedef struct Client {
struct sockaddr_in address;
unsigned int address_length;
int file_descriptor;
pid_t ssh_child_pid;
void* ssl;
void* ssl_ctx;
} Client;
Server* server_create(int port);
bool server_listen(Server* server, void (*handler)(int file_descriptor));
void server_accept_loop(Server* server, void (*child_fn)(int, void*), void* child_ctx,
const char* log_fmt);
void server_delete(Server** server);
Client* client_create();
bool client_connect(Client* client, char* host, int port);
void client_disconnect(Client* client);
void client_delete(Client* client);
#endif