[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ipcop-svn
Subject:    [Ipcop-svn] SF.net SVN: ipcop:[3510] ipcop/trunk
From:       owes () users ! sourceforge ! net
Date:       2009-08-29 7:06:20
Message-ID: E1MhI0y-00058v-LW () dn4whf1 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Revision: 3510
          http://ipcop.svn.sourceforge.net/ipcop/?rev=3510&view=rev
Author:   owes
Date:     2009-08-29 07:06:20 +0000 (Sat, 29 Aug 2009)

Log Message:
-----------
Add oneliner config for shaping/settings.
Suppress some error messages from restartshaping.

Modified Paths:
--------------
    ipcop/trunk/lfs/ipcop
    ipcop/trunk/src/misc-progs/restartshaping.c

Modified: ipcop/trunk/lfs/ipcop
===================================================================
--- ipcop/trunk/lfs/ipcop	2009-08-29 06:50:11 UTC (rev 3509)
+++ ipcop/trunk/lfs/ipcop	2009-08-29 07:06:20 UTC (rev 3510)
@@ -116,6 +116,7 @@
 	# Oneliner configfiles
 	echo  "ENABLED=off"					> $(CONFIG_ROOT)/ipsec/settings
 	echo  "VPN_DELAYED_START=0"				>>$(CONFIG_ROOT)/ipsec/settings
+	echo  "VALID=yes"					> $(CONFIG_ROOT)/shaping/settings
 	echo  "01"						> $(CONFIG_ROOT)/certs/serial
 	echo  "nameserver    1.2.3.4"				> $(CONFIG_ROOT)/ppp/fake-resolv.conf
 	echo  -e "<ipcop>\n</ipcop>"				> $(CONFIG_ROOT)/patches/available.xml

Modified: ipcop/trunk/src/misc-progs/restartshaping.c
===================================================================
--- ipcop/trunk/src/misc-progs/restartshaping.c	2009-08-29 06:50:11 UTC (rev 3509)
+++ ipcop/trunk/src/misc-progs/restartshaping.c	2009-08-29 07:06:20 UTC (rev 3510)
@@ -109,15 +109,16 @@
 
     iface = ipcop_ethernet.red_device[1];
 
+    /* Remove old shaping, silence error since shaping may have been inactive */
     verbose_printf(1, "Remove qdiscs ... \n");
-    snprintf(command, STRING_SIZE - 1, "/sbin/tc qdisc del dev %s root", iface);
+    snprintf(command, STRING_SIZE - 1, "/sbin/tc qdisc del dev %s root %s", iface, \
flag_verbose ? "" : "2>/dev/null");  safe_system(command);
-    snprintf(command, STRING_SIZE - 1, "/sbin/tc qdisc del dev %s ingress", iface);
+    snprintf(command, STRING_SIZE - 1, "/sbin/tc qdisc del dev %s ingress %s", \
iface, flag_verbose ? "" : "2>/dev/null");  safe_system(command);
 
     /* Find the ENABLE value */
     if (test_kv(shp_kv, "ENABLE", "on") != SUCCESS) {
-        fprintf(stderr, "Shaping is not ENABLED\n");
+        verbose_printf(1, "Shaping is not ENABLED\n");
         goto EXIT;
     }
 
@@ -154,10 +155,13 @@
 
     verbose_printf(1, "Add qdiscs ... \n");
     /* Uplink classes */
-    snprintf(command, STRING_SIZE - 1, "/sbin/tc qdisc add dev %s root handle 1: htb \
default 20 r2q %d", iface, r2q); +    snprintf(command, STRING_SIZE - 1,
+            "/sbin/tc qdisc add dev %s root handle 1: htb default 20 r2q %d",
+            iface, r2q);
     safe_system(command);
-    snprintf(command, STRING_SIZE - 1, "/sbin/tc class add dev %s parent 1: classid \
                1:1 htb rate %dkbit", iface,
-             uplink);
+    snprintf(command, STRING_SIZE - 1,
+            "/sbin/tc class add dev %s parent 1: classid 1:1 htb rate %dkbit",
+            iface, uplink);
     safe_system(command);
     snprintf(command, STRING_SIZE - 1,
              "/sbin/tc class add dev %s parent 1:1 classid 1:10 htb rate %dkbit ceil \
%dkbit prio 1", iface, @@ -185,8 +189,7 @@
              "/sbin/tc filter add dev %s parent 1:0 protocol ip prio 10 u32 match ip \
tos 0x10 0xff flowid 1:10", iface);  safe_system(command);
     snprintf(command, STRING_SIZE - 1,
-             "/sbin/tc filter add dev %s parent 1:0 protocol ip prio 10 u32 match ip \
                protocol 1 0xff flowid 1:10",
-             iface);
+             "/sbin/tc filter add dev %s parent 1:0 protocol ip prio 10 u32 match ip \
protocol 1 0xff flowid 1:10", iface);  safe_system(command);
 
     /* ACK packets for high priority queue (to speed up downloads) */


This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Ipcop-svn mailing list
Ipcop-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipcop-svn


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic