]> the.earth.li Git - onak.git/blobdiff - onak-conf.c
Remove auto* related files from .gitignore
[onak.git] / onak-conf.c
index e6b645c48057bf4bf10fb4143ebcd82f87a1dc14..c30260fd6318cbb2d47d5792fe34a8adbf9f0943 100644 (file)
  * You should have received a copy of the GNU General Public License along with
  * this program.  If not, see <https://www.gnu.org/licenses/>.
  */
-
-#include "config.h"
-
 #include <ctype.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <strings.h>
 
+#include "build-config.h"
+
 #include "cleankey.h"
 #include "ll.h"
 #include "log.h"
 #include "onak-conf.h"
 
+#ifdef DBINIT
 extern struct onak_dbctx *DBINIT(struct onak_db_config *dbcfg, bool readonly);
+#endif
 
 /*
  *     config - Runtime configuration for onak.
@@ -51,7 +52,11 @@ struct onak_config config = {
        .backends = NULL,
        .backends_dir = NULL,
 
+#ifdef DBINIT
        .dbinit = DBINIT,
+#else
+       .dbinit = NULL,
+#endif
 
        .clean_policies = ONAK_CLEAN_CHECK_SIGHASH,
 
@@ -288,6 +293,15 @@ static bool parseconfigline(char *line)
                                config.clean_policies &=
                                        ~ONAK_CLEAN_CHECK_SIGHASH;
                        }
+               } else if (MATCH("verification", "check_packet_size")) {
+                       if (parsebool(value, config.clean_policies &
+                                       ONAK_CLEAN_LARGE_PACKETS)) {
+                               config.clean_policies |=
+                                       ONAK_CLEAN_LARGE_PACKETS;
+                       } else {
+                               config.clean_policies &=
+                                       ~ONAK_CLEAN_LARGE_PACKETS;
+                       }
                } else {
                        return false;
                }