diff -Naur iptables-1.3.5/extensions/libipt_fusivTC.c iptables-1.3.5_IPQOS/extensions/libipt_fusivTC.c
--- iptables-1.3.5/extensions/libipt_fusivTC.c	1969-12-31 16:00:00.000000000 -0800
+++ iptables-1.3.5_IPQOS/extensions/libipt_fusivTC.c	2007-01-10 17:30:14.000000000 -0800
@@ -0,0 +1,293 @@
+/* Copyright (C) 2006 Ikanos Communications
+ * See IKANOS_PROP_LICENSE.txt for license information. */
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <getopt.h>
+
+#include <iptables.h>
+#include <linux/netfilter_ipv4/ip_tables.h>
+#include <fusivTC.h>
+
+/* Function which prints out usage message. */
+static void
+help(void)
+{
+	printf(
+"fusivTC target v%s options:\n"
+" Commands \n"
+"  --map           <info>                Map QoS information to the Scheduler Q\n"
+"  --set-priority  <priority>            QoS Priority [0-7]\n"
+"  --mark          <stamp>:<priority>    Mark QoS information \n"
+"  --remark        <stamp>               Re-Mark (Convert) QoS Information in packet\n"
+"  --rate-control  <bool>[-<abw>-<mbw>]  Enable / Disable Rate Control, required for WRT \n\n"
+" Command Options:\n"
+"  info             : 'tos' / 'cos' \n"
+"  stamp            : 'tos' / 'dscp' / 'cos' \n"
+"  priority         : Value between 0 to 7 \n"
+"  bool             : 'true' / 'false' "
+"  abw              : Assured or Committed Rate in KBPS"
+"  mbw              : Maximum or Peak Rate in KBPS"
+"\n",
+IPTABLES_VERSION);
+}
+
+static struct option opts[] = {
+	{ "map", 1, 0, '1' },
+	{ "set-priority", 1, 0, '2' },
+	{ "mark", 1, 0, '3' },
+	{ "rate-control", 1, 0, '4' },
+	{ "remark", 1, 0, '5' },
+	{ 0 }
+};
+
+/* Initialize the target. */
+static void
+init(struct ipt_entry_target *t, unsigned int *nfcache)
+{
+	/* Can not cache this */
+	*nfcache |= NFC_UNKNOWN;
+  struct fusivtc_target_info  *target = (struct fusivtc_target_info*)t->data;
+	/* Reset the target info structure */
+	target->ucPriority 					= 0xFF;
+	target->marking_priority 		= 0xFF;
+	target->markingInfo					= 0;
+	target->remarkInfo		 		  = 0;
+	target->mappingInfo         = 0;
+	target->rateControl         = 0;
+}
+
+/* Function which parses command options; returns true if it
+   ate an option */
+static int
+parse(int c, char **argv, int invert, unsigned int *flags,
+      const struct ipt_entry *entry,
+      struct ipt_entry_target **target)
+{
+  int index;
+
+	struct fusivtc_target_info *tcinfo
+		= (struct fusivtc_target_info *)(*target)->data;
+	switch (c) {
+		char *end;
+	case '1':  /* Do Mapping */
+	  if(tcinfo->mappingInfo != 0x0)
+			exit_error(PARAMETER_PROBLEM,"Redundent configurations invoked");
+	  if(tcinfo->ucPriority != 0xFF)
+			exit_error(PARAMETER_PROBLEM, "Mapping and Policy can not be configured together");
+	  if(strcasecmp(optarg,"tos") == 0)
+	    tcinfo->mappingInfo =  IPQOS_TOS;
+		else if(strcasecmp(optarg,"dscp") == 0)
+			tcinfo->mappingInfo =  IPQOS_DSCP;
+		else if(strcasecmp(optarg,"cos") == 0)
+			tcinfo->mappingInfo =  IPQOS_COS;
+		else
+			exit_error(PARAMETER_PROBLEM, "Bad Mapping value `%s'", optarg);
+		*flags |= 1;
+		break;
+	case '2': /* Configure the policy */
+	  if(tcinfo->ucPriority != 0xFF)
+      exit_error(PARAMETER_PROBLEM,"Redundent configurations invoked");
+	  if(tcinfo->mappingInfo != 0)
+			exit_error(PARAMETER_PROBLEM, "Mapping and Policy can not be configured together");
+	  tcinfo->ucPriority = strtoul(optarg, &end, 0);
+		if (*end != '\0' || end == optarg)
+      exit_error(PARAMETER_PROBLEM, "Bad Policy value `%s'", optarg);
+		if(tcinfo->ucPriority > 7)
+      exit_error(PARAMETER_PROBLEM, "Bad Policy value `%s'", optarg);
+    *flags |= 0x2;
+		break;
+	case '3': /* Configure the Markinginformation */
+    if(strncasecmp(optarg,"tos",3) == 0)
+		{
+			if(tcinfo->markingInfo & IPQOS_DSCP)
+				exit_error(PARAMETER_PROBLEM,"Select either DSCP or TOS marking, not both");
+			else if(tcinfo->markingInfo & IPQOS_TOS)
+				exit_error(PARAMETER_PROBLEM,"Redundent configurations invoked");
+      tcinfo->markingInfo =  IPQOS_TOS;
+			index = 3;
+		}
+    else if(strncasecmp(optarg,"dscp",4) == 0)
+		{
+			if(tcinfo->markingInfo & IPQOS_TOS)
+				exit_error(PARAMETER_PROBLEM,"Select either DSCP or TOS marking, not both");
+			else if(tcinfo->markingInfo & IPQOS_DSCP)
+				exit_error(PARAMETER_PROBLEM,"Redundent configurations invoked");
+		  tcinfo->markingInfo =  IPQOS_DSCP;
+			index = 4;
+		}
+    else if(strncasecmp(optarg,"cos",3) == 0)
+		{
+			if(tcinfo->markingInfo & IPQOS_COS)
+				exit_error(PARAMETER_PROBLEM,"Redundent configurations invoked");
+      tcinfo->markingInfo =  IPQOS_COS;
+			index = 3;
+		}
+    else
+      exit_error(PARAMETER_PROBLEM, "Bad Marking value `%s'", optarg);
+
+		if(optarg[index++] != ':')
+			exit_error(PARAMETER_PROBLEM, "Bad priority value '%s'", optarg);
+
+	  tcinfo->marking_priority = optarg[index++] - '0';
+		if(tcinfo->marking_priority > 7)
+      exit_error(PARAMETER_PROBLEM, "Bad priority value `%d'", tcinfo->marking_priority);
+		if (optarg[index] != '\0')
+      exit_error(PARAMETER_PROBLEM, "Bad priority value `%s'", optarg);
+    *flags |= 0x4;
+		break;
+	case '5': /* Configure the Convert  */
+    if(strcasecmp(optarg,"tos") == 0)
+		{
+			if(tcinfo->remarkInfo & IPQOS_DSCP)
+				exit_error(PARAMETER_PROBLEM,"Select either DSCP or TOS marking, not both");
+			else if(tcinfo->remarkInfo & IPQOS_TOS)
+				exit_error(PARAMETER_PROBLEM,"Redundent configurations invoked");
+      tcinfo->remarkInfo =  IPQOS_TOS;
+		}
+    else if(strcasecmp(optarg,"dscp") == 0)
+		{
+			if(tcinfo->remarkInfo & IPQOS_TOS)
+				exit_error(PARAMETER_PROBLEM,"Select either DSCP or TOS marking, not both");
+			else if(tcinfo->remarkInfo & IPQOS_DSCP)
+				exit_error(PARAMETER_PROBLEM,"Redundent configurations invoked");
+		  tcinfo->remarkInfo =  IPQOS_DSCP;
+		}
+    else if(strcasecmp(optarg,"cos") == 0)
+		{
+			if(tcinfo->remarkInfo & IPQOS_COS)
+				exit_error(PARAMETER_PROBLEM,"Redundent configurations invoked");
+      tcinfo->remarkInfo =  IPQOS_COS;
+		}
+    else
+      exit_error(PARAMETER_PROBLEM, "Bad Mapping value `%s'", optarg);
+    *flags |= 0x8;
+		break;
+	case '4':
+    *flags |= 0x10;
+		if(tcinfo->rateControl)
+      exit_error(PARAMETER_PROBLEM,"Redundent configurations invoked");
+		if(strncasecmp(optarg,"true",4) == 0)
+		{
+			end = &optarg[4];
+			if(*end++ != '-')
+			  return 0;
+      while(*end != '\0' && *end != '-')
+			{
+				if(isdigit(*end) == 0)
+					return 0;
+				end++;
+			}
+			if(*end++ != '-')
+        return 0;
+      while(*end != '\0')
+      {
+				if(isdigit(*end) == 0)
+					return 0;
+				end++;
+			}
+		  sscanf(&optarg[4],"-%d-%d",&tcinfo->confAssuredBW,&tcinfo->confMaxBW);
+			if(tcinfo->confAssuredBW < 0 || tcinfo->confMaxBW < 0)
+		    exit_error(PARAMETER_PROBLEM, "Bad rate-control value `%s'", optarg);
+			tcinfo->rateControl = 1;
+		}
+		else if(strncasecmp(optarg,"false",5) != 0)
+		  exit_error(PARAMETER_PROBLEM, "Bad rate-control value `%s'", optarg);
+		break;
+	default:
+	  exit_error(PARAMETER_PROBLEM, "This feature is not available now `%s'", optarg);
+		return 0;
+	}
+	return 1;
+}
+
+static void
+final_check(unsigned int flags)
+{
+	if (!flags)
+		exit_error(PARAMETER_PROBLEM, "fusivTC target: one of the action required");
+	if( (flags & 0x8) && !(flags & 0x1))
+	{
+		exit_error(PARAMETER_PROBLEM, "fusivTC target: Re-Marking Requires a Mapping");
+	}
+}
+
+/* Prints out the targinfo. */
+static void
+print(const struct ipt_ip *ip,
+      const struct ipt_entry_target *target,
+      int numeric)
+{
+	struct fusivtc_target_info *tcinfo = (struct fusivtc_target_info *)target->data;
+	if(tcinfo->mappingInfo)
+	{
+		switch(tcinfo->mappingInfo)
+		{
+			case IPQOS_TOS:
+    	  printf("map=tos");
+				break;
+			case IPQOS_DSCP:
+			  printf("map=dscp");
+				break;
+			case IPQOS_COS:
+			  printf("map=cos");
+				break;
+		}
+		printf("  ");
+	}
+	if(tcinfo->markingInfo)
+	{
+		switch(tcinfo->markingInfo)
+		{
+			case IPQOS_TOS:
+    	  printf("mark=tos");
+				break;
+			case IPQOS_DSCP:
+			  printf("mark=dscp");
+				break;
+			case IPQOS_COS:
+			  printf("mark=cos");
+				break;
+		}
+		printf("  ");
+	}
+	if(tcinfo->ucPriority != 0xFF)
+	{
+		printf("priority:  %d ",tcinfo->ucPriority);
+	}
+	if(tcinfo->rateControl)
+	{
+		printf("rate-control:  true-%d-%d [STAT:  %d/%d-%d/%d-%d/%d]",
+		      tcinfo->confAssuredBW,tcinfo->confMaxBW,tcinfo->greenPkts,tcinfo->greenBytes,
+					tcinfo->yellowPkts,tcinfo->yellowBytes,tcinfo->redPkts,tcinfo->redBytes);
+	}
+	else 
+		printf("rate-control:  false");
+}
+
+/* Saves the union ipt_targinfo in parsable form to stdout. */
+static void
+save(const struct ipt_ip *ip, const struct ipt_entry_target *target)
+{
+}
+
+static
+struct iptables_target ipt_fusivTC_target
+= { 
+	  .name   = "fusivTC",
+	  .version  = IPTABLES_VERSION,
+	  .size   = IPT_ALIGN(sizeof(struct fusivtc_target_info)),
+	  .userspacesize  = IPT_ALIGN(sizeof(struct fusivtc_target_info)),
+	  .help   = &help,
+	  .init   = &init,
+	  .parse    = &parse,
+	  .final_check  = &final_check,
+	  .print    = &print,
+	  .save   = &save,
+	  .extra_opts = opts
+};
+
+void _init(void)
+{
+	register_target(&ipt_fusivTC_target);
+}
diff -Naur iptables-1.3.5/extensions/Makefile iptables-1.3.5_IPQOS/extensions/Makefile
--- iptables-1.3.5/extensions/Makefile	2004-06-17 03:22:54.000000000 -0700
+++ iptables-1.3.5_IPQOS/extensions/Makefile	2007-01-10 17:30:01.000000000 -0800
@@ -7,6 +7,7 @@
 #
 PF_EXT_SLIB:=ah addrtype comment connlimit connmark conntrack dscp ecn esp hashlimit helper icmp iprange length limit mac mark multiport owner physdev pkttype policy realm rpc sctp standard state tcp tcpmss tos ttl udp unclean CLASSIFY CONNMARK DNAT DSCP ECN LOG MARK MASQUERADE MIRROR NETMAP NFQUEUE NOTRACK REDIRECT REJECT SAME SNAT TARPIT TCPMSS TOS TRACE TTL ULOG
 PF6_EXT_SLIB:=connmark eui64 hl icmpv6 length limit mac mark multiport owner physdev policy standard state tcp udp CONNMARK HL LOG NFQUEUE MARK TRACE
+PF_EXT_SLIB += fusivTC
 
 # Optionals
 PF_EXT_SLIB_OPTS:=$(foreach T,$(wildcard extensions/.*-test),$(shell KERNEL_DIR=$(KERNEL_DIR) $(T)))
diff -Naur iptables-1.3.5/Makefile iptables-1.3.5_IPQOS/Makefile
--- iptables-1.3.5/Makefile	2004-06-17 04:21:07.000000000 -0700
+++ iptables-1.3.5_IPQOS/Makefile	2007-01-10 17:29:54.000000000 -0800
@@ -27,7 +27,7 @@
 RELEASE_DIR:=/tmp
 
 # Need libc6 for this.  FIXME: Should covert to autoconf.
-ifeq ($(shell [ -f /usr/include/netinet/ip6.h ] && echo YES), YES)
+ifeq ($(shell grep -q '__UCLIBC_HAS_IPV6__ 1'  $(BUILD_DIR)/build_mips_nofpu/uClibc/include/bits/uClibc_config.h && echo YES), YES)
 DO_IPV6:=1
 endif
 
@@ -38,6 +38,11 @@
 CFLAGS += -DNO_SHARED_LIBS=1
 endif
 
+CFLAGS += -I$(PWD)/../fusiv_src/kernel/drivers/ipqos
+
+
+
+
 EXTRAS+=iptables iptables.o iptables.8
 EXTRA_INSTALLS+=$(DESTDIR)$(BINDIR)/iptables $(DESTDIR)$(MANDIR)/man8/iptables.8
 
