Ignore:
Timestamp:
11/12/09 15:44:48 (3 years ago)
Author:
eagle
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/i2prep/src/ocatsetup.c

    r514 r518  
    4444   // fhd_key_len 
    4545   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 
    5248   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, 
    5650   NULL, 1, 
    5751#ifdef __CYGWIN__ 
     
    6054   0,                                      // use_tap 
    6155#endif 
    62    {0x00, 0x00, 0x6c, 0x00, 0x00, 0x00},   // ocat_hwaddr (OnionCat MAC address) 
    6356   PID_FILE,                               // pid_file 
    6457   0,                                      // create_pid_file 
     
    7164#endif 
    7265   { 
    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            */ 
    7766      {{{0xfd, 0x87, 0xd8, 0x7e, 0xeb, 0x43, 
    7867           0xf6, 0x83, 0x64, 0xac, 0x73, 0xf9, 0x61, 0xac, 0x9a, 0x00}}}  // initial permanent peer "62bwjldt7fq2zgqa" (dot.cat) 
     
    8069   0, 
    8170   "/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 
    9072   0, 
    9173   {0}, 
     
    10587#endif 
    10688   , 
    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   } 
    109136}; 
    110137 
     
    125152   setup_.uptime = time(NULL); 
    126153 
    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); 
    130157#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); 
    132159#endif 
    133160 
     
    166193   inet_ntop(AF_INET, &setup_.ocat_addr4, ip, SBUF); 
    167194   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); 
    170197 
    171198   if (setup_.logf == stderr) 
     
    183210         //"tor_socks_port    = %d\n" 
    184211         //"ocat_listen_port       = %d\n" 
    185          "ocat_dest_port         = %d\n" 
    186212         "ocat_ctrl_port         = %d\n" 
    187          "tunfd[0]               = %d\n" 
    188          "tunfd[1]               = %d\n" 
    189213         "debug_level            = %d\n" 
    190214         "usrname                = \"%s\"\n" 
    191          "onion_url              = \"%s\"\n" 
    192215         "ocat_addr              = %s\n" 
    193216         "create_clog            = %d\n" 
     
    195218         "controller             = %d\n" 
    196219         "ocat_dir               = \"%s\"\n" 
    197          "tun_dev                = \"%s\"\n" 
    198          "tunname                = \"%s\"\n" 
    199220         "ipv4_enable            = %d\n" 
    200221         "ocat_addr4             = %s\n" 
     
    217238         //setup_.tor_socks_port, 
    218239         //setup_.ocat_listen_port, 
    219          setup_.ocat_dest_port, 
    220240         setup_.ocat_ctrl_port, 
    221          setup_.tunfd[0], setup_.tunfd[1], 
    222241         setup_.debug_level, 
    223242         setup_.usrname, 
    224          setup_.onion_url, 
    225243         ip6, 
    226244         setup_.create_clog, 
     
    228246         setup_.controller, 
    229247         setup_.ocat_dir, 
    230          setup_.tun_dev, 
    231          setup_.tunname, 
    232248         setup_.ipv4_enable, 
    233249         ip, 
     
    250266      if (inet_ntop(AF_INET6, &setup_.root_peer[i], rp, SBUF)) 
    251267         fprintf(f, "root_peer[%d]           = %s\n", i, rp); 
    252  
     268/* 
    253269   if (inet_ntops((struct sockaddr*) setup_.socks_dst, &sas)) 
    254270   { 
     
    272288         log_msg(LOG_WARNING, "could not convert struct sockaddr: \"%s\"", strerror(errno)); 
    273289      fprintf(f, "oc_listen_fd[%d]        = %d\n", i, CNF(oc_listen_fd)[i]); 
    274    } 
     290   }*/ 
    275291} 
    276292 
Note: See TracChangeset for help on using the changeset viewer.