📄 ip_rte_support.h
字号:
/* Macro for accessing the ith interface */
#define ip_rte_intf_tbl_access_by_port_info(_iprmd_ptr, _port_info) \
ip_rte_intf_tbl_access ((_iprmd_ptr), (int)(_port_info.intf_tbl_index))
#define inet_rte_intf_tbl_access_by_port_info(_iprmd_ptr, _port_info) \
inet_rte_intf_tbl_access ((_iprmd_ptr), (int)((_port_info).intf_tbl_index))
/* Macro for accessing the interface info of a subinterface from*/
/* interface index of the parent interface and the subinterface */
/* index. */
#define ip_rte_subintf_info_get(_iprmd_ptr, _phys_intf_tbl_index, _subintf_index) \
(ip_rte_intf_tbl_access ((_iprmd_ptr), ((_phys_intf_tbl_index) + (_subintf_index) + 1)))
/* Macro for calculating the inteface index of a subinterface */
/* given the interface index of the parent interface and the */
/* subinterface index. */
#define ip_rte_subintf_index_get(_iprmd_ptr, _phys_intf_tbl_index, _subintf_index) \
((_phys_intf_tbl_index) + (_subintf_index) + 1)
/* Macro for getting the subnet level broadcast address */
/* of the IP subnet to which an interface belongs. */
#define ip_rte_intf_broadcast_addr_get(_intf_ptr) \
((IpT_Address) ip_address_node_broadcast_create (ip_rte_intf_addr_get((_intf_ptr)), ip_rte_intf_mask_get((_intf_ptr))))
int ip_rte_intf_tbl_index_get (IpT_Rte_Module_Data* iprmd_ptr, IpT_Interface_Info *intf_info_ptr);
/* Function for obtaining the outstrm corresponding to an */
/* interface. For aggregate interfaces, this function will */
/* invoke the group process (LACP, PAgP etc.) to pick an */
/* output stream. */
int ip_rte_intf_outstrm_get (IpT_Interface_Info* intf_info_ptr, Packet* pkptr, int* slot_index_ptr);
InetT_Address inet_rte_intf_broadcast_addr_get (IpT_Interface_Info* iface_ptr, InetT_Addr_Family addr_family);
/* Macro for extracting the inteface index from the port info */
#define ip_rte_intf_tbl_index_from_port_info_get(_iprmd_ptr, _port_info) ((int)((_port_info).intf_tbl_index))
int ip_rte_minor_port_from_intf_table_index_get (IpT_Rte_Module_Data* iprmd_ptr, int table_index);
#define ipv6_rte_intf_tbl_index_from_port_info_get(_iprmd_ptr, _port_info) ((int)((_port_info).intf_tbl_index - \
inet_first_ipv6_intf_index_get(_iprmd_ptr)))
/* Function for obtaining the minor port (subinterface index) of */
/* the interface corresponding to the specified port info */
int ip_rte_minor_port_from_port_info_get(IpT_Rte_Module_Data* iprmd_ptr, IpT_Port_Info port_info);
/* Macro for checking if a port info structure corresponds to a */
/* valid interface. */
#define ip_rte_port_info_is_defined(_port_info) ((Boolean) ((_port_info).intf_tbl_index != IPC_INTF_INDEX_INVALID))
/* Macro for obtaining the addr_index of an interface specified */
/* by its interface index. */
#define ip_rte_intf_tbl_index_to_addr_index(_iprmd_ptr, _table_index) \
(ip_rte_intf_addr_index_get (ip_rte_intf_tbl_access((_iprmd_ptr), (_table_index))))
/* Macro for obtaining the interface index of the parent */
/* interface of a subinterface */
#define ip_rte_phys_intf_index_from_subintf_index_get(_iprmd_ptr, _subintf_index) \
((_subintf_index) - ( 1 + ip_rte_minor_port_from_intf_table_index_get ((_iprmd_ptr), (_subintf_index))))
IpT_Port_Info ip_rte_port_info_create (int intf_table_index, char* intf_name);
IpT_Port_Info ipv6_rte_port_info_create (IpT_Rte_Module_Data* iprmd_ptr, int ipv6_intf_index);
IpT_Port_Info ip_rte_port_info_from_tbl_index (IpT_Rte_Module_Data* iprmd_ptr, int intf_index);
#define ip_rte_phys_intf_index_from_link_id_obtain(_iprmd_ptr, _link_objid) \
ip_rte_phys_intf_index_from_link_id_obtain_core (_iprmd_ptr, _link_objid, OPC_FALSE, OPC_NIL)
int ip_rte_phys_intf_index_from_link_id_obtain_core (IpT_Rte_Module_Data * iprmd_ptr, Objid link_objid,
Boolean group_intf_check, int* member_intf_index_ptr);
Boolean ip_rte_node_multicast_enabled (IpT_Rte_Module_Data* iprmd_ptr);
/* Macro for checking if the specified interface address */
/* corresponds to an unnumbered interface. Unnumbered interface */
/* addresses would be of the form 0.0.X.0 where X is a positive */
/* integer. */
#define ip_rte_intf_addr_is_unnumbered(_intf_addr)((IP_ADDRESS_COMPONENT_GET (_intf_addr, 3) == 0) && (! ip_address_equal (_intf_addr, IpI_No_Ip_Address)))
/* InetT_Address based functions. */
#define inet_rte_v4intf_addr_get(_intf_ptr) (inet_address_range_addr_get (&((_intf_ptr)->inet_addr_range)))
#define inet_rte_v4intf_mask_get(_intf_ptr) (inet_address_range_mask_get (&((_intf_ptr)->inet_addr_range)))
#define inet_rte_v4intf_broadcast_addr_get(_intf_ptr) (inet_address_range_broadcast_addr_get (&((_intf_ptr)->inet_addr_range)))
#define inet_rte_v6intf_broadcast_addr_get(_intf_ptr) (inet_address_copy (InetI_Ipv6_All_Nodes_LL_Mcast_Addr))
#define inet_address_is_broadcast_for_interface(_addr, _intf_ptr) \
(ip_rte_next_hop_address_is_broadcast_for_interface (inet_ipv4_address_get (_addr), (_intf_ptr)))
#define inet_rte_v4intf_network_address_get(_intf_ptr) (inet_address_range_network_addr_get (&((_intf_ptr)->inet_addr_range)))
#define inet_rte_v4intf_addr_range_get(_intf_ptr) (&((_intf_ptr)->inet_addr_range))
#define inet_rte_v4intf_addr_equal(_intf_ptr, _addr) (inet_address_range_address_equal (&((_intf_ptr)->inet_addr_range), &_addr))
Boolean inet_rte_v4intf_addr_range_check (InetT_Address addr, IpT_Interface_Info* intf_ptr, InetT_Address_Range** addr_range_pptr);
Boolean inet_rte_intf_addr_range_check (IpT_Interface_Info* intf_ptr, InetT_Address next_hop, InetT_Address_Range** addr_range_pptr);
IpT_Intf_Name_Objid_Table_Handle
ip_rte_proto_intf_attr_objid_table_build (Objid proto_params_objid);
int ip_rte_proto_intf_attr_objid_table_size (IpT_Intf_Name_Objid_Table_Handle table_handle);
Objid ip_rte_proto_intf_attr_objid_table_lookup_by_name (IpT_Intf_Name_Objid_Table_Handle intf_name_htable_ptr,
const char* interface_name);
#define ip_rte_proto_intf_attr_objid_table_lookup(_table, _intf_ptr) \
(ip_rte_proto_intf_attr_objid_table_lookup_by_name (_table, ip_rte_intf_name_get (_intf_ptr)))
void ip_rte_proto_intf_attr_objid_table_destroy (IpT_Intf_Name_Objid_Table_Handle intf_name_htable_ptr);
IpT_Packet_Format
ip_rte_packet_format_valid (IpT_Rte_Module_Data * iprmd_ptr,
Packet * pkptr);
Boolean ip_rte_packet_arrival (IpT_Rte_Module_Data * iprmd_ptr,
Packet ** pkpptr, int instrm,
IpT_Rte_Ind_Ici_Fields ** intf_ici_fdstruct_pptr,
IpT_Interface_Info ** iface_info_pptr);
void ip_rte_packet_send (IpT_Rte_Module_Data* iprmd_ptr, Packet* pkptr,
Ici* pk_ici_ptr, IpT_Rte_Ind_Ici_Fields* intf_ici_fdstruct_ptr,
IpT_Rte_Process_Type process_type, void* process_info_ptr);
void ip_rte_dgram_forward (Packet * pkptr,
IpT_Rte_Ind_Ici_Fields *intf_ici_fdstruct_ptr);
void ip_rte_dgram_discard (IpT_Rte_Module_Data * iprmd_ptr,
Packet* pkptr, Ici* intf_ici_ptr, const char* discard_reason);
double ip_rte_comp_delay_and_size_compute (IpT_Rte_Module_Data * iprmd_ptr,
Packet* pkptr, IpT_Dgram_Fields* pk_fd_ptr, Ici* intf_ici_ptr,
IpT_Interface_Info* iface_info_ptr);
void ip_rte_intf_ici_destroy (Ici* intf_iciptr);
void ip_rte_pk_stats_update (IpT_Rte_Module_Data * iprmd_ptr,
Packet* pkptr, double * last_stat_update_time_ptr,
OmsT_Bgutil_Routed_State * stat_bgutil_routed_state_ptr,
Stathandle * packet_shandle_ptr);
void ip_rte_next_hop_error (IpT_Address addr);
void ip_rte_comp_decomp_trace_print (Packet* pkptr,
IpT_Compression_Method method, OpT_Packet_Size old_size,
OpT_Packet_Size new_size, const char action [15]);
void inet_rte_datagram_broadcast (IpT_Rte_Module_Data * iprmd_ptr,
IpT_Rte_Datagram_Interface_Forward forward_proc,
InetT_Address dest_addr, Packet *pk_ptr, int intf_tbl_index,
IpT_Rte_Ind_Ici_Fields* ici_fdstruct_ptr);
#define ip_rte_datagram_broadcast(_iprmd_ptr,_forward_proc,_dest_addr,_pk_ptr,\
_intf_tbl_index,_ici_fdstruct_ptr)\
inet_rte_datagram_broadcast(_iprmd_ptr,_forward_proc,_dest_addr,_pk_ptr,\
_intf_tbl_index,_ici_fdstruct_ptr)
void ip_rte_datagram_interface_forward_direct (
IpT_Rte_Module_Data * iprmd_ptr, InetT_Address dest_addr,
InetT_Address next_addr, Packet* pk_ptr, int intf_tbl_index,
IpT_Rte_Ind_Ici_Fields* intf_ici_fdstruct_ptr);
Boolean ip_rte_decompress (Packet * pkptr,
IpT_Rte_Ind_Ici_Fields * intf_ici_fdstruct_ptr,
IpT_Dgram_Fields * pk_fd_ptr);
double ip_rte_compress (IpT_Rte_Module_Data * iprmd_ptr,Packet * pkptr,
OpT_Packet_Size packet_size, IpT_Rte_Ind_Ici_Fields * intf_ici_fdstruct_ptr,
IpT_Dgram_Fields * pk_fd_ptr);
Objid ip_rte_parameters_objid_obtain (Objid node_id,
Objid module_id, Boolean* gateway_status_p);
Boolean ip_interface_routing_protocols_contains (List* routing_protocols_lptr,
int routing_protocol);
void ip_rte_pk_stats_update_endsim (void * module_info_ptr,
int PRG_ARG_UNUSED(dumlocal_code));
Boolean ip_rte_is_local_address(const IpT_Address intf_addr, IpT_Rte_Module_Data* iprmd_ptr,
IpT_Interface_Info** interface_pptr, int* intf_index_ptr);
Boolean inet_rte_is_local_address(const InetT_Address intf_addr, IpT_Rte_Module_Data* iprmd_ptr,
int* intf_index_ptr);
IpT_Interface_Info* ip_rte_first_loopback_intf_info_get (IpT_Rte_Module_Data* iprmd_ptr);
IpT_Interface_Info* ipv6_rte_first_loopback_intf_info_get (IpT_Rte_Module_Data* iprmd_ptr);
InetT_Address inet_rte_first_loopback_intf_addr_get (IpT_Rte_Module_Data* iprmd_ptr, InetT_Addr_Family addr_family);
InetT_Address inet_rte_intf_addr_get (IpT_Interface_Info* intf_ptr, InetT_Addr_Family addr_family);
InetT_Address ipv6_rte_intf_addr_get (IpT_Interface_Info* intf_ptr);
Compcode ip_rte_addr_local_network (IpT_Address ip_address, IpT_Rte_Module_Data * iprmd_ptr,
IpT_Interface_Info** interface_pptr, IpT_Port_Info* port_info_ptr, int* port_num_ptr);
Compcode inet_rte_addr_local_network_core (InetT_Address ip_addr, IpT_Rte_Module_Data* iprmd_ptr,
IpT_Port_Info* port_info_ptr, InetT_Address_Range** addr_range_pptr);
Compcode ip_rte_destination_local_network (IpT_Rte_Module_Data * iprmd_ptr, InetT_Address dest_addr,
short* table_index_ptr, IpT_Interface_Info** interface_pptr, int *outstrm_ptr,
InetT_Address_Range** addr_range_pptr);
#define inet_rte_addr_local_network(_addr, _iprmd_ptr, _port_info_ptr) \
inet_rte_addr_local_network_core ((_addr), (_iprmd_ptr), (_port_info_ptr), OPC_NIL)
Boolean ip_rte_dest_local_network (IpT_Address ip_addr, IpT_Rte_Module_Data* iprmd_ptr,
int* intf_index_ptr);
IpT_Interface_Info* ip_rte_phys_intf_info_get (const IpT_Rte_Module_Data* iprmd_ptr,
const int intf_index);
int ip_rte_intf_minor_port_from_tbl_index (const IpT_Rte_Module_Data* iprmd_ptr,
const int intf_index);
Boolean inet_rte_is_local_intf_name (char* intf_name, IpT_Rte_Module_Data* intf_lptr, int* intf_index_ptr,
IpT_Interface_Info **intf_info_pptr, InetT_Addr_Family addr_family);
#define ip_rte_is_local_intf_name(_name,_iprmd_ptr,_intf_index_ptr,_intf_info_pptr) \
(inet_rte_is_local_intf_name(_name,_iprmd_ptr,_intf_index_ptr,_intf_info_pptr,InetC_Addr_Family_v4))
Boolean ip_rte_subintf_from_layer2_mapping_get (const char* mapping_name, IpT_Layer2_Mapping mapping_type,
IpT_Rte_Module_Data* iprmd_ptr, int* intf_tbl_index_ptr);
Boolean ip_rte_interfaces_on_same_phys_intf (IpT_Rte_Module_Data* iprmd_ptr, int table_index,
int phys_intf_table_index);
int ip_rte_flow_map_insert(const void* e0, const void* e1);
int ip_rte_flow_map_search (const void* f1, const void* f2);
IpT_Address ip_rte_loopback_from_iface_addr_get (IpT_Address ipaddr);
IpT_Address ip_loopback_address_from_node_id (Objid node_objid);
Compcode ip_rte_support_packet_socket_info_get (Packet* ip_dgram_ptr, IpT_Pkt_Socket_Info* socket_info_ptr);
Boolean ip_rte_support_packet_match (Packet* pkt_ptr, IpT_Rte_Map_Match_Info* match_info_ptr, IpT_Acl_Table* acl_table);
#define ip_rte_next_hop_address_range_check(_next_hop_addr, _ip_intf_ptr) (inet_rte_v4intf_addr_range_check \
(inet_address_from_ipv4_address_create (_next_hop_addr), (_ip_intf_ptr), OPC_NIL))
Boolean ip_rte_next_hop_address_is_broadcast_for_interface (IpT_Address addr,
IpT_Interface_Info* ip_intf_ptr);
void ip_rte_add_routes_to_nato_table (Objid node_objid, Objid module_objid, Objid attr_objid,
const char* cmpnd_attr_name, const char* address_attr_name, const char* mask_attr_name,
const char* auto_assigned_string);
IpT_Icmp_Ping_Data* ip_rte_icmp_ping_data_create (InetT_Address ip_address, int mpls_label, int mpls_exp);
void ip_rte_icmp_ping_data_destroy (IpT_Icmp_Ping_Data* ping_data_ptr);
int ip_rte_intf_index_from_intf_addr_get (IpT_Rte_Module_Data* iprmd_ptr, InetT_Address intf_addr);
IpT_Address ip_rte_first_loopback_intf_addr_get(IpT_Rte_Module_Data* iprmd_ptr);
void ip_rte_iface_rsvp_info_set (double* bw_ptr, double bandwidth,
OpT_uInt8* iface_rsvp_enabled_ptr, IpT_Intf_Name_Objid_Table_Handle rsvp_intf_objid_lookup_table,
char* iface_name, int lsp_signaling_protocol);
int ip_rte_tunnel_to_dest_find (IpT_Rte_Module_Data* iprmd_ptr, InetT_Address dest_addr, int protocol);
void ip_rte_support_policy_check_info_print (Packet* pkt_ptr, char* node_name, Boolean routable);
Boolean ip_rte_intf_has_local_address (const IpT_Address ip_addr, IpT_Interface_Info* interface_ptr);
Boolean ipv6_rte_intf_has_local_address(const InetT_Address intf_addr, IpT_Interface_Info* intf_ptr);
Boolean inet_rte_intf_has_local_address (const InetT_Address ip_addr, IpT_Interface_Info* intf_ptr);
Boolean ip_packet_protocol_is_tunnel (IpT_Protocol_Type protocol);
void ip_rte_arp_req_ici_destroy (Ici* ip_arp_req_ici_ptr);
Boolean ip_rte_interfaces_are_compatible (IpT_Interface_Info* intf_info_ptr1, IpT_Interface_Info* intf_info_ptr2);
Compcode ip_rte_local_interface_pick (IpT_Rte_Module_Data* iprmd_ptr, IpT_Interface_Info* remote_intf_info_ptr,
int* intf_index_ptr);
void ip_rte_from_ip_dest_fec_get (IpT_Cmn_Rte_Table_Entry* ip_route_ptr, char* fec_name);
char* ip_rte_port_info_intf_name_get (IpT_Port_Info* port_info_ptr, IpT_Rte_Module_Data* iprmd_ptr);
/* Interface lower layer type get and set functions. */
#define ip_rte_intf_lower_layer_is_fr(intf_ptr) ((Boolean) ((intf_ptr)->phys_intf_info_ptr->lower_layer_type == IpC_Intf_Lower_Layer_FR))
#define ip_rte_intf_lower_layer_is_atm(intf_ptr) ((Boolean) ((intf_ptr)->phys_intf_info_ptr->lower_layer_type == IpC_Intf_Lower_Layer_ATM))
#define ip_rte_port_info_intf_name_set(_port_info_ptr, input_intf_name) (((_port_info_ptr)->output_info).intf_name = (input_intf_name))
#define ip_rte_port_info_contains_mpls_info(_port_info_ptr) ((_port_info_ptr)->intf_tbl_index == IPC_INTF_TBL_INDEX_MPLS)
#define ip_rte_port_info_mpls_bottom_label_get(_port_info_ptr) ((_port_info_ptr)->output_info.mpls_info_ptr->bottom_label)
#define ip_rte_port_info_mpls_top_nhlfe_get(_port_info_ptr) ((_port_info_ptr)->output_info.mpls_info_ptr->top_nhlfe_ptr)
#define ip_load_balancer_is_enabled(_iprmd_ptr) ((_iprmd_ptr)->load_balancer_info_ptr != OPC_NIL)
#define ip_mobile_ip_is_enabled(_iprmd_ptr) ((_iprmd_ptr)->mip_info_ptr != OPC_NIL)
#define ip_mobile_ipv6_is_enabled(_iprmd_ptr) ((_iprmd_ptr)->mipv6_info_ptr != OPC_NIL)
#define ip_mobile_ipv6_is_mobile_node(_iprmd_ptr) ((_iprmd_ptr)->mipv6_info_ptr->node_type == Mipv6C_Mobile_Node)
#define ip_mobile_ipv6_is_mobility_enabled(_iprmd_ptr) ((Boolean) (ip_mobile_ipv6_is_enabled(_iprmd_ptr)) && (ip_mobile_ipv6_is_mobile_node(_iprmd_ptr)))
#define ip_gtp_is_enabled(_iprmd_ptr) ((_iprmd_ptr)->gtp_info_ptr != OPC_NIL)
#define ip_manet_is_enabled(_iprmd_ptr) ((_iprmd_ptr)->manet_info_ptr != OPC_NIL)
#define ip_manet_aodv_rte_table_get(_iprmd_ptr) (((_iprmd_ptr)->manet_info_ptr != OPC_NIL)? (_iprmd_ptr)->manet_info_ptr->aodv_route_table_ptr: OPC_NIL)
#define ip_mpls_is_enabled(_iprmd_ptr) ((_iprmd_ptr)->mpls_info_ptr != OPC_NIL)
#define ip_mpls_fecs_list_get(_iprmd_ptr) ((_iprmd_ptr)->mpls_info_ptr->fecs_lptr)
#define ip_mpls_label_space_is_global(_iprmd_ptr) ((_iprmd_ptr)->mpls_info_ptr->label_space_global)
// koo
#define ip_manet_dymo_rte_table_get(_iprmd_ptr) (((_iprmd_ptr)->manet_info_ptr != OPC_NIL)? (_iprmd_ptr)->manet_info_ptr->dymo_route_table_ptr: OPC_NIL)
// koo
void ip_manet_enable (IpT_Rte_Module_Data* iprmd_ptr, IpT_Rte_Protocol proto);
IpT_Address ip_rte_highest_loopback_addr_get (IpT_Rte_Module_Data* ip_module_data_ptr);
IpT_Address ip_rte_highest_intf_addr_get (IpT_Rte_Module_Data* ip_module_data_ptr);
void ip_rte_pk_bits_stats_update (IpT_Rte_Module_Data *iprmd_ptr,
Packet *pkptr, double *last_stat_update_time_ptr,
OmsT_Bgutil_Routed_State *stat_bgutil_routed_state_ptr,
Stathandle *packet_sec_shandle_ptr, Stathandle *bits_sec_shandle_ptr);
void ip_rte_link_header_size_adjust (Packet* pkptr, IpT_Interface_Info* iface_info_ptr, IpT_Header_Adjust_Action adjust_action);
#if defined (__cplusplus)
} /* end of 'extern "C" {' */
#endif
#endif /* HDR_IP_RTE_SUPPORT_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -