📄 iprtypes.h
字号:
/** Copyright (c) 1998-2001 by NETsilicon Inc.** This software is copyrighted by and is the sole property of* NETsilicon. All rights, title, ownership, or other interests* in the software remain the property of NETsilicon. This* software may only be used in accordance with the corresponding* license agreement. Any unauthorized use, duplication, transmission,* distribution, or disclosure of this software is expressly forbidden.** This Copyright notice may not be removed or modified without prior* written consent of NETsilicon.** NETsilicon, reserves the right to modify this software* without notice.** NETsilicon* 411 Waverley Oaks Road USA 781.647.1234* Suite 227 http://www.netsilicon.com* Waltham, MA 02452 AmericaSales@netsilicon.com*************************************************************************** $Name: Fusion 6.52 Fusion 6.51 $* $Date: 2001/09/24 11:25:36 $* $Source: M:/psisrc/routing/incl/rcs/iprtypes.h $* $Revision: 1.6 $************************************************************************** File Description: Definitions for IP forwarding database *************************************************************************//* metric types */#define IPRT_INT 1 /*internal*/#define IPRT_EXT 2 /*external*//* route preference. old style hard coded, also used for softcoded initialization. Note: we must try to obey the maxim "never leak up" when redistributing routes from one domain into another. This prevents routing loops. Of course, user modified preference could mess this up, but that is user's concern. A first look, below preference would seem to be violated leaking ospf/etc routes into bgp. But this is not a problem since bgp is path vector and bgp wont use any routes leaked into bgp by the local domain.*/#define IPRT_PREF_LOCAL 10#define IPRT_PREF_STATIC 9#define IPRT_PREF_BGP 8#define IPRT_PREF_OSPF_INTRA 7#define IPRT_PREF_OSPF_INTER 6#define IPRT_PREF_OSPF_EXT 4#define IPRT_PREF_RIP 4#define IPRT_PREF_STATICLOW 4#define IPRT_PREF_ISIS 4/* owner of route (who put it in table), values with "X" denote dummies used for prefercne calc only*/#define IPRT_ISIS 1#define IPRT_RIP 2#define IPRT_OSPF 3#define IPRT_STATIC 4#define IPRT_LOCAL 5#define IPRT_BGP 6#define IPRT_STATICLOW 7#define XIPRT_OSPF_INTER 8#define XIPRT_OSPF_EXT 9#define IPRT_MAXTYPE 9/* must be same order as above */#define IPRT_DEF_PREF { \0, \IPRT_PREF_ISIS, \IPRT_PREF_RIP, \IPRT_PREF_OSPF_INTRA, \IPRT_PREF_STATIC, \IPRT_PREF_LOCAL, \IPRT_PREF_BGP, \IPRT_PREF_STATICLOW, \IPRT_PREF_OSPF_INTER, \IPRT_PREF_OSPF_EXT \}#define RTIP_PREF(xpref,xown,xlvl) { \ int xindex; \ if(xown != IPRT_OSPF || (xlvl == 1)){ \ xindex = xown; \ } \ else{ \ xindex = IPRT_STATICLOW + xlvl -1; \ } \ xpref = i_node->rn_rtprefs[xindex]; \}/* same as above, but doesnt complain about code unreachable,not usable by ospf*/#define RTIP_NLPREF(xpref,xown) { \ int xindex; \ xindex = xown; \ xpref = i_node->rn_rtprefs[xindex]; \}/* cross protocol tags defined by rfc 1745 *//* igp originates, admin says its ext rt */#define RTTAG_NCMP_0 0x80000000/* egp originates into ospf or bgp learns rt with org = egp and rt has no transitive attributes */#define RTTAG_NCMP_1 0x90000000/* bgp learns, exports to stub ospf domain */#define RTTAG_NCMP_2 0xa0000000/* igp (eg rip) imports to ospf */#define RTTAG_CMP_0 0xc0000000/* bgp learns from 1 as hop away, if admin chooses this method*/#define RTTAG_CMP_1 0xd0000000/* general case bgp learns */#define RTTAG_CMP_2 0xe0000000/* tag type field */#define RTTAG_TYPE 0xf0000000/* as num tag field */#define RTTAG_AS 0x0000ffff/* arbitrary tag field */#define RTTAG_ARB 0x0fff0000/* Error codes for API functions. Not directly using Fusion error codes to allow the code to be used for non-Fusion platforms without too much grief.*/#define RR_ERR -1 /* Returned from API calls */#define RR_NOERR 0 /* Returned for no error *//* Error codes go into the errp argument */#define RR_ERR_INVAL 0x80#define RR_ERR_ALREADY 0x81
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -