Delete src/Network directory

This commit is contained in:
Timerix22 2022-08-24 13:44:30 +06:00 committed by GitHub
parent 731c589b6e
commit 8b3043b546
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 44 deletions

View File

@ -1 +0,0 @@
#include "network.h"

View File

@ -1,43 +0,0 @@
#pragma once
#if __cplusplus
extern "C" {
#endif
#include "../Hashtable/Hashtable.h"
#if defined(_MSC_VER) || defined(_WIN64) || defined(_WIN32)
#include "winsock.h"
#else
#include "../Hashtable/Hashtable.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netdb.h>
#endif
#define KNPAC_MAX_DATA_SIZE 65503
typedef struct knPackage{
char header[5]; // knpac
uint8 version; // protocol version
uint16 data_size; // size of data block in bytes (1-)
uint32 package_num; // number in sequence of sent packages
uint32 destination_hash; // hash32 of knDestination.name
uint64 data_hash; // hash64 of data
uint8* data; // ptr to data
} knPackage;
typedef struct knDestination{
char* name;
} knDestination;
typedef struct knSocket {
Hashtable* destinations;
int socketfd;
} knSocket;
#if __cplusplus
}
#endif