bgpd: Reuse orf_type_str/orf_mode_str for dynamic capabilities code

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
This commit is contained in:
Donatas Abraitis 2023-10-17 16:01:00 +03:00
parent 1fb08e91d7
commit 6ece98ecc1
2 changed files with 9 additions and 8 deletions

View File

@ -340,15 +340,14 @@ static void bgp_capability_orf_not_support(struct peer *peer, iana_afi_t afi,
peer->host, afi, safi, type, mode); peer->host, afi, safi, type, mode);
} }
static const struct message orf_type_str[] = { const struct message orf_type_str[] = { { ORF_TYPE_RESERVED, "Reserved" },
{ORF_TYPE_RESERVED, "Reserved"}, { ORF_TYPE_PREFIX, "Prefixlist" },
{ORF_TYPE_PREFIX, "Prefixlist"}, { 0 } };
{0}};
static const struct message orf_mode_str[] = {{ORF_MODE_RECEIVE, "Receive"}, const struct message orf_mode_str[] = { { ORF_MODE_RECEIVE, "Receive" },
{ORF_MODE_SEND, "Send"}, { ORF_MODE_SEND, "Send" },
{ORF_MODE_BOTH, "Both"}, { ORF_MODE_BOTH, "Both" },
{0}}; { 0 } };
static int bgp_capability_orf_entry(struct peer *peer, static int bgp_capability_orf_entry(struct peer *peer,
struct capability_header *hdr) struct capability_header *hdr)

View File

@ -108,5 +108,7 @@ extern void bgp_capability_vty_out(struct vty *vty, struct peer *peer,
bool use_json, json_object *json_neigh); bool use_json, json_object *json_neigh);
extern as_t peek_for_as4_capability(struct peer *peer, uint16_t length); extern as_t peek_for_as4_capability(struct peer *peer, uint16_t length);
extern const struct message capcode_str[]; extern const struct message capcode_str[];
extern const struct message orf_type_str[];
extern const struct message orf_mode_str[];
#endif /* _QUAGGA_BGP_OPEN_H */ #endif /* _QUAGGA_BGP_OPEN_H */