+// SPDX-License-Identifier: ISC
/*
* FRR switchable defaults.
* Copyright (c) 2017-2019 David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <zebra.h>
#include "defaults.h"
-#include "version.h"
+#include "lib/version.h"
static char df_version[128] = FRR_VER_SHORT, df_profile[128] = DFLT_NAME;
static struct frr_default *dflt_first = NULL, **dflt_next = &dflt_first;
const char *version, bool check)
{
int cmp;
- static struct spec {
+ static const struct spec {
const char *str;
- bool dir, eq;
- } *s, specs[] = {
+ int dir, eq;
+ } specs[] = {
{"<=", -1, 1},
{">=", 1, 1},
{"==", 0, 1},
{"=", 0, 1},
{NULL, 0, 0},
};
+ const struct spec *s;
if (!vspec)
/* NULL = all versions */
if (!saveentry)
saveentry = entry;
+ if (dflt->dflt_bool)
+ *dflt->dflt_bool = dfltentry->val_bool;
if (dflt->dflt_str)
*dflt->dflt_str = dfltentry->val_str;
if (dflt->dflt_long)
*dflt->dflt_ulong = dfltentry->val_ulong;
if (dflt->dflt_float)
*dflt->dflt_float = dfltentry->val_float;
+ if (dflt->save_bool)
+ *dflt->save_bool = saveentry->val_bool;
if (dflt->save_str)
*dflt->save_str = saveentry->val_str;
if (dflt->save_long)