/* $XORP: xorp/xrl/interfaces/fea_rawlink.xif,v 1.3 2007/08/16 01:02:01 pavlin Exp $ */

/*
 * Interface for sending raw link-level packets on an interface.
 * Typically implemented by the FEA.
 */

interface raw_link/0.1 {
	/**
	 * Send a raw link-level packet on an interface.
	 *
         * @param if_name the interface to send the packet on.
         * @param vif_name the vif to send the packet on.
	 * @param src_address the MAC source address.
	 * @param dst_address the MAC destination address.
	 * @param ether_type the EtherType protocol type or the
	 * Destination SAP. It must be between 1536 and 65535 to specify the
	 * EtherType, or between 1 and 255 to specify the Destination SAP
	 * IEEE 802.2 LLC frames.
	 * @param payload the payload, everything after the MAC header.
	 */
	send	? if_name:txt  						\
		& vif_name:txt 						\
		& src_address:mac					\
		& dst_address:mac  					\
		& ether_type:u32  					\
		& payload:binary;

	/**
	 * Register to receive raw link-level packets. The receiver is
	 *  expected to support raw_link_client/0.1 interface.
	 *
	 * @param xrl_target_instance_name the receiver's XRL target instance
	 * name.
         * @param if_name the interface through which packets should be
	 * accepted.
         * @param vif_name the vif through which packets should be accepted.
	 * @param ether_type the EtherType protocol number or the
	 * Destination SAP that the receiver is interested in.
	 * It must be between 1536 and 65535 to specify the EtherType,
	 * or between 1 and 255 to specify the Destination SAP for
	 * IEEE 802.2 LLC frames.
	 * A protocol number of 0 is used to specify all protocols.
	 * @param filter_program the optional filter program to be applied on
	 * the received packets. The program uses tcpdump(1) style expression.
	 * @param enable_multicast_loopback if true then enable delivering
	 * of multicast datagrams back to this host (assuming the host is
	 * a member of the same multicast group).
	 */
	register_receiver	? xrl_target_instance_name:txt		\
				& if_name:txt				\
				& vif_name:txt				\
				& ether_type:u32			\
				& filter_program:txt			\
				& enable_multicast_loopback:bool;

	/**
	 * Unregister to receive raw link-level packets.
	 *
	 * @param xrl_target_instance_name the receiver's XRL target instance
	 * name.
         * @param if_name the interface through which packets should not
	 * be accepted.
         * @param vif_name the vif through which packets should not be
	 * accepted.
	 * @param ether_type the EtherType protocol number or the
	 * Destination SAP that the receiver is not interested in anymore.
	 * It must be between 1536 and 65535 to specify the EtherType,
	 * or between 1 and 255 to specify the Destination SAP for
	 * IEEE 802.2 LLC frames.
	 * A protocol number of 0 is used to specify all protocols.
	 * @param filter_program the filter program that was applied on the
	 * received packets. The program uses tcpdump(1) style expression.
	 */
	unregister_receiver	? xrl_target_instance_name:txt		\
				& if_name:txt				\
				& vif_name:txt				\
				& ether_type:u32			\
				& filter_program:txt;

	/**
	 * Join a MAC multicast group.
	 *
	 * @param xrl_target_instance_name the receiver's XRL target instance
	 * name.
         * @param if_name the interface through which packets should be
	 * accepted.
         * @param vif_name the vif through which packets should be accepted.
	 * @param ether_type the EtherType protocol number or the
	 * Destination SAP that the receiver is interested in.
	 * It must be between 1536 and 65535 to specify the EtherType,
	 * or between 1 and 255 to specify the Destination SAP for
	 * IEEE 802.2 LLC frames.
	 * A protocol number of 0 is used to specify all protocols.
	 * @param filter_program the optional filter program to be applied on
	 * the received packets. The program uses tcpdump(1) style expression.
	 * @param group_address the multicast group address to join.
	 */
	join_multicast_group	? xrl_target_instance_name:txt		\
				& if_name:txt				\
				& vif_name:txt				\
				& ether_type:u32			\
				& filter_program:txt			\
				& group_address:mac;

	/**
	 * Leave a MAC multicast group.
	 *
	 * @param xrl_target_instance_name the receiver's XRL target instance
	 * name.
         * @param if_name the interface through which packets should not be
	 * accepted.
         * @param vif_name the vif through which packets should not be
	 * accepted.
	 * @param ether_type the EtherType protocol number or the
	 * Destination SAP that the receiver is not interested in anymore.
	 * It must be between 1536 and 65535 to specify the EtherType,
	 * or between 1 and 255 to specify the Destination SAP for
	 * IEEE 802.2 LLC frames.
	 * A protocol number of 0 is used to specify all protocols.
	 * @param filter_program the filter program that was applied on the
	 * received packets. The program uses tcpdump(1) style expression.
	 * @param group_address the multicast group address to leave.
	 */
	leave_multicast_group	? xrl_target_instance_name:txt		\
				& if_name:txt				\
				& vif_name:txt				\
				& ether_type:u32			\
				& filter_program:txt			\
				& group_address:mac;
}
