📄 ip_cmn_rte_table.h
字号:
char* custom_rte_protocol_label_ptr; /* Name of the custom routing protocol */
IpT_Rte_Proc_Id custom_rte_protocol_id; /* id assigned to the custom routing */
/* protocol */
} IpT_Custom_Rte_Protocol_Id_Table_Entry;
/* Data structure describing an IP port */
typedef struct IpT_Port_Info
{
short intf_tbl_index; /* Index of the interface in interface table */
short minor_port; /* Index of sub-interface (not used by standard */
/* - routing protocols), but handled by the */
/* IP forwarding engine. */
union
{
char* intf_name; /* valid if intf_tbl_index is a valid index, or an LSP. */
struct MplsT_Port_Output_Info* mpls_info_ptr; /* valid if intf_tbl_index is set to IPC_INT_TBL_INDEX_MPLS */
} output_info;
} IpT_Port_Info;
typedef struct IpT_Mcast_Port_Info
{
int major_port;
int minor_port;
} IpT_Mcast_Port_Info;
typedef InetT_Address_Range IpT_Dest_Prefix;
#define ip_cmn_rte_table_dest_prefix_print(_str, _prefix) inet_address_range_print (_str, &(_prefix))
#define ip_cmn_rte_table_dest_prefix_create inet_address_range_network_create
#define ip_cmn_rte_table_dest_prefix_from_addr_range_create inet_address_range_network_from_addr_range_create
#define ip_cmn_rte_table_dest_prefix_destroy(_prefix) inet_address_range_destroy(&(_prefix))
#define ip_cmn_rte_table_dest_prefix_addr_equal(_pre,_addr) inet_address_range_address_equal(&(_pre), &(_addr))
#define ip_cmn_rte_table_dest_prefix_ipv4_addr_equal inet_address_range_ipv4_address_equal
#define ip_cmn_rte_table_dest_prefix_ipv4_mask_equal inet_address_range_ipv4_mask_equal
#define ip_cmn_rte_table_dest_prefix_ipv4_addr_get(_pre) inet_address_range_ipv4_addr_get(&(_pre))
#define ip_cmn_rte_table_dest_prefix_ipv4_mask_get(_pre) inet_address_range_ipv4_mask_get(&(_pre))
#define ip_cmn_rte_table_dest_prefix_ipv4_addr_range_get(_pre) \
inet_ipv4_address_range_get(&(_pre))
#define ip_cmn_rte_table_dest_prefix_addr_print(_str, _pre) inet_address_range_address_print(_str, &(_pre))
#define ip_cmn_rte_table_dest_prefix_v4mask_print(str,_pre) ip_address_print(str, ip_smask_from_inet_smask_create (inet_address_range_mask_get (&(_pre))))
#define ip_cmn_rte_table_dest_prefix_addr_family_get(_pre) (inet_address_range_family_get (&(_pre)))
#define ip_cmn_rte_table_dest_prefix_addr_get(_pre) (inet_address_range_addr_get (&(_pre)))
#define ip_cmn_rte_table_dest_prefix_mask_get(_pre) (inet_address_range_mask_get (&(_pre)))
#define ip_cmn_rte_table_dest_prefix_mask_len_get(_pre) (inet_address_range_mask_len_get (&(_pre)))
#define ip_cmn_rte_table_dest_prefix_copy(_prefix) (inet_address_range_copy (_prefix))
#define ip_cmn_rte_table_dest_prefix_str_parse(_str,_type) (inet_address_range_str_parse ((_str), (_type)))
#define ip_cmn_rte_table_dest_prefix_valid(_prefix) (inet_address_range_valid (_prefix))
#define ip_cmn_rte_table_dest_prefix_equal(_pre1, _pre2) (inet_address_range_equal (&(_pre1), &(_pre2)))
#define ip_cmn_rte_table_ipv4_dest_prefix_equal(_p1,_p2) (inet_ipv4_address_range_equal (&(_p1), &(_p2)))
#define ip_cmn_rte_table_dest_prefix_compare(_p1,_p2) (inet_address_range_compare (&(_p1), &(_p2)))
#define ip_cmn_rte_table_dest_prefix_check(_addr, _pre) (inet_address_range_check (_addr, &(_pre)))
#define ip_cmn_rte_table_entry_dest_get(_entry_ptr) (ip_cmn_rte_table_dest_prefix_ipv4_addr_get (_entry_ptr->dest_prefix))
#define ip_cmn_rte_table_entry_mask_get(_entry_ptr) (ip_cmn_rte_table_dest_prefix_ipv4_mask_get (_entry_ptr->dest_prefix))
#define ip_cmn_rte_table_entry_mask_len_get(_entry_ptr) (ip_cmn_rte_table_dest_prefix_mask_len_get (_entry_ptr->dest_prefix))
/* Data types representing the dest source table used to implement */
/* destination based load balancing. Currently it is a string hash */
/* table. But we might change it in the future. */
typedef PrgT_String_Hash_Table* IpT_Cmn_Rte_Dest_Src_Table_Handle;
typedef char* IpT_Cmn_Rte_Dest_Src_Table_Key;
/** A datatype that represents an **/
/** entry in the IP route table. Note **/
/** that the following declaration **/
/** implicitly supports CIDR. **/
typedef struct IpT_Cmn_Rte_Table_Entry
{
IpT_Dest_Prefix dest_prefix;
IpT_Rte_Proc_Id route_src_proto;
double route_insert_time;
/* Flags to indicate whether this route is being*/
/* used to resolve the next hop of another route*/
/* bit position 0: Default flag. */
/* bit position 1: Static route flag. */
OpT_uInt16 flags;
/* Ptr. to the route in the originating routing */
/* protocol's routing table. */
void* route_src_obj_ptr;
int admin_distance;
List* next_hop_list;
List* backup_list;
} IpT_Cmn_Rte_Table_Entry;
/** IpT_Rte_Table_Updates: Used as index for **/
/** writing stats into the array of stathandles **/
/** maintained as part of IP route tables. **/
typedef enum
{
IpC_Rte_Table_Any_Update,
IpC_Rte_Table_Entry_Add,
IpC_Rte_Table_Entry_Delete,
IpC_Rte_Table_Next_Hop_Update,
IpC_Rte_Table_Time_Between_Any_Update,
IpC_Rte_Table_Size
} IpT_Rte_Table_Updates;
/** The IP route table data type. **/
/** The Process Registry handle members **/
/** will point to the process registry **/
/** records of the corresponding routing **/
/** processes in a node. **/
typedef struct IpT_Cmn_Rte_Table
{
Objid node_objid;
int usage_threshold;
/* Vector which keeps track of the process handles */
/* of all routing processes (including any multiple */
/* processes of the same protocol) that are running */
/* on this node. */
PrgT_Vector* routeproc_vptr;
/* Vector which keeps track of the redistribution */
/* matrix for this node. Each element in the list */
/* will correspond to a routing process running on */
/* this node (therefore, the size of this vector */
/* and the size of routeproc_vptr will be the */
/* same). Each element will have a corresponding */
/* list of all the routing processes it */
/* redistributes to. */
PrgT_Vector* redist_matrix_vptr;
IpT_Rte_Table_Load load_type;
/* IPv4 and IPv6 Patricia trees. */
OmsT_Ptree* ptree_ptr_array[IPC_NUM_ADDR_FAMILIES];
/* Total number of entries in the table. */
int num_entries;
/* Statistics for monitoring routing table updates. */
/* The array of stathandles will record statistics */
/* separately for All updates, Add, Remove, Changes */
/* and also time between two consecutive updates. */
/* Uses "IpT_Rte_Table_Updates" as the indices. */
Stathandle update_stathandle [6];
double last_update_time;
/* Key to the hash of convergence statistics */
OmsT_Convergence_Handle convg_handle;
/* Information about the IPv4 default route */
IpT_Cmn_Rte_Table_Entry *gateway_of_last_resort;
IpT_Cmn_Rte_Table_Entry *best_default_route;
/* Default routes need to mantained separately. */
/* This is for IPv4 only. */
List* resolved_default_routes;
List* unresolved_default_routes;
/* Pointer to the Module data of the parent node */
struct IpT_Rte_Module_Data* iprmd_ptr;
/* Cache table used to implement destination based */
/* load balancing. */
IpT_Cmn_Rte_Dest_Src_Table_Handle dest_src_table;
/* Number of entries in the above table. */
int dest_src_table_size;
/* VRF to which this route table belongs. */
struct IpT_Vrf_Table* vrf_table_ptr;
} IpT_Cmn_Rte_Table;
typedef struct
{
InetT_Address next_hop;
double route_insert_time;
int route_metric;
List* table_key_lptr;
IpT_Port_Info port_info;
} IpT_Next_Hop_Entry;
typedef struct
{
IpT_Rte_Proc_Id route_proto;
int admin_distance;
/* Ptr. to the route in the originating routing */
/* protocol's routing table. */
void* route_src_obj_ptr;
} IpT_Backup_Entry;
/* Structure to store an entry in the static routing table. */
typedef struct IpT_Rte_Table_Entry
{
Boolean valid;
IpT_Dest_Prefix dest_prefix;
InetT_Address next_hop;
int admin_weight;
} IpT_Rte_Table_Entry;
/* Structure to store the entire static routing table. */
typedef struct IpT_Rte_Table
{
List* resolved_static_route_lists [IPC_NUM_ADDR_FAMILIES];
List* unresolved_static_route_lists [IPC_NUM_ADDR_FAMILIES];
} IpT_Rte_Table;
/* This structure is used in the routeproc_vptr */
/* vector. */
/* Is used to keep track of each routing */
/* process running on this node. */
typedef struct IpT_Rte_Proc_Info
{
IpT_Rte_Proc_Id routeproc_id; /* Specifies the ID of this routing */
/* process. */
Prohandle routeproc_handle; /* Specifies the process handle of this */
/* routing process. */
} IpT_Route_Proc_Info;
/* This structure is used in the */
/* redist_matrix_vptr vector. */
/* Is used to keep track of the redistribution */
/* information of each routing process running */
/* on this node. */
typedef struct IpT_Redist_Matrix_Entry
{
IpT_Rte_Proc_Id routeproc_id; /* Specifies the ID of this routing */
/* process. */
List* redist_routeproc_lptr; /* List of all the routing protocols */
/* that this routing process will be */
/* redistributing to. */
} IpT_Redist_Matrix_Entry;
/* This structure is used in the */
/* redist_routeproc_lptr, which is part of the */
/* IpT_Redist_Matrix_Entry structure. */
typedef struct IpT_Redist_Info
{
IpT_Rte_Proc_Id routeproc_id; /* Specifies the ID of the routing */
/* process that is being redistributed */
/* to by the corresponding */
/* IpT_Redist_Matrix_Entry. */
void * redist_metric; /* The metric used in this instance of */
/* redistribution. */
int bgp_redist_type; /* Specifies whether the source protocol*/
/* is BGP, and if it is, what type of */
/* redistribution it performs. */
/* (EBGP only, or both IBGP and EBGP). */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -