- get_config_bool(lookup_config(config_tree, "StrictSubnets"), &strictsubnets);
- get_config_bool(lookup_config(config_tree, "TunnelServer"), &tunnelserver);
- strictsubnets |= tunnelserver;
-
-
-
- if(get_config_int(lookup_config(config_tree, "UDPRcvBuf"), &udp_rcvbuf)) {
- if(udp_rcvbuf <= 0) {
- logger(DEBUG_ALWAYS, LOG_ERR, "UDPRcvBuf cannot be negative!");
- return false;
- }
- }
-
- if(get_config_int(lookup_config(config_tree, "UDPSndBuf"), &udp_sndbuf)) {
- if(udp_sndbuf <= 0) {
- logger(DEBUG_ALWAYS, LOG_ERR, "UDPSndBuf cannot be negative!");
- return false;
- }
- }
-
- int replaywin_int;
- if(get_config_int(lookup_config(config_tree, "ReplayWindow"), &replaywin_int)) {
- if(replaywin_int < 0) {
- logger(DEBUG_ALWAYS, LOG_ERR, "ReplayWindow cannot be negative!");
- return false;
- }
- replaywin = (unsigned)replaywin_int;
- }
-
- /* Generate packet encryption key */
-
- if(!get_config_string(lookup_config(config_tree, "Cipher"), &cipher))
- cipher = xstrdup("blowfish");
-
- if(!cipher_open_by_name(&myself->incipher, cipher)) {
- logger(DEBUG_ALWAYS, LOG_ERR, "Unrecognized cipher type!");
- return false;
- }
-
- free(cipher);
-
- regenerate_key();
-
- /* Check if we want to use message authentication codes... */
-
- int maclength = 4;
- get_config_int(lookup_config(config_tree, "MACLength"), &maclength);
-
- if(maclength < 0) {
- logger(DEBUG_ALWAYS, LOG_ERR, "Bogus MAC length!");
- return false;
- }
-
- if(!get_config_string(lookup_config(config_tree, "Digest"), &digest))
- digest = xstrdup("sha1");
-
- if(!digest_open_by_name(&myself->indigest, digest, maclength)) {
- logger(DEBUG_ALWAYS, LOG_ERR, "Unrecognized digest type!");
- return false;
- }
-
- free(digest);
-