Tomato 1.28
[tomato.git] / release / src / router / zebra / ospf6d / ospf6_neighbor.h
bloba6607788114e558c2825a444a46c6551433b4038
1 /*
2 * Copyright (C) 1999 Yasuhiro Ohara
4 * This file is part of GNU Zebra.
6 * GNU Zebra is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2, or (at your option) any
9 * later version.
11 * GNU Zebra is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with GNU Zebra; see the file COPYING. If not, write to the
18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
22 #ifndef OSPF6_NEIGHBOR_H
23 #define OSPF6_NEIGHBOR_H
25 /* Neighbor structure */
26 struct ospf6_neighbor
28 /* Neighbor Router ID String */
29 char str[32];
31 /* OSPFv3 Interface this neighbor belongs to */
32 struct ospf6_interface *ospf6_interface;
34 /* Neighbor state */
35 u_char state;
37 /* Neighbor Router ID */
38 u_int32_t router_id;
40 /* Router Priority of this neighbor */
41 u_char priority;
43 u_int32_t ifid;
44 u_int32_t dr;
45 u_int32_t bdr;
46 u_int32_t prevdr;
47 u_int32_t prevbdr;
49 /* Link-LSA's options field */
50 char options[3];
52 /* IPaddr of I/F on our side link */
53 struct in6_addr hisaddr;
55 /* new */
56 struct ospf6_lsdb *summary_list;
57 struct ospf6_lsdb *request_list;
58 struct ospf6_lsdb *retrans_list;
60 /* For Database Exchange */
61 u_char dbdesc_bits;
62 u_int32_t dbdesc_seqnum;
63 struct ospf6_dbdesc *dbdesc_previous;
65 /* last received DD , including OSPF capability of this neighbor */
66 struct ospf6_dbdesc last_dd;
68 /* LSAs to retransmit to this neighbor */
69 list dbdesc_lsa;
71 /* placeholder for DbDesc */
72 struct iovec dbdesc_last_send[1024];
74 struct thread *inactivity_timer;
76 /* DbDesc */
77 struct thread *thread_send_dbdesc;
78 struct thread *thread_rxmt_dbdesc;
79 list dbdesclist;
80 struct ospf6_lsdb *dbdesc_list;
82 /* LSReq */
83 struct thread *thread_send_lsreq;
84 struct thread *thread_rxmt_lsreq;
86 /* LSUpdate */
87 struct thread *send_update;
88 struct thread *thread_send_update;
89 struct thread *thread_rxmt_update;
91 /* statistics */
92 u_int ospf6_stat_state_changed;
93 u_int ospf6_stat_seqnum_mismatch;
94 u_int ospf6_stat_bad_lsreq;
95 u_int ospf6_stat_oneway_received;
96 u_int ospf6_stat_inactivity_timer;
97 u_int ospf6_stat_dr_election;
98 u_int ospf6_stat_retrans_dbdesc;
99 u_int ospf6_stat_retrans_lsreq;
100 u_int ospf6_stat_retrans_lsupdate;
101 u_int ospf6_stat_received_lsa;
102 u_int ospf6_stat_received_lsupdate;
104 struct timeval tv_last_hello_received;
107 extern char *ospf6_neighbor_state_string[];
110 /* Function Prototypes */
112 ospf6_neighbor_last_dbdesc_release (struct thread *);
114 void
115 ospf6_neighbor_lslist_clear (struct ospf6_neighbor *);
117 void
118 ospf6_neighbor_summary_add (struct ospf6_lsa *, struct ospf6_neighbor *);
119 void
120 ospf6_neighbor_summary_remove (struct ospf6_lsa *, struct ospf6_neighbor *);
122 void
123 ospf6_neighbor_request_add (struct ospf6_lsa *, struct ospf6_neighbor *);
124 void
125 ospf6_neighbor_request_remove (struct ospf6_lsa *, struct ospf6_neighbor *);
127 void
128 ospf6_neighbor_retrans_add (struct ospf6_lsa *, struct ospf6_neighbor *);
129 void
130 ospf6_neighbor_retrans_remove (struct ospf6_lsa *, struct ospf6_neighbor *);
132 void
133 ospf6_neighbor_dbdesc_add (struct ospf6_lsa *lsa,
134 struct ospf6_neighbor *nei);
135 void
136 ospf6_neighbor_dbdesc_remove (struct ospf6_lsa *lsa,
137 struct ospf6_neighbor *nei);
139 void
140 ospf6_neighbor_dbex_init (struct ospf6_neighbor *nei);
142 void
143 ospf6_neighbor_thread_cancel_all (struct ospf6_neighbor *);
145 struct ospf6_neighbor *
146 ospf6_neighbor_create (u_int32_t, struct ospf6_interface *);
147 void
148 ospf6_neighbor_delete (struct ospf6_neighbor *);
149 struct ospf6_neighbor *
150 ospf6_neighbor_lookup (u_int32_t, struct ospf6_interface *);
152 void ospf6_neighbor_init ();
154 #endif /* OSPF6_NEIGHBOR_H */