chiark / gitweb /
NEW etc.: Use NEW in all obvious places
[secnet.git] / netlink.h
index a54ec012280f0324c375dd743aa77055b0cc3b76..b24c6ef241837ecda08f36cbc3473d6b6fa314d5 100644 (file)
--- a/netlink.h
+++ b/netlink.h
@@ -23,7 +23,7 @@ struct netlink_client {
     void *dst;
     string_t name;
     uint32_t link_quality;
-    uint32_t mtu;
+    int32_t mtu;
     uint32_t options;
     uint32_t outcount;
     bool_t up; /* Should these routes exist in the kernel? */
@@ -31,6 +31,10 @@ struct netlink_client {
     struct netlink_client *next;
 };
 
+/* options field in 'struct netlink_client' */
+#define OPT_SOFTROUTE   1
+#define OPT_ALLOWROUTE  2
+
 typedef bool_t netlink_route_fn(void *cst, struct netlink_client *routes);
 
 /* Netlink provides one function to the device driver, to call to deliver
@@ -40,19 +44,18 @@ typedef bool_t netlink_route_fn(void *cst, struct netlink_client *routes);
 struct netlink {
     closure_t cl;
     void *dst; /* Pointer to host interface state */
-    string_t name;
-    uint32_t max_start_pad;
-    uint32_t max_end_pad;
+    cstring_t name;
     struct ipset *networks; /* Local networks */
     struct subnet_list *subnets; /* Same as networks, for display */
     struct ipset *remote_networks; /* Allowable remote networks */
+    uint32_t local_address; /* host interface address */
     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;
+    int32_t mtu;
     struct netlink_client *clients; /* Linked list of clients */
     struct netlink_client **routes; /* Array of clients, sorted by priority */
-    uint32_t n_clients;
+    int32_t n_clients;
     netlink_deliver_fn *deliver_to_host; /* Provided by driver */
     netlink_route_fn *set_routes; /* Provided by driver */
     struct buffer_if icmp; /* Buffer for assembly of outgoing ICMP */
@@ -62,7 +65,7 @@ struct netlink {
 
 extern netlink_deliver_fn *netlink_init(struct netlink *st,
                                        void *dst, struct cloc loc,
-                                       dict_t *dict, string_t description,
+                                       dict_t *dict, cstring_t description,
                                        netlink_route_fn *set_routes,
                                        netlink_deliver_fn *to_host);