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 along
17 * with this program; see the file COPYING; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 * Purpose: per-nve rib
26 #ifndef QUAGGA_HGP_RFAPI_RIB_H
27 #define QUAGGA_HGP_RFAPI_RIB_H
30 * Key for indexing RIB and Pending RIB skiplists. For L3 RIBs,
31 * the VN address is sufficient because it represents the actual next hop.
33 * For L2 RIBs, it is possible to have multiple routes to a given L2
34 * prefix via a given VN address, but each route having a unique aux_prefix.
42 * for L2 routes: optional IP addr
43 * .family == 0 means "none"
45 struct prefix aux_prefix
;
50 * RFAPI Advertisement Data Block
52 * Holds NVE prefix advertisement information
58 struct prefix prefix_ip
;
60 struct prefix prefix_eth
;
61 } s
; /* mainly for legacy use */
62 struct rfapi_rib_key key
;
66 struct rfapi_l2address_option l2o
;
71 struct rfapi_rib_key rk
; /* NVE VN addr + aux addr */
75 time_t last_sent_time
;
76 uint32_t rsp_counter
; /* dedup initial responses */
77 struct bgp_tea_options
*tea_options
;
78 struct rfapi_un_option
*un_options
;
79 struct rfapi_vn_option
*vn_options
;
84 * Work item for updated responses queue
86 struct rfapi_updated_responses_queue
88 struct rfapi_descriptor
*rfd
;
94 rfapiRibClear (struct rfapi_descriptor
*rfd
);
97 rfapiRibFree (struct rfapi_descriptor
*rfd
);
100 rfapiRibUpdatePendingNode (
102 struct rfapi_descriptor
*rfd
,
103 struct rfapi_import_table
*it
,
104 struct route_node
*it_node
,
108 rfapiRibUpdatePendingNodeSubtree (
110 struct rfapi_descriptor
*rfd
,
111 struct rfapi_import_table
*it
,
112 struct route_node
*it_node
,
113 struct route_node
*omit_subtree
,
118 struct route_node
*rfd_rib_node
,
119 struct prefix
*pfx_vn
,
120 struct prefix
*pfx_un
,
122 struct bgp_info
*bi
);
124 extern struct rfapi_next_hop_entry
*
127 struct rfapi_descriptor
*rfd
,
128 struct rfapi_next_hop_entry
*response
,
129 int use_eth_resolution
);
132 rfapiRibPendingDeleteRoute (
134 struct rfapi_import_table
*it
,
136 struct route_node
*it_node
);
139 rfapiRibShowResponsesSummary (void *stream
);
142 rfapiRibShowResponsesSummaryClear (void);
145 rfapiRibShowResponses (
147 struct prefix
*pfx_match
,
151 rfapiRibFTDFilterRecentPrefix(
152 struct rfapi_descriptor
*rfd
,
153 struct route_node
*it_rn
, /* import table node */
154 struct prefix
*pfx_target_original
); /* query target */
157 rfapiFreeRfapiUnOptionChain (struct rfapi_un_option
*p
);
160 rfapiFreeRfapiVnOptionChain (struct rfapi_vn_option
*p
);
163 rfapiRibCheckCounts (
164 int checkstats
, /* validate rfd & global counts */
165 unsigned int offset
); /* number of ri's held separately */
167 /* enable for debugging; disable for performance */
169 #define RFAPI_RIB_CHECK_COUNTS(checkstats, offset) rfapiRibCheckCounts(checkstats, offset)
171 #define RFAPI_RIB_CHECK_COUNTS(checkstats, offset)
175 rfapi_rib_key_init (struct prefix
*prefix
, /* may be NULL */
176 struct prefix_rd
*rd
, /* may be NULL */
177 struct prefix
*aux
, /* may be NULL */
178 struct rfapi_rib_key
*rk
);
181 rfapi_rib_key_cmp (void *k1
, void *k2
);
184 rfapiAdbFree (struct rfapi_adb
*adb
);
186 #endif /* QUAGGA_HGP_RFAPI_RIB_H */