mirror of
https://github.com/hufrea/byedpi.git
synced 2024-12-21 22:05:32 +00:00
fix headers
This commit is contained in:
parent
084921e523
commit
632e6b038b
5
.gitignore
vendored
5
.gitignore
vendored
@ -1,2 +1,5 @@
|
|||||||
.vscode
|
.vscode
|
||||||
ciadpi.exe
|
ciadpi.exe
|
||||||
|
ciadpi
|
||||||
|
*.o
|
||||||
|
compile_flags.txt
|
||||||
|
2
conev.c
2
conev.c
@ -1,4 +1,4 @@
|
|||||||
#define CONEV_H
|
|
||||||
#include "conev.h"
|
#include "conev.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
6
conev.h
6
conev.h
@ -1,4 +1,6 @@
|
|||||||
#pragma once
|
#ifndef CONEV_H
|
||||||
|
#define CONEV_H
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#ifndef __linux__
|
#ifndef __linux__
|
||||||
@ -107,3 +109,5 @@ void destroy_pool(struct poolhd *pool);
|
|||||||
struct eval *next_event(struct poolhd *pool, int *offs, int *type);
|
struct eval *next_event(struct poolhd *pool, int *offs, int *type);
|
||||||
|
|
||||||
int mod_etype(struct poolhd *pool, struct eval *val, int type);
|
int mod_etype(struct poolhd *pool, struct eval *val, int type);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
3
desync.c
3
desync.c
@ -1,5 +1,7 @@
|
|||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
|
|
||||||
|
#include "desync.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
@ -16,7 +18,6 @@
|
|||||||
#include <sys/sendfile.h>
|
#include <sys/sendfile.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
|
||||||
#include <desync.h>
|
|
||||||
|
|
||||||
#ifdef MFD_CLOEXEC
|
#ifdef MFD_CLOEXEC
|
||||||
#include <sys/syscall.h>
|
#include <sys/syscall.h>
|
||||||
|
16
desync.h
16
desync.h
@ -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(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);
|
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 unacked;
|
||||||
uint32_t rrr[29];
|
uint32_t rrr[29];
|
||||||
uint32_t notsent_bytes;
|
uint32_t notsent_bytes;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
7
error.h
7
error.h
@ -1,3 +1,6 @@
|
|||||||
|
#ifndef ERROR_H
|
||||||
|
#define ERROR_H
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
@ -18,7 +21,7 @@
|
|||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#define uniperror(str) \
|
#define uniperror(str) \
|
||||||
fprintf(stderr, "%s: %d\n", str, GetLastError())
|
fprintf(stderr, "%s: %ld\n", str, GetLastError())
|
||||||
#else
|
#else
|
||||||
#ifdef ANDROID_APP
|
#ifdef ANDROID_APP
|
||||||
#define uniperror(str) \
|
#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)); \
|
inet_ntop(AF_INET, &dst.in.sin_addr, ADDR_STR, sizeof(ADDR_STR)); \
|
||||||
else \
|
else \
|
||||||
inet_ntop(AF_INET6, &dst.in6.sin6_addr, ADDR_STR, sizeof(ADDR_STR));
|
inet_ntop(AF_INET6, &dst.in6.sin6_addr, ADDR_STR, sizeof(ADDR_STR));
|
||||||
|
|
||||||
|
#endif
|
||||||
|
3
extend.c
3
extend.c
@ -1,3 +1,6 @@
|
|||||||
|
|
||||||
|
#include "extend.h"
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <ws2tcpip.h>
|
#include <ws2tcpip.h>
|
||||||
|
|
||||||
|
13
extend.h
13
extend.h
@ -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,
|
int connect_hook(struct poolhd *pool, struct eval *val,
|
||||||
struct sockaddr_ina *dst, int next);
|
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);
|
int protect(int conn_fd, const char *path);
|
||||||
#else
|
#else
|
||||||
#define protect(fd, path) 0
|
#define protect(fd, path) 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
4
mpool.c
4
mpool.c
@ -1,7 +1,9 @@
|
|||||||
|
|
||||||
|
#include "mpool.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "mpool.h"
|
|
||||||
|
|
||||||
|
|
||||||
static inline int scmp(const struct elem *p, const struct elem *q)
|
static inline int scmp(const struct elem *p, const struct elem *q)
|
||||||
|
5
mpool.h
5
mpool.h
@ -1,3 +1,6 @@
|
|||||||
|
#ifndef MPOOL_H
|
||||||
|
#define MPOOL_H
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include "kavl.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_delete(struct mphdr *hdr, char *str, int len);
|
||||||
|
|
||||||
void mem_destroy(struct mphdr *hdr);
|
void mem_destroy(struct mphdr *hdr);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
|
|
||||||
#include <packets.h>
|
#include "packets.h"
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#ifndef PACKETS_H
|
||||||
|
#define PACKETS_H
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdbool.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_dns_req(char *buffer, size_t n);
|
||||||
|
|
||||||
//bool is_quic_initial(char *buffer, size_t bsize);
|
//bool is_quic_initial(char *buffer, size_t bsize);
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
7
params.h
7
params.h
@ -1,3 +1,6 @@
|
|||||||
|
#ifndef PARAMS_H
|
||||||
|
#define PARAMS_H
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
@ -107,4 +110,6 @@ extern struct packet fake_http;
|
|||||||
extern struct packet oob_data;
|
extern struct packet oob_data;
|
||||||
extern struct packet fake_udp;
|
extern struct packet fake_udp;
|
||||||
|
|
||||||
extern char ip_option[1];
|
extern char ip_option[1];
|
||||||
|
|
||||||
|
#endif
|
||||||
|
3
proxy.c
3
proxy.c
@ -1,6 +1,8 @@
|
|||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
#define EID_STR
|
#define EID_STR
|
||||||
|
|
||||||
|
#include "proxy.h"
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -8,7 +10,6 @@
|
|||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#include "proxy.h"
|
|
||||||
#include "params.h"
|
#include "params.h"
|
||||||
#include "conev.h"
|
#include "conev.h"
|
||||||
#include "extend.h"
|
#include "extend.h"
|
||||||
|
5
proxy.h
5
proxy.h
@ -1,3 +1,6 @@
|
|||||||
|
#ifndef PROXY_H
|
||||||
|
#define PROXY_H
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
@ -111,3 +114,5 @@ int listen_socket(struct sockaddr_ina *srv);
|
|||||||
int event_loop(int srvfd);
|
int event_loop(int srvfd);
|
||||||
|
|
||||||
int run(struct sockaddr_ina *srv);
|
int run(struct sockaddr_ina *srv);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
|
|
||||||
#include "win_service.h"
|
#include "win_service.h"
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
#define SERVICE_NAME "ByeDPI"
|
#define SERVICE_NAME "ByeDPI"
|
||||||
@ -76,4 +78,4 @@ int register_winsvc(int argc, char *argv[])
|
|||||||
svc_argv = argv;
|
svc_argv = argv;
|
||||||
|
|
||||||
return StartServiceCtrlDispatcher(ServiceTable);
|
return StartServiceCtrlDispatcher(ServiceTable);
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user