ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/gvpe/src/conf.C
(Generate patch)

Comparing gvpe/src/conf.C (file contents):
Revision 1.52 by root, Tue Feb 8 23:11:35 2011 UTC vs.
Revision 1.54 by root, Tue Feb 15 13:31:23 2011 UTC

105 return false; 105 return false;
106 106
107 return true; 107 return true;
108} 108}
109 109
110void
111conf_node::print ()
112{
113 printf ("%4d fe:fd:80:00:0%1x:%02x %c %-8.8s %-10.10s %s%s%d\n",
114 id,
115 id >> 8, id & 0xff,
116 compress ? 'Y' : 'N',
117 connectmode == C_ONDEMAND ? "ondemand"
118 : connectmode == C_NEVER ? "never"
119 : connectmode == C_ALWAYS ? "always"
120 : connectmode == C_DISABLED ? "disabled"
121 : "",
122 nodename,
123 hostname ? hostname : "",
124 hostname ? ":" : "",
125 hostname ? udp_port : 0
126 );
127}
128
129conf_node::~conf_node () 110conf_node::~conf_node ()
130{ 111{
131#if 0 112#if 0
132 // does not work, because string pointers etc. are shared 113 // does not work, because string pointers etc. are shared
133 // is not called, however 114 // is not called, however
191 172
192 rsa_key = 0; 173 rsa_key = 0;
193 174
194 free (pidfilename); pidfilename = 0; 175 free (pidfilename); pidfilename = 0;
195 free (ifname); ifname = 0; 176 free (ifname); ifname = 0;
196#if ENABLE_HTTP_PROXY 177#if ENABLE_HTTP_PROXY
197 free (proxy_host); proxy_host = 0; 178 free (proxy_host); proxy_host = 0;
198 free (proxy_auth); proxy_auth = 0; 179 free (proxy_auth); proxy_auth = 0;
199#endif 180#endif
200#if ENABLE_DNS 181#if ENABLE_DNS
201 free (dns_forw_host); dns_forw_host = 0; 182 free (dns_forw_host); dns_forw_host = 0;
202#endif 183#endif
203 free (script_if_up); script_if_up = 0; 184 free (script_if_up); script_if_up = 0;
204 free (script_node_up); script_node_up = 0; 185 free (script_node_up); script_node_up = 0;
205 free (script_node_change); script_node_change = 0; 186 free (script_node_change); script_node_change = 0;
651 632
652 return fname; 633 return fname;
653} 634}
654 635
655void 636void
637conf_node::print ()
638{
639 printf ("%4d fe:fd:80:00:0%1x:%02x %c %-8.8s %-10.10s %02x %s%s%d\n",
640 id,
641 id >> 8, id & 0xff,
642 compress ? 'Y' : 'N',
643 connectmode == C_ONDEMAND ? "ondemand"
644 : connectmode == C_NEVER ? "never"
645 : connectmode == C_ALWAYS ? "always"
646 : connectmode == C_DISABLED ? "disabled"
647 : "",
648 nodename,
649 protocols,
650 hostname ? hostname : "",
651 hostname ? ":" : "",
652 hostname ? udp_port : 0
653 );
654}
655
656void
656configuration::print () 657configuration::print ()
657{ 658{
658 printf (_("\nConfiguration\n\n")); 659 printf (_("\nConfiguration\n\n"));
659 printf (_("# of nodes: %d\n"), nodes.size ()); 660 printf (_("# of nodes: %d\n"), nodes.size ());
660 printf (_("this node: %s\n"), thisnode ? thisnode->nodename : "<unset>"); 661 printf (_("this node: %s\n"), thisnode ? thisnode->nodename : "<unset>");
664 printf (_("interface: %s\n"), ifname); 665 printf (_("interface: %s\n"), ifname);
665 printf (_("primary rsa key: %s\n"), prikeyfile ? prikeyfile : "<default>"); 666 printf (_("primary rsa key: %s\n"), prikeyfile ? prikeyfile : "<default>");
666 printf (_("rsa key size: %d\n"), rsa_key ? RSA_size (rsa_key) * 8 : -1); 667 printf (_("rsa key size: %d\n"), rsa_key ? RSA_size (rsa_key) * 8 : -1);
667 printf ("\n"); 668 printf ("\n");
668 669
669 printf ("%4s %-17s %s %-8.8s %-10.10s %s\n", 670 printf ("%4s %-17s %s %-8.8s %-10.10s %04s %s\n",
670 _("ID#"), _("MAC"), _("Com"), _("Conmode"), _("Node"), _("Host:Port")); 671 _("ID#"), _("MAC"), _("Com"), _("Conmode"), _("Node"), _("Prot"), _("Host:Port"));
671 672
672 for (node_vector::iterator i = nodes.begin (); i != nodes.end (); ++i) 673 for (node_vector::iterator i = nodes.begin (); i != nodes.end (); ++i)
673 (*i)->print (); 674 (*i)->print ();
674 675
675 printf ("\n"); 676 printf ("\n");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines