diff options
| author | Philippe Guibert <philippe.guibert@6wind.com> | 2022-11-18 13:49:53 +0100 | 
|---|---|---|
| committer | Philippe Guibert <philippe.guibert@6wind.com> | 2023-02-10 10:27:23 +0100 | 
| commit | e84c7c12f224f27ae430f2929a9fd121b133c2b3 (patch) | |
| tree | 4957646b5b93635e3b9cab8281f591cda750a89d /lib/asn.h | |
| parent | 17571c4ae7fa294e031b3e614a4fa62f834d0b3d (diff) | |
bgpd: modify bgp as number output
A json AS number API is created in order to output a
given AS number. In order to keep backward compatibility,
if the as-notation uses a number, then the json is encoded
as an integer, otherwise the encoding will be a string.
For what is not relevant to running-configuration, the
as-notation mode is the one used for the BGP instance.
Also, the vty completion gets the configured 'as_pretty'
string value, when an user wants to get the available
BGP instances.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'lib/asn.h')
| -rw-r--r-- | lib/asn.h | 2 | 
1 files changed, 2 insertions, 0 deletions
@@ -51,6 +51,8 @@ extern bool asn_str2asn_notation(const char *asstring, as_t *asn,  extern const char *asn_mode2str(enum asnotation_mode asnotation);  void asn_asn2json_array(json_object *jseg_list, as_t asn,  			enum asnotation_mode asnotation); +void asn_asn2json(json_object *jseg_list, const char *attr, +		  as_t asn, enum asnotation_mode asnotation);  /* display AS in appropriate format */  #ifdef _FRR_ATTRIBUTE_PRINTFRR  #pragma FRR printfrr_ext "%pASP"  (as_t *)  | 
