3 * Copyright 2009-2016, LabN Consulting, L.L.C.
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 * Purpose: per-nve rib
27 #ifndef QUAGGA_HGP_RFAPI_RIB_H
28 #define QUAGGA_HGP_RFAPI_RIB_H
31 * Key for indexing RIB and Pending RIB skiplists. For L3 RIBs,
32 * the VN address is sufficient because it represents the actual next hop.
34 * For L2 RIBs, it is possible to have multiple routes to a given L2
35 * prefix via a given VN address, but each route having a unique aux_prefix.
43 * for L2 routes: optional IP addr
44 * .family == 0 means "none"
46 struct prefix aux_prefix
;
51 * RFAPI Advertisement Data Block
53 * Holds NVE prefix advertisement information
59 struct prefix prefix_ip
;
61 struct prefix prefix_eth
;
62 } s
; /* mainly for legacy use */
63 struct rfapi_rib_key key
;
67 struct rfapi_l2address_option l2o
;
72 struct rfapi_rib_key rk
; /* NVE VN addr + aux addr */
76 time_t last_sent_time
;
77 uint32_t rsp_counter
; /* dedup initial responses */
78 struct bgp_tea_options
*tea_options
;
79 struct rfapi_un_option
*un_options
;
80 struct rfapi_vn_option
*vn_options
;
85 * Work item for updated responses queue
87 struct rfapi_updated_responses_queue
89 struct rfapi_descriptor
*rfd
;
95 rfapiRibClear (struct rfapi_descriptor
*rfd
);
98 rfapiRibFree (struct rfapi_descriptor
*rfd
);
101 rfapiRibUpdatePendingNode (
103 struct rfapi_descriptor
*rfd
,
104 struct rfapi_import_table
*it
,
105 struct route_node
*it_node
,
109 rfapiRibUpdatePendingNodeSubtree (
111 struct rfapi_descriptor
*rfd
,
112 struct rfapi_import_table
*it
,
113 struct route_node
*it_node
,
114 struct route_node
*omit_subtree
,
119 struct route_node
*rfd_rib_node
,
120 struct prefix
*pfx_vn
,
121 struct prefix
*pfx_un
,
123 struct bgp_info
*bi
);
125 extern struct rfapi_next_hop_entry
*
128 struct rfapi_descriptor
*rfd
,
129 struct rfapi_next_hop_entry
*response
,
130 int use_eth_resolution
);
133 rfapiRibPendingDeleteRoute (
135 struct rfapi_import_table
*it
,
137 struct route_node
*it_node
);
140 rfapiRibShowResponsesSummary (void *stream
);
143 rfapiRibShowResponsesSummaryClear (void);
146 rfapiRibShowResponses (
148 struct prefix
*pfx_match
,
152 rfapiRibFTDFilterRecentPrefix(
153 struct rfapi_descriptor
*rfd
,
154 struct route_node
*it_rn
, /* import table node */
155 struct prefix
*pfx_target_original
); /* query target */
158 rfapiFreeRfapiUnOptionChain (struct rfapi_un_option
*p
);
161 rfapiFreeRfapiVnOptionChain (struct rfapi_vn_option
*p
);
164 rfapiRibCheckCounts (
165 int checkstats
, /* validate rfd & global counts */
166 unsigned int offset
); /* number of ri's held separately */
168 /* enable for debugging; disable for performance */
170 #define RFAPI_RIB_CHECK_COUNTS(checkstats, offset) rfapiRibCheckCounts(checkstats, offset)
172 #define RFAPI_RIB_CHECK_COUNTS(checkstats, offset)
176 rfapi_rib_key_init (struct prefix
*prefix
, /* may be NULL */
177 struct prefix_rd
*rd
, /* may be NULL */
178 struct prefix
*aux
, /* may be NULL */
179 struct rfapi_rib_key
*rk
);
182 rfapi_rib_key_cmp (void *k1
, void *k2
);
185 rfapiAdbFree (struct rfapi_adb
*adb
);
187 #endif /* QUAGGA_HGP_RFAPI_RIB_H */