📄 fnsospf.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: 2002/01/10 14:03:04 $* $Source: M:/psisrc/routing/incl/rcs/fnsospf.h $* $Revision: 1.19 $*************************************************************************** File Description: OSPF Fusion User API functions. * (DO NOT USE ospf_api.h).***************************************************************************/#include "fnsproto.h"#include "std.h"#include "netdev.h"#include "nerrno.h"#include "ospf.h"#include "fnsrr.h"#include "os_const.h"/* OSPF API data structures */#define OSPF_ACTION_GET 0#define OSPF_ACTION_SET 1#define OSPF_ACTION_CREATE 2#define OSPF_ACTION_DELETE 3#define OSPF_ADMIN_ENABLE 1#define OSPF_ADMIN_DISABLE 2typedef struct _ospf_global_cfg { u8 action; /* OSPF_ACTION_GET/SET */ u8 admin_state; /* OSPF_ADMIN_ENABLE/DISABLE */ u32 router_id; /* Router ID - not set if admin state is DISABLE */ u8 rfc1583_compat; /* Boolean - non-zero ==> run in RFC 1583 compatability mode, not set if admin_state is DISABLE */ u8 as_boundary_router; /* Boolean - non-zero ==> this router is an AS boundary router. */ u8 opaque_option; /* Boolean - non-zero ==>we support flooding opaque LSAs, and advertise the option. zero we don't. */} ospf_global_cfg, *ospf_global_cfg_ptr;/* Same as SNMP */#define OSPF_AREA_NORM AREA_NORM#define OSPF_AREA_STUB AREA_STUB#define OSPF_AREA_NSSA AREA_NSSAtypedef struct _ospf_area_cfg { u8 action; /* OSPF_ACTION_GET/SET/CREATE/DELETE */ u32 area_id; u8 area_type; /* One of OSPF_NORMAL_AREA, OSPF_NSAA_AREA (not-so-stubby area), or OSPF_STUB_AREA */ u8 nssa_translate; /* If true(!=0) and area is NSSA and router is border router then type 7 routes will be translated into type 5 routes for advertisement into the AS. Ignored if area is not an NSSA */ u8 stub_def_type; /* If area is NSSA specifies whether !default! route advertised into area is External Type 1 or External Type 2. Must be set to one of EXT_TYPE_1 or EXT_TYPE_2. Not meaningful for non-NSSA areas. */ u16 stub_def_cost; /* Cost of default summary LSA advertised into stub area or NSSA if the router is an area border router. Not meaningful for normal areas. */ u8 no_summaries; /* If false (0) then if the router is an area border router for a stub area it will originate/propagate type 3 summary LSAs into the area. If false (0) then it will neither originate nor propagate summary LSAs into the stub areas. */ } ospf_area_cfg, *ospf_area_cfg_ptr;/* Range configuration - */typedef struct _ospf_range_{ u32 addr; u32 mask; u8 advertise; /* Boolean - 0 means don't advertise, != 0 means advertise */ int status; /* Set to an error code if error occurs for the range during creation, otherwise set to OSPFERR_NO_ERR. For a create operation with multiple ranges some could work and some could fail. */}ospf_range, *ospf_range_ptr;typedef struct _ospf_range_cfg { u8 action; /* OSPF_ACTION_CREATE/DELETE/GET, SET NOT SUPPORTED) */ u32 area_id; /* Must apply to a previously created area */ u8 listlen; /* Number of ranges in list */ ospf_range *rlist; /* The list of ranges - must be listlen entries */}ospf_range_cfg, *ospf_range_cfg_ptr;#define OSPF_IF_ADMIN_OFF 0#define OSPF_IF_ADMIN_ON 1#define OSPF_MAX_AUTH_LEN 16 /* 16 bytes for MD5, or 64 bits for plain text */typedef struct ospf_auth_key_tag{ u8 key[OSPF_MAX_AUTH_LEN]; u8 key_id;}ospf_auth_key;#define OSPF_AUTH_NONE AUTH_TYPE_NONE#define OSPF_AUTH_SIMPLE AUTH_TYPE_SIMPLE#define OSPF_AUTH_MD5 AUTH_TYPE_MD5#define OSPF_MAX_KEYS OSM_NUMKEYS/* The ospf_if_cfg structure is used to configure both interfaces and virtual links.*/typedef struct _ospf_if_cfg { u8 action; /* OSPF_ACTION_GET/SET, and for Virtual links only OSPF_ACTION_CREATE/DELETE */ u8 admin_state; /* Turn OSPF on/off on interface - ignored for virtual links. They must be deleted to disable them administratively. */ /* NOTE: when admin_state is set to OSPF_IF_ADMIN_OFF the rest of the parameters are completely ignored so they don't need to be filled in, or if previously configured then they won't be modified. */ u32 area_id; /* Area to which interface is assigned, or through which a virtual circuit runs. */ u32 rid; /* If a virtual link then this can be set or read and is the router ID of router at other end of the virtual link. If this is a regular interface then it is ignored on sets and returns our router ID on gets. */ u32 cost; /* Cost of sending on interface */ /* The following are straight from RFC 2328 */ u8 RxmtInterval; u8 InfTransDelay; u8 RouterPriority; u8 HelloInterval; u8 RouterDeadInterval; u8 auth_type; /* OSPF_AUTH_NONE, OSPF_AUTH_SIMPLE or OSPF_AUTH_CRTYPO */ u8 auth_pass[8]; /* Password for simple password authentication */ /* We can have multiple keys for MD5 authentication */ ospf_auth_key auth_keys[OSPF_MAX_KEYS]; u8 auth_num_keys; /* Set to actual number of keys */ u8 auth_active_key_idx; /* The index in the auth_keys[] array of the key which should be made the currently active key. NOTE: This is NOT the ID of the active key, just the index in the array. */} ospf_if_cfg, *ospf_if_cfg_ptr;/* A pointer, cast as a void*, of the ospf_ext_route structure is passed in ip_add_route_leak when adding leaks to OSPF.*/typedef struct _ospf_ext_route { u8 mtype; /* The type of metric to use for the external route - ASE_TYPE1 or ASE_TYPE2 */ int cost; /* The value of the metric */ u32 fwd; /* If not 0.0.0.0 then use this as forwarding address */ u32 tag; /* External route tag. */}ospf_ext_route, *ospf_ext_route_ptr;/* Must be kept in agreement with os_neigh.h !! */#define OSPF_NEIGHBOR_DOWN_STATE 1#define OSPF_NEIGHBOR_ATTEMPT_STATE 2#define OSPF_NEIGHBOR_INIT_STATE 3#define OSPF_NEIGHBOR_2WAY_STATE 4#define OSPF_NEIGHBOR_EX_START_STATE 5#define OSPF_NEIGHBOR_EXCHANGE_STATE 6#define OSPF_NEIGHBOR_LOADING_STATE 7#define OSPF_NEIGHBOR_FULL_STATE 8/* Flags for neighbor options */#define OSPF_NBR_OPT_TOS 0x0001 /* Routes on TOS other than 0 ? */#define OSPF_NBR_OPT_EXT 0x0002 /* Stub area or no? */#define OSPF_NBR_OPT_MCAST 0x0004 /* Routes multicasts? */#define OSPF_NBR_OPT_NSSA 0x0008 /* Handles NSSA ? */typedef struct _ospf_neigh_entry {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -