summaryrefslogtreecommitdiffstats
path: root/eigrpd
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-09-07 02:12:46 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-10-03 01:51:49 +0200
commit79b3087675c7c4cc6c0693ca205c02b76c45525a (patch)
tree8983d08fd716f937cdf8533922fc6d165bc3fadc /eigrpd
parentMerge pull request #1259 from qlyoung/vtysh-warn-mi (diff)
downloadfrr-79b3087675c7c4cc6c0693ca205c02b76c45525a.tar.xz
frr-79b3087675c7c4cc6c0693ca205c02b76c45525a.zip
eigrpd: Start fixing eigrp_interface
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>
Diffstat (limited to 'eigrpd')
-rw-r--r--eigrpd/eigrp_interface.c2
-rw-r--r--eigrpd/eigrp_macros.h4
-rw-r--r--eigrpd/eigrp_structs.h64
3 files changed, 33 insertions, 37 deletions
diff --git a/eigrpd/eigrp_interface.c b/eigrpd/eigrp_interface.c
index f2512eada..0e0af71fb 100644
--- a/eigrpd/eigrp_interface.c
+++ b/eigrpd/eigrp_interface.c
@@ -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();
diff --git a/eigrpd/eigrp_macros.h b/eigrpd/eigrp_macros.h
index fdb84673d..7a803fdbf 100644
--- a/eigrpd/eigrp_macros.h
+++ b/eigrpd/eigrp_macros.h
@@ -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)
diff --git a/eigrpd/eigrp_structs.h b/eigrpd/eigrp_structs.h
index 5bc63a7c4..71761391a 100644
--- a/eigrpd/eigrp_structs.h
+++ b/eigrpd/eigrp_structs.h
@@ -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