4 * library functions for userland testing of dummynet schedulers
10 m_freem(struct mbuf *m)
12 printf("free %p\n", m);
16 dn_sched_modevent(module_t mod, int cmd, void *arg)
25 dn_free_pkts(struct mbuf *m)
35 dn_delete_queue(void *_q, void *do_free)
37 struct dn_queue *q = _q;
41 dn_free_pkts(q->mq.head);
47 * This is a simplified function for testing purposes, which does
48 * not implement statistics or random loss.
49 * Enqueue a packet in q, subject to space and queue management policy
50 * (whose parameters are in q->fs).
51 * Update stats for the queue and the scheduler.
52 * Return 0 on success, 1 on drop. The packet is consumed anyways.
55 dn_enqueue(struct dn_queue *q, struct mbuf* m, int drop)
59 if (q->ni.length >= 200)
63 q->ni.tot_bytes += m->m_pkthdr.len;
73 ipdn_bound_var(int *v, int dflt, int lo, int hi, const char *msg)
92 for (bit = 1; mask != 1; bit++)
93 mask = (unsigned int)mask >> 1;