4 #define DEFAULT_BUFSIZE 2048
5 #define DEFAULT_MTU 1000
6 #define ICMP_BUFSIZE 1024
8 struct netlink_client {
9 struct subnet_list *networks;
10 netlink_deliver_fn *deliver;
13 uint32_t link_quality;
15 struct netlink_client *next;
18 struct netlink_route {
24 struct netlink_client *c;
27 typedef bool_t netlink_route_fn(void *cst, struct netlink_route *route);
29 /* Netlink provides one function to the device driver, to call to deliver
30 a packet from the device. The device driver provides one function to
31 netlink, for it to call to deliver a packet to the device. */
35 struct netlink_if ops;
36 void *dst; /* Pointer to host interface state */
38 uint32_t max_start_pad;
40 struct subnet_list networks;
41 struct subnet_list exclude_remote_networks;
42 uint32_t local_address; /* host interface address */
43 uint32_t secnet_address; /* our own address */
45 struct netlink_client *clients;
46 netlink_deliver_fn *deliver_to_host; /* Provided by driver */
47 netlink_route_fn *set_route; /* Provided by driver */
48 struct buffer_if icmp; /* Buffer for assembly of outgoing ICMP */
49 uint32_t n_routes; /* How many routes do we know about? */
50 struct netlink_route *routes;
53 extern netlink_deliver_fn *netlink_init(struct netlink *st,
54 void *dst, struct cloc loc,
55 dict_t *dict, string_t description,
56 netlink_route_fn *set_route,
57 netlink_deliver_fn *to_host);
59 #endif /* netlink_h */