6 #define DEFAULT_BUFSIZE 2048
7 #define DEFAULT_MTU 1000
8 #define ICMP_BUFSIZE 1024
12 struct netlink_client
{
14 struct netlink_if ops
;
16 struct ipset
*networks
;
17 struct subnet_list
*subnets
; /* Same information as 'networks' */
18 uint32_t priority
; /* Higher priority clients have their networks
19 checked first during routing. This allows
20 things like laptops to supersede whole
22 netlink_deliver_fn
*deliver
;
25 uint32_t link_quality
;
29 bool_t up
; /* Should these routes exist in the kernel? */
30 bool_t kup
; /* Do these routes exist in the kernel? */
31 struct netlink_client
*next
;
34 /* options field in 'struct netlink_client' */
35 #define OPT_SOFTROUTE 1
36 #define OPT_ALLOWROUTE 2
38 typedef bool_t
netlink_route_fn(void *cst
, struct netlink_client
*routes
);
40 /* Netlink provides one function to the device driver, to call to deliver
41 a packet from the device. The device driver provides one function to
42 netlink, for it to call to deliver a packet to the device. */
46 void *dst
; /* Pointer to host interface state */
48 int32_t max_start_pad
;
49 struct ipset
*networks
; /* Local networks */
50 struct subnet_list
*subnets
; /* Same as networks, for display */
51 struct ipset
*remote_networks
; /* Allowable remote networks */
52 uint32_t secnet_address
; /* our own address, or the address of the
53 other end of a point-to-point link */
56 struct netlink_client
*clients
; /* Linked list of clients */
57 struct netlink_client
**routes
; /* Array of clients, sorted by priority */
59 netlink_deliver_fn
*deliver_to_host
; /* Provided by driver */
60 netlink_route_fn
*set_routes
; /* Provided by driver */
61 struct buffer_if icmp
; /* Buffer for assembly of outgoing ICMP */
62 uint32_t outcount
; /* Packets sent to host */
63 uint32_t localcount
; /* Packets sent to secnet */
66 extern netlink_deliver_fn
*netlink_init(struct netlink
*st
,
67 void *dst
, struct cloc loc
,
68 dict_t
*dict
, cstring_t description
,
69 netlink_route_fn
*set_routes
,
70 netlink_deliver_fn
*to_host
);
72 #endif /* netlink_h */