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
32 int64_t creation
; /* timestamp of creation */
33 struct in_addr source_addr
;
34 pim_hello_options hello_options
;
36 uint16_t propagation_delay_msec
;
37 uint16_t override_interval_msec
;
39 uint32_t generation_id
;
40 struct list
*prefix_list
; /* list of struct prefix */
41 struct thread
*t_expire_timer
;
42 struct interface
*interface
;
44 struct thread
*jp_timer
;
45 struct list
*upstream_jp_agg
;
48 void pim_neighbor_timer_reset(struct pim_neighbor
*neigh
, uint16_t holdtime
);
49 void pim_neighbor_free(struct pim_neighbor
*neigh
);
50 struct pim_neighbor
*pim_neighbor_find(struct interface
*ifp
,
51 struct in_addr source_addr
);
52 struct pim_neighbor
*pim_neighbor_find_by_secondary (struct interface
*ifp
,
54 struct pim_neighbor
*pim_neighbor_find_if (struct interface
*ifp
);
57 #define PIM_NEIGHBOR_SEND_DELAY 0
58 #define PIM_NEIGHBOR_SEND_NOW 1
59 struct pim_neighbor
*pim_neighbor_add(struct interface
*ifp
,
60 struct in_addr source_addr
,
61 pim_hello_options hello_options
,
63 uint16_t propagation_delay
,
64 uint16_t override_interval
,
66 uint32_t generation_id
,
67 struct list
*addr_list
,
69 void pim_neighbor_delete(struct interface
*ifp
,
70 struct pim_neighbor
*neigh
,
71 const char *delete_message
);
72 void pim_neighbor_delete_all(struct interface
*ifp
,
73 const char *delete_message
);
74 void pim_neighbor_update(struct pim_neighbor
*neigh
,
75 pim_hello_options hello_options
,
78 struct list
*addr_list
);
79 struct prefix
*pim_neighbor_find_secondary(struct pim_neighbor
*neigh
,
81 int pim_if_dr_election(struct interface
*ifp
);
83 #endif /* PIM_NEIGHBOR_H */