]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: deduplicate struct definition
authorQuentin Young <qlyoung@cumulusnetworks.com>
Wed, 13 Sep 2017 15:18:51 +0000 (11:18 -0400)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Wed, 13 Sep 2017 15:47:35 +0000 (11:47 -0400)
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
bgpd/bgp_ecommunity.c
bgpd/bgp_ecommunity.h
bgpd/bgp_evpn_vty.c

index 897b1c7508c275e371431f502c159d38493549fc..bdcc12705c4744395128751c67451d5f8d4e82b3 100644 (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. */
index 927b1370cf02482a7ee0502c8236096de13d3d19..c967f8bd4758c4627cd68617c14b191357ea6c84 100644 (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];
index 17511827b1b8fcffde582f53b2d7a3a1f48b1fa8..eb69e7605125d0f8df2f45ceec29a9658f32263a 100644 (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;