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.6 by pcg, Fri Mar 28 16:14:40 2003 UTC vs.
Revision 1.8 by pcg, Wed Apr 2 03:25:17 2003 UTC

51char *identname; 51char *identname;
52char *pidfilename; 52char *pidfilename;
53 53
54struct configuration conf; 54struct configuration conf;
55 55
56u8 best_protocol (u8 protset)
57{
58 if (protset & PROT_IPv4)
59 return PROT_IPv4;
60
61 return PROT_UDPv4;
62}
63
64const char *strprotocol (u8 protocol)
65{
66 if (protocol & PROT_IPv4 ) return "rawip";
67 if (protocol & PROT_UDPv4) return "udp";
68
69 return "<unknown>";
70}
71
56configuration::configuration () 72configuration::configuration ()
57{ 73{
58 init (); 74 init ();
59} 75}
60 76
71 keepalive = DEFAULT_KEEPALIVE; 87 keepalive = DEFAULT_KEEPALIVE;
72 llevel = L_INFO; 88 llevel = L_INFO;
73 ip_proto = IPPROTO_GRE; 89 ip_proto = IPPROTO_GRE;
74 90
75 default_node.udp_port = DEFAULT_UDPPORT; 91 default_node.udp_port = DEFAULT_UDPPORT;
92 default_node.tcp_port = DEFAULT_UDPPORT;
76 default_node.connectmode = conf_node::C_ALWAYS; 93 default_node.connectmode = conf_node::C_ALWAYS;
77 default_node.compress = true; 94 default_node.compress = true;
78 default_node.protocols = PROT_UDPv4; 95 default_node.protocols = PROT_UDPv4;
79} 96}
80 97
264 } 281 }
265 282
266 /* node-specific, defaultable */ 283 /* node-specific, defaultable */
267 else if (!strcmp (var, "udp-port")) 284 else if (!strcmp (var, "udp-port"))
268 node->udp_port = atoi (val); 285 node->udp_port = atoi (val);
286 else if (!strcmp (var, "tcp-port"))
287 node->tcp_port = atoi (val);
269 else if (!strcmp (var, "router-priority")) 288 else if (!strcmp (var, "router-priority"))
270 node->routerprio = atoi (val); 289 node->routerprio = atoi (val);
271 else if (!strcmp (var, "connect")) 290 else if (!strcmp (var, "connect"))
272 { 291 {
273 if (!strcmp (val, "ondemand")) 292 if (!strcmp (val, "ondemand"))
290 else if (!strcmp (var, "compress")) 309 else if (!strcmp (var, "compress"))
291 { 310 {
292 parse_bool (node->compress, "compress", true, false); 311 parse_bool (node->compress, "compress", true, false);
293 } 312 }
294 // all these bool options really really cost a lot of executable size! 313 // all these bool options really really cost a lot of executable size!
314 else if (!strcmp (var, "enable-tcp"))
315 {
316 u8 v; parse_bool (v, "enable-tcp" , PROT_TCPv4, 0); node->protocols = (node->protocols & ~PROT_TCPv4) | v;
317 }
295 else if (!strcmp (var, "enable-udp")) 318 else if (!strcmp (var, "enable-udp"))
296 { 319 {
297 u8 v; parse_bool (v, "enable-udp" , PROT_UDPv4, 0); node->protocols = (node->protocols & ~PROT_UDPv4) | v; 320 u8 v; parse_bool (v, "enable-udp" , PROT_UDPv4, 0); node->protocols = (node->protocols & ~PROT_UDPv4) | v;
298 } 321 }
299 else if (!strcmp (var, "enable-rawip")) 322 else if (!strcmp (var, "enable-rawip"))

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines