#ifndef _DN_TEST_H
#define _DN_TEST_H
#ifdef __cplusplus
extern "C" {
#endif
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <string.h>
#include <errno.h>
#include <sys/queue.h>
#include <sys/time.h>
extern int debug;
#define ND(fmt, args...) do {} while (0)
#define D1(fmt, args...) do {} while (0)
#define D(fmt, args...) fprintf(stderr, "%-10s %4d %-8s " fmt "\n", \
__FILE__, __LINE__, __FUNCTION__, ## args)
#define DX(lev, fmt, args...) do { \
if (debug > lev) D(fmt, ## args); } while (0)
#ifndef offsetof
#define offsetof(t,m) (int)(intptr_t)((&((t *)0L)->m))
#endif
#if defined(__APPLE__)
typedef unsigned int u_int;
#endif
#include <mylist.h>
#define _NETINET_IP_VAR_H_
#define _IPFW2_H
#define _SYS_MBUF_H_
enum {
DN_QUEUE,
};
enum {
DN_SCHED_FIFO,
DN_SCHED_WF2QP,
};
struct dn_id {
uint16_t len;
uint8_t type;
uint8_t subtype;
};
struct dn_fs {
int par[4];
int index;
int y;
int base_y;
int next_y;
int n_flows;
int first_flow;
int next_flow;
int cur;
};
struct dn_sch {
};
struct dn_flow {
struct dn_id oid;
uint64_t tot_pkts;
uint64_t tot_bytes;
uint32_t length;
uint32_t len_bytes;
uint32_t drops;
struct list_head h;
uint64_t bytes;
uint64_t sch_bytes;
};
struct dn_link {
};
struct ip_fw_args {
};
struct mbuf {
struct {
int len;
} m_pkthdr;
struct mbuf *m_nextpkt;
uint32_t flow_id;
};
#define MALLOC_DECLARE(x) extern volatile int __dummy__ ## x
#define KASSERT(x, y) do { if (!(x)) printf y ; exit(0); } while (0)
struct ipfw_flow_id {
};
typedef void * module_t;
struct _md_t {
const char *name;
int (*f)(module_t, int, void *);
void *p;
};
typedef struct _md_t moduledata_t;
#define DECLARE_MODULE(name, b, c, d) \
moduledata_t *_g_##name = & b
#define MODULE_DEPEND(a, b, c, d, e)
#include <dn_heap.h>
#include <ip_dn_private.h>
#include <dn_sched.h>
#ifndef __FreeBSD__
int fls(int);
#endif
static inline void
mq_append(struct mq *q, struct mbuf *m)
{
if (q->head == NULL)
q->head = m;
else
q->tail->m_nextpkt = m;
q->tail = m;
m->m_nextpkt = NULL;
}
#ifdef __cplusplus
}
#endif
#endif