3 * Copyright (C) 2008 Everton da Silva Marques
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; see the file COPYING; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 #ifndef PIM_NEIGHBOR_H
21 #define PIM_NEIGHBOR_H
30 #include "pim_iface.h"
33 int64_t creation
; /* timestamp of creation */
34 struct in_addr source_addr
;
35 pim_hello_options hello_options
;
37 uint16_t propagation_delay_msec
;
38 uint16_t override_interval_msec
;
40 uint32_t generation_id
;
41 struct list
*prefix_list
; /* list of struct prefix */
42 struct thread
*t_expire_timer
;
43 struct interface
*interface
;
45 struct thread
*jp_timer
;
46 struct list
*upstream_jp_agg
;
47 struct bfd_session_params
*bfd_session
;
50 void pim_neighbor_timer_reset(struct pim_neighbor
*neigh
, uint16_t holdtime
);
51 void pim_neighbor_free(struct pim_neighbor
*neigh
);
52 struct pim_neighbor
*pim_neighbor_find(struct interface
*ifp
,
53 struct in_addr source_addr
);
54 struct pim_neighbor
*pim_neighbor_find_by_secondary(struct interface
*ifp
,
56 struct pim_neighbor
*pim_neighbor_find_if(struct interface
*ifp
);
59 #define PIM_NEIGHBOR_SEND_DELAY 0
60 #define PIM_NEIGHBOR_SEND_NOW 1
62 pim_neighbor_add(struct interface
*ifp
, struct in_addr source_addr
,
63 pim_hello_options hello_options
, uint16_t holdtime
,
64 uint16_t propagation_delay
, uint16_t override_interval
,
65 uint32_t dr_priority
, uint32_t generation_id
,
66 struct list
*addr_list
, int send_hello_now
);
67 void pim_neighbor_delete(struct interface
*ifp
, struct pim_neighbor
*neigh
,
68 const char *delete_message
);
69 void pim_neighbor_delete_all(struct interface
*ifp
, const char *delete_message
);
70 void pim_neighbor_update(struct pim_neighbor
*neigh
,
71 pim_hello_options hello_options
, uint16_t holdtime
,
72 uint32_t dr_priority
, struct list
*addr_list
);
73 struct prefix
*pim_neighbor_find_secondary(struct pim_neighbor
*neigh
,
75 int pim_if_dr_election(struct interface
*ifp
);
77 #endif /* PIM_NEIGHBOR_H */