netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [IPROUTE]: iflink_vlan: support GVRP flag
@ 2008-07-03 17:06 Patrick McHardy
  0 siblings, 0 replies; only message in thread
From: Patrick McHardy @ 2008-07-03 17:06 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Linux Netdev List

[-- Attachment #1: Type: text/plain, Size: 54 bytes --]

This is the patch for iproute for configuring GVRP.



[-- Attachment #2: iproute-gvrp.diff --]
[-- Type: text/x-diff, Size: 1745 bytes --]

commit 32143eed8b706e5c6554ab42903533b3bccdc060
Author: Patrick McHardy <kaber@trash.net>
Date:   Thu Jul 3 19:05:09 2008 +0200

    [IPROUTE]: iflink_vlan: support GVRP flag
    
    Signed-off-by: Patrick McHardy <kaber@trash.net>

diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 4014ba9..2dc4a57 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -32,6 +32,7 @@ enum vlan_ioctl_cmds {
 
 enum vlan_flags {
 	VLAN_FLAG_REORDER_HDR	= 0x1,
+	VLAN_FLAG_GVRP		= 0x2,
 };
 
 enum vlan_name_types {
diff --git a/ip/iplink_vlan.c b/ip/iplink_vlan.c
index 1964839..9724482 100644
--- a/ip/iplink_vlan.c
+++ b/ip/iplink_vlan.c
@@ -26,7 +26,7 @@ static void explain(void)
 		"\n"
 		"VLANID := 0-4095\n"
 		"FLAG-LIST := [ FLAG-LIST ] FLAG\n"
-		"FLAG := [ reorder_hdr { on | off } ]\n"
+		"FLAG := [ reorder_hdr { on | off } ] [ gvrp { on | off } ]\n"
 		"QOS-MAP := [ QOS-MAP ] QOS-MAPPING\n"
 		"QOS-MAPPING := FROM:TO\n"
 	);
@@ -93,6 +93,15 @@ static int vlan_parse_opt(struct link_util *lu, int argc, char **argv,
 				flags.flags &= ~VLAN_FLAG_REORDER_HDR;
 			else
 				return on_off("reorder_hdr");
+		} else if (matches(*argv, "gvrp") == 0) {
+			NEXT_ARG();
+			flags.mask |= VLAN_FLAG_GVRP;
+			if (strcmp(*argv, "on") == 0)
+				flags.flags |= VLAN_FLAG_GVRP;
+			else if (strcmp(*argv, "off") == 0)
+				flags.flags &= ~VLAN_FLAG_GVRP;
+			else
+				return on_off("gvrp");
 		} else if (matches(*argv, "ingress-qos-map") == 0) {
 			NEXT_ARG();
 			if (vlan_parse_qos_map(&argc, &argv, n,
@@ -146,6 +155,7 @@ static void vlan_print_flags(FILE *fp, __u32 flags)
 			fprintf(fp, #f "%s", flags ? "," : ""); \
 		}
 	_PF(REORDER_HDR);
+	_PF(GVRP);
 #undef _PF
 	if (flags)
 		fprintf(fp, "%x", flags);

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2008-07-03 17:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-03 17:06 [IPROUTE]: iflink_vlan: support GVRP flag Patrick McHardy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).