|
DataMuseum.dkPresents historical artifacts from the history of: Regnecentalen RC-900 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Regnecentalen RC-900 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 3222 (0xc96) Types: TextFile Notes: UNIX file Names: »route.h«
└─⟦8c4f54e61⟧ Bits:30004068/disk2.imd Interactive TCP/IP v.1.2 └─⟦8c4f54e61⟧ UNIX Filesystem └─⟦this⟧ »hb/new/usr/include/net/route.h«
/* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * * @(#)route.h 5.4 - 87/07/16 * * Portions of this software copyrighted as an unpublished work. * (c) Copyright 1988 INTERACTIVE Systems Corporation * All rights reserved. * * RESTRICTED RIGHTS: * * These programs are supplied under a license. They may be used, * disclosed, and/or copied only as permitted under such license * agreement. Any copy must contain the above copyright notice and * this restricted rights notice. Use, copying, and/or disclosure * of the programs is strictly prohibited unless otherwise provided * in the license agreement. */ #ifndef _h_ROUTE #define _h_ROUTE #ident "@(#)route.h 2.1 - 89/04/21" /* * Kernel resident routing tables. * * The routing tables are initialized when interface addresses * are set by making entries for all directly connected interfaces. */ /* * A route consists of a destination address and a reference * to a routing entry. These are often held by protocols * in their control blocks, e.g. inpcb. */ struct route { struct rtentry *ro_rt; struct sockaddr ro_dst; }; /* * We distinguish between routes to hosts and routes to networks, * preferring the former if available. For each route we infer * the interface to use from the gateway address supplied when * the route was entered. Routes that forward packets through * gateways are marked so that the output routines know to address the * gateway rather than the ultimate destination. */ struct rtentry { u_long rt_hash; /* to speed lookups */ struct sockaddr rt_dst; /* key */ struct sockaddr rt_gateway; /* value */ short rt_flags; /* up/down?, host/net */ short rt_refcnt; /* # held references */ u_long rt_use; /* raw # packets forwarded */ mblk_t *rt_mblk; /* self reference mblk_t for rt */ struct ifnet *rt_ifp; /* the answer: interface to use */ }; #define RTF_UP 0x1 /* route useable */ #define RTF_GATEWAY 0x2 /* destination is a gateway */ #define RTF_HOST 0x4 /* host entry (net otherwise) */ #define RTF_DYNAMIC 0x10 /* created dynamically (by redirect) */ #define RTF_MODIFIED 0x20 /* modified dynamically (by redirect) */ /* * Routing statistics. */ struct rtstat { short rts_badredirect; /* bogus redirect calls */ short rts_dynamic; /* routes created by redirects */ short rts_newgateway; /* routes modified by redirects */ short rts_unreach; /* lookups which failed */ short rts_wildcard; /* lookups satisfied by a wildcard */ }; #ifdef KERNEL #define RTFREE(rt) \ if ((rt)->rt_refcnt == 1) \ rtfree(rt); \ else \ (rt)->rt_refcnt--; #ifdef GATEWAY #define RTHASHSIZ 64 #else #define RTHASHSIZ 8 #endif #if (RTHASHSIZ & (RTHASHSIZ - 1)) == 0 #define RTHASHMOD(h) ((h) & (RTHASHSIZ - 1)) #else #define RTHASHMOD(h) ((h) % RTHASHSIZ) #endif #ifdef INKERNEL extern mblk_t *rthost[]; extern mblk_t *rtnet[]; extern struct rtstat rtstat; #else mblk_t *rthost[RTHASHSIZ]; mblk_t *rtnet[RTHASHSIZ]; struct rtstat rtstat; #endif #endif #endif /* _h_ROUTE */