#define DEFAULT_PORT 443 #define MAXCHILD 10 #define SIZE 2048 #define PROT_SIZE 32 #define SYSLOG_FAC LOG_LOCAL6 #define CERTFILE "./mycert.pem" #define KEYFILE "./mykey.pem" #define CAFILE "./ca-cert.pem" #define CLIENT_BANNER "SSL-TUNNEL/%s PROT/1.0\n" #define readsocket(s,b,n) recv((s),(b),(n),0) #define writesocket(s,b,n) send((s),(b),(n),0) typedef int bool; typedef struct key_value { char *key ; char *value ; } key_value_t ; #define FALSE 0 #define TRUE 1 #define false 0 #define true 1 #define SSLCONNECT "CONNECT %s:%d HTTP/1.0\r\n" #define PROXYAUTH "Proxy-Authorization: Basic %s\r\n" #define USERAGENT "User-Agent: " #define FINAL "\r\n" typedef struct { char *localaddr; /* Local Ip address of tunnel */ char *remoteaddr; /* Remote Ip address of tunnel */ char *remotehost; /* Remote host (on wich we ssh connect) */ char *localppp; /* Local PPP command */ int verbose; /* Verbose */ char *ipparam; /* parameter to pass to pppd */ char *proxyname; /* Proxy name */ int proxyport; /* Proxy Port */ int port; /* Tunnel port */ int useproxy; /* UseProxy */ char *proxyusername; /* User and password for SSL Connect auth */ char *proxypass; /* Proxy password */ char *useragent; /* User agent for HTTP authentification */ int localechoint; /* Local LCP echo interval */ int localechfail; /* Local Echo Fail */ int localdebug; /* Launch ppp with debug */ int localproxy; /* Local proxy arp */ int network_timeout; /* Timeout for read and write */ char *keyfile; /* Key File */ char *certfile; /* Certificate */ char *cacertfile; /* List of trusted certificates */ char *randfile; /* Random seed */ int autoreconnect; /* Auto reconnect */ int daemon; /* go in background */ char *logfile; /* Log file name */ char *peer; /* Peer Name */ int bsdppp; /* Use User-land *BSD ppp */ } tunnel ; #define LOCAL_PPP "/usr/sbin/pppd" #define DEFAULT_PROXY_PORT 8080 #define DEFAULT_PROXY_NAME "127.0.0.1" #define DEFAULT_USER_AGENT "Mozilla/4.73 (Win95;I)" #define DEFAULT_IP_PARAM "tunnel" #define DEFAULT_LOCAL_ECHOINT 10 #define DEFAULT_LOCAL_ECHOFAIL 10 #define DEFAULT_LOCAL_PROXYARP 0 #define DEFAULT_NETWORK_TIMEOUT 20 #define CF_SIZE 256 /* sleep at least 10s between connects */ #define MIN_DELAY 10