diff options
author | wollman <wollman@FreeBSD.org> | 1996-05-06 17:42:13 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 1996-05-06 17:42:13 +0000 |
commit | a62508b8bee3bafa48a7604857ce29517058ee90 (patch) | |
tree | 8093bc9089a487f8a96db12b540bd49c5f390c9d /sys/net/route.h | |
parent | 05b36227ad904ca4a0a741f9386b23c4a18e9f94 (diff) | |
download | FreeBSD-src-a62508b8bee3bafa48a7604857ce29517058ee90.zip FreeBSD-src-a62508b8bee3bafa48a7604857ce29517058ee90.tar.gz |
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.
Diffstat (limited to 'sys/net/route.h')
-rw-r--r-- | sys/net/route.h | 7 |
1 files changed, 5 insertions, 2 deletions
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. |