diff options
author | David Lamparter <equinox@opensourcerouting.org> | 2021-08-19 11:36:16 +0200 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2021-08-27 10:41:23 +0200 |
commit | e34e07e640989bff120acc2954536e3471134f88 (patch) | |
tree | 1a3707044205877ad3b3228b3e9f316da9609015 | |
parent | Merge pull request #9496 from idryzhov/vrf-cmd-init-unused-arg (diff) | |
download | frr-e34e07e640989bff120acc2954536e3471134f88.tar.xz frr-e34e07e640989bff120acc2954536e3471134f88.zip |
pimd: de-circularize includes
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>
-rw-r--r-- | pimd/pim_assert.h | 18 | ||||
-rw-r--r-- | pimd/pim_bfd.c | 1 | ||||
-rw-r--r-- | pimd/pim_bsm.c | 1 | ||||
-rw-r--r-- | pimd/pim_iface.h | 1 | ||||
-rw-r--r-- | pimd/pim_ifchannel.h | 16 | ||||
-rw-r--r-- | pimd/pim_igmpv3.h | 2 | ||||
-rw-r--r-- | pimd/pim_instance.h | 2 | ||||
-rw-r--r-- | pimd/pim_mroute.h | 2 | ||||
-rw-r--r-- | pimd/pim_nb_config.c | 1 | ||||
-rw-r--r-- | pimd/pim_neighbor.h | 1 | ||||
-rw-r--r-- | pimd/pim_oil.h | 3 | ||||
-rw-r--r-- | pimd/pim_rp.c | 2 | ||||
-rw-r--r-- | pimd/pim_rp.h | 3 | ||||
-rw-r--r-- | pimd/pim_rpf.c | 1 | ||||
-rw-r--r-- | pimd/pim_rpf.h | 3 | ||||
-rw-r--r-- | pimd/pim_upstream.h | 2 | ||||
-rw-r--r-- | pimd/pim_zlookup.c | 1 | ||||
-rw-r--r-- | pimd/pimd.h | 1 |
18 files changed, 37 insertions, 24 deletions
diff --git a/pimd/pim_assert.h b/pimd/pim_assert.h index 63fda3fe3..c07cbeb01 100644 --- a/pimd/pim_assert.h +++ b/pimd/pim_assert.h @@ -24,8 +24,22 @@ #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 diff --git a/pimd/pim_bfd.c b/pimd/pim_bfd.c index dfe2d5f2f..c7fcbba71 100644 --- a/pimd/pim_bfd.c +++ b/pimd/pim_bfd.c @@ -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" diff --git a/pimd/pim_bsm.c b/pimd/pim_bsm.c index f2845ee6e..a3a3426f3 100644 --- a/pimd/pim_bsm.c +++ b/pimd/pim_bsm.c @@ -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" diff --git a/pimd/pim_iface.h b/pimd/pim_iface.h index 92784103f..dc70b4134 100644 --- a/pimd/pim_iface.h +++ b/pimd/pim_iface.h @@ -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) diff --git a/pimd/pim_ifchannel.h b/pimd/pim_ifchannel.h index 7ec8191e5..52f02a660 100644 --- a/pimd/pim_ifchannel.h +++ b/pimd/pim_ifchannel.h @@ -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) */ diff --git a/pimd/pim_igmpv3.h b/pimd/pim_igmpv3.h index 6abaef6e2..5adf22a6f 100644 --- a/pimd/pim_igmpv3.h +++ b/pimd/pim_igmpv3.h @@ -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) diff --git a/pimd/pim_instance.h b/pimd/pim_instance.h index 52ded08ae..68c5b9167 100644 --- a/pimd/pim_instance.h +++ b/pimd/pim_instance.h @@ -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 diff --git a/pimd/pim_mroute.h b/pimd/pim_mroute.h index 2d8e1b01f..4cd6b9f0a 100644 --- a/pimd/pim_mroute.h +++ b/pimd/pim_mroute.h @@ -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); diff --git a/pimd/pim_nb_config.c b/pimd/pim_nb_config.c index 4b4c1ec7d..20fc4eaef 100644 --- a/pimd/pim_nb_config.c +++ b/pimd/pim_nb_config.c @@ -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" diff --git a/pimd/pim_neighbor.h b/pimd/pim_neighbor.h index b461098a6..d71b2b87c 100644 --- a/pimd/pim_neighbor.h +++ b/pimd/pim_neighbor.h @@ -27,6 +27,7 @@ #include "prefix.h" #include "pim_tlv.h" +#include "pim_iface.h" struct pim_neighbor { int64_t creation; /* timestamp of creation */ diff --git a/pimd/pim_oil.h b/pimd/pim_oil.h index b0aa2b17c..af8ac8459 100644 --- a/pimd/pim_oil.h +++ b/pimd/pim_oil.h @@ -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? diff --git a/pimd/pim_rp.c b/pimd/pim_rp.c index 3e3b6dddb..f2a969e04 100644 --- a/pimd/pim_rp.c +++ b/pimd/pim_rp.c @@ -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" diff --git a/pimd/pim_rp.h b/pimd/pim_rp.h index dd7cd5d75..595025e5c 100644 --- a/pimd/pim_rp.h +++ b/pimd/pim_rp.h @@ -24,9 +24,10 @@ #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, diff --git a/pimd/pim_rpf.c b/pimd/pim_rpf.c index 98944e8fe..10e157e9c 100644 --- a/pimd/pim_rpf.c +++ b/pimd/pim_rpf.c @@ -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" diff --git a/pimd/pim_rpf.h b/pimd/pim_rpf.h index f006519b7..006aa1b63 100644 --- a/pimd/pim_rpf.h +++ b/pimd/pim_rpf.h @@ -22,9 +22,6 @@ #include <zebra.h> -#include "pim_upstream.h" -#include "pim_neighbor.h" - /* RFC 4601: diff --git a/pimd/pim_upstream.h b/pimd/pim_upstream.h index 56039d560..ea3b564f8 100644 --- a/pimd/pim_upstream.h +++ b/pimd/pim_upstream.h @@ -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" diff --git a/pimd/pim_zlookup.c b/pimd/pim_zlookup.c index dce936b8a..abf9577bd 100644 --- a/pimd/pim_zlookup.c +++ b/pimd/pim_zlookup.c @@ -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" diff --git a/pimd/pimd.h b/pimd/pimd.h index 88e692b50..4cb860a6b 100644 --- a/pimd/pimd.h +++ b/pimd/pimd.h @@ -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; |