Changeset 518 for branches/i2prep/src/ocatsetup.c
- Timestamp:
- 11/12/09 15:44:48 (3 years ago)
- File:
-
- 1 edited
-
branches/i2prep/src/ocatsetup.c (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/i2prep/src/ocatsetup.c
r514 r518 44 44 // fhd_key_len 45 45 sizeof(uint32_t), 46 //TOR_SOCKS_PORT, 47 //OCAT_LISTEN_PORT, 48 OCAT_DEST_PORT, OCAT_CTRL_PORT, 49 //! default tunfd is stdin/stdout 50 {0, 1}, 51 //! default debug level 46 OCAT_CTRL_PORT, 47 //! default debug level 52 48 LOG_DEBUG, 53 OCAT_UNAME, {0}, {{{0}}}, 0, 0, 1, OCAT_DIR, TUN_DEV, 54 {'\0'}, // tunname 55 0, TOR_PREFIX4, TOR_PREFIX4_MASK, 49 OCAT_UNAME, 0, 0, 1, OCAT_DIR, 0, TOR_PREFIX4, TOR_PREFIX4_MASK, 56 50 NULL, 1, 57 51 #ifdef __CYGWIN__ … … 60 54 0, // use_tap 61 55 #endif 62 {0x00, 0x00, 0x6c, 0x00, 0x00, 0x00}, // ocat_hwaddr (OnionCat MAC address)63 56 PID_FILE, // pid_file 64 57 0, // create_pid_file … … 71 64 #endif 72 65 { 73 /*74 {{{0xfd, 0x87, 0xd8, 0x7e, 0xeb, 0x43,75 0xed, 0xb1, 0x08, 0xe4, 0x35, 0x88, 0xe5, 0x46, 0x35, 0xca}}}, // initial permanent peer "5wyqrzbvrdsumnok" (mail.root-servers.cat)76 */77 66 {{{0xfd, 0x87, 0xd8, 0x7e, 0xeb, 0x43, 78 67 0xf6, 0x83, 0x64, 0xac, 0x73, 0xf9, 0x61, 0xac, 0x9a, 0x00}}} // initial permanent peer "62bwjldt7fq2zgqa" (dot.cat) … … 80 69 0, 81 70 "/dev/urandom", 82 {(struct sockaddr_in*) &socks_dst6_}, 83 // oc_listen 84 NULL, 85 // oc_listen_fd 86 NULL, 87 // oc_listen_cnt 88 0, 89 //! rand_addr 71 //! rand_addr 90 72 0, 91 73 {0}, … … 105 87 #endif 106 88 , 107 // socksfd 108 {-1, -1} 89 0 90 { 91 { 92 PT_TOR, 93 // socksfd 94 {-1, -1}, 95 {(struct sockaddr_in*) &socks_dst6_}, 96 // oc_listen 97 NULL, 98 // oc_listen_fd 99 NULL, 100 // oc_listen_cnt 101 0, 102 OCAT_DEST_PORT, 103 //! default tunfd is stdin/stdout 104 {0, 1}, 105 //! onion_url 106 {'\0'}, 107 //! ocat_addr 108 {{{0}}}, 109 TUN_DEV, 110 {'\0'}, // tunname 111 {0x00, 0x00, 0x6c, 0x00, 0x00, 0x00}, // ocat_hwaddr (OnionCat MAC address) 112 }, 113 { 114 PT_I2P, 115 // socksfd 116 {-1, -1}, 117 {(struct sockaddr_in*) &socks_dst6_}, 118 // oc_listen 119 NULL, 120 // oc_listen_fd 121 NULL, 122 // oc_listen_cnt 123 0, 124 OCAT_DEST_PORT, 125 //! default tunfd is stdin/stdout 126 {0, 1}, 127 //! onion_url 128 {'\0'}, 129 //! ocat_addr 130 {{{0}}}, 131 TUN_DEV, 132 {'\0'}, // tunname 133 {0x00, 0x00, 0x6c, 0x00, 0x00, 0x00}, // ocat_hwaddr (OnionCat MAC address) 134 }, 135 } 109 136 }; 110 137 … … 125 152 setup_.uptime = time(NULL); 126 153 127 setup_. socks_dst->sin_family = AF_INET;128 setup_. socks_dst->sin_port = htons(TOR_SOCKS_PORT);129 setup_. socks_dst->sin_addr.s_addr = htonl(INADDR_LOOPBACK);154 setup_.conn[PT_TOR].socks_dst->sin_family = AF_INET; 155 setup_.conn[PT_TOR].socks_dst->sin_port = htons(TOR_SOCKS_PORT); 156 setup_.conn[PT_TOR].socks_dst->sin_addr.s_addr = htonl(INADDR_LOOPBACK); 130 157 #ifdef HAVE_SIN_LEN 131 setup_. socks_dst->sin_len = SOCKADDR_SIZE(setup_.socks_dst);158 setup_.conn[PT_TOR].socks_dst->sin_len = SOCKADDR_SIZE(setup_.conn[PT_TOR].socks_dst); 132 159 #endif 133 160 … … 166 193 inet_ntop(AF_INET, &setup_.ocat_addr4, ip, SBUF); 167 194 inet_ntop(AF_INET, &setup_.ocat_addr4_mask, nm, SBUF); 168 inet_ntop(AF_INET6, &setup_. ocat_addr, ip6, SBUF);169 ether_ntoa_r((struct ether_addr*) setup_. ocat_hwaddr, hw);195 inet_ntop(AF_INET6, &setup_.conn[PT_TOR].ocat_addr, ip6, SBUF); 196 ether_ntoa_r((struct ether_addr*) setup_.conn[PT_TOR].ocat_hwaddr, hw); 170 197 171 198 if (setup_.logf == stderr) … … 183 210 //"tor_socks_port = %d\n" 184 211 //"ocat_listen_port = %d\n" 185 "ocat_dest_port = %d\n"186 212 "ocat_ctrl_port = %d\n" 187 "tunfd[0] = %d\n"188 "tunfd[1] = %d\n"189 213 "debug_level = %d\n" 190 214 "usrname = \"%s\"\n" 191 "onion_url = \"%s\"\n"192 215 "ocat_addr = %s\n" 193 216 "create_clog = %d\n" … … 195 218 "controller = %d\n" 196 219 "ocat_dir = \"%s\"\n" 197 "tun_dev = \"%s\"\n"198 "tunname = \"%s\"\n"199 220 "ipv4_enable = %d\n" 200 221 "ocat_addr4 = %s\n" … … 217 238 //setup_.tor_socks_port, 218 239 //setup_.ocat_listen_port, 219 setup_.ocat_dest_port,220 240 setup_.ocat_ctrl_port, 221 setup_.tunfd[0], setup_.tunfd[1],222 241 setup_.debug_level, 223 242 setup_.usrname, 224 setup_.onion_url,225 243 ip6, 226 244 setup_.create_clog, … … 228 246 setup_.controller, 229 247 setup_.ocat_dir, 230 setup_.tun_dev,231 setup_.tunname,232 248 setup_.ipv4_enable, 233 249 ip, … … 250 266 if (inet_ntop(AF_INET6, &setup_.root_peer[i], rp, SBUF)) 251 267 fprintf(f, "root_peer[%d] = %s\n", i, rp); 252 268 /* 253 269 if (inet_ntops((struct sockaddr*) setup_.socks_dst, &sas)) 254 270 { … … 272 288 log_msg(LOG_WARNING, "could not convert struct sockaddr: \"%s\"", strerror(errno)); 273 289 fprintf(f, "oc_listen_fd[%d] = %d\n", i, CNF(oc_listen_fd)[i]); 274 } 290 }*/ 275 291 } 276 292
Note: See TracChangeset
for help on using the changeset viewer.
