108 pool_get(fib_ae_export_pool, export);
109 memset(export, 0,
sizeof(*export));
134 index =
vec_search(import->faei_importeds, entry_index);
136 if (index <
vec_len(import->faei_importeds))
148 vec_del1(import->faei_importeds, index);
165 if (*existing == entry_index)
181 &import->faei_prefix))
197 vec_add1(import->faei_importeds, entry_index);
254 pool_get(fib_ae_import_pool,
import);
257 import->faei_export_fib = export_fib;
258 import->faei_prefix = fib_entry->
fe_prefix;
260 import->faei_export_sibling = ~0;
265 import->faei_export_entry =
267 &import->faei_prefix);
275 import->faei_export_entry =
277 &import->faei_prefix);
306 import->faei_export_sibling =
353 if (~0 != import->faei_export_sibling)
356 import->faei_export_sibling);
358 import->faei_export_sibling = ~0;
378 (
import - fib_ae_import_pool));
388 pool_put(fib_ae_export_pool, export);
397 pool_put(fib_ae_import_pool,
import);
485 export_fib =
import->faei_export_fib;
525 s =
format(s,
"\n Attached-Import:%d:[", (
import - fib_ae_import_pool));
527 s =
format(s,
"export-entry:%d ", import->faei_export_entry);
528 s =
format(s,
"export-sibling:%d ", import->faei_export_sibling);
529 s =
format(s,
"exporter:%d ", import->faei_exporter);
530 s =
format(s,
"export-fib:%d ", import->faei_export_fib);
532 s =
format(s,
"import-entry:%d ", import->faei_import_entry);
533 s =
format(s,
"import-fib:%d ", import->faei_import_fib);
535 s =
format(s,
"importeds:[");
538 s =
format(s,
"%d, ", *index);
554 s =
format(s,
"\n Attached-Export:%d:[", (export - fib_ae_export_pool));
557 s =
format(s,
"importers:[");
560 s =
format(s,
"%d, ", *index);
void fib_entry_unlock(fib_node_index_t fib_entry_index)
fib_node_index_t fib_table_lookup_exact_match(u32 fib_index, const fib_prefix_t *prefix)
Perfom an exact match in the non-forwarding table.
fib_entry_flag_t fib_entry_get_flags_i(const fib_entry_t *fib_entry)
void fib_attached_export_cover_change(fib_entry_t *fib_entry)
If this entry is tracking a cover (in another table) then that cover has changed. ...
void fib_entry_cover_untrack(fib_entry_t *cover, u32 tracked_index)
A description of the need to import routes from the export table.
fib_node_index_t fd_index
Valid for the attached import cases.
static int dpo_id_is_valid(const dpo_id_t *dpoi)
Return true if the DPO object is valid, i.e.
void fib_entry_get_prefix(fib_node_index_t fib_entry_index, fib_prefix_t *pfx)
const dpo_id_t * fib_entry_contribute_ip_forwarding(fib_node_index_t fib_entry_index)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
fib_node_index_t faei_exporter
The index of the exporter tracker.
fib_node_index_t faei_import_entry
The attached entry in the import table.
fib_node_index_t faei_export_entry
The entry in the epxort table that this importer is importing covereds from.
u32 fe_fib_index
The index of the FIB table this entry is in.
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
static void fib_entry_import_add(fib_ae_import_t *import, fib_node_index_t entry_index)
fib_node_index_t faee_ei
THe connected entry this export is acting on behalf of.
void fib_attached_export_covered_added(fib_entry_t *cover, fib_node_index_t covered)
u32 fib_entry_cover_track(fib_entry_t *cover, fib_node_index_t covered)
void fib_attached_export_purge(fib_entry_t *fib_entry)
All the imported entries need to be pruged.
fib_node_index_t faei_export_fib
The FIB index and prefix we are tracking.
void fib_entry_delegate_remove(fib_entry_t *fib_entry, fib_entry_delegate_type_t type)
void fib_table_entry_special_remove(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source)
Remove a 'special' entry from the FIB.
u8 * fib_ae_export_format(fib_node_index_t expi, u8 *s)
u8 * format_fib_prefix(u8 *s, va_list *args)
Aggregrate type for a prefix.
fib_node_index_t fib_entry_get_index(const fib_entry_t *fib_entry)
#define vec_search(v, E)
Search a vector for the index of the entry that matches.
fib_entry_delegate_t * fib_entry_delegate_get(const fib_entry_t *fib_entry, fib_entry_delegate_type_t type)
fib_node_index_t fib_table_lookup(u32 fib_index, const fib_prefix_t *prefix)
Perfom a longest prefix match in the non-forwarding table.
Attached import/export functionality.
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
struct fib_ae_export_t_ fib_ae_export_t
A description of the need to export routes to one or more export tables.
#define pool_put(P, E)
Free an object E in pool P.
#define vec_del1(v, i)
Delete the element at index I.
const dpo_id_t * load_balance_get_bucket(index_t lbi, u32 bucket)
static void fib_ae_export_import_add(fib_ae_export_t *export, fib_ae_import_t *import)
u8 * fib_ae_import_format(fib_node_index_t impi, u8 *s)
u32 faee_locks
Reference counting locks.
void fib_attached_export_covered_removed(fib_entry_t *cover, fib_node_index_t covered)
#define vec_free(V)
Free vector's memory (no header).
void fib_table_entry_delete(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source)
Delete a FIB entry.
u32 fib_node_index_t
A typedef of a node index.
fib_entry_t * fib_entry_get(fib_node_index_t index)
u32 faei_export_sibling
the sibling index on the cover
void fib_entry_lock(fib_node_index_t fib_entry_index)
fib_node_index_t fib_table_entry_special_dpo_add(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, const dpo_id_t *dpo)
Add a 'special' entry to the FIB that links to the DPO passed A special entry is an entry that the FI...
A description of the need to export routes to one or more export tables.
fib_node_index_t * faee_importers
The vector/list of import tracker indicies.
void fib_attached_export_cover_update(fib_entry_t *fib_entry)
If this entry is tracking a cover (in another table) then that cover has been updated.
void fib_attached_export_import(fib_entry_t *fib_entry, fib_node_index_t export_fib)
FIB attached export.
void fib_entry_cover_walk(fib_entry_t *cover, fib_entry_covered_walk_t walk, void *args)
static fib_ae_import_t * fib_ae_import_pool
static fib_ae_export_t * fib_ae_export_pool
int fib_prefix_cmp(const fib_prefix_t *p1, const fib_prefix_t *p2)
Compare two prefixes for equality.
index_t dpoi_index
the index of objects of that type
#define FIB_NODE_INDEX_INVALID
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static void fib_entry_import_remove(fib_ae_import_t *import, fib_node_index_t entry_index)
fib_node_index_t * faei_importeds
A vector/list of imported entry indicies.
static void fib_attached_export_cover_modified_i(fib_entry_t *fib_entry)
#define vec_foreach(var, vec)
Vector iterator.
static fib_ae_export_t * fib_entry_ae_add_or_lock(fib_node_index_t connected)
fib_node_index_t faei_import_fib
The FIB index we are importing into.
A Delagate is a means to implmenet the Delagation design pattern; the extension of an objects functio...
fib_entry_delegate_t * fib_entry_delegate_find_or_add(fib_entry_t *fib_entry, fib_entry_delegate_type_t fdt)
static int fib_entry_covered_walk_import(fib_entry_t *cover, fib_node_index_t covered, void *ctx)
Call back when walking a connected prefix's covered prefixes for import.
const fib_prefix_t fe_prefix
The prefix of the route.
struct fib_ae_import_t_ fib_ae_import_t
A description of the need to import routes from the export table.
fib_entry_flag_t fib_entry_get_flags(fib_node_index_t fib_entry_index)