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.5 by pcg, Fri Mar 28 04:05:10 2003 UTC vs.
Revision 1.7 by pcg, Fri Mar 28 16:21:09 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
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;
76 default_node.connectmode = conf_node::C_ALWAYS; 92 default_node.connectmode = conf_node::C_ALWAYS;
77 default_node.compress = true; 93 default_node.compress = true;
78 default_node.can_send = PROT_UDPv4; 94 default_node.protocols = PROT_UDPv4;
79 default_node.can_recv = PROT_IPv4;
80} 95}
81 96
82void configuration::cleanup() 97void configuration::cleanup()
83{ 98{
84 if (rsa_key) 99 if (rsa_key)
291 else if (!strcmp (var, "compress")) 306 else if (!strcmp (var, "compress"))
292 { 307 {
293 parse_bool (node->compress, "compress", true, false); 308 parse_bool (node->compress, "compress", true, false);
294 } 309 }
295 // all these bool options really really cost a lot of executable size! 310 // all these bool options really really cost a lot of executable size!
296 else if (!strcmp (var, "can-send-udp")) 311 else if (!strcmp (var, "enable-udp"))
297 {
298 u8 v; parse_bool (v, "can-send-udp", PROT_UDPv4, 0); node->can_send = (node->can_send & ~PROT_UDPv4) | v;
299 } 312 {
300 else if (!strcmp (var, "can-recv-udp")) 313 u8 v; parse_bool (v, "enable-udp" , PROT_UDPv4, 0); node->protocols = (node->protocols & ~PROT_UDPv4) | v;
301 { 314 }
302 u8 v; parse_bool (v, "can-recv-udp", PROT_UDPv4, 0); node->can_recv = (node->can_recv & ~PROT_UDPv4) | v; 315 else if (!strcmp (var, "enable-rawip"))
303 } 316 {
304 else if (!strcmp (var, "can-send-rawip"))
305 {
306 u8 v; parse_bool (v, "can-send-rawip", PROT_IPv4, 0); node->can_send = (node->can_send & ~PROT_IPv4) | v; 317 u8 v; parse_bool (v, "enable-rawip", PROT_IPv4, 0); node->protocols = (node->protocols & ~PROT_IPv4 ) | v;
307 }
308 else if (!strcmp (var, "can-recv-rawip"))
309 {
310 u8 v; parse_bool (v, "can-recv-rawip", PROT_IPv4, 0); node->can_recv = (node->can_recv & ~PROT_IPv4) | v;
311 } 318 }
312 319
313 // unknown or misplaced 320 // unknown or misplaced
314 else 321 else
315 { 322 {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines