X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=netlink.h;h=9f46fa8807a5951160e4b9f661250096369eece4;hb=794f2398b8fe84bf398bb10d6eeca6fe6737f65f;hp=f1144441fb094623781435889d709c5d9f2c5a4d;hpb=3454dce4c6909648b711a59b57c5a527036b2a8e;p=secnet.git diff --git a/netlink.h b/netlink.h index f114444..9f46fa8 100644 --- a/netlink.h +++ b/netlink.h @@ -1,12 +1,20 @@ #ifndef netlink_h #define netlink_h +#include "ipaddr.h" + #define DEFAULT_BUFSIZE 2048 #define DEFAULT_MTU 1000 #define ICMP_BUFSIZE 1024 +struct netlink; + struct netlink_client { - struct subnet_list *networks; + closure_t cl; + struct netlink_if ops; + struct netlink *nst; + struct ipset *networks; + struct subnet_list *subnets; /* Same information as 'networks' */ netlink_deliver_fn *deliver; void *dst; string_t name; @@ -21,6 +29,8 @@ struct netlink_route { bool_t allow_route; bool_t up; bool_t kup; + uint32_t quality; /* provided by client */ + uint32_t outcount; struct netlink_client *c; }; @@ -32,15 +42,16 @@ typedef bool_t netlink_route_fn(void *cst, struct netlink_route *route); struct netlink { closure_t cl; - struct netlink_if ops; void *dst; /* Pointer to host interface state */ string_t name; uint32_t max_start_pad; uint32_t max_end_pad; - struct subnet_list networks; - struct subnet_list exclude_remote_networks; - uint32_t local_address; /* host interface address */ - uint32_t secnet_address; /* our own address */ + struct ipset *networks; /* Local networks */ + struct subnet_list *subnets; /* Same information as networks */ + struct ipset *remote_networks; /* Allowable remote networks */ + uint32_t secnet_address; /* our own address, or the address of the + other end of a point-to-point link */ + bool_t ptp; uint32_t mtu; struct netlink_client *clients; netlink_deliver_fn *deliver_to_host; /* Provided by driver */ @@ -48,6 +59,8 @@ struct netlink { struct buffer_if icmp; /* Buffer for assembly of outgoing ICMP */ uint32_t n_routes; /* How many routes do we know about? */ struct netlink_route *routes; + uint32_t outcount; /* Packets sent to host */ + uint32_t localcount; /* Packets sent to secnet */ }; extern netlink_deliver_fn *netlink_init(struct netlink *st,