diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/defaults.c | 7 | ||||
| -rw-r--r-- | lib/json.c | 5 | ||||
| -rw-r--r-- | lib/json.h | 3 | ||||
| -rw-r--r-- | lib/nexthop.h | 11 |
4 files changed, 23 insertions, 3 deletions
diff --git a/lib/defaults.c b/lib/defaults.c index 71ccc73cc6..7466aad5b1 100644 --- a/lib/defaults.c +++ b/lib/defaults.c @@ -100,10 +100,10 @@ static bool frr_match_version(const char *name, const char *vspec, 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}, @@ -112,6 +112,7 @@ static bool frr_match_version(const char *name, const char *vspec, {"=", 0, 1}, {NULL, 0, 0}, }; + const struct spec *s; if (!vspec) /* NULL = all versions */ diff --git a/lib/json.c b/lib/json.c index 991240639a..6bea3982e3 100644 --- a/lib/json.c +++ b/lib/json.c @@ -50,6 +50,11 @@ void json_object_int_add(struct json_object *obj, const char *key, int64_t i) json_object_object_add(obj, key, json_object_new_int64(i)); } +void json_object_double_add(struct json_object *obj, const char *key, double i) +{ + json_object_object_add(obj, key, json_object_new_double(i)); +} + void json_object_boolean_false_add(struct json_object *obj, const char *key) { json_object_object_add(obj, key, json_object_new_boolean(0)); diff --git a/lib/json.h b/lib/json.h index c8866c524a..afe0b175da 100644 --- a/lib/json.h +++ b/lib/json.h @@ -48,6 +48,9 @@ extern void json_object_int_add(struct json_object *obj, const char *key, int64_t i); void json_object_boolean_add(struct json_object *obj, const char *key, bool val); + +extern void json_object_double_add(struct json_object *obj, const char *key, + double i); extern void json_object_boolean_false_add(struct json_object *obj, const char *key); extern void json_object_boolean_true_add(struct json_object *obj, diff --git a/lib/nexthop.h b/lib/nexthop.h index c4e88dd844..9b71262589 100644 --- a/lib/nexthop.h +++ b/lib/nexthop.h @@ -25,6 +25,7 @@ #include "prefix.h" #include "mpls.h" +#include "vxlan.h" #ifdef __cplusplus extern "C" { @@ -60,6 +61,10 @@ enum blackhole_type { ? (type) \ : ((type) | 1) +enum nh_encap_type { + NET_VXLAN = 100, /* value copied from FPM_NH_ENCAP_VXLAN. */ +}; + /* Nexthop structure. */ struct nexthop { struct nexthop *next; @@ -123,6 +128,12 @@ struct nexthop { * only meaningful if the HAS_BACKUP flag is set. */ uint8_t backup_idx; + + /* Encapsulation information. */ + enum nh_encap_type nh_encap_type; + union { + vni_t vni; + } nh_encap; }; /* Backup index value is limited */ |
