[bwm-tools-devel] COMMIT - r44 - in trunk: bwmd include lib
Brought to you by:
nkukard
|
From: SVN C. <sv...@li...> - 2005-01-15 19:43:12
|
Author: nkukard
Date: 2005-01-15 21:42:31 +0200 (Sat, 15 Jan 2005)
New Revision: 44
Modified:
trunk/bwmd/ipq.c
trunk/include/flow.h
trunk/lib/xmlConf.c
Log:
* Fixed max value of nfmark from long int to unsigned long int
Modified: trunk/bwmd/ipq.c
===================================================================
--- trunk/bwmd/ipq.c 2005-01-13 19:52:32 UTC (rev 43)
+++ trunk/bwmd/ipq.c 2005-01-15 19:42:31 UTC (rev 44)
@@ -84,7 +84,7 @@
// Queue a packet
-static int queuePacket(struct runnerData_t *runnerData, long int nfmark, struct packet_t *packet)
+static int queuePacket(struct runnerData_t *runnerData, unsigned long int nfmark, struct packet_t *packet)
{
struct pktQueue_t *foundQueue = NULL;
struct flow_t *foundFlow = NULL;
@@ -98,11 +98,12 @@
{
struct pktQueue_t *pktQueue = (struct pktQueue_t*) data;
-
+
+ // Check that we havn't found a queue
if (foundQueue) return;
- // Check if we found it
- if (pktQueue->nfmark == nfmark)
+ // Sanity check and check if we found it
+ if (pktQueue->nfmark && pktQueue->nfmark == nfmark)
foundQueue = pktQueue;
}
@@ -113,8 +114,8 @@
if (foundFlow) return;
- // Check if we found it
- if (flow->nfmark == nfmark)
+ // First make sure we have a value... then check if we found it
+ if (flow->nfmark && flow->nfmark == nfmark)
foundFlow = flow;
}
Modified: trunk/include/flow.h
===================================================================
--- trunk/include/flow.h 2005-01-13 19:52:32 UTC (rev 43)
+++ trunk/include/flow.h 2005-01-15 19:42:31 UTC (rev 44)
@@ -63,7 +63,7 @@
struct flow_t *parentFlow; // void* because we cannot ref below?
- long int nfmark;
+ unsigned long int nfmark;
long int curSize;
long int curLen;
@@ -91,7 +91,7 @@
// Shaping
struct flow_t *parent; // STATIC, not specified, determined - pointer to parent
int prio; // STATIC - Flow priority
- long int nfmark; // STATIC - nfmark value i must match auto to queues
+ unsigned long int nfmark; // STATIC - nfmark value i must match auto to queues
long int maxQueueSize; // STATIC - max length in bytes of queue
long int maxQueueLen; // STATIC - and/or length in items
long int maxRate; // STATIC - max rate in bytes per second
Modified: trunk/lib/xmlConf.c
===================================================================
--- trunk/lib/xmlConf.c 2005-01-13 19:52:32 UTC (rev 43)
+++ trunk/lib/xmlConf.c 2005-01-15 19:42:31 UTC (rev 44)
@@ -644,7 +644,7 @@
long int maxQueueLen,
long int maxRate,
long int burstRate,
- long int nfmark,
+ unsigned long int nfmark,
float parent_th,
int reportTimeout)
{
@@ -770,7 +770,7 @@
pktQueue->lock = g_mutex_new();
pktQueue->prio = i;
pktQueue->parentFlow = flow;
- pktQueue->nfmark = -1;
+ pktQueue->nfmark = 0;
pktQueue->curSize = 0;
pktQueue->curLen = 0;
pktQueue->maxSize = 0;
@@ -858,7 +858,7 @@
// Create a packet queue for the flow
static struct pktQueue_t *createPktQueue(
long int prio,
- long int nfmark,
+ unsigned long int nfmark,
struct flow_t *parentFlow)
{
struct pktQueue_t *pktQueue = parentFlow->pktQueues[prio];
@@ -926,7 +926,8 @@
if (ok)
{
char *p;
- long int statsLen, maxQueueSize, maxQueueLen, maxRate, burstRate, reportTimeout, nfmark;
+ long int statsLen, maxQueueSize, maxQueueLen, maxRate, burstRate, reportTimeout;
+ unsigned long int nfmark;
float parent_th;
@@ -954,7 +955,7 @@
}
p = g_hash_table_lookup(tagProperties,"nfmark");
- nfmark = p ? atol(p) : -1;
+ nfmark = p ? atoll(p) : 0;
p = g_hash_table_lookup(tagProperties,"burst-threshold");
parent_th = p ? atof(p) : -1;
@@ -1042,7 +1043,7 @@
if (ok)
{
long int prio;
- long int nfmark;
+ unsigned long int nfmark;
struct pktQueue_t *pktQueue;
@@ -1054,7 +1055,7 @@
ok = 0;
}
- nfmark = atol(queueNfmark);
+ nfmark = atoll(queueNfmark);
// fprintf(stderr," Flow queue: %li\n", nfmark);
|