summaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorFilip Tehlar <ftehlar@cisco.com>2017-03-07 10:23:01 +0100
committerFlorin Coras <florin.coras@gmail.com>2017-03-08 15:50:57 +0000
commit6786f1b5f8401d1ebc843b77e7d7315d34f3895d (patch)
tree483b4f0f7c2077d3a58e2bb8fa2d1ac64e77721f /src/vnet
parent141ecc5495985612a23465f0772711bf77f7ce60 (diff)
LISP: fix gpe sub-interface lookup
Change-Id: I080b90a4bc53c2595ade696c592e86790c7ca939 Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/lisp-gpe/lisp_gpe_sub_interface.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/vnet/lisp-gpe/lisp_gpe_sub_interface.c b/src/vnet/lisp-gpe/lisp_gpe_sub_interface.c
index 56f5263650d..0dfbc40d8e7 100644
--- a/src/vnet/lisp-gpe/lisp_gpe_sub_interface.c
+++ b/src/vnet/lisp-gpe/lisp_gpe_sub_interface.c
@@ -49,11 +49,11 @@ lisp_gpe_sub_interface_db_find (const ip_address_t * lrloc, u32 vni)
{
uword *p;
- lisp_gpe_sub_interface_key_t key = {
- .local_rloc = *lrloc,
- .vni = clib_host_to_net_u32 (vni),
- };
+ lisp_gpe_sub_interface_key_t key;
+ memset (&key, 0, sizeof (key));
+ ip_address_copy (&key.local_rloc, lrloc);
+ key.vni = clib_host_to_net_u32 (vni);
p = hash_get_mem (lisp_gpe_sub_interfaces, &key);
if (NULL == p)
@@ -66,16 +66,16 @@ static void
lisp_gpe_sub_interface_db_insert (const lisp_gpe_sub_interface_t * l3s)
{
hash_set_mem (lisp_gpe_sub_interfaces,
- &l3s->key, l3s - lisp_gpe_sub_interface_pool);
+ l3s->key, l3s - lisp_gpe_sub_interface_pool);
hash_set_mem (lisp_gpe_sub_interfaces_sw_if_index,
- &l3s->key, l3s->sw_if_index);
+ l3s->key, l3s->sw_if_index);
}
static void
lisp_gpe_sub_interface_db_remove (const lisp_gpe_sub_interface_t * l3s)
{
- hash_unset_mem (lisp_gpe_sub_interfaces, &l3s->key);
- hash_unset_mem (lisp_gpe_sub_interfaces_sw_if_index, &l3s->key);
+ hash_unset_mem (lisp_gpe_sub_interfaces, l3s->key);
+ hash_unset_mem (lisp_gpe_sub_interfaces_sw_if_index, l3s->key);
}
lisp_gpe_sub_interface_t *
Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
// Copyright (c) 2017 Cisco and/or its affiliates.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package adapter

// VppAdapter provides connection to VPP. It is responsible for sending and receiving of binary-encoded messages to/from VPP.
type VppAdapter interface {
	// Connect connects the process to VPP.
	Connect() error

	// Disconnect disconnects the process from VPP.
	Disconnect()

	// GetMsgID returns a runtime message ID for the given message name and CRC.
	GetMsgID(msgName string, msgCrc string) (uint16, error)

	// SendMsg sends a binary-encoded message to VPP.
	SendMsg(clientID uint32, data []byte) error

	// SetMsgCallback sets a callback function that will be called by the adapter whenever a message comes from VPP.
	SetMsgCallback(func(context uint32, msgId uint16, data []byte))

	// WaitReady waits until adapter is ready.
	WaitReady() error
}