From b7f71639c93584eb92c459b66dde0037077aa67c Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Wed, 19 Jan 2022 15:45:11 +0100 Subject: [PATCH] pim6d: isolate remaining TODOs into stubs file This creates `pim6_stubs.c`, which is intended to temporarily provide stubbed-out definitions of some functions we don't have yet for IPv6. This makes pim6d compile without the `PIM_V6_TEMP_BREAK` hack, and is very important as an intermediate step to get a working environment for further work. Signed-off-by: David Lamparter --- pimd/pim6_stubs.c | 141 ++++++++++++++++++++++++++++++++++++++++++++++ pimd/subdir.am | 11 ++-- 2 files changed, 147 insertions(+), 5 deletions(-) create mode 100644 pimd/pim6_stubs.c diff --git a/pimd/pim6_stubs.c b/pimd/pim6_stubs.c new file mode 100644 index 0000000000..038baa0692 --- /dev/null +++ b/pimd/pim6_stubs.c @@ -0,0 +1,141 @@ +/* + * PIMv6 temporary stubs + * Copyright (C) 2022 David Lamparter for NetDEF, Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; see the file COPYING; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include + +#include "pimd.h" +#include "pim_nht.h" +#include "pim_zlookup.h" +#include "pim_pim.h" +#include "pim_register.h" +#include "pim_cmd.h" + +/* + * NH lookup / NHT + */ +void pim_sendmsg_zebra_rnh(struct pim_instance *pim, struct zclient *zclient, + struct pim_nexthop_cache *pnc, int command) +{ +} + +int pim_ecmp_nexthop_lookup(struct pim_instance *pim, + struct pim_nexthop *nexthop, struct prefix *src, + struct prefix *grp, int neighbor_needed) +{ + return 0; +} + +int pim_find_or_track_nexthop(struct pim_instance *pim, struct prefix *addr, + struct pim_upstream *up, struct rp_info *rp, + struct pim_nexthop_cache *out_pnc) +{ + return 0; +} + +void pim_delete_tracked_nexthop(struct pim_instance *pim, struct prefix *addr, + struct pim_upstream *up, struct rp_info *rp) +{ +} + +struct pim_nexthop_cache *pim_nexthop_cache_find(struct pim_instance *pim, + struct pim_rpf *rpf) +{ + return NULL; +} + +void pim_rp_nexthop_del(struct rp_info *rp_info) +{ +} + +void pim_nht_bsr_add(struct pim_instance *pim, struct in_addr addr) +{ +} + +void pim_nht_bsr_del(struct pim_instance *pim, struct in_addr addr) +{ +} + +int zclient_lookup_nexthop(struct pim_instance *pim, + struct pim_zlookup_nexthop nexthop_tab[], + const int tab_size, pim_addr addr, + int max_lookup) +{ + return -1; +} + +void zclient_lookup_new(void) +{ +} + +void zclient_lookup_free(void) +{ +} + +/* + * packet handling + */ +int pim_msg_send(int fd, pim_addr src, pim_addr dst, uint8_t *pim_msg, + int pim_msg_size, const char *ifname) +{ + return 0; +} + +int pim_hello_send(struct interface *ifp, uint16_t holdtime) +{ + return -1; +} + +void pim_hello_restart_now(struct interface *ifp) +{ +} + +void pim_hello_restart_triggered(struct interface *ifp) +{ +} + +int pim_sock_add(struct interface *ifp) +{ + return -1; +} + +void pim_sock_delete(struct interface *ifp, const char *delete_message) +{ +} + +/* + * PIM register + */ +void pim_register_join(struct pim_upstream *up) +{ +} + +void pim_null_register_send(struct pim_upstream *up) +{ +} + +void pim_reg_del_on_couldreg_fail(struct interface *ifp) +{ +} + +/* + * CLI + */ +void pim_cmd_init(void) +{ +} diff --git a/pimd/subdir.am b/pimd/subdir.am index 0afaf666e0..8e99b0c010 100644 --- a/pimd/subdir.am +++ b/pimd/subdir.am @@ -18,7 +18,6 @@ pim_common = \ pimd/pim_bfd.c \ pimd/pim_br.c \ pimd/pim_bsm.c \ - pimd/pim_cmd.c \ pimd/pim_errors.c \ pimd/pim_hello.c \ pimd/pim_iface.c \ @@ -34,10 +33,7 @@ pim_common = \ pimd/pim_nb.c \ pimd/pim_nb_config.c \ pimd/pim_neighbor.c \ - pimd/pim_nht.c \ pimd/pim_oil.c \ - pimd/pim_pim.c \ - pimd/pim_register.c \ pimd/pim_routemap.c \ pimd/pim_rp.c \ pimd/pim_rpf.c \ @@ -52,13 +48,13 @@ pim_common = \ pimd/pim_util.c \ pimd/pim_vty.c \ pimd/pim_zebra.c \ - pimd/pim_zlookup.c \ pimd/pim_vxlan.c \ pimd/pimd.c \ # end pimd_pimd_SOURCES = \ $(pim_common) \ + pimd/pim_cmd.c \ pimd/pim_igmp.c \ pimd/pim_igmp_mtrace.c \ pimd/pim_igmp_stats.c \ @@ -69,7 +65,11 @@ pimd_pimd_SOURCES = \ pimd/pim_msdp.c \ pimd/pim_msdp_packet.c \ pimd/pim_msdp_socket.c \ + pimd/pim_nht.c \ + pimd/pim_pim.c \ + pimd/pim_register.c \ pimd/pim_signals.c \ + pimd/pim_zlookup.c \ pimd/pim_zpthread.c \ # end @@ -82,6 +82,7 @@ nodist_pimd_pimd_SOURCES = \ pimd_pim6d_SOURCES = \ $(pim_common) \ pimd/pim6_main.c \ + pimd/pim6_stubs.c \ # end nodist_pimd_pim6d_SOURCES = \ -- 2.39.5