📄 fnsospf.h
字号:
u32 IpAddr; u32 RtrId; u32 AreaId; /* Only relevant for virtual neighbors */ u8 Options; u16 Priority; /* Not meaningful for virtual neighbors */ u8 State; u8 virtual_nbr; /* Boolean - true(!=0) indicates this is a virtual neighbor, false (0) indicates it is not. If virutal then NbrAreaId gives the area through which the vlink to the neighbor is configured. */}ospf_neigh_entry, *ospf_neigh_entry_ptr;typedef struct _ospf_neigh_table { int count; /* The count of the number of neighbors. An input and return. On input it specifies the max number of entries that can be returned. If zero then we return the current number of entries in the OSPF neighbor table. If non-zero then we return at most the specified number. The size of tbl (next) MUST be large enough to hold count entries or memory corruption will occur. */ ospf_neigh_entry_ptr tbl;}ospf_neigh_table, *ospf_neigh_table_ptr;/* See RFC 1850 Link State Database for meanings of fields.*/typedef struct _ospf_lsdb_entry { u32 AreaId; u8 Type; u32 LsId; u32 RouterId; u32 SeqNo; u32 mask; /* Not applicable to all LSAs. Set to zero if N/A but application should know when it is applicable. */ u32 fwd; /* Forwarding address - applies only to external LSAs */ u16 link_count; /* Only applies to Router LSAs */ u16 Age; u16 CkSum;}ospf_lsdb_entry, *ospf_lsdb_entry_ptr;/* The Type of the lsdb entry is one of:*/#define OSPF_ROUTER_LINK 1#define OSPF_NETWORK_LINK 2#define OSPF_SUMMARY_LINK 3#define OSPF_AS_SUMMARY_LINK 4#define OSPF_EXT_LINK 5#define OSPF_MCAST_LINK 6 /* (Not currently supported) */#define OSPF_NSSA_EXT_LINK 7typedef struct _ospf_linkstate_database { int count; /* The count of the number of entries in the link state database. An input and return. On input it specifies the max number of entries that can be returned. If zero then we return the current number of entries in the linkstate databasee. If non-zero then we return at most the specified number of entries. The size of tbl (next) MUST be large enough to hold count entries or memory corruption will occur. */ ospf_lsdb_entry_ptr links;}ospf_lsdb, *ospf_lsdb_ptr;/* * The following are used with fns_ospf_retr_area_table. * Most fields of the ospf_area_entry are the same as * the OSPF MIB (RFC 1850) Area Table fields. But the * widths have been changed to conserve memory in some * cases. For example, would there ever be more than * 65000 routers? I think not. Note that many of the values * are set by configuration with fns_ospf_area_config() but * once SNMP is supported they might be changed by an SNMP * agent so for convenience the fns_ospf_retr_area() function * can be used to retrieve the same info as the fns_ospf_config_area() * function. * */#define OSPF_IMPORT_EXTERNAL 1#define OSPF_NO_IMPORT_EXTERNAL 2#define OSPF_IMPORT_NSSA 3#define OSPF_NO_AREA_SUMMARY 1#define OSPF_SEND_AREA_SUMMARY 2typedef struct _ospf_area_entry { u32 AreaId; u8 ImportAsExtern; /* One of OSPF_IMPORT_EXTERNAL, OSPF_NO_IMPORT_EXTERNAL, or OSPF_IMPORT_NSSA. */ u32 SpfRuns; u16 BdrRtrCount; u16 AsBdrRtrCount; u32 LsaCount; u32 LsaCksumSum; u8 AreaSummary; /* One of OSPF_NO_AREA_SUMMARY, or OSPF_SEND_AREA_SUMMARY */}ospf_area_entry, *ospf_area_entry_ptr;typedef struct _ospf_area_table { int count; ospf_area_entry_ptr tbl;}ospf_area_table, *ospf_area_table_ptr;/* * The following are used with fns_ospf_retr_area_table. * They are equivalent to the RFC 1850 OSPF MIB entries * in the ospfIfTable. * *//* Interface admin status */#define OSPF_IF_ENABLED 1#define OSPF_IF_DISABLED 2/* Interface state */#define OSPF_IF_DOWN 1#define OSPF_IF_UP 2#define OSPF_IF_WAITING 3 /* we are waiting to elect DR */#define OSPF_IF_PTPT 4 /* Point-To-Point Up */#define OSPF_IF_DR 5 /* we are the DR */#define OSPF_IF_BDR 6 /* we are the backup DR */#define OSPF_IF_OTHER_DR 7 /* we are no kind of DR *//* Interface Type */#define OSPF_IF_BROADCAST 1#define OSPF_IF_NBMA 2#define OSPF_IF_PTP 3 /* Point-To-Point */#define OSPF_IF_PTMP 4 /* Point-To-Multipoint */#define OSPF_MCAST_FWD_BLOCKED 1 /* no multicast forwarding */#define OSPF_MCAST_FWD_MCAST 2 /* using multicast address */#define OSPF_MCAST_FWD_UNICAST 3 /* to each OSPF neighbor */#define OSPF_IF_DEMAND 1 /* A demand interface so suppress hellos to full neighbors and set do-not-age flag on propagated LSAs. */#define OSPF_IF_NOT_DEMAND 2 /* Not a demand interface */typedef struct _ospf_interface_entry { u32 IpAddress; u32 AddressLessIf; u32 AreaId; u32 DesignatedRouter; u32 BackupDesignatedRouter; u32 Events; u16 Type; /* One of above interface types OSPF_IF_BROADCAST etc. */ u8 AdminStat; /* One of OSPF_IF_ENABLED (1) or OSPF_IF_DISABLED (2) */ u8 RtrPriority; /* The following intervals are limited to u8s as in the config function bigger values don't seem and just waste memory. */ u8 TransitDelay; u8 RetransInterval; u8 HelloInterval; u8 RtrDeadInterval; u8 PollInterval; u8 State; /* one of the OSPF_IF states above */ u8 AuthType; /* One of the authentication types as above */ u8 MulticastForwarding; u8 Demand; /* One of OSPF_IF_DEMAND or OSPF_IF_NOT_DEMAND */}ospf_if_entry, *ospf_if_entry_ptr;typedef struct _ospf_if_table { int count; ospf_if_entry_ptr tbl;}ospf_if_table, *ospf_if_table_ptr;/* API Function Prototypes */int fns_ospf_global_config( ospf_global_cfg_ptr cfg );int fns_ospf_area_config( ospf_area_cfg_ptr cfg );int fns_ospf_range_config( ospf_range_cfg_ptr cfg );int fns_ospf_if_config( char *devname, ospf_if_cfg_ptr cfg );/* Vlink configuration uses the ospf_if_cfg_ptr */int fns_ospf_vlink_config( char *vname, ospf_if_cfg_ptr cfg );int ospf_admin_enable(int action);#ifndef NO_OSPF_CONSOLEint fns_ospf_retr_neigh_table( ospf_neigh_table_ptr tbl );int fns_ospf_retr_lsdb( ospf_lsdb_ptr lsdb );int fns_ospf_retr_area_table( ospf_area_table_ptr tbl );int fns_ospf_retr_if_table( ospf_if_table_ptr tbl );const char *ospf_neigh_state_to_string(int state);const char *ospf_err_to_string(int err);const char *ospf_lsa_type_to_string(int type);const char *ospf_if_state_to_string(int state);const char *ospf_if_type_to_string(int type);const char *ospf_if_mcast_fwd_to_string(int fwd);#endif#ifndef MAX_V_NAME#define MAX_V_NAME 8#endif#ifndef MAX_V_LINKS#define MAX_V_LINKS 16#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -