mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-04-28 21:20:48 +00:00
lib, bgpd: move json_array_string_add to lib
json_array_string_add is used to add a string entry into a JSON list. This API is needed by zebra so moving it from bgpd to lib. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
This commit is contained in:
parent
72f2674a95
commit
a2339ed9e3
@ -1658,11 +1658,6 @@ static char *bgp_evpn_es_vteps_str(char *vtep_str, struct bgp_evpn_es *es,
|
||||
return vtep_str;
|
||||
}
|
||||
|
||||
static inline void json_array_string_add(json_object *json, const char *str)
|
||||
{
|
||||
json_object_array_add(json, json_object_new_string(str));
|
||||
}
|
||||
|
||||
static void bgp_evpn_es_json_vtep_fill(json_object *json_vteps,
|
||||
struct bgp_evpn_es_vtep *es_vtep)
|
||||
{
|
||||
|
@ -39,6 +39,11 @@ bool use_json(const int argc, struct cmd_token *argv[])
|
||||
return false;
|
||||
}
|
||||
|
||||
void json_array_string_add(json_object *json, const char *str)
|
||||
{
|
||||
json_object_array_add(json, json_object_new_string(str));
|
||||
}
|
||||
|
||||
void json_object_string_add(struct json_object *obj, const char *key,
|
||||
const char *s)
|
||||
{
|
||||
|
@ -57,6 +57,7 @@ extern void json_object_boolean_true_add(struct json_object *obj,
|
||||
const char *key);
|
||||
extern struct json_object *json_object_lock(struct json_object *obj);
|
||||
extern void json_object_free(struct json_object *obj);
|
||||
extern void json_array_string_add(json_object *json, const char *str);
|
||||
|
||||
#define JSON_STR "JavaScript Object Notation\n"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user