Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
teib: Rename NHRP to TEIB
[vpp.git]
/
src
/
vnet
/
gre
/
interface.c
diff --git
a/src/vnet/gre/interface.c
b/src/vnet/gre/interface.c
index
553c89a
..
6efa3da
100644
(file)
--- a/
src/vnet/gre/interface.c
+++ b/
src/vnet/gre/interface.c
@@
-25,7
+25,7
@@
#include <vnet/adj/adj_nbr.h>
#include <vnet/mpls/mpls.h>
#include <vnet/l2/l2_input.h>
#include <vnet/adj/adj_nbr.h>
#include <vnet/mpls/mpls.h>
#include <vnet/l2/l2_input.h>
-#include <vnet/
nhrp/nhrp
.h>
+#include <vnet/
teib/teib
.h>
u8 *
format_gre_tunnel_type (u8 * s, va_list * args)
u8 *
format_gre_tunnel_type (u8 * s, va_list * args)
@@
-183,23
+183,23
@@
gre_tunnel_restack (gre_tunnel_t * gt)
}
static void
}
static void
-gre_
nhrp
_mk_key (const gre_tunnel_t * t,
- const
nhrp
_entry_t * ne, gre_tunnel_key_t * key)
+gre_
teib
_mk_key (const gre_tunnel_t * t,
+ const
teib
_entry_t * ne, gre_tunnel_key_t * key)
{
const fib_prefix_t *nh;
{
const fib_prefix_t *nh;
- nh =
nhrp
_entry_get_nh (ne);
+ nh =
teib
_entry_get_nh (ne);
/* construct the key using mode P2P so it can be found in the DP */
if (FIB_PROTOCOL_IP4 == nh->fp_proto)
gre_mk_key4 (t->tunnel_src.ip4,
nh->fp_addr.ip4,
/* construct the key using mode P2P so it can be found in the DP */
if (FIB_PROTOCOL_IP4 == nh->fp_proto)
gre_mk_key4 (t->tunnel_src.ip4,
nh->fp_addr.ip4,
-
nhrp
_entry_get_fib_index (ne),
+
teib
_entry_get_fib_index (ne),
t->type, TUNNEL_MODE_P2P, 0, &key->gtk_v4);
else
gre_mk_key6 (&t->tunnel_src.ip6,
&nh->fp_addr.ip6,
t->type, TUNNEL_MODE_P2P, 0, &key->gtk_v4);
else
gre_mk_key6 (&t->tunnel_src.ip6,
&nh->fp_addr.ip6,
-
nhrp
_entry_get_fib_index (ne),
+
teib
_entry_get_fib_index (ne),
t->type, TUNNEL_MODE_P2P, 0, &key->gtk_v6);
}
t->type, TUNNEL_MODE_P2P, 0, &key->gtk_v6);
}
@@
-207,7
+207,7
@@
gre_nhrp_mk_key (const gre_tunnel_t * t,
* An NHRP entry has been added
*/
static void
* An NHRP entry has been added
*/
static void
-gre_
nhrp_entry_added (const nhrp
_entry_t * ne)
+gre_
teib_entry_added (const teib
_entry_t * ne)
{
gre_main_t *gm = &gre_main;
const ip46_address_t *nh;
{
gre_main_t *gm = &gre_main;
const ip46_address_t *nh;
@@
-216,7
+216,7
@@
gre_nhrp_entry_added (const nhrp_entry_t * ne)
u32 sw_if_index;
u32 t_idx;
u32 sw_if_index;
u32 t_idx;
- sw_if_index =
nhrp
_entry_get_sw_if_index (ne);
+ sw_if_index =
teib
_entry_get_sw_if_index (ne);
if (vec_len (gm->tunnel_index_by_sw_if_index) < sw_if_index)
return;
if (vec_len (gm->tunnel_index_by_sw_if_index) < sw_if_index)
return;
@@
-233,7
+233,7
@@
gre_nhrp_entry_added (const nhrp_entry_t * ne)
/* the next-hop (underlay) of the NHRP entry will form part of the key for
* ingress lookup to match packets to this interface */
/* the next-hop (underlay) of the NHRP entry will form part of the key for
* ingress lookup to match packets to this interface */
- gre_
nhrp
_mk_key (t, ne, &key);
+ gre_
teib
_mk_key (t, ne, &key);
gre_tunnel_db_add (t, &key);
/* update the rewrites for each of the adjacencies for this peer (overlay)
gre_tunnel_db_add (t, &key);
/* update the rewrites for each of the adjacencies for this peer (overlay)
@@
-242,15
+242,15
@@
gre_nhrp_entry_added (const nhrp_entry_t * ne)
.t = t,
.ne = ne
};
.t = t,
.ne = ne
};
- nh =
nhrp
_entry_get_peer (ne);
- adj_nbr_walk_nh (
nhrp
_entry_get_sw_if_index (ne),
+ nh =
teib
_entry_get_peer (ne);
+ adj_nbr_walk_nh (
teib
_entry_get_sw_if_index (ne),
(ip46_address_is_ip4 (nh) ?
FIB_PROTOCOL_IP4 :
FIB_PROTOCOL_IP6), nh, mgre_mk_complete_walk, &ctx);
}
static void
(ip46_address_is_ip4 (nh) ?
FIB_PROTOCOL_IP4 :
FIB_PROTOCOL_IP6), nh, mgre_mk_complete_walk, &ctx);
}
static void
-gre_
nhrp_entry_deleted (const nhrp
_entry_t * ne)
+gre_
teib_entry_deleted (const teib
_entry_t * ne)
{
gre_main_t *gm = &gre_main;
const ip46_address_t *nh;
{
gre_main_t *gm = &gre_main;
const ip46_address_t *nh;
@@
-259,7
+259,7
@@
gre_nhrp_entry_deleted (const nhrp_entry_t * ne)
u32 sw_if_index;
u32 t_idx;
u32 sw_if_index;
u32 t_idx;
- sw_if_index =
nhrp
_entry_get_sw_if_index (ne);
+ sw_if_index =
teib
_entry_get_sw_if_index (ne);
if (vec_len (gm->tunnel_index_by_sw_if_index) < sw_if_index)
return;
if (vec_len (gm->tunnel_index_by_sw_if_index) < sw_if_index)
return;
@@
-271,37
+271,37
@@
gre_nhrp_entry_deleted (const nhrp_entry_t * ne)
t = pool_elt_at_index (gm->tunnels, t_idx);
/* remove the next-hop as an ingress lookup key */
t = pool_elt_at_index (gm->tunnels, t_idx);
/* remove the next-hop as an ingress lookup key */
- gre_
nhrp
_mk_key (t, ne, &key);
+ gre_
teib
_mk_key (t, ne, &key);
gre_tunnel_db_remove (t, &key);
gre_tunnel_db_remove (t, &key);
- nh =
nhrp
_entry_get_peer (ne);
+ nh =
teib
_entry_get_peer (ne);
/* make all the adjacencies incomplete */
/* make all the adjacencies incomplete */
- adj_nbr_walk_nh (
nhrp
_entry_get_sw_if_index (ne),
+ adj_nbr_walk_nh (
teib
_entry_get_sw_if_index (ne),
(ip46_address_is_ip4 (nh) ?
FIB_PROTOCOL_IP4 :
FIB_PROTOCOL_IP6), nh, mgre_mk_incomplete_walk, t);
}
static walk_rc_t
(ip46_address_is_ip4 (nh) ?
FIB_PROTOCOL_IP4 :
FIB_PROTOCOL_IP6), nh, mgre_mk_incomplete_walk, t);
}
static walk_rc_t
-gre_tunnel_delete_
nhrp
_walk (index_t nei, void *ctx)
+gre_tunnel_delete_
teib
_walk (index_t nei, void *ctx)
{
gre_tunnel_t *t = ctx;
gre_tunnel_key_t key;
{
gre_tunnel_t *t = ctx;
gre_tunnel_key_t key;
- gre_
nhrp_mk_key (t, nhrp
_entry_get (nei), &key);
+ gre_
teib_mk_key (t, teib
_entry_get (nei), &key);
gre_tunnel_db_remove (t, &key);
return (WALK_CONTINUE);
}
static walk_rc_t
gre_tunnel_db_remove (t, &key);
return (WALK_CONTINUE);
}
static walk_rc_t
-gre_tunnel_add_
nhrp
_walk (index_t nei, void *ctx)
+gre_tunnel_add_
teib
_walk (index_t nei, void *ctx)
{
gre_tunnel_t *t = ctx;
gre_tunnel_key_t key;
{
gre_tunnel_t *t = ctx;
gre_tunnel_key_t key;
- gre_
nhrp_mk_key (t, nhrp
_entry_get (nei), &key);
+ gre_
teib_mk_key (t, teib
_entry_get (nei), &key);
gre_tunnel_db_add (t, &key);
return (WALK_CONTINUE);
gre_tunnel_db_add (t, &key);
return (WALK_CONTINUE);
@@
-421,7
+421,7
@@
vnet_gre_tunnel_add (vnet_gre_tunnel_add_del_args_t * a,
gre_tunnel_db_add (t, &key);
if (t->mode == TUNNEL_MODE_MP)
gre_tunnel_db_add (t, &key);
if (t->mode == TUNNEL_MODE_MP)
-
nhrp_walk_itf (t->sw_if_index, gre_tunnel_add_nhrp
_walk, t);
+
teib_walk_itf (t->sw_if_index, gre_tunnel_add_teib
_walk, t);
if (t->type == GRE_TUNNEL_TYPE_ERSPAN)
{
if (t->type == GRE_TUNNEL_TYPE_ERSPAN)
{
@@
-477,7
+477,7
@@
vnet_gre_tunnel_delete (vnet_gre_tunnel_add_del_args_t * a,
return VNET_API_ERROR_NO_SUCH_ENTRY;
if (t->mode == TUNNEL_MODE_MP)
return VNET_API_ERROR_NO_SUCH_ENTRY;
if (t->mode == TUNNEL_MODE_MP)
-
nhrp_walk_itf (t->sw_if_index, gre_tunnel_delete_nhrp
_walk, t);
+
teib_walk_itf (t->sw_if_index, gre_tunnel_delete_teib
_walk, t);
sw_if_index = t->sw_if_index;
vnet_sw_interface_set_flags (vnm, sw_if_index, 0 /* down */ );
sw_if_index = t->sw_if_index;
vnet_sw_interface_set_flags (vnm, sw_if_index, 0 /* down */ );
@@
-753,16
+753,16
@@
VLIB_CLI_COMMAND (show_gre_tunnel_command, static) = {
};
/* *INDENT-ON* */
};
/* *INDENT-ON* */
-const static
nhrp_vft_t gre_nhrp
_vft = {
- .nv_added = gre_
nhrp
_entry_added,
- .nv_deleted = gre_
nhrp
_entry_deleted,
+const static
teib_vft_t gre_teib
_vft = {
+ .nv_added = gre_
teib
_entry_added,
+ .nv_deleted = gre_
teib
_entry_deleted,
};
/* force inclusion from application's main.c */
clib_error_t *
gre_interface_init (vlib_main_t * vm)
{
};
/* force inclusion from application's main.c */
clib_error_t *
gre_interface_init (vlib_main_t * vm)
{
-
nhrp_register (&gre_nhrp
_vft);
+
teib_register (&gre_teib
_vft);
return (NULL);
}
return (NULL);
}