Blame SOURCES/open-lldp-v1.0.1-7-VDP-Support-for-OUI-infrastructure-in-VDP22.patch

ee47b4
From 64c9ba3c03c735e8031964edf52e148373ec29ce Mon Sep 17 00:00:00 2001
ee47b4
From: padkrish <padkrish@cisco.com>
ee47b4
Date: Wed, 21 Jan 2015 03:38:24 +0000
ee47b4
Subject: [PATCH] VDP: Support for OUI infrastructure in VDP22.
ee47b4
ee47b4
This patch contains the header field changes for a general framework
ee47b4
for supporting OUI fields in VDP22 at the station side. The specific
ee47b4
changes are described below.
ee47b4
ee47b4
qbg_vdpnl.h:
ee47b4
-------------
ee47b4
Couple of parameters are added to the vdpnl_vsi structure. One is
ee47b4
the number of OUI parameters. Generally, this will be 1, as the
ee47b4
chances of having different OUI in a single message for VDP22 is
ee47b4
quite low. Nevertheless, there's support for having multiple OUI
ee47b4
in a single VSI. The other field is a general structure of len,opaque
ee47b4
data format for carrying the OUI data.
ee47b4
ee47b4
qbg_vdp22_oui.h:
ee47b4
----------------
ee47b4
This is a new header file added for supporting the OUI framework. This
ee47b4
file contains the OUI specific sub-structures for vdpnl and vsi22
ee47b4
structures and function handler structure.:w
ee47b4
ee47b4
Signed-off-by: padkrish <padkrish@cisco.com>
ee47b4
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
ee47b4
---
ee47b4
 Makefile.am             |  3 ++-
ee47b4
 include/qbg_vdp22.h     |  4 ++++
ee47b4
 include/qbg_vdp22_oui.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++
ee47b4
 include/qbg_vdp22def.h  |  1 +
ee47b4
 include/qbg_vdpnl.h     |  2 ++
ee47b4
 5 files changed, 55 insertions(+), 1 deletion(-)
ee47b4
 create mode 100644 include/qbg_vdp22_oui.h
ee47b4
ee47b4
diff --git a/Makefile.am b/Makefile.am
ee47b4
index fc4f8d6..403088b 100644
ee47b4
--- a/Makefile.am
ee47b4
+++ b/Makefile.am
ee47b4
@@ -69,7 +69,8 @@ lldp_8021qaz_cmds.c include/lldp_8021qaz_cmds.h \
ee47b4
 include/lldp_evb22.h lldp_evb22.c lldp_evb22_cmds.c \
ee47b4
 include/qbg22.h include/qbg_ecp22.h qbg/ecp22.c \
ee47b4
 include/qbg_vdp22.h qbg/vdp22.c qbg/vdpnl.c qbg/vdp22sm.c qbg/vdp22br.c \
ee47b4
-include/qbg_vdp22def.h qbg/vdp22_cmds.c qbg/vdp_ascii.c
ee47b4
+include/qbg_vdp22def.h qbg/vdp22_cmds.c qbg/vdp_ascii.c \
ee47b4
+include/qbg_vdp22_oui.h
ee47b4
 
ee47b4
 lib_LTLIBRARIES = liblldp_clif.la
ee47b4
 liblldp_clif_la_LDFLAGS = -version-info 1:0:0
ee47b4
diff --git a/include/qbg_vdp22.h b/include/qbg_vdp22.h
ee47b4
index 6c3c9ee..6585a10 100644
ee47b4
--- a/include/qbg_vdp22.h
ee47b4
+++ b/include/qbg_vdp22.h
ee47b4
@@ -59,6 +59,7 @@
ee47b4
 #include	<linux/if_link.h>
ee47b4
 
ee47b4
 #include	<qbg_vdp22def.h>
ee47b4
+#include        <qbg_vdp22_oui.h>
ee47b4
 
ee47b4
 enum vdp22_role {		/* State for VDP22 bridge processing */
ee47b4
 	VDP22_BRIDGE = 1,	/* Bridge role */
ee47b4
@@ -140,6 +141,8 @@ struct vsi22 {
ee47b4
 	unsigned char fif;		/* Filter info format */
ee47b4
 	unsigned short no_fdata;	/* Entries in filter data */
ee47b4
 	struct fid22 *fdata;		/* Filter data variable length */
ee47b4
+	unsigned short no_ouidata;      /* Entries in OUI data */
ee47b4
+	struct vdp22_oui_data_s *oui_str_data; /* OUI data variable length */
ee47b4
 	struct vdp22 *vdp;		/* Back pointer to VDP head */
ee47b4
 	unsigned long flags;		/* Flags, see above */
ee47b4
 	struct vdp22smi smi;		/* State machine information */
ee47b4
@@ -189,6 +192,7 @@ void vdp22_stop_timers(struct vsi22 *);
ee47b4
 int vdp22_start_localchange_timer(struct vsi22 *);
ee47b4
 bool vdp22_cmp_fdata(struct vsi22 *, struct vsi22 *);
ee47b4
 void vdp22_delete_vsi(struct vsi22 *);
ee47b4
+struct vdp22_oui_handler_s * vdp22_get_oui_hndlr(char *);
ee47b4
 
ee47b4
 /*
ee47b4
  * Functions to get and set vlan identifier and qos.
ee47b4
diff --git a/include/qbg_vdp22_oui.h b/include/qbg_vdp22_oui.h
ee47b4
new file mode 100644
ee47b4
index 0000000..0aeb7b9
ee47b4
--- /dev/null
ee47b4
+++ b/include/qbg_vdp22_oui.h
ee47b4
@@ -0,0 +1,46 @@
ee47b4
+/*******************************************************************************
ee47b4
+
ee47b4
+  Implementation of OUI for VDP2.2
ee47b4
+  Copyright (c) 2012-2014 by Cisco Systems, Inc.
ee47b4
+
ee47b4
+  Author(s): Padmanabhan Krishnan <padkrish at cisco dot com>
ee47b4
+
ee47b4
+  This program is free software; you can redistribute it and/or modify it
ee47b4
+  under the terms and conditions of the GNU General Public License,
ee47b4
+  version 2, as published by the Free Software Foundation.
ee47b4
+
ee47b4
+  This program is distributed in the hope it will be useful, but WITHOUT
ee47b4
+  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ee47b4
+  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
ee47b4
+  more details.
ee47b4
+
ee47b4
+  You should have received a copy of the GNU General Public License along with
ee47b4
+  this program; if not, write to the Free Software Foundation, Inc.,
ee47b4
+  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
ee47b4
+
ee47b4
+  The full GNU General Public License is included in this distribution in
ee47b4
+  the file called "COPYING".
ee47b4
+*******************************************************************************/
ee47b4
+
ee47b4
+#ifndef __VDP22_OUI_H__
ee47b4
+#define __VDP22_OUI_H__
ee47b4
+
ee47b4
+#include <stdbool.h>
ee47b4
+
ee47b4
+/*
ee47b4
+ * Generic OUI related defines
ee47b4
+ */
ee47b4
+enum vdp22_oui {
ee47b4
+	VDP22_OUI_TYPE_LEN = 3,          /* Size of OUI Type field */
ee47b4
+	VDP22_OUI_MAX_NAME = 20,
ee47b4
+};
ee47b4
+
ee47b4
+struct vdp22_oui_data_s {
ee47b4
+	void *vsi_data;
ee47b4
+	unsigned char oui_type[VDP22_OUI_TYPE_LEN];
ee47b4
+	char oui_name[VDP22_OUI_MAX_NAME];
ee47b4
+	int len;
ee47b4
+	void *data;
ee47b4
+};
ee47b4
+
ee47b4
+#endif /* __VDP22_OUI_H__ */
ee47b4
diff --git a/include/qbg_vdp22def.h b/include/qbg_vdp22def.h
ee47b4
index c305a2b..a2d2654 100644
ee47b4
--- a/include/qbg_vdp22def.h
ee47b4
+++ b/include/qbg_vdp22def.h
ee47b4
@@ -91,6 +91,7 @@ enum vsi_key_arg {
ee47b4
 	VSI_FILTER_ARG,
ee47b4
 	VSI_MAND_NUM_ARG,
ee47b4
 	VSI_HINTS_ARG,
ee47b4
+	VSI_OUI_ARG,
ee47b4
 	VSI_INVALID_ARG
ee47b4
 };
ee47b4
 
ee47b4
diff --git a/include/qbg_vdpnl.h b/include/qbg_vdpnl.h
ee47b4
index c5c93ed..bf18e71 100644
ee47b4
--- a/include/qbg_vdpnl.h
ee47b4
+++ b/include/qbg_vdpnl.h
ee47b4
@@ -66,6 +66,8 @@ struct vdpnl_vsi {		/* Data structure for VSI data via netlink */
ee47b4
 	unsigned char filter_fmt;	/* Filter format type */
ee47b4
 	int macsz;			/* Entries in mac-vlan pair list */
ee47b4
 	struct vdpnl_mac *maclist;	/* List of MAC-VLAN pairs */
ee47b4
+	int ouisz;                      /* No of OUI entries */
ee47b4
+	struct vdpnl_oui_data_s *oui_list; /* OUI Entries */
ee47b4
 };
ee47b4
 
ee47b4
 int vdpnl_recv(unsigned char *, size_t);
ee47b4
-- 
ee47b4
2.1.0
ee47b4