summaryrefslogtreecommitdiff
path: root/sys/net/route.h
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2013-10-31 18:10:22 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2013-10-31 18:10:22 +0000
commit2d3d35a0136aa1d3a7276be1a3b4b616229a9263 (patch)
treed0304c95bc4797e36d92e6345b28b52683689ccc /sys/net/route.h
parent983f52fc2855629253e17f9d97d7f7a5883e8073 (diff)
Convert the route expire timestamp in kernel and routing message
to 64 bit. Increase the routing message version from 4 to 5. Add a small compatibility layer that allows to set routes with old user land and new kernel. Old kernel with new user land does not work. The compatibility layer ist not perfect, but it allows to configure addresses with old ifconfig and new kernel. Route get also works in this setup. dhclient hangs as messages for interface address changes with old version are not generated. OK claudio@
Diffstat (limited to 'sys/net/route.h')
-rw-r--r--sys/net/route.h50
1 files changed, 45 insertions, 5 deletions
diff --git a/sys/net/route.h b/sys/net/route.h
index be189441e14..f096c9fcf1c 100644
--- a/sys/net/route.h
+++ b/sys/net/route.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.h,v 1.82 2013/10/24 18:50:16 deraadt Exp $ */
+/* $OpenBSD: route.h,v 1.83 2013/10/31 18:10:21 bluhm Exp $ */
/* $NetBSD: route.h,v 1.9 1996/02/13 22:00:49 christos Exp $ */
/*
@@ -48,10 +48,9 @@
*/
struct rt_kmetrics {
u_int64_t rmx_pksent; /* packets sent using this route */
+ int64_t rmx_expire; /* lifetime for route, e.g. redirect */
u_int rmx_locks; /* Kernel must leave these values */
u_int rmx_mtu; /* MTU for this path */
- u_int rmx_expire; /* lifetime for route, e.g. redirect */
- u_int rmx_pad;
};
/*
@@ -59,9 +58,9 @@ struct rt_kmetrics {
*/
struct rt_metrics {
u_int64_t rmx_pksent; /* packets sent using this route */
+ int64_t rmx_expire; /* lifetime for route, e.g. redirect */
u_int rmx_locks; /* Kernel must leave these values */
u_int rmx_mtu; /* MTU for this path */
- u_int rmx_expire; /* lifetime for route, e.g. redirect */
u_int rmx_refcnt; /* # references hold */
/* some apps may still need these no longer used metrics */
u_int rmx_hopcount; /* max hops expected */
@@ -70,6 +69,7 @@ struct rt_metrics {
u_int rmx_ssthresh; /* outbound gateway buffer limit */
u_int rmx_rtt; /* estimated round trip time */
u_int rmx_rttvar; /* estimated rtt variance */
+ u_int rmx_pad;
};
/*
@@ -207,7 +207,47 @@ struct rt_msghdr {
/* overload no longer used field */
#define rtm_use rtm_rmx.rmx_pksent
-#define RTM_VERSION 4 /* Up the ante and ignore older versions */
+#if defined(_KERNEL) && ! defined(SMALL_KERNEL)
+/*
+ * Compatibility structures for version 4 messages.
+ * Only needed for transition during OpenBSD 5.4-current.
+ */
+struct rt_ometrics {
+ u_int64_t rmx_pksent; /* packets sent using this route */
+ u_int rmx_locks; /* Kernel must leave these values */
+ u_int rmx_mtu; /* MTU for this path */
+ u_int rmx_expire; /* lifetime for route, e.g. redirect */
+ u_int rmx_refcnt; /* # references hold */
+ /* some apps may still need these no longer used metrics */
+ u_int rmx_hopcount; /* max hops expected */
+ u_int rmx_recvpipe; /* inbound delay-bandwidth product */
+ u_int rmx_sendpipe; /* outbound delay-bandwidth product */
+ u_int rmx_ssthresh; /* outbound gateway buffer limit */
+ u_int rmx_rtt; /* estimated round trip time */
+ u_int rmx_rttvar; /* estimated rtt variance */
+};
+struct rt_omsghdr {
+ u_short rtm_msglen; /* to skip over non-understood messages */
+ u_char rtm_version; /* future binary compatibility */
+ u_char rtm_type; /* message type */
+ u_short rtm_hdrlen; /* sizeof(rt_msghdr) to skip over the header */
+ u_short rtm_index; /* index for associated ifp */
+ u_short rtm_tableid; /* routing table id */
+ u_char rtm_priority; /* routing priority */
+ u_char rtm_mpls; /* MPLS additional infos */
+ int rtm_addrs; /* bitmask identifying sockaddrs in msg */
+ int rtm_flags; /* flags, incl. kern & message, e.g. DONE */
+ int rtm_fmask; /* bitmask used in RTM_CHANGE message */
+ pid_t rtm_pid; /* identify sender */
+ int rtm_seq; /* for sender to identify action */
+ int rtm_errno; /* why failed */
+ u_int rtm_inits; /* which metrics we are initializing */
+ struct rt_ometrics rtm_rmx; /* metrics themselves */
+};
+#define RTM_OVERSION 4 /* Provide backward compatibility */
+#endif /* defined(_KERNEL) && ! defined(SMALL_KERNEL) */
+
+#define RTM_VERSION 5 /* Up the ante and ignore older versions */
#define RTM_MAXSIZE 2048 /* Maximum size of an accepted route msg */