]> git.puffer.fish Git - matthieu/frr.git/commitdiff
eigrpd: Start fixing eigrp_interface
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 7 Sep 2017 00:12:46 +0000 (20:12 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 2 Oct 2017 23:51:49 +0000 (19:51 -0400)
The EIGRP interface handling code created 2 levels
of interface information, the ei( created per *connected*
address?????) and the ifp->info pointer.

Start the combination of pushing these together and
cleaning up the weirdness that is these two data
structures.

This commit probably breaks eigrp's handling of
interfaces.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
eigrpd/eigrp_interface.c
eigrpd/eigrp_macros.h
eigrpd/eigrp_structs.h

index f2512eadade61c18c7656dd32c8aebb7c7848c6a..0e0af71fb9c6b737df02998272ccf5520213b4b6 100644 (file)
@@ -159,7 +159,7 @@ int eigrp_if_new_hook(struct interface *ifp)
 {
        int rc = 0;
 
-       ifp->info = XCALLOC(MTYPE_EIGRP_IF_INFO, sizeof(struct eigrp_if_info));
+       ifp->info = XCALLOC(MTYPE_EIGRP_IF_INFO, sizeof(struct eigrp_interface));
 
        IF_OIFS(ifp) = route_table_init();
        IF_OIFS_PARAMS(ifp) = route_table_init();
index fdb84673dfb678031c5ec05ae2de3fb9ea6c8d43..7a803fdbfce4cba490aa278c93cd474ab594ade3 100644 (file)
@@ -29,9 +29,9 @@
 #define _ZEBRA_EIGRP_MACROS_H_
 
 #define DECLARE_IF_PARAM(T, P) T P; u_char P##__config:1
-#define IF_EIGRP_IF_INFO(I) ((struct eigrp_if_info *)((I)->info))
+#define IF_EIGRP_IF_INFO(I) ((struct eigrp_interface *)((I)->info))
 #define IF_OIFS(I)  (IF_EIGRP_IF_INFO (I)->eifs)
-#define IF_OIFS_PARAMS(I) (IF_EIGRP_IF_INFO (I)->params)
+#define IF_OIFS_PARAMS(I) (IF_EIGRP_IF_INFO (I)->eparams)
 
 #define SET_IF_PARAM(S, P) ((S)->P##__config) = 1
 #define IF_DEF_PARAMS(I) (IF_EIGRP_IF_INFO (I)->def_params)
index 5bc63a7c47740170024e7ea8fda01b2b0b0a1a6d..71761391ac5a7ab905628cee20a3f9dbf873bc94 100644 (file)
@@ -135,10 +135,39 @@ struct eigrp {
        QOBJ_FIELDS
 };
 DECLARE_QOBJ_TYPE(eigrp)
-//------------------------------------------------------------------------------------------------------------------------------------------
+
+struct eigrp_if_params {
+       DECLARE_IF_PARAM(u_char, passive_interface); /* EIGRP Interface is
+                                                       passive: no sending or
+                                                       receiving (no need to
+                                                       join multicast groups)
+                                                       */
+       DECLARE_IF_PARAM(u_int32_t, v_hello);   /* Hello Interval */
+       DECLARE_IF_PARAM(u_int16_t, v_wait); /* Router Hold Time Interval */
+       DECLARE_IF_PARAM(u_char, type);      /* type of interface */
+       DECLARE_IF_PARAM(u_int32_t, bandwidth);
+       DECLARE_IF_PARAM(u_int32_t, delay);
+       DECLARE_IF_PARAM(u_char, reliability);
+       DECLARE_IF_PARAM(u_char, load);
+
+       DECLARE_IF_PARAM(char *,
+                        auth_keychain); /* Associated keychain with interface*/
+       DECLARE_IF_PARAM(int, auth_type); /* EIGRP authentication type */
+};
+
+enum { MEMBER_ALLROUTERS = 0,
+       MEMBER_MAX,
+};
 
 /*EIGRP interface structure*/
 struct eigrp_interface {
+       struct eigrp_if_params *def_params;
+       struct route_table *eparams;
+       struct route_table *eifs;
+
+       /*multicast group refcnts */
+       unsigned int membership_counts[MEMBER_MAX];
+       
        /* This interface's parent eigrp instance. */
        struct eigrp *eigrp;
 
@@ -196,39 +225,6 @@ struct eigrp_interface {
        struct route_map *routemap[EIGRP_FILTER_MAX];
 };
 
-struct eigrp_if_params {
-       DECLARE_IF_PARAM(u_char, passive_interface); /* EIGRP Interface is
-                                                       passive: no sending or
-                                                       receiving (no need to
-                                                       join multicast groups)
-                                                       */
-       DECLARE_IF_PARAM(u_int32_t, v_hello);   /* Hello Interval */
-       DECLARE_IF_PARAM(u_int16_t, v_wait); /* Router Hold Time Interval */
-       DECLARE_IF_PARAM(u_char, type);      /* type of interface */
-       DECLARE_IF_PARAM(u_int32_t, bandwidth);
-       DECLARE_IF_PARAM(u_int32_t, delay);
-       DECLARE_IF_PARAM(u_char, reliability);
-       DECLARE_IF_PARAM(u_char, load);
-
-       DECLARE_IF_PARAM(char *,
-                        auth_keychain); /* Associated keychain with interface*/
-       DECLARE_IF_PARAM(int, auth_type); /* EIGRP authentication type */
-};
-
-enum { MEMBER_ALLROUTERS = 0,
-       MEMBER_MAX,
-};
-
-struct eigrp_if_info {
-       struct eigrp_if_params *def_params;
-       struct route_table *params;
-       struct route_table *eifs;
-       unsigned int
-               membership_counts[MEMBER_MAX]; /* multicast group refcnts */
-};
-
-//------------------------------------------------------------------------------------------------------------------------------------------
-
 /* Determines if it is first or last packet
  * when packet consists of multiple packet
  * chunks because of many route TLV