Changeset 518 for branches/i2prep/src/ocat.h
- Timestamp:
- 11/12/09 15:44:48 (3 years ago)
- File:
-
- 1 edited
-
branches/i2prep/src/ocat.h (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/i2prep/src/ocat.h
r514 r518 112 112 #define TOR_PREFIX4_MASK 0xff000000 113 113 #endif 114 //! hidden service TLD 115 #define ONION_TLD "onion" 114 116 //! Length of an .onion-URL (without ".onion" and '\0') 115 117 #define ONION_URL_LEN 16 … … 118 120 //! Total length of .onion-URL (equal to ONION_NAME_SIZE) 119 121 #define ONION_NAME_LEN ONION_NAME_SIZE 122 //! hidden service TLD 123 #define I2P_TLD "oc.b32.i2p" 124 //! Length of an .onion-URL (without ".onion" and '\0') 125 #define I2P_URL_LEN 16 126 //! Total length of .onion-URL 127 #define I2P_NAME_SIZE (I2P_URL_LEN + 11) 128 120 129 121 130 #define MAXPEERS 1024 … … 128 137 //! SOCKS port of TOR proxy 129 138 #define TOR_SOCKS_PORT 9050 139 #define I2P_SOCKS_PORT 9051 130 140 #ifdef __OpenBSD__ 131 141 #define OCAT_UNAME "_tor" … … 235 245 #define VERSION_STRING_LEN 256 236 246 237 typedef enum PeerType {PT_TOR, PT_I2P} PeerType_t; 247 typedef enum peer{PT_TOR, PT_I2P} peer_t; 248 #define PT_TOR_B (1 << (PT_TOR - 1)) 249 #define PT_I2P_B (1 << (PT_I2P - 1)) 250 251 typedef struct NetConn 252 { 253 peer_t type; 254 int socksfd[2]; 255 //! destination socket address of Tor's SOCKS port 256 union 257 { 258 struct sockaddr_in *socks_dst; 259 struct sockaddr_in6 *socks_dst6; 260 }; 261 //! local listening socket address for incoming connections 262 struct sockaddr **listen; 263 int *listen_fd; 264 int listen_cnt; 265 //! virtual port of OnionCat hidden service 266 uint16_t dest_port; 267 //! file descriptors of TUN device (usually tunfd[0] == tunfd[1]) 268 int tunfd[2]; 269 char host_id[ONION_NAME_SIZE]; 270 struct in6_addr addr; 271 //! name of tunnel charcter device 272 char *tun_dev; 273 //! tunnel interface name 274 char tunname[SIZE_256]; 275 //! local OnionCat MAC address 276 uint8_t hwaddr[ETHER_ADDR_LEN]; 277 } NetConn_t; 238 278 239 279 struct OcatSetup … … 243 283 uint32_t fhd_key[2]; 244 284 int fhd_key_len; 245 //! TCP port of SOCKS port of local Tor proxy246 //uint16_t tor_socks_port;247 //! reload port of OnionCat listening for connections248 //uint16_t ocat_listen_port;249 //! virtual port of OnionCat hidden service250 uint16_t ocat_dest_port;251 285 //! local port of controller interface 252 286 uint16_t ocat_ctrl_port; 253 //! file descriptors of TUN device (usually tunfd[0] == tunfd[1])254 int tunfd[2];255 287 int debug_level; 256 288 //! user name to change uid to 257 289 char *usrname; 258 char onion_url[ONION_NAME_SIZE];259 struct in6_addr ocat_addr;260 290 //! flag to create connection log 261 291 int create_clog; … … 264 294 int controller; 265 295 char *ocat_dir; 266 //! name of tunnel charcter device267 char *tun_dev;268 //! tunnel interface name269 char tunname[SIZE_256];270 296 int ipv4_enable; 271 297 struct in_addr ocat_addr4; … … 274 300 int config_read; 275 301 int use_tap; 276 //! local OnionCat MAC address277 uint8_t ocat_hwaddr[ETHER_ADDR_LEN];278 302 char *pid_file; 279 303 int create_pid_file; … … 287 311 time_t uptime; 288 312 char *frandn; 289 //! destination socket address of Tor's SOCKS port290 union291 {292 struct sockaddr_in *socks_dst;293 struct sockaddr_in6 *socks_dst6;294 };295 //! local listening socket address for incoming connections296 struct sockaddr **oc_listen;297 int *oc_listen_fd;298 int oc_listen_cnt;299 313 int rand_addr; 300 314 char version[VERSION_STRING_LEN]; … … 306 320 int *ctrl_listen_fd; 307 321 int ctrl_listen_cnt; 308 //! communication pipe for socks "selected" connector309 int socksfd[2];322 int conn_enabled; 323 NetConn_t conn[2]; 310 324 }; 311 325 … … 359 373 unsigned inm; 360 374 unsigned outm; 361 PeerType_t type;375 peer_t type; 362 376 } OcatPeer_t; 363 377
Note: See TracChangeset
for help on using the changeset viewer.
