2023-02-08 13:17:09 +01:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2015-02-04 07:01:14 +01:00
|
|
|
/*
|
2017-05-13 10:25:29 +02:00
|
|
|
* PIM for Quagga
|
|
|
|
* Copyright (C) 2008 Everton da Silva Marques
|
|
|
|
*/
|
2015-02-04 07:01:14 +01:00
|
|
|
|
|
|
|
#ifndef PIM_NEIGHBOR_H
|
|
|
|
#define PIM_NEIGHBOR_H
|
|
|
|
|
|
|
|
#include <zebra.h>
|
|
|
|
|
|
|
|
#include "if.h"
|
|
|
|
#include "linklist.h"
|
2016-11-07 21:40:08 +01:00
|
|
|
#include "prefix.h"
|
2015-02-04 07:01:14 +01:00
|
|
|
|
|
|
|
#include "pim_tlv.h"
|
2021-08-19 11:36:16 +02:00
|
|
|
#include "pim_iface.h"
|
2021-12-14 13:25:40 +01:00
|
|
|
#include "pim_str.h"
|
2015-02-04 07:01:14 +01:00
|
|
|
|
|
|
|
struct pim_neighbor {
|
|
|
|
int64_t creation; /* timestamp of creation */
|
2021-12-14 13:25:40 +01:00
|
|
|
pim_addr source_addr;
|
2015-02-04 07:01:14 +01:00
|
|
|
pim_hello_options hello_options;
|
|
|
|
uint16_t holdtime;
|
|
|
|
uint16_t propagation_delay_msec;
|
|
|
|
uint16_t override_interval_msec;
|
|
|
|
uint32_t dr_priority;
|
|
|
|
uint32_t generation_id;
|
|
|
|
struct list *prefix_list; /* list of struct prefix */
|
2022-03-01 22:18:12 +01:00
|
|
|
struct event *t_expire_timer;
|
2015-02-04 07:01:14 +01:00
|
|
|
struct interface *interface;
|
2017-02-15 03:32:16 +01:00
|
|
|
|
2022-03-01 22:18:12 +01:00
|
|
|
struct event *jp_timer;
|
2017-02-15 03:32:16 +01:00
|
|
|
struct list *upstream_jp_agg;
|
2021-04-12 18:48:21 +02:00
|
|
|
struct bfd_session_params *bfd_session;
|
2015-02-04 07:01:14 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
void pim_neighbor_timer_reset(struct pim_neighbor *neigh, uint16_t holdtime);
|
|
|
|
void pim_neighbor_free(struct pim_neighbor *neigh);
|
|
|
|
struct pim_neighbor *pim_neighbor_find(struct interface *ifp,
|
2023-01-23 06:10:45 +01:00
|
|
|
pim_addr source_addr, bool secondary);
|
2017-03-30 05:44:12 +02:00
|
|
|
struct pim_neighbor *pim_neighbor_find_by_secondary(struct interface *ifp,
|
|
|
|
struct prefix *src);
|
2016-09-07 21:34:29 +02:00
|
|
|
struct pim_neighbor *pim_neighbor_find_if(struct interface *ifp);
|
|
|
|
|
2016-08-06 12:26:05 +02:00
|
|
|
|
|
|
|
#define PIM_NEIGHBOR_SEND_DELAY 0
|
|
|
|
#define PIM_NEIGHBOR_SEND_NOW 1
|
2015-02-04 07:01:14 +01:00
|
|
|
struct pim_neighbor *
|
2022-01-14 17:47:14 +01:00
|
|
|
pim_neighbor_add(struct interface *ifp, pim_addr source_addr,
|
2015-02-04 07:01:14 +01:00
|
|
|
pim_hello_options hello_options, uint16_t holdtime,
|
|
|
|
uint16_t propagation_delay, uint16_t override_interval,
|
|
|
|
uint32_t dr_priority, uint32_t generation_id,
|
2016-08-06 12:26:05 +02:00
|
|
|
struct list *addr_list, int send_hello_now);
|
2015-02-04 07:01:14 +01:00
|
|
|
void pim_neighbor_delete(struct interface *ifp, struct pim_neighbor *neigh,
|
|
|
|
const char *delete_message);
|
|
|
|
void pim_neighbor_delete_all(struct interface *ifp, const char *delete_message);
|
|
|
|
void pim_neighbor_update(struct pim_neighbor *neigh,
|
|
|
|
pim_hello_options hello_options, uint16_t holdtime,
|
|
|
|
uint32_t dr_priority, struct list *addr_list);
|
|
|
|
struct prefix *pim_neighbor_find_secondary(struct pim_neighbor *neigh,
|
2017-03-30 05:44:12 +02:00
|
|
|
struct prefix *addr);
|
2015-06-19 03:14:20 +02:00
|
|
|
int pim_if_dr_election(struct interface *ifp);
|
2015-02-04 07:01:14 +01:00
|
|
|
|
|
|
|
#endif /* PIM_NEIGHBOR_H */
|