
#include <xorp_config.h>

/*
 * Multicast Forwarding Engine Abstraction XRL interface.
 */


interface mfea/0.1 {

	/**
	 * Test if the underlying system supports IPv4 multicast routing.
	 * 
	 * @param result true if the underlying system supports IPv4
	 * multicast routing, otherwise false.
	 */
	have_multicast_routing4 -> result:bool;

	/**
	 * Register a protocol on an interface in the Multicast FEA.
	 *
	 * There could be only one registered protocol per interface/vif.
	 *
	 * @param xrl_sender_name the XRL name of the originator of this XRL.
	 * @param if_name the name of the interface to register for the
	 * particular protocol.
	 * @param vif_name the name of the vif to register for the
	 * particular protocol.
	 * @param ip_protocol the IP protocol number. It must be between
	 * 1 and 255.
	 */
	register_protocol4 ? xrl_sender_name:txt			\
			& if_name:txt & vif_name:txt			\
			& ip_protocol:u32;

	/**
	 * Unregister a protocol on an interface in the Multicast FEA.
	 *
	 * There could be only one registered protocol per interface/vif.
	 *
	 * @param xrl_sender_name the XRL name of the originator of this XRL.
	 * @param if_name the name of the interface to unregister for the
	 *        particular protocol.
	 * @param vif_name the name of the vif to unregister for the
	 *        particular protocol.
	 */
	unregister_protocol4 ? xrl_sender_name:txt			\
			& if_name:txt & vif_name:txt;

	/**
	 * Add/delete a Multicast Forwarding Cache with the kernel.
	 *
	 * @param xrl_sender_name the XRL name of the originator of this XRL.
	 * @param source_address the source address of the MFC to add/delete.
	 * @param group_address the group address of the MFC to add/delete.
	 * @param iif_vif_index the index of the vif that is the incoming
	 *        interface.
	 * @param oiflist the bit-vector with the set of outgoing interfaces.
	 * @param oiflist_disable_wrongvif the bit-vector with the set of
	 *        outgoing interfaces to disable WRONGVIF kernel signal.
	 * @param max_vifs_oiflist the number of vifs covered
	 *        by oiflist or oiflist_disable_wrongvif .
	 * @param rp_address the RP address of the MFC to add.
	 */
	add_mfc4	? xrl_sender_name:txt				\
			& source_address:ipv4 & group_address:ipv4	\
			& iif_vif_index:u32				\
			& oiflist:binary				\
			& oiflist_disable_wrongvif:binary		\
			& max_vifs_oiflist:u32				\
			& rp_address:ipv4				\
			& distance:u32;
	delete_mfc4	? xrl_sender_name:txt				\
			& source_address:ipv4 & group_address:ipv4;

	/**
	 * Use strings instead of indexes.  Let mfea do the mapping.
         */
	add_mfc4_str	? xrl_sender_name:txt				\
			& source_address:ipv4 				\
			& group_address:ipv4				\
			& iif_name:txt					\
			& oif_names:txt					\
			& distance:u32;
	
	/**
	 * Add/delete a dataflow monitor with the MFEA.
	 *
	 * @param xrl_sender_name the XRL name of the originator of this XRL.
	 * @param source_address the source address of the dataflow to
	 * start/stop monitoring.
	 * @param group_address the group address of the dataflow to
	 * start/stop monitoring.
	 * @param threshold_interval_sec the number of seconds in the
	 * interval to measure.
	 * @param threshold_interval_usec the number of microseconds in the
	 * interval to measure.
	 * @param threshold_packets the threshold (in number of packets)
	 * to compare against.
	 * @param threshold_bytes the threshold (in number of bytes)
	 * to compare against.
	 * @param is_threshold_in_packets if true, threshold_packets
	 * is valid.
	 * @param is_threshold_in_bytes if true, threshold_bytes
	 * is valid.
	 * @param is_geq_upcall if true, the operation for comparison is ">=".
	 * @param is_leq_upcall if true, the operation for comparison is "<=".
	 */
	add_dataflow_monitor4	? xrl_sender_name:txt			\
				& source_address:ipv4			\
				& group_address:ipv4			\
				& threshold_interval_sec:u32		\
				& threshold_interval_usec:u32		\
				& threshold_packets:u32			\
				& threshold_bytes:u32			\
				& is_threshold_in_packets:bool		\
				& is_threshold_in_bytes:bool		\
				& is_geq_upcall:bool			\
				& is_leq_upcall:bool;
	delete_dataflow_monitor4? xrl_sender_name:txt			\
				& source_address:ipv4			\
				& group_address:ipv4			\
				& threshold_interval_sec:u32		\
				& threshold_interval_usec:u32		\
				& threshold_packets:u32			\
				& threshold_bytes:u32			\
				& is_threshold_in_packets:bool		\
				& is_threshold_in_bytes:bool		\
				& is_geq_upcall:bool			\
				& is_leq_upcall:bool;
	delete_all_dataflow_monitor4? xrl_sender_name:txt		\
				& source_address:ipv4			\
				& group_address:ipv4;

	/**
	 * Enable/disable/start/stop a MFEA vif interface.
	 *
	 * @param vif_name the name of the vif to enable/disable/start/stop.
	 * @param enable if true, then enable the vif, otherwise
	 * disable it.
	 */
	enable_vif	? vif_name:txt & enable:bool;
	start_vif	? vif_name:txt;
	stop_vif	? vif_name:txt;

	/**
	 * Enable/disable/start/stop all MFEA vif interfaces.
	 *
	 * @param enable if true, then enable the vifs, otherwise
	 * disable them.
	 */
	enable_all_vifs	? enable:bool;
	start_all_vifs;
	stop_all_vifs;

	/**
	 * Enable/disable/start/stop the MFEA.
	 *
	 * @param enable if true, then enable the MFEA, otherwise
	 * disable it.
	 */
	enable_mfea	? enable:bool;
	start_mfea;
	stop_mfea;

	/**
	 * Enable/disable/start/stop the MFEA CLI access.
	 *
	 * @param enable if true, then enable the MFEA CLI access, otherwise
	 * disable it.
	 */
	enable_cli	? enable:bool;
	start_cli;
	stop_cli;

	/**
	 * Enable/disable the MFEA trace log for all operations.
	 *
	 * @param enable if true, then enable the trace log, otherwise
	 * disable it.
	 */
	log_trace_all	? enable:bool;

#ifdef HAVE_IPV6


	/**
	 * Test if the underlying system supports IPv6 multicast routing.
	 * 
	 * @param result true if the underlying system supports IPv6
	 * multicast routing, otherwise false.
	 */
	have_multicast_routing6 -> result:bool;

	register_protocol6 ? xrl_sender_name:txt			\
			& if_name:txt & vif_name:txt			\
			& ip_protocol:u32;
	unregister_protocol6 ? xrl_sender_name:txt			\
			& if_name:txt & vif_name:txt;
	add_mfc6	? xrl_sender_name:txt				\
			& source_address:ipv6 & group_address:ipv6	\
			& iif_vif_index:u32				\
			& oiflist:binary				\
			& oiflist_disable_wrongvif:binary		\
			& max_vifs_oiflist:u32				\
			& rp_address:ipv6				\
			& distance:u32;
	delete_mfc6	? xrl_sender_name:txt				\
			& source_address:ipv6 & group_address:ipv6;
	add_dataflow_monitor6	? xrl_sender_name:txt			\
				& source_address:ipv6			\
				& group_address:ipv6			\
				& threshold_interval_sec:u32		\
				& threshold_interval_usec:u32		\
				& threshold_packets:u32			\
				& threshold_bytes:u32			\
				& is_threshold_in_packets:bool		\
				& is_threshold_in_bytes:bool		\
				& is_geq_upcall:bool			\
				& is_leq_upcall:bool;
	delete_dataflow_monitor6? xrl_sender_name:txt			\
				& source_address:ipv6			\
				& group_address:ipv6			\
				& threshold_interval_sec:u32		\
				& threshold_interval_usec:u32		\
				& threshold_packets:u32			\
				& threshold_bytes:u32			\
				& is_threshold_in_packets:bool		\
				& is_threshold_in_bytes:bool		\
				& is_geq_upcall:bool			\
				& is_leq_upcall:bool;
	delete_all_dataflow_monitor6? xrl_sender_name:txt		\
				& source_address:ipv6			\
				& group_address:ipv6;

#endif //ipv6
}
