[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ns] [Patch] Hash Classifier



Hi!

In order to derive new classifiers from the hash classifier, the
following patch has to be applied. IMO, it makes sense to apply this
patch to the base ns distribution (even without classes being derived
from it) since you cannot include the classifier-hash.h file somewhere
else except as it is now in classifier-hash.cc due to the missing
'#ifdef hash_classifier_h_'.


Regards,

/J"org
----
J"org Diederich
Institute of Operating Systems and Computer Networks, 
Technical University Braunschweig, Germany
Email: [email protected]


diff -ur ns-2.1b7-current.orig/classifier-hash.cc ns-2.1b7-current/classifier-hash.cc
--- ns-2.1b7-current.orig/classifier-hash.cc	Fri Oct  1 01:09:24 1999
+++ ns-2.1b7-current/classifier-hash.cc	Fri Oct  6 15:52:51 2000
@@ -51,9 +51,6 @@
 
 #include <stdlib.h>
 #include "config.h"
-#include "packet.h"
-#include "ip.h"
-#include "classifier.h"
 #include "classifier-hash.h"
 
 
diff -ur ns-2.1b7-current.orig/classifier-hash.h ns-2.1b7-current/classifier-hash.h
--- ns-2.1b7-current.orig/classifier-hash.h	Fri Oct  1 01:09:25 1999
+++ ns-2.1b7-current/classifier-hash.h	Fri Oct  6 15:52:53 2000
@@ -32,6 +32,14 @@
  * SUCH DAMAGE.
  */
 
+#ifndef _hash_classifier_h_
+#define _hash_classifier_h_
+
+#include "classifier.h"
+#include "packet.h"
+#include "ip.h"
+
+
 /* class defs for HashClassifier (base), SrcDest, SrcDestFid HashClassifiers */
 class HashClassifier : public Classifier {
 public:
@@ -164,4 +172,4 @@
 		return (const char*) mshift(dst);
 	}
 };
-
+#endif