Reincarnated GRD. Changed mesh decay to go to 1/N rather than 0.
[distributedratelimiting.git] / drl / ratetypes.h
index c88c931..59a481a 100644 (file)
@@ -41,6 +41,13 @@ typedef struct identity {
     /** Pointer to the identity's parent in the HTB hierarchy. */
     struct identity *parent;
 
+    /** Array of the leaves that are limited by this identity. Points into the
+     * leaves array for the identity's instance. */
+    struct leaf **leaves;
+
+    /** The number of leaves for which this identity is responsible. */
+    int leaf_count;
+
     /** The fixed (per second) EWMA weight. */
     double fixed_ewma_weight;
     
@@ -71,6 +78,8 @@ typedef struct identity {
     /** FPS previous weight value. */
     double last_localweight;
 
+    double total_weight;
+
     /** A flag to indicate whether or not the identity is in the flowstart
      * state.  During flowstart, the identity's limit is raised to allow for
      * flows to grow before incurring losses. */
@@ -79,10 +88,10 @@ typedef struct identity {
     /* GRD */
 
     /** GRD drop probability information. */
-    double localdropprob;
+    double drop_prob;
     
     /** GRD previous drop probability information. */
-    double last_localdropprob;
+    double last_drop_prob;
 
     /* Flow accounting machinery. */
 
@@ -139,6 +148,9 @@ typedef struct leaf {
     /** The leaf's parent in the hierarchy.  This is the identity to which this
      * leaf belongs. */
     identity_t *parent;
+
+    /** GRD: The leaf's packet drop probability. */
+    double drop_prob;
 } leaf_t;
 
 /**
@@ -194,7 +206,7 @@ typedef struct limiter {
     uint32_t nodelimit;
 
     /** The DRL policy (GRD, FPS) this node is using. */
-    enum policies policynum;
+    enum policies policy;
 
     /** The estimate interval (in milliseconds). */
     int estintms;