Changeset 534 for trunk/src/ocat.h


Ignore:
Timestamp:
11/29/09 22:37:56 (2 years ago)
Author:
eagle
Message:

merged GarliCat branch back into trunk
onioncat-privatehosts.pl added (code by zzz)

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src

  • trunk/src/ocat.h

    r523 r534  
    102102 
    103103#define IP6HLEN sizeof(struct ip6_hdr) 
    104 //! TOR prefix: FD87:D87E:EB43::/48 
    105 #define TOR_PREFIX {{{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0,0,0,0,0,0,0,0,0,0}}} 
    106 #define TOR_PREFIX_LEN 48 
    107 #if BYTE_ORDER == LITTLE_ENDIAN 
    108 #define TOR_PREFIX4 {0x0000000a} 
    109 #define TOR_PREFIX4_MASK 0x000000ff 
    110 #else 
    111 #define TOR_PREFIX4 {0x0a000000} 
    112 #define TOR_PREFIX4_MASK 0xff000000 
    113 #endif 
    114104//! Length of an .onion-URL (without ".onion" and '\0') 
    115105#define ONION_URL_LEN 16 
    116 //! Total length of .onion-URL 
    117 #define ONION_NAME_SIZE (ONION_URL_LEN + 7) 
    118 //! Total length of .onion-URL (equal to ONION_NAME_SIZE) 
    119 #define ONION_NAME_LEN ONION_NAME_SIZE 
    120106 
    121107#define MAXPEERS 1024 
    122 //! Local listening port for incoming connections from TOR. 
    123 #define OCAT_LISTEN_PORT 8060 
    124 //! Local control port for querying status information. 
    125 #define OCAT_CTRL_PORT 8066 
    126 //! Virtual destination port for hidden services 
    127 #define OCAT_DEST_PORT 8060 
    128 //! SOCKS port of TOR proxy 
    129 #define TOR_SOCKS_PORT 9050 
    130108#ifdef __OpenBSD__ 
    131109#define OCAT_UNAME "_tor" 
     
    235213#define VERSION_STRING_LEN 256 
    236214 
    237 typedef enum PeerType {PT_TOR, PT_I2P} PeerType_t; 
     215 
     216#define NTYPE_TOR 0 
     217#define NTYPE_I2P 1 
     218 
    238219 
    239220struct OcatSetup 
     
    256237   //! user name to change uid to 
    257238   char *usrname; 
    258    char onion_url[ONION_NAME_SIZE]; 
     239   char onion_url[SIZE_256]; 
    259240   struct in6_addr ocat_addr; 
    260241   //! flag to create connection log 
     
    282263   int use_syslog; 
    283264   int daemon; 
     265#ifdef CONNECT_ROOT_PEERS 
    284266   //! hardcoded permanent peers 
    285267#define ROOT_PEERS 1 
    286268   struct in6_addr root_peer[ROOT_PEERS]; 
     269#endif 
    287270   time_t uptime; 
    288271   char *frandn; 
     
    308291   //! communication pipe for socks "selected" connector 
    309292   int socksfd[2]; 
     293   int net_type; 
    310294}; 
    311295 
     
    359343   unsigned inm; 
    360344   unsigned outm; 
    361    PeerType_t type; 
    362345} OcatPeer_t; 
    363346 
     
    566549void print_setup_struct(FILE *); 
    567550void init_setup(void); 
     551void post_init_setup(void); 
    568552void lock_setup(void); 
    569553void unlock_setup(void); 
     
    599583int strsockaddr(const char *, struct sockaddr *); 
    600584void add_local_listeners(void); 
    601 void add_listener(const char *, const char *); 
     585void add_listener(const char *); 
    602586void delete_listeners(struct sockaddr **, int *, int); 
    603587int fdprintf(int, const char *, va_list); 
Note: See TracChangeset for help on using the changeset viewer.