7 * Copyright (c) 2017, ETH Zurich.
10 * This file is distributed under the terms in the attached LICENSE file.
11 * If you do not find this file, copies can be found by writing to:
12 * ETH Zurich D-INFK, Universitaetsstrasse 6, CH-8092 Zurich. Attn: Systems Group.
16 #ifndef LIB_NET_INCLUDE_NETWORKING_INTERNAL_H_
17 #define LIB_NET_INCLUDE_NETWORKING_INTERNAL_H_
20 #include <barrelfish/barrelfish.h>
21 #include <barrelfish/deferred.h>
23 #include <devif/queue_interface.h>
24 #include <devif/backends/loopback_devif.h>
25 #include <devif/backends/net/sfn5122f_devif.h>
26 #include <devif/backends/net/e10k_devif.h>
27 #include <devif/backends/net/e1000_devif.h>
29 #include <lwip/netif.h>
31 #include <net/net_filter.h>
33 #include <net/netbufs.h>
34 #include <net/netif.h>
40 // enable benchmarking
41 #define BENCH_LWIP_STACK 0
42 #define BENCH_DEVQ_ENQUEUE 0
43 #define BENCH_DEVQ_DEQUEUE 0
44 #define BENCH_NUM_MEASUREMENTS_BITS 16
45 #define BENCH_NUM_MEASUREMENTS (1UL << BENCH_NUM_MEASUREMENTS_BITS)
47 #define NETBUF_DEBGUG 0
50 * @brief encapsulates the state of the networking library
58 /* DHCP timer events */
60 struct periodic_event dhcp_timer;
65 uint64_t arp_triggerid;
67 struct waitset *waitset;
70 struct net_buf_pool *pool;
72 struct net_filter_state* filter;
74 // ip4_addr_t ipaddr, netmask, gw;
77 extern struct net_state state;
79 static inline struct net_state *get_default_net_state(void)
89 struct pbuf_custom pbuf;
97 struct net_buf_region *region;
107 struct net_buf_region
110 struct frame_identity frame;
111 struct capref framecap;
112 struct net_buf_region *next;
114 uint8_t buffer_shift;
116 struct net_buf_pool *pool;
117 struct net_buf_p *netbufs; /// array of netbufs
122 struct net_buf_region *regions;
131 #endif /* LIB_NET_INCLUDE_NETWORKING_INTERNAL_H_ */