… | |
… | |
103 | |
103 | |
104 | if (match_list (deny_direct, other->nodename)) |
104 | if (match_list (deny_direct, other->nodename)) |
105 | return false; |
105 | return false; |
106 | |
106 | |
107 | return true; |
107 | return true; |
108 | } |
|
|
109 | |
|
|
110 | void |
|
|
111 | conf_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 | } |
108 | } |
128 | |
109 | |
129 | conf_node::~conf_node () |
110 | conf_node::~conf_node () |
130 | { |
111 | { |
131 | #if 0 |
112 | #if 0 |
… | |
… | |
651 | |
632 | |
652 | return fname; |
633 | return fname; |
653 | } |
634 | } |
654 | |
635 | |
655 | void |
636 | void |
|
|
637 | conf_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 | |
|
|
656 | void |
656 | configuration::print () |
657 | configuration::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"); |