--- shaperd-0.2.1.orig/src/bwadm.hpp
+++ shaperd-0.2.1/src/bwadm.hpp
@@ -2,7 +2,9 @@
#define _BWADM_HPP_
#include "time.hpp"
-#include <list.h>
+#include <list>
+
+using namespace std;
struct classinfo {
public:
--- shaperd-0.2.1.orig/src/makefile
+++ shaperd-0.2.1/src/makefile
@@ -9,8 +9,8 @@
objs = classifier.o bwadm.o classdef.o config.o packet.o main.o sched.o log.o
deps = $(objs:.o=.d)
libs =
-dopt = -I/usr/src/linux/include
-copt = -Wall -O2 -I/usr/src/linux/include
+dopt = -I/usr/src/linux/include -I/usr/include/libipq
+copt = -Wall -O2 -I/usr/src/linux/include -I/usr/include/libipq
lopt = -Wall -O2
GCC = gcc
G++ = g++
--- shaperd-0.2.1.orig/src/classdef.cpp
+++ shaperd-0.2.1/src/classdef.cpp
@@ -103,7 +103,7 @@
{
packet_classifier **new_vector;
- new_vector = new(nothrow) (packet_classifier*)[n_classifiers+1];
+ new_vector = new(nothrow) packet_classifier*[n_classifiers+1];
if( new_vector==0 ) goto __err_new;
if( n_classifiers>0 ) {
@@ -270,7 +270,7 @@
v_classifiers[i]->set_real_prio(r_pr);
}
- v_queues = new(nothrow) (queue<generic_packet*>)[n];
+ v_queues = new(nothrow) queue<generic_packet*>[n];
if( v_queues==0 ) {
log_info(LL_ALERT, "no memory for queue {%s:%d}",
__FILE__, __LINE__);
--- shaperd-0.2.1.orig/src/main.cpp
+++ shaperd-0.2.1/src/main.cpp
@@ -7,6 +7,7 @@
#include <queue>
#include <stdio.h>
#include <string.h>
+#include <cstdlib>
extern "C" {
#include <errno.h>
@@ -597,7 +598,10 @@
printf("version %s\n", VERSION_STR);
printf("built %s, %s; %s %s\n",
str_divert, str_ipq, __DATE__, __TIME__);
- printf("Compiled against: %s\n", UTS_RELEASE);
+ printf("Compiled against: linux-%d.%d.%d\n",
+ (LINUX_VERSION_CODE >> 16) & 0xff,
+ (LINUX_VERSION_CODE >> 8) & 0xff,
+ (LINUX_VERSION_CODE >> 0) & 0xff);
printf("GNU CC: %s\n", __VERSION__);
exit(0);
--- shaperd-0.2.1.orig/src/defaults.hpp
+++ shaperd-0.2.1/src/defaults.hpp
@@ -5,6 +5,6 @@
#define VERSION_STR "0.2.1, 03-03-2002"
#define DEFAULT_PIDFILE "/var/run/shaperd.pid"
-#define DEFAULT_CFGFILE "/usr/local/shaperd/shaperd.conf"
+#define DEFAULT_CFGFILE "/etc/shaperd/shaperd.conf"
#endif
--- shaperd-0.2.1.orig/src/bwadm.cpp
+++ shaperd-0.2.1/src/bwadm.cpp
@@ -19,14 +19,14 @@
delete[] v_classes;
}
-int bwadm::add_class(int id, int bw=0)
+int bwadm::add_class(int id, int bw)
{
classinfo **new_v, *new_classinfo;
// temporary stuff. avoid!!!
if( n_classes!=id ) return -1;
- new_v = new(nothrow) (classinfo*)[n_classes+1];
+ new_v = new(nothrow) classinfo*[n_classes+1];
if( new_v==0 ) goto __err_newv;
new_classinfo = new(nothrow) classinfo;
--- shaperd-0.2.1.orig/src/config.cpp
+++ shaperd-0.2.1/src/config.cpp
@@ -4,6 +4,7 @@
#include "classdef.hpp"
#include <stdio.h>
#include <string.h>
+#include <cassert>
extern "C" {
#include <netdb.h>
@@ -32,7 +33,7 @@
static int get_ipq_maxlen();
#endif
-shaper_config::shaper_config(int opt_fw=OPT_FW_NONE)
+shaper_config::shaper_config(int opt_fw)
{
n_classes = 0;
v_classes = 0;
@@ -55,7 +56,7 @@
{
classdef **new_vector;
- new_vector = new(nothrow) (classdef *)[n_classes+1];
+ new_vector = new(nothrow) classdef*[n_classes+1];
if( new_vector==0 ) {
goto __err_new;
}
@@ -1544,8 +1545,9 @@
fp = fopen(IP_QUEUE_MAXLEN_FN, "r");
if( fp==0 ) {
log_message(LL_ALERT,
- "can't open %s (is ip_queue loaded? "
- "is /proc mounted? how are babies made? :)",
+ "can't open %s (is ip_queue loaded?\n"
+ "is /proc mounted? how are babies made? :)\n"
+ "you can try 'mount /proc' and/or 'modprobe ip_queue'",
IP_QUEUE_MAXLEN_FN);
goto _err_cleanup;
}