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

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