From a62508b8bee3bafa48a7604857ce29517058ee90 Mon Sep 17 00:00:00 2001 From: wollman Date: Mon, 6 May 1996 17:42:13 +0000 Subject: Add three new route flags to help determine what sort of address the destination represents. For IP: - Iff it is a host route, RTF_LOCAL and RTF_BROADCAST indicate local (belongs to this host) and broadcast addresses, respectively. - For all routes, RTF_MULTICAST is set if the destination is multicast. The RTF_BROADCAST flag is used by ip_output() to eliminate a call to in_broadcast() in a common case; this gives about 1% in our packet-generation experiments. All three flags might be used (although they aren't now) to determine whether a packet can be forwarded; a given host route can represent a forwardable address if: (rt->rt_flags & (RTF_HOST | RTF_LOCAL | RTF_BROADCAST | RTF_MULTICAST)) == RTF_HOST Obviously, one still has to do all the work if a host route is not present, but this code allows one to cache the results of such a lookup if rtalloc1() is called without masking RTF_PRCLONING. --- sys/net/route.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'sys/net/route.h') diff --git a/sys/net/route.h b/sys/net/route.h index e6e504a..fa1a1bb 100644 --- a/sys/net/route.h +++ b/sys/net/route.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)route.h 8.3 (Berkeley) 4/19/94 - * $Id: route.h,v 1.19 1995/12/14 09:53:28 phk Exp $ + * $Id: route.h,v 1.20 1996/01/30 22:58:00 mpp Exp $ */ #ifndef _NET_ROUTE_H_ @@ -154,7 +154,10 @@ struct ortentry { #define RTF_PROTO3 0x40000 /* protocol specific routing flag */ #define RTF_CHAINDELETE 0x80000 /* chain is being deleted (internal) */ #define RTF_PINNED 0x100000 /* future use */ - /* 0x200000 and up unassigned */ +#define RTF_LOCAL 0x200000 /* route represents a local address */ +#define RTF_BROADCAST 0x400000 /* route represents a bcast address */ +#define RTF_MULTICAST 0x800000 /* route represents a mcast address */ + /* 0x1000000 and up unassigned */ /* * Routing statistics. -- cgit v1.1