]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: de-circularize includes
authorDavid Lamparter <equinox@opensourcerouting.org>
Thu, 19 Aug 2021 09:36:16 +0000 (11:36 +0200)
committerDavid Lamparter <equinox@opensourcerouting.org>
Fri, 27 Aug 2021 08:41:23 +0000 (10:41 +0200)
pimd's include files are very interdependent.  Let's chop that down a
bit to gain some flexibility.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
18 files changed:
pimd/pim_assert.h
pimd/pim_bfd.c
pimd/pim_bsm.c
pimd/pim_iface.h
pimd/pim_ifchannel.h
pimd/pim_igmpv3.h
pimd/pim_instance.h
pimd/pim_mroute.h
pimd/pim_nb_config.c
pimd/pim_neighbor.h
pimd/pim_oil.h
pimd/pim_rp.c
pimd/pim_rp.h
pimd/pim_rpf.c
pimd/pim_rpf.h
pimd/pim_upstream.h
pimd/pim_zlookup.c
pimd/pimd.h

index 63fda3fe34a1a83b9ee4dc1539c72ce2b6820060..c07cbeb0132dc2b6bef0b0a68d82d415a02a50ab 100644 (file)
 
 #include "if.h"
 
-#include "pim_neighbor.h"
-#include "pim_ifchannel.h"
+struct pim_ifchannel;
+struct pim_neighbor;
+
+enum pim_ifassert_state {
+       PIM_IFASSERT_NOINFO,
+       PIM_IFASSERT_I_AM_WINNER,
+       PIM_IFASSERT_I_AM_LOSER
+};
+
+struct pim_assert_metric {
+       uint32_t rpt_bit_flag;
+       uint32_t metric_preference;
+       uint32_t route_metric;
+       struct in_addr ip_address; /* neighbor router that sourced the Assert
+                                     message */
+};
 
 /*
   RFC 4601: 4.11.  Timer Values
index dfe2d5f2fa1fd0a8781e0edbfebcac2bda579fed..c7fcbba71ef27f03c947b517c9837a788ad93044 100644 (file)
@@ -28,6 +28,7 @@
 #include "zclient.h"
 
 #include "pim_instance.h"
+#include "pim_neighbor.h"
 #include "pim_cmd.h"
 #include "pim_vty.h"
 #include "pim_iface.h"
index f2845ee6e12cd8ff99ba702173fc36c9b179a02a..a3a3426f39098f5beaef0c1fc556e4e9a5420d1e 100644 (file)
@@ -28,6 +28,7 @@
 #include "pimd.h"
 #include "pim_iface.h"
 #include "pim_instance.h"
+#include "pim_neighbor.h"
 #include "pim_rpf.h"
 #include "pim_hello.h"
 #include "pim_pim.h"
index 92784103fe4e5928e4a506cf39cd6f62fbc6aa71..dc70b4134ff0523108b75b4b8e0df7528917a98f 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "pim_igmp.h"
 #include "pim_upstream.h"
+#include "pim_instance.h"
 #include "bfd.h"
 
 #define PIM_IF_MASK_PIM                             (1 << 0)
index 7ec8191e568704d07f42277194405b8a42c60b05..52f02a660b7e4681a63863c76e2a8d601d335524 100644 (file)
@@ -25,6 +25,8 @@
 #include "if.h"
 #include "prefix.h"
 
+#include "pim_assert.h"
+
 struct pim_ifchannel;
 #include "pim_upstream.h"
 
@@ -39,20 +41,6 @@ enum pim_ifjoin_state {
        PIM_IFJOIN_PRUNE_PENDING_TMP,
 };
 
-enum pim_ifassert_state {
-       PIM_IFASSERT_NOINFO,
-       PIM_IFASSERT_I_AM_WINNER,
-       PIM_IFASSERT_I_AM_LOSER
-};
-
-struct pim_assert_metric {
-       uint32_t rpt_bit_flag;
-       uint32_t metric_preference;
-       uint32_t route_metric;
-       struct in_addr ip_address; /* neighbor router that sourced the Assert
-                                     message */
-};
-
 /*
   Flag to detect change in CouldAssert(S,G,I)
 */
index 6abaef6e26540c47938a619b1de335dbd0914e66..5adf22a6fa4b7594bc06c40ded5d68b9000fd646 100644 (file)
@@ -23,6 +23,8 @@
 #include <zebra.h>
 #include "if.h"
 
+#include "pim_igmp.h"
+
 #define IGMP_V3_CHECKSUM_OFFSET            (2)
 #define IGMP_V3_REPORT_NUMGROUPS_OFFSET    (6)
 #define IGMP_V3_REPORT_GROUPPRECORD_OFFSET (8)
index 52ded08ae390e4c02823779456b0d18535605ff1..68c5b9167bb0c7cc2ca6f8576ea8e94cb2bf5f82 100644 (file)
@@ -210,6 +210,8 @@ struct pim_instance {
 void pim_vrf_init(void);
 void pim_vrf_terminate(void);
 
+extern struct pim_router *router;
+
 struct pim_instance *pim_get_pim_instance(vrf_id_t vrf_id);
 
 #endif
index 2d8e1b01fb89117e391aebf0fa21f0d6c63bb0e0..4cd6b9f0ace32a9f4b2c1824b56b7dd4d5844e74 100644 (file)
@@ -167,6 +167,8 @@ struct igmpmsg {
   Above: from <linux/mroute.h>
 */
 
+struct channel_oil;
+
 int pim_mroute_socket_enable(struct pim_instance *pim);
 int pim_mroute_socket_disable(struct pim_instance *pim);
 
index 4b4c1ec7db81df1b751c7ba369fcf5eb366f61cd..20fc4eaef6afa814c2377291b38eb098952a4b91 100644 (file)
@@ -23,6 +23,7 @@
 #include "pim_nb.h"
 #include "lib/northbound_cli.h"
 #include "pim_igmpv3.h"
+#include "pim_neighbor.h"
 #include "pim_pim.h"
 #include "pim_mlag.h"
 #include "pim_bfd.h"
index b461098a602d8274656071fc01a72239f5ac1ea8..d71b2b87c30880a6661724317073ea725e11ec95 100644 (file)
@@ -27,6 +27,7 @@
 #include "prefix.h"
 
 #include "pim_tlv.h"
+#include "pim_iface.h"
 
 struct pim_neighbor {
        int64_t creation; /* timestamp of creation */
index b0aa2b17c584daf28390622180f58a2fa0a779f7..af8ac8459400d8d3ff8ce79513a21e959ebe28d7 100644 (file)
@@ -20,8 +20,9 @@
 #ifndef PIM_OIL_H
 #define PIM_OIL_H
 
+struct pim_interface;
+
 #include "pim_mroute.h"
-#include "pim_iface.h"
 
 /*
  * Where did we get this (S,G) from?
index 3e3b6dddb5604f01c13a35e2d522cfcfef200b8d..f2a969e04a22fc91dbe99da7dd5627c497c7af2d 100644 (file)
@@ -42,7 +42,7 @@
 #include "pim_rpf.h"
 #include "pim_sock.h"
 #include "pim_memory.h"
-#include "pim_iface.h"
+#include "pim_neighbor.h"
 #include "pim_msdp.h"
 #include "pim_nht.h"
 #include "pim_mroute.h"
index dd7cd5d75e35504a7c57851355042be7f5d07aab..595025e5c97740ca707dedfc22a7e2acfbba7ad6 100644 (file)
 #include "prefix.h"
 #include "vty.h"
 #include "plist.h"
-#include "pim_iface.h"
 #include "pim_rpf.h"
 
+struct pim_interface;
+
 enum rp_source {
        RP_SRC_NONE = 0,
        RP_SRC_STATIC,
index 98944e8fed78696b2fe86abfc02cc03dc1d65a96..10e157e9c44784a51667943aa14dc20e279e4fe8 100644 (file)
@@ -31,6 +31,7 @@
 #include "pim_pim.h"
 #include "pim_str.h"
 #include "pim_iface.h"
+#include "pim_neighbor.h"
 #include "pim_zlookup.h"
 #include "pim_ifchannel.h"
 #include "pim_time.h"
index f006519b7105b1415f8a866e5eece8df27a94e9b..006aa1b636cec85c400c85cbfd76f730ec863a99 100644 (file)
@@ -22,9 +22,6 @@
 
 #include <zebra.h>
 
-#include "pim_upstream.h"
-#include "pim_neighbor.h"
-
 /*
   RFC 4601:
 
index 56039d56057b02310d3bb622852dbfdaace0d6af..ea3b564f8a380dc7679663a82acd781c4a391dde 100644 (file)
@@ -24,7 +24,7 @@
 #include <prefix.h>
 #include "plist.h"
 
-#include <pimd/pim_rpf.h>
+#include "pim_rpf.h"
 #include "pim_str.h"
 #include "pim_ifchannel.h"
 
index dce936b8a99ba9d4cf9ba1b54c5d4ea6f800d4d5..abf9577bd53ac5ec0de6a7fe7d4f7bf69579cc14 100644 (file)
@@ -31,6 +31,7 @@
 
 #include "pimd.h"
 #include "pim_iface.h"
+#include "pim_neighbor.h"
 #include "pim_pim.h"
 #include "pim_str.h"
 #include "pim_oil.h"
index 88e692b50d2c7dc71d36a4f67200862d2970720b..4cb860a6b7a95be4d1463a7bca6f4ab0618b4e60 100644 (file)
@@ -136,7 +136,6 @@ extern const char *const PIM_ALL_ROUTERS;
 extern const char *const PIM_ALL_PIM_ROUTERS;
 extern const char *const PIM_ALL_IGMP_ROUTERS;
 
-extern struct pim_router *router;
 extern struct zebra_privs_t pimd_privs;
 extern struct in_addr qpim_all_pim_routers_addr;
 extern uint8_t qpim_ecmp_enable;