diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2017-12-02 22:10:47 +0100 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2017-12-02 22:10:47 +0100 |
commit | b499c7305cee6942dc037f34b2e37489f501da47 (patch) | |
tree | e4557a1d8189189aa91430152ff95954e55b88ca /ptunnel.h | |
parent | c5b0c7e5aa15cd14c1fd47fe2404a71ef6578543 (diff) |
ptunnel-ng:
* option parsing
* refactoring
Diffstat (limited to 'ptunnel.h')
-rwxr-xr-x | ptunnel.h | 53 |
1 files changed, 24 insertions, 29 deletions
@@ -45,32 +45,33 @@ // Includes #ifndef WIN32 -#include <sys/unistd.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <netinet/in.h> -#include <arpa/inet.h> -#include <netdb.h> -#include <pthread.h> -#include <errno.h> -#include <net/ethernet.h> -#include <syslog.h> -#include <pwd.h> -#include <grp.h> +#include <sys/unistd.h> +#include <sys/types.h> +#include <sys/socket.h> +#include <netinet/in.h> +#include <arpa/inet.h> +#include <netdb.h> +#include <pthread.h> +#include <errno.h> +#include <net/ethernet.h> +#include <syslog.h> +#include <pwd.h> +#include <grp.h> #endif /* !WIN32 */ -#include <stdarg.h> -#include <unistd.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <time.h> -#include <sys/time.h> -#include <signal.h> -#include <stdint.h> -#include <pcap.h> +#include <stdarg.h> +#include <unistd.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> +#include <sys/time.h> +#include <signal.h> +#include <stdint.h> +#include <stdbool.h> +#include <pcap.h> #ifdef WIN32 -#include <winsock2.h> +#include <winsock2.h> typedef int socklen_t; typedef uint32_t in_addr_t; #define ETH_ALEN 6 /* Octets in one ethernet addr */ @@ -81,11 +82,6 @@ struct ether_header { }; #endif /* WIN32 */ -// Constants -#define false 0 -#define true 1 -#define bool char - enum { kOpt_undefined = 0, // Constants for parsing options kOpt_set_magic, @@ -427,7 +423,6 @@ typedef struct { // Prototypes (sorry about the long lines..) - void usage(char *exec_name); void* pt_proxy(void *args); void pcap_packet_handler(u_char *refcon, const struct pcap_pkthdr *hdr, const u_char* pkt); void handle_packet(char *buf, int bytes, int is_pcap, struct sockaddr_in *addr, int icmp_sock); |