⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ip_rte_v4.h

📁 备
💻 H
📖 第 1 页 / 共 2 页
字号:
   											/* CSPF rtes for MPLS LSPs.						*/	

	double				te_cost;			/* TE cost specified under MPLS->Iface Info. 	*/

	} IpT_Iface_Mpls_Info;

/* Data structure to hold RSVP information for a particular interface						*/
typedef struct
	{
	Boolean 			rsvp_status;		/* Boolean to hold the RSVP status on this iface*/
	
	double	       		max_reservable_bandwidth_percent;
											/* Maximum Reservable bandwidth %age on iface	*/

	double	       		max_reservable_bandwidth_per_flow_percent;
											/* Maximum Reservable bandwidth %age for each 	*/
											/* individual flow on the interface				*/

	} IpT_Iface_Rsvp_Info;

/* Mobile IPv6 information stored per interface.	*/
typedef struct Mipv6T_Interface_Info
	{
	Mipv6T_Node_Type	mipv6_iface_type;
	OpT_uInt16 			ha_preference;
	OpT_uInt16			ha_lifetime;
	OpT_uInt16			max_num_mn;
	} Mipv6T_Interface_Info;

/* Structure to store the IPv6 related information of an interface.							*/
typedef struct Ipv6T_Interface_Info
	{
	unsigned int					intf_id;			/* Globally unique interface ID.			*/
	int								num_addresses;		/* Number of IPv6 addresses (incl. the link	*/
														/* local address).							*/

	InetT_Address_Range				*ipv6_addr_array;	/* Array of IP address ranges.				*/
														/* The first element of the array will be	*/
														/* will be the link local address. 			*/

	union												/* Router advertisement related information	*/
		{												/* On host nodes, ra_host_info_ptr will be	*/
		struct Ipv6T_Ra_Host_Info*	ra_host_info_ptr;	/* set. On Router advertisement enabled		*/
		struct Ipv6T_Ra_Gtwy_Info*	ra_gtwy_info_ptr;	/* router interfaces, ra_gtwy_info_ptr will	*/
		} ra_info;										/* be set.									*/

	struct Ipv6T_Nd_Info*			nd_info_ptr;		/* Neighbor Discovery related information.	*/

	Mipv6T_Interface_Info	*mipv6_info_ptr;	/* MIPv6 related information.				*/
	} Ipv6T_Interface_Info;


/* Structure to store information specific to GRE tunnels.									*/
typedef struct IpT_Tunnel_GRE_Params
	{
	Boolean						sequence_dgrams; 	/* Should we drop out-of-sequence packets	*/
	
	int							max_seq_number;	 	/* Current max sequence number seen on an	*/
													/* an incoming datagram						*/
	} IpT_Tunnel_GRE_Params;

typedef struct IpT_Tunnel_GRE_Hdr_Fields
	{
	int							ver;				/* Version number of GRE.				*/
	
	int							protocol_type;		/* What is the encapsulated protocol?	*/
	
	Boolean						checksum_present;	/* Are the checksum and reserved1		*/
													/* fields present in the packet?		*/
	
	} IpT_Tunnel_GRE_Hdr_Fields;
	
/* Structure to hold tunnel address to physical address mapping. */
typedef struct IpT_Tunnel_Address_Map
	{
	InetT_Address				tunnel_addr;		/* Logical end point of the tunnel. */
	InetT_Address				tunnel_phy_addr;	/* Physical address mapped to the above address. */
	} IpT_Tunnel_Address_Map;

/* Structure to store information specific to Tunnel interfaces.							*/
typedef struct IpT_Tunnel_Info
	{
	IpT_Tunnel_Mode				mode;				/* Type of tunnel.						*/

	struct IpT_Interface_Info*	source_intf_ptr;	/* Source Interface of the tunnel		*/
	
	InetT_Address				src_addr;			/* The source address as specified in	*/
													/* the tunnel information.				*/		
	
	int							dest_count;			/* Number of destinations in the array  */
	IpT_Tunnel_Address_Map*		dest_addr_array;	/* Destinations of the tunnel	(pt2mpt)*/

	InetT_Address				dest_addr;			/* Destination of the tunnel (pt2pt)	*/

	OmsT_Dist_Handle			encapsulation_delay;

	OmsT_Dist_Handle			decapsulation_delay;
	
	int							ttl;				/* TTL value to be used for outer packet	*/
	
	int							tos;				/* TOS value to be used for outer packet	*/		
	
	short						passenger_proto_flags;	/* A bit-field being used to record		*/
														/* which passenger protocols are 		*/
														/* enabled on the tunnel.				*/		

	OpT_Packet_Size				hdr_size_bits;		/* Some tunnels (GRE) may have a header.	*/
	
	OmsT_Dim_Stat_Handle		traffic_rcvd_bps_lsh;
	OmsT_Dim_Stat_Handle		traffic_rcvd_pps_lsh;
	OmsT_Dim_Stat_Handle		traffic_sent_bps_lsh;
	OmsT_Dim_Stat_Handle		traffic_sent_pps_lsh;
	OmsT_Dim_Stat_Handle		traffic_dropped_bps_lsh;
	OmsT_Dim_Stat_Handle		traffic_dropped_pps_lsh;
	OmsT_Dim_Stat_Handle		delay_sec_lsh;
	OmsT_Dim_Stat_Handle		delay_jitter_sec_lsh;
	
	OmsT_Stat_Data*				delay_stat_ptr; /* OMS data structure used to compute deviation.	*/	

	OmsT_Bgutil_Routed_State* 	bgutil_sent_state_ptr; /* Bgutil structures used to record	*/
	OmsT_Bgutil_Routed_State*	bgutil_rcvd_state_ptr; /* traffic sent and received stats	*/  
	double						last_sent_update_time; /* for background traffic.			*/
	double						last_rcvd_update_time; /*									*/
	
	IpT_Tunnel_GRE_Params*		gre_params_ptr;		/* GRE specific parameters of tunnel		*/
	} IpT_Tunnel_Info;

/* Data structure to store the interface from which an unnumbered interface must get its	*/
/* address. During parsing, the interface will be stored by name. Once all interfaces have	*/
/* been read in the interface name is resolved to an interface address.						*/
typedef union IpT_Unnumbered_Info
	{
	char*			interface_name;
	IpT_Address		interface_addr;
	} IpT_Unnumbered_Info;

/* Advance declaration for structure containing Aggregation related information.			*/
struct IpT_Group_Intf_Info;

/* Data Structure containing elements whose value will be the same for the physical			*/
/* interface and any subinterfaces it might have. e.g. connected link_objid. 				*/
typedef struct
	{
	IpT_Interface_Type	intf_type;		/* See enum explaination above.			*/
	
	short				ip_addr_index;	/* Index in IP interface information	*/
										/* specification (i_th row in the		*/
										/* compound attribute specification.)	*/

	short				port_num;		/* Output stream index reprsenting this iface.	*/

	short				in_port_num;	/* Input stream index reprsenting this iface.	*/

	short				slot_index;		/* Slot number to which a particular	*/
										/* interface belongs.					*/

	Objid				connected_link_objid;	/* Object identifier of the link	*/
												/* connected to this interface.		*/

	double				link_bandwidth;		/* Interface data rate (in bits/sec).	*/

	IpT_Interface_Status	intf_status;	/* Specifies whether this interface is Active, 		*/
											/* Shutdown, Loopback Address, or an unconnected 	*/
											/* interface. Enumerated values above.		 	 	*/

	short				link_status;		/* Whether or not the connectied link is active.	*/

	short				num_subinterfaces;	/* Number of subinterfaces on this physical interface	*/

	struct IpT_Interface_Info** subintf_pptr;/* Array of pointers to the subinterfaces on this	*/
											/* physical interface. If no subinterfaces are 		*/
											/* defined, this element wil be set to OPC_NIL		*/

	int					lower_layer_addr;	/* Lower layer address of this physical interface	*/
											/* This address will be same for all the ifaces		*/
   											/* including subifaces ubder this phyiscal iface	*/	
	
	OpT_Int8			lower_layer_type;	/* An enum that indicates the lower layer type.	*/

	struct IpT_Group_Intf_Info* group_info_ptr; /* Aggregation related information.				*/

	} IpT_Phys_Interface_Info;

/* Data structure describing an IP interface or subinterface*/
typedef struct IpT_Interface_Info
	{
	IpT_Address_Range*	addr_range_ptr;	/* Range of addresses covered by this	*/
										/* single IP interface.					*/

	InetT_Address_Range	inet_addr_range;/* The address and subnet mask in the	*/
										/* InetT format.						*/

	IpT_Address			network_address;/* IP Network to which this iface belongs*/

	Ipv6T_Interface_Info*	ipv6_info_ptr;	/* IPv6 information. For IPv4 only	*/
											/* interfaces, it will be NIL		*/

	IpT_Tunnel_Info*	tunnel_info_ptr;/* Used to store tunnel information for	*/
										/* tunnel interfaces.					*/

	IpT_Sec_Addr_Table	*sec_addr_tbl_ptr;
										/* Range of secondary addresses			*/
	
	IpT_Unnumbered_Info	*unnumbered_info;	/* The source interface of an		*/
											/* unnumbered interface.			*/

	char*				full_name;		/* Full Name given to IP interface by 	*/
										/* the user. For subinterfaces, this	*/
										/* would be of the form: 				*/
										/* <Physical Iface Name>.<Subiface Name>*/

	int					mtu;			/* Maximum amount of data that can be	*/
										/* transmitted in one IP datagram.		*/

	List*				routing_protocols_lptr;	/* Routing protocol(s), if any 	*/
									    /* run on this interface.				*/

	double				load_bits;		/* Outgoing load in bits/sec (ie, total	*/
										/* bits/total time) for this interface.	*/

	double				load_bps;		/* Outgoing load in bits/sec (ie, total	*/
										/* bits/total time) for this interface.	*/

	double				avail_bw;		/* BW available for reservation by RSVP	*/
										/* or CR-LDP							*/

	double				delay;			/* Value of delay that'll be incurred	*/
										/* on traveling through this interface	*/
	   									/* Usually this is just set as a static */
										/* value. But it can also be actively	*/
										/* computed								*/

	double				reliability;	/* Fraction of packets that arrive		*/
										/* undamaged.							*/

	IpT_Compression_Info* comp_info;    /* Information about the data           */
										/* compression scheme used at this      */
										/* interface. DS is defined in          */
										/* oms_data_def_ds_defs.h               */

	OpT_uInt8			multicast_enabled;	/* A flag, which is set to OPC_TRUE	*/
									   	/* if multicast routing is enabled on 	*/
									   	/* this IP interface					*/
	
	OpT_uInt8			manet_enabled;	/* Flag to indicate if any MANET routing*/
										/* protocol is enabled on this interface*/
	
	OpT_uInt8			igmp_enabled;	/* Flag specifying whether IGMP is 		*/
										/* enabled on the interface.			*/

	Prohandle			igmp_rte_iface_ph;	/* Process handle of the IGMP Router*/
   										/* Interface child process, which		*/
   										/* handles IGMP message	received on		*/
									    /* this IP interface. This field is		*/
										/* set only if multicasting is enabled	*/
									    /* on this interface					*/

	/* The oms_bgutil package uses this state variable to keep track of the	*/
	/* background utilization traffic flowing through this interface.		*/
	struct OmsT_Bgutil_Routed_State*	load_bgutil_routed_state_ptr;

	/* We use this variable to keep track of how much we need to fill in	*/
	/* the load_bits variable with background utilization traffic.			*/
	double				last_load_update_time;

	IpT_Queuing_Scheme	queuing_scheme;		/* Specify the queuing scheme for the interface: 	*/
											/* None, FIFO, WFQ. PQ, CQ							*/

	Prohandle			output_iface_prohandle;	/* Prohandle for the child process ip_output_iface	*/
												/* in charge of queuing scheme, RED, CAR.			*/


	IpT_Iface_Rsvp_Info* rsvp_info_ptr;		/* Stores all the RSVP info like status,		*/
										    /* max reservable BW and max per flow			*/
										    /* reservable BW								*/
	OpT_uInt8			rsvp_enabled;		/* Specified whether RSVP is enabled on the		*/
											/* interface.									*/

	short				intf_index;			/* Index of this interface in the interface		*/
											/* array maintained by IP.						*/
	short				subintf_addr_index; /* Row number of this subinterface in the		*/
											/* Subinterface Information compound attribute	*/
											/* For a physical interface, this element will	*/
											/* be set to IPC_SUBINTF_PHYS_INTF (-1). Thus	*/
											/* the value of this element can be used to 	*/
											/* determine whether this structure represents	*/
   											/* a physical interface or a subinterface 		*/

	IpT_Layer2_Mappings layer2_mappings;	/* A structure containing information such as	*/
											/* PVCs, VLANs, ELANs etc. Refer definition of	*/
											/* struct for more details.						*/

	IpT_Intf_User_Metrics*	user_metrics;	/* User supplied metrics for the interface 		*/

	/* We use this for mapping flow in index to flow out index for bgutil flows */
	List*				flow_id_map_list_ptr; 
	
	IpT_Phys_Interface_Info* phys_intf_info_ptr;/* Pointer to a structure that contains 	*/
											/* attributes whose values are the same for the	*/
											/* physical interface and all the subinterfaces	*/

	IpT_Iface_Mpls_Info*	mpls_info_ptr; 	/* Pointer to hold MPLS info for this iface		*/

	struct IpT_Acl_Filter_Info*	filter_info_ptr;
											/* Stores the info about Packet Filters			*/
											/* configured on the interface, both in			*/
   											/* In and Out direction.						*/ 

	char*					policy_routing_name; /* Name of the Policy routing, usually 	*/
											/* a Route Map name, that will be used for 		*/
											/* all the incoming traffic on this interface	*/
	
	OpT_uInt8				mip_enabled;	/* Flag indicating if the mobile IP process is  */
											/* enabled on this interface or not				*/
	Prohandle			mip_phndl;		/* The handle to the mobile IP process on this  */
											/* interface if the above flag is true			*/
	
	List*				notif_proc_lptr;	/* List of processes (IpT_Te_Notif_Info) objects	*/
											/* that have registered for SIG_CHANGE notification	*/
											/* events for this interface (used for TE)			*/	
	} IpT_Interface_Info;

/* Data structure to store all the interfaces of a router,	*/
/* physical interfaces as well as subinterfaces.			*/
typedef struct IpT_Interface_Table
	{
	IpT_Interface_Info**	intf_info_ptr_array;	/* Array of pointers to IpT_Interface_Info	*/
													/* structures.								*/
	/* The entries in the array will be ordered as follows. The IPv4 only interfaces come first	*/
	/* Then come the IPv4/IPv6 interfaces. IPv6 only interfaces will be at the end.				*/

	unsigned short			total_interfaces;		/* Total number of elements in the above 	*/
													/* array (including IPv4 only, IPv4/IPv6 and*/
													/* IPv6 only interfaces).					*/

	unsigned short			num_ipv4_interfaces;	/* Number of IPv4 only and IPv4/IPv6 interfaces	*/

	unsigned short			num_ipv6_interfaces;	/* Number of IPv4/IPv6 and IPv6 only interfaces	*/

	IpT_Interface_Info**	first_ipv6_intf_ptr;	/* The intf_info_ptr_array offset by the number	*/
													/* of IPv4 only interfaces.						*/
	} IpT_Interface_Table;
	

typedef struct
	{
	List*	ip_iface_table_ptr;
	} IpT_Info;

#define	IPC_FAST_ADDR_INVALID	-1	/* Representation of an invalid fast address. */

/* Globals					*/
extern Boolean					ip_nato_tables_created;
extern NatoT_Table_Handle		ip_networks_table_handle;
extern NatoT_Table_Handle		ip_table_handle;

/* Procedure Declarations */
void				ip_rtab_local_addr_register (InetT_Address* ip_addr_ptr,
						struct IpT_Rte_Module_Data* iprmd_ptr);
Objid 				ip_rtab_index_to_node_objid_convert (int addr_index);
int					ip_rtab_num_addrs_registered (void);
int					ip_rtab_num_networks_registered (void);
int					ip_dyn_rte_protocol_obtain (char* rte_protocol_label_ptr);
Boolean 			ip_basetraf_protocol_parse(void** protocol_info_ptr, 
	char* sname, char* dname, char* stat_annotate_str, Objid bgutil_specs_objid, 
	Objid demand_objid, Objid dest_objid, Boolean is_src_to_dest_traffic, Boolean is_lsp_traffic);
void				ip_basetraf_conv_info_free (IpT_Conversation_Info* ip_conv_info_ptr);
DLLEXPORT Compcode	ip_support_ip_pkt_socket_info_extract (Packet* pkptr, IpT_Pkt_Socket_Info* pkt_ip_info_ptr); 
DLLEXPORT void		ip_support_ip_pkt_socket_info_apply (Packet* pkptr, IpT_Pkt_Socket_Info* pkt_ip_info_ptr, Boolean apply_outer_and_inner, Boolean apply_source, Boolean apply_dest);
DLLEXPORT void		ip_support_application_type_set (Packet* pkptr, IpT_Dgram_Fields* pk_fd_ptr, int src_port, int dest_port, Boolean apply_source, Boolean apply_dest);

int							inet_rtab_unique_addr_convert (InetT_Address addr, IpT_Addr_Status* addr_status_ptr);
#define	ip_rtab_unique_addr_convert(_ipv4_addr,_addr_status_ptr)	(inet_rtab_unique_addr_convert (inet_address_from_ipv4_address_create (_ipv4_addr),_addr_status_ptr))
#define inet_rtab_addr_convert(_inet_addr)							(inet_rtab_unique_addr_convert (_inet_addr,OPC_NIL))
#define	ip_rtab_addr_convert(_ipv4_addr)							(inet_rtab_unique_addr_convert (inet_address_from_ipv4_address_create (_ipv4_addr),OPC_NIL))

InetT_Address 				inet_rtab_index_to_addr_convert (int addr_index);
#define	ip_rtab_index_to_addr_convert(_index)	(inet_ipv4_address_get (inet_rtab_index_to_addr_convert (_index)))
Boolean						inet_rtab_addr_exists (InetT_Address addr);
#define	ip_rtab_addr_exists(_ipv4_addr)			(inet_rtab_addr_exists (inet_address_from_ipv4_address_create (_ipv4_addr)))
int							inet_rtab_network_convert (InetT_Address addr);
#define ip_rtab_network_convert(_ipv4_addr)		(inet_rtab_network_convert (inet_address_from_ipv4_address_create (_ipv4_addr)))
void						ip_rtab_intf_lower_layer_address_register (IpT_Interface_Info* intf_ptr,
								int lower_layer_address, int lower_layer_addr_type);
#if defined (__cplusplus)
} /* end of 'extern "C" {' */
#endif

#endif /* for _IP_RTE_H_INCL_ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -