Merge pull request #1173 from qlyoung/dedup-struct-ecomm

bgpd: deduplicate struct definition
This commit is contained in:
Lou Berger 2017-09-13 13:16:41 -04:00 committed by GitHub
commit 469874c45a
3 changed files with 15 additions and 17 deletions

View File

@ -555,15 +555,8 @@ static int ecommunity_rt_soo_str(char *buf, u_int8_t *pnt, int type,
const char *prefix;
/* For parse Extended Community attribute tupple. */
struct ecommunity_as {
as_t as;
u_int32_t val;
} eas;
struct ecommunity_ip {
struct in_addr ip;
u_int16_t val;
} eip;
struct ecommunity_as eas;
struct ecommunity_ip eip;
/* Determine prefix for string, if any. */

View File

@ -70,6 +70,16 @@ struct ecommunity {
char *str;
};
struct ecommunity_as {
as_t as;
uint32_t val;
};
struct ecommunity_ip {
struct in_addr ip;
uint16_t val;
};
/* Extended community value is eight octet. */
struct ecommunity_val {
char val[ECOMMUNITY_SIZE];

View File

@ -35,6 +35,7 @@
#include "bgpd/bgp_evpn_private.h"
#include "bgpd/bgp_zebra.h"
#include "bgpd/bgp_vty.h"
#include "bgpd/bgp_ecommunity.h"
#define SHOW_DISPLAY_STANDARD 0
#define SHOW_DISPLAY_TAGS 1
@ -57,14 +58,8 @@ static void display_import_rt(struct vty *vty, struct irt_node *irt,
{
u_char *pnt;
u_char type, sub_type;
struct ecommunity_as {
as_t as;
u_int32_t val;
} eas;
struct ecommunity_ip {
struct in_addr ip;
u_int16_t val;
} eip;
struct ecommunity_as eas;
struct ecommunity_ip eip;
struct listnode *node, *nnode;
struct bgpevpn *tmp_vpn;
json_object *json_rt = NULL;