diff options
author | Filip Tehlar <ftehlar@cisco.com> | 2017-09-27 14:32:02 +0200 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2017-09-27 18:27:46 +0000 |
commit | a4980b8f3e53bd0917c75910938fbb077105821f (patch) | |
tree | de6078f8483a945b114e3a065e32f1fea93eecef /src/vnet/lisp-cp/control.c | |
parent | 535f0bfe0274e86c5d2e00dfd66dd632c6ae20a9 (diff) |
LISP: add API handlers for set/get transport protocol
Change-Id: Ib675164c475edcdbe3013df7b847adf5e050c53f
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Diffstat (limited to 'src/vnet/lisp-cp/control.c')
-rw-r--r-- | src/vnet/lisp-cp/control.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/vnet/lisp-cp/control.c b/src/vnet/lisp-cp/control.c index 42b5b8b01b4..0d6d453de00 100644 --- a/src/vnet/lisp-cp/control.c +++ b/src/vnet/lisp-cp/control.c @@ -4351,6 +4351,7 @@ lisp_cp_init (vlib_main_t * vm) lcm->map_register_ttl = MAP_REGISTER_DEFAULT_TTL; lcm->max_expired_map_registers = MAX_EXPIRED_MAP_REGISTERS_DEFAULT; lcm->expired_map_registers = 0; + lcm->transport_protocol = LISP_TRANSPORT_PROTOCOL_UDP; return 0; } @@ -4720,6 +4721,26 @@ VLIB_REGISTER_NODE (lisp_retry_service_node,static) = { }; /* *INDENT-ON* */ +u32 +vnet_lisp_set_transport_protocol (u8 protocol) +{ + lisp_cp_main_t *lcm = vnet_lisp_cp_get_main (); + + if (protocol < LISP_TRANSPORT_PROTOCOL_UDP || + protocol > LISP_TRANSPORT_PROTOCOL_API) + return VNET_API_ERROR_INVALID_ARGUMENT; + + lcm->transport_protocol = protocol; + return 0; +} + +lisp_transport_protocol_t +vnet_lisp_get_transport_protocol (void) +{ + lisp_cp_main_t *lcm = vnet_lisp_cp_get_main (); + return lcm->transport_protocol; +} + VLIB_INIT_FUNCTION (lisp_cp_init); /* |