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>
38 #include <if/net_ARP_defs.h>
42 // enable benchmarking
43 #define BENCH_LWIP_STACK 0
44 #define BENCH_DEVQ_ENQUEUE 0
45 #define BENCH_DEVQ_DEQUEUE 0
46 #define BENCH_NUM_MEASUREMENTS_BITS 16
47 #define BENCH_NUM_MEASUREMENTS (1UL << BENCH_NUM_MEASUREMENTS_BITS)
49 #define NETBUF_DEBGUG 0
52 * @brief encapsulates the state of the networking library
60 /* DHCP timer events */
62 struct periodic_event dhcp_timer;
68 uint64_t arp_triggerid;
69 struct net_ARP_binding* arp;
71 struct waitset *waitset;
74 struct net_buf_pool *pool;
76 struct net_filter_state* filter;
78 // ip4_addr_t ipaddr, netmask, gw;
81 extern struct net_state state;
83 static inline struct net_state *get_default_net_state(void)
93 struct pbuf_custom pbuf;
101 struct net_buf_region *region;
111 struct net_buf_region
114 struct frame_identity frame;
115 struct capref framecap;
116 struct net_buf_region *next;
118 uint8_t buffer_shift;
120 struct net_buf_pool *pool;
121 struct net_buf_p *netbufs; /// array of netbufs
126 struct net_buf_region *regions;
135 #endif /* LIB_NET_INCLUDE_NETWORKING_INTERNAL_H_ */