aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/mfib/ip4_mfib.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2017-09-10 04:39:11 -0700
committerDamjan Marion <dmarion.lists@gmail.com>2017-09-11 10:14:36 +0000
commit1500254bee11355bbd69cc1dd9705be4f002f2bd (patch)
treec403642105f399baccb3a727020232b5732fe8f7 /src/vnet/mfib/ip4_mfib.c
parenta7191840beeb2c3a0f2598707ed1051a9f23c45f (diff)
FIB table add/delete API
part 2; - this adds the code to create an IP and MPLS table via the API. - but the enforcement that the table must be created before it is used is still missing, this is so that CSIT can pass. Change-Id: Id124d884ade6cb7da947225200e3bb193454c555 Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/mfib/ip4_mfib.c')
-rw-r--r--src/vnet/mfib/ip4_mfib.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/vnet/mfib/ip4_mfib.c b/src/vnet/mfib/ip4_mfib.c
index 1849a3a4201..b2482580678 100644
--- a/src/vnet/mfib/ip4_mfib.c
+++ b/src/vnet/mfib/ip4_mfib.c
@@ -33,7 +33,8 @@ static const mfib_prefix_t ip4_specials[] = {
};
static u32
-ip4_create_mfib_with_table_id (u32 table_id)
+ip4_create_mfib_with_table_id (u32 table_id,
+ mfib_source_t src)
{
mfib_table_t *mfib_table;
@@ -53,7 +54,7 @@ ip4_create_mfib_with_table_id (u32 table_id)
mfib_table->v4.table_id =
table_id;
- mfib_table_lock(mfib_table->mft_index, FIB_PROTOCOL_IP4);
+ mfib_table_lock(mfib_table->mft_index, FIB_PROTOCOL_IP4, src);
/*
* add the special entries into the new FIB
@@ -113,14 +114,15 @@ ip4_mfib_table_destroy (ip4_mfib_t *mfib)
}
u32
-ip4_mfib_table_find_or_create_and_lock (u32 table_id)
+ip4_mfib_table_find_or_create_and_lock (u32 table_id,
+ mfib_source_t src)
{
u32 index;
index = ip4_mfib_index_from_table_id(table_id);
if (~0 == index)
- return ip4_create_mfib_with_table_id(table_id);
- mfib_table_lock(index, FIB_PROTOCOL_IP4);
+ return ip4_create_mfib_with_table_id(table_id, src);
+ mfib_table_lock(index, FIB_PROTOCOL_IP4, src);
return (index);
}