fix headers

This commit is contained in:
dartvader316 2024-08-07 14:25:26 +03:00
parent 084921e523
commit 632e6b038b
17 changed files with 87 additions and 13 deletions

5
.gitignore vendored
View file

@ -1,2 +1,5 @@
.vscode
ciadpi.exe
ciadpi.exe
ciadpi
*.o
compile_flags.txt

View file

@ -1,4 +1,4 @@
#define CONEV_H
#include "conev.h"
#include <stdlib.h>

View file

@ -1,4 +1,6 @@
#pragma once
#ifndef CONEV_H
#define CONEV_H
#include <stdint.h>
#ifndef __linux__
@ -107,3 +109,5 @@ void destroy_pool(struct poolhd *pool);
struct eval *next_event(struct poolhd *pool, int *offs, int *type);
int mod_etype(struct poolhd *pool, struct eval *val, int type);
#endif

View file

@ -1,5 +1,7 @@
#define _GNU_SOURCE
#include "desync.h"
#include <stdio.h>
#include <string.h>
@ -16,7 +18,6 @@
#include <sys/sendfile.h>
#include <fcntl.h>
#include <desync.h>
#ifdef MFD_CLOEXEC
#include <sys/syscall.h>

View file

@ -1,3 +1,15 @@
#ifndef DESYNC_H
#define DESYNC_H
#include <stdint.h>
#include <stddef.h>
#ifdef _WIN32
#include <winsock2.h>
#else
#include <sys/socket.h>
#endif
ssize_t desync(int sfd, char *buffer, size_t bfsize, ssize_t n, ssize_t offset, struct sockaddr *dst, int dp_c);
ssize_t desync_udp(int sfd, char *buffer, size_t bfsize, ssize_t n, struct sockaddr *dst, int dp_c);
@ -9,4 +21,6 @@ struct tcpi {
uint32_t unacked;
uint32_t rrr[29];
uint32_t notsent_bytes;
};
};
#endif

View file

@ -1,3 +1,6 @@
#ifndef ERROR_H
#define ERROR_H
#include <stdio.h>
#include <errno.h>
@ -18,7 +21,7 @@
#ifdef _WIN32
#define uniperror(str) \
fprintf(stderr, "%s: %d\n", str, GetLastError())
fprintf(stderr, "%s: %ld\n", str, GetLastError())
#else
#ifdef ANDROID_APP
#define uniperror(str) \
@ -72,3 +75,5 @@ static inline const int unie(int e)
inet_ntop(AF_INET, &dst.in.sin_addr, ADDR_STR, sizeof(ADDR_STR)); \
else \
inet_ntop(AF_INET6, &dst.in6.sin6_addr, ADDR_STR, sizeof(ADDR_STR));
#endif

View file

@ -1,3 +1,6 @@
#include "extend.h"
#ifdef _WIN32
#include <ws2tcpip.h>

View file

@ -1,3 +1,12 @@
#ifndef EXTEND_H
#define EXTEND_H
#include <stddef.h>
#include "mpool.h"
#include "conev.h"
#include "proxy.h"
int connect_hook(struct poolhd *pool, struct eval *val,
struct sockaddr_ina *dst, int next);
@ -14,4 +23,6 @@ ssize_t udp_hook(struct eval *val,
int protect(int conn_fd, const char *path);
#else
#define protect(fd, path) 0
#endif
#endif
#endif

View file

@ -1,7 +1,9 @@
#include "mpool.h"
#include <stdlib.h>
#include <string.h>
#include "mpool.h"
static inline int scmp(const struct elem *p, const struct elem *q)

View file

@ -1,3 +1,6 @@
#ifndef MPOOL_H
#define MPOOL_H
#include <stdbool.h>
#include <time.h>
#include "kavl.h"
@ -24,3 +27,5 @@ struct elem *mem_add(struct mphdr *hdr, char *str, int len);
void mem_delete(struct mphdr *hdr, char *str, int len);
void mem_destroy(struct mphdr *hdr);
#endif

View file

@ -1,6 +1,7 @@
#define _GNU_SOURCE
#include <packets.h>
#include "packets.h"
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>

View file

@ -1,3 +1,6 @@
#ifndef PACKETS_H
#define PACKETS_H
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
@ -43,3 +46,6 @@ int part_tls(char *buffer, size_t bsize, ssize_t n, long pos);
//bool is_dns_req(char *buffer, size_t n);
//bool is_quic_initial(char *buffer, size_t bsize);
#endif

View file

@ -1,3 +1,6 @@
#ifndef PARAMS_H
#define PARAMS_H
#include <stdint.h>
#include <stdio.h>
@ -107,4 +110,6 @@ extern struct packet fake_http;
extern struct packet oob_data;
extern struct packet fake_udp;
extern char ip_option[1];
extern char ip_option[1];
#endif

View file

@ -1,6 +1,8 @@
#define _GNU_SOURCE
#define EID_STR
#include "proxy.h"
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
@ -8,7 +10,6 @@
#include <signal.h>
#include <assert.h>
#include "proxy.h"
#include "params.h"
#include "conev.h"
#include "extend.h"

View file

@ -1,3 +1,6 @@
#ifndef PROXY_H
#define PROXY_H
#include <stdint.h>
#ifdef _WIN32
@ -111,3 +114,5 @@ int listen_socket(struct sockaddr_ina *srv);
int event_loop(int srvfd);
int run(struct sockaddr_ina *srv);
#endif

View file

@ -1,4 +1,6 @@
#include "win_service.h"
#include <windows.h>
#define SERVICE_NAME "ByeDPI"
@ -76,4 +78,4 @@ int register_winsvc(int argc, char *argv[])
svc_argv = argv;
return StartServiceCtrlDispatcher(ServiceTable);
}
}

View file

@ -1 +1,7 @@
int register_winsvc(int argc, char *argv[]);
#ifndef WIN_SERVICE_H
#define WIN_SERVICE_H
int register_winsvc(int argc, char *argv[]);
#endif