Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/next/external/packages/extras-buildpkgs/swconfig/debian/patches/add-switch-h.patch
Views: 3966
diff --git a/Makefile b/Makefile1index b142268..a72318a 1006442--- a/Makefile3+++ b/Makefile4@@ -1,6 +1,7 @@5ifndef CFLAGS6CFLAGS = -O2 -g -I /usr/include/libnl3/7endif8+CFLAGS += -I ./include/9LIBS=-lnl-3 -lnl-genl-310all: swconfig1112diff --git a/include/linux/switch.h b/include/linux/switch.h13new file mode 10064414index 0000000..a59b23915--- /dev/null16+++ b/include/linux/switch.h17@@ -0,0 +1,103 @@18+/*19+ * switch.h: Switch configuration API20+ *21+ * Copyright (C) 2008 Felix Fietkau <[email protected]>22+ *23+ * This program is free software; you can redistribute it and/or24+ * modify it under the terms of the GNU General Public License25+ * as published by the Free Software Foundation; either version 226+ * of the License, or (at your option) any later version.27+ *28+ * This program is distributed in the hope that it will be useful,29+ * but WITHOUT ANY WARRANTY; without even the implied warranty of30+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the31+ * GNU General Public License for more details.32+ */33+34+#ifndef _UAPI_LINUX_SWITCH_H35+#define _UAPI_LINUX_SWITCH_H36+37+#include <linux/types.h>38+#include <linux/netdevice.h>39+#include <linux/netlink.h>40+#include <linux/genetlink.h>41+#ifndef __KERNEL__42+#include <netlink/netlink.h>43+#include <netlink/genl/genl.h>44+#include <netlink/genl/ctrl.h>45+#endif46+47+/* main attributes */48+enum {49+ SWITCH_ATTR_UNSPEC,50+ /* global */51+ SWITCH_ATTR_TYPE,52+ /* device */53+ SWITCH_ATTR_ID,54+ SWITCH_ATTR_DEV_NAME,55+ SWITCH_ATTR_ALIAS,56+ SWITCH_ATTR_NAME,57+ SWITCH_ATTR_VLANS,58+ SWITCH_ATTR_PORTS,59+ SWITCH_ATTR_PORTMAP,60+ SWITCH_ATTR_CPU_PORT,61+ /* attributes */62+ SWITCH_ATTR_OP_ID,63+ SWITCH_ATTR_OP_TYPE,64+ SWITCH_ATTR_OP_NAME,65+ SWITCH_ATTR_OP_PORT,66+ SWITCH_ATTR_OP_VLAN,67+ SWITCH_ATTR_OP_VALUE_INT,68+ SWITCH_ATTR_OP_VALUE_STR,69+ SWITCH_ATTR_OP_VALUE_PORTS,70+ SWITCH_ATTR_OP_DESCRIPTION,71+ /* port lists */72+ SWITCH_ATTR_PORT,73+ SWITCH_ATTR_MAX74+};75+76+enum {77+ /* port map */78+ SWITCH_PORTMAP_PORTS,79+ SWITCH_PORTMAP_SEGMENT,80+ SWITCH_PORTMAP_VIRT,81+ SWITCH_PORTMAP_MAX82+};83+84+/* commands */85+enum {86+ SWITCH_CMD_UNSPEC,87+ SWITCH_CMD_GET_SWITCH,88+ SWITCH_CMD_NEW_ATTR,89+ SWITCH_CMD_LIST_GLOBAL,90+ SWITCH_CMD_GET_GLOBAL,91+ SWITCH_CMD_SET_GLOBAL,92+ SWITCH_CMD_LIST_PORT,93+ SWITCH_CMD_GET_PORT,94+ SWITCH_CMD_SET_PORT,95+ SWITCH_CMD_LIST_VLAN,96+ SWITCH_CMD_GET_VLAN,97+ SWITCH_CMD_SET_VLAN98+};99+100+/* data types */101+enum switch_val_type {102+ SWITCH_TYPE_UNSPEC,103+ SWITCH_TYPE_INT,104+ SWITCH_TYPE_STRING,105+ SWITCH_TYPE_PORTS,106+ SWITCH_TYPE_NOVAL,107+};108+109+/* port nested attributes */110+enum {111+ SWITCH_PORT_UNSPEC,112+ SWITCH_PORT_ID,113+ SWITCH_PORT_FLAG_TAGGED,114+ SWITCH_PORT_ATTR_MAX115+};116+117+#define SWITCH_ATTR_DEFAULTS_OFFSET 0x1000118+119+120+#endif /* _UAPI_LINUX_SWITCH_H */121122123