-#define SCALE_MUL(x,y) ( ( (x) * (y) ) >> SCALE_RED )
- int w_q ; /* queue weight (scaled) */
- int max_th ; /* maximum threshold for queue (scaled) */
- int min_th ; /* minimum threshold for queue (scaled) */
- int max_p ; /* maximum value for p_b (scaled) */
- u_int c_1 ; /* max_p/(max_th-min_th) (scaled) */
- u_int c_2 ; /* max_p*min_th/(max_th-min_th) (scaled) */
- u_int c_3 ; /* for GRED, (1-max_p)/max_th (scaled) */
- u_int c_4 ; /* for GRED, 1 - 2*max_p (scaled) */
- user64_addr_t w_q_lookup ; /* lookup table for computing (1-w_q)^t */
- u_int lookup_depth ; /* depth of lookup table */
- int lookup_step ; /* granularity inside the lookup table */
- int lookup_weight ; /* equal to (1-w_q)^t / (1-w_q)^(t+1) */
- int avg_pkt_size ; /* medium packet size */
- int max_pkt_size ; /* max packet size */
-} ;
-
-struct dn_pipe_64 { /* a pipe */
- user64_addr_t next ;
-
- int pipe_nr ; /* number */
- int bandwidth; /* really, bytes/tick. */
- int delay ; /* really, ticks */
-
- user64_addr_t head, tail ; /* packets in delay line */
-
- /* WF2Q+ */
- struct dn_heap_64 scheduler_heap ; /* top extract - key Finish time*/
- struct dn_heap_64 not_eligible_heap; /* top extract- key Start time */
- struct dn_heap_64 idle_heap ; /* random extract - key Start=Finish time */
-
- dn_key V ; /* virtual time */
- int sum; /* sum of weights of all active sessions */
- int numbytes; /* bits I can transmit (more or less). */
-
- dn_key sched_time ; /* time pipe was scheduled in ready_heap */
-
- /*
- * When the tx clock come from an interface (if_name[0] != '\0'), its name
- * is stored below, whereas the ifp is filled when the rule is configured.
- */
- char if_name[IFNAMSIZ];
- user64_addr_t ifp ;
- int ready ; /* set if ifp != NULL and we got a signal from it */
-
- struct dn_flow_set_64 fs ; /* used with fixed-rate flows */
+#define SCALE_MUL(x, y) ( ( (x) * (y) ) >> SCALE_RED )
+ int w_q; /* queue weight (scaled) */
+ int max_th; /* maximum threshold for queue (scaled) */
+ int min_th; /* minimum threshold for queue (scaled) */
+ int max_p; /* maximum value for p_b (scaled) */
+ u_int c_1; /* max_p/(max_th-min_th) (scaled) */
+ u_int c_2; /* max_p*min_th/(max_th-min_th) (scaled) */
+ u_int c_3; /* for GRED, (1-max_p)/max_th (scaled) */
+ u_int c_4; /* for GRED, 1 - 2*max_p (scaled) */
+ user64_addr_t w_q_lookup; /* lookup table for computing (1-w_q)^t */
+ u_int lookup_depth; /* depth of lookup table */
+ int lookup_step; /* granularity inside the lookup table */
+ int lookup_weight; /* equal to (1-w_q)^t / (1-w_q)^(t+1) */
+ int avg_pkt_size; /* medium packet size */
+ int max_pkt_size; /* max packet size */
+};
+
+struct dn_pipe_64 { /* a pipe */
+ user64_addr_t next;
+
+ int pipe_nr; /* number */
+ int bandwidth; /* really, bytes/tick. */
+ int delay; /* really, ticks */
+
+ user64_addr_t head, tail; /* packets in delay line */
+
+ /* WF2Q+ */
+ struct dn_heap_64 scheduler_heap; /* top extract - key Finish time*/
+ struct dn_heap_64 not_eligible_heap; /* top extract- key Start time */
+ struct dn_heap_64 idle_heap; /* random extract - key Start=Finish time */
+
+ dn_key V; /* virtual time */
+ int sum; /* sum of weights of all active sessions */
+ int numbytes; /* bits I can transmit (more or less). */
+
+ dn_key sched_time; /* time pipe was scheduled in ready_heap */
+
+ /*
+ * When the tx clock come from an interface (if_name[0] != '\0'), its name
+ * is stored below, whereas the ifp is filled when the rule is configured.
+ */
+ char if_name[IFNAMSIZ];
+ user64_addr_t ifp;
+ int ready; /* set if ifp != NULL and we got a signal from it */
+
+ struct dn_flow_set_64 fs; /* used with fixed-rate flows */
+};
+
+#include <sys/eventhandler.h>
+/* Dummynet event handling declarations */
+extern struct eventhandler_lists_ctxt dummynet_evhdlr_ctxt;
+extern void dummynet_init(void);
+
+struct dn_pipe_mini_config {
+ uint32_t bandwidth;
+ uint32_t delay;
+ uint32_t plr;
+};
+
+struct dn_rule_mini_config {
+ uint32_t dir;
+ uint32_t af;
+ uint32_t proto;
+ /*
+ * XXX PF rules actually define ranges of ports and
+ * along with range goes an opcode ((not) equal to, less than
+ * greater than, etc.
+ * For now the following works assuming there's no port range
+ * and the rule is for specific port.
+ * Also the operation is assumed as equal to.
+ */
+ uint32_t src_port;
+ uint32_t dst_port;
+ char ifname[IFXNAMSIZ];