/* $XORP: xorp/xrl/interfaces/fti.xif,v 1.9 2007/07/12 21:35:27 pavlin Exp $ */

#include <xorp_config.h>

/*
 * Forwarding Table XRL interface.
 */

interface fti/0.2 {

	/**
	 * Lookup a route for a destination host address.
	 * 
	 * @param dst the destination host address to lookup.
	 * @param nexthop the address of the next-hop router toward dst.
	 * @param ifname the name of the physical interface toward dst.
	 * @param vifname the name of the virtual interface toward dst.
	 * @param metric the routing metric toward dst.
	 * @param admin_distance the administratively defined distance
	 * toward dst.
	 * @param protocol_origin the name of the protocol that originated
	 * this routing entry.
	 */
	lookup_route_by_dest4 ? dst:ipv4 -> netmask:ipv4net &		\
				    nexthop:ipv4 &			\
				    ifname:txt &			\
				    vifname:txt &			\
				    metric:u32 &			\
				    admin_distance:u32 &		\
				    protocol_origin:txt;

	/**
	 * Lookup a route for a destination subnet address.
	 * 
	 * @param dst the destination subnet address to lookup.
	 * @param nexthop the address of the next-hop router toward dst.
	 * @param ifname the name of the physical interface toward dst.
	 * @param vifname the name of the virtual interface toward dst.
	 * @param metric the routing metric toward dst.
	 * @param admin_distance the administratively defined distance
	 * toward dst.
	 * @param protocol_origin the name of the protocol that originated
	 * this routing entry.
	 */
	lookup_route_by_network4 ?  dst:ipv4net				\
		      -> nexthop:ipv4 &					\
		    	 ifname:txt &					\
			 vifname:txt &					\
			 metric:u32 &					\
			 admin_distance:u32 &				\
			 protocol_origin:txt;

	/*
	 * TBD: start_reading and read_entry forwarding table dump methods.
	 * Perhaps we request the forwarding table be dumped to file and then
	 * transfer the file.
	 */

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

	/**
	 * Test whether the IPv4 unicast forwarding engine is enabled
	 * or disabled to forward packets.
	 * 
	 * @param enabled if true, then the IPv4 unicast forwarding
	 * is enabled, otherwise is disabled.
	 */
	get_unicast_forwarding_enabled4 -> enabled:bool;

	/**
	 * Set the IPv4 unicast forwarding engine to enable or disable
	 * forwarding of packets.
	 * 
	 * @param enabled if true, then enable IPv4 unicast forwarding,
	 * otherwise disable it.
	 */
	set_unicast_forwarding_enabled4 ? enabled:bool;

	/**
	 * Set the IPv4 unicast forwarding engine whether to retain existing
	 * XORP forwarding entries on startup.
	 *
	 * @param retain if true, then retain the XORP forwarding entries,
	 * otherwise delete them.
	 */
	set_unicast_forwarding_entries_retain_on_startup4 ? retain:bool;

	/**
	 * Set the IPv4 unicast forwarding engine whether to retain existing
	 * XORP forwarding entries on shutdown.
	 *
	 * @param retain if true, then retain the XORP forwarding entries,
	 * otherwise delete them.
	 */
	set_unicast_forwarding_entries_retain_on_shutdown4 ? retain:bool;

	/**
	 * Set the IPv4 unicast forwarding table ID to be used.
	 *
	 * @param is_configured if true, the forwarding table ID is configured,
	 * otherwise the default table should be used.
	 * @param table_id the IPv4 unicast forwarding table ID to be used.
	 */
	set_unicast_forwarding_table_id4 ? is_configured:bool & table_id:u32;

#ifdef HAVE_IPV6


	/**
	 * Lookup a route for a destination host address.
	 * 
	 * @param dst the destination host address to lookup.
	 * @param nexthop the address of the next-hop router toward dst.
	 * @param ifname the name of the physical interface toward dst.
	 * @param vifname the name of the virtual interface toward dst.
	 * @param metric the routing metric toward dst.
	 * @param admin_distance the administratively defined distance
	 * toward dst.
	 * @param protocol_origin the name of the protocol that originated
	 * this routing entry.
	 */
	lookup_route_by_dest6 ? dst:ipv6 -> netmask:ipv6net &		\
				    nexthop:ipv6 &			\
				    ifname:txt &			\
				    vifname:txt &			\
				    metric:u32 &			\
				    admin_distance:u32 &		\
				    protocol_origin:txt;


	/**
	 * Lookup a route for a destination subnet address.
	 * 
	 * @param dst the destination subnet address to lookup.
	 * @param nexthop the address of the next-hop router toward dst.
	 * @param ifname the name of the physical interface toward dst.
	 * @param vifname the name of the virtual interface toward dst.
	 * @param metric the routing metric toward dst.
	 * @param admin_distance the administratively defined distance
	 * toward dst.
	 * @param protocol_origin the name of the protocol that originated
	 * this routing entry.
	 */
	lookup_route_by_network6 ?  dst:ipv6net				\
		      -> nexthop:ipv6 &					\
			 ifname:txt &					\
			 vifname:txt &					\
			 metric:u32 &					\
			 admin_distance:u32 &				\
			 protocol_origin:txt;

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


	/**
	 * Test whether the IPv6 unicast forwarding engine is enabled
	 * or disabled to forward packets.
	 * 
	 * @param enabled if true, then the IPv6 unicast forwarding
	 * is enabled, otherwise is disabled.
	 */
	get_unicast_forwarding_enabled6 -> enabled:bool;

	/**
	 * Set the IPv6 unicast forwarding engine to enable or disable
	 * forwarding of packets.
	 * 
	 * @param enabled if true, then enable IPv6 unicast forwarding,
	 * otherwise disable it.
	 */
	set_unicast_forwarding_enabled6 ? enabled:bool;

	/**
	 * Set the IPv6 unicast forwarding engine whether to retain existing
	 * XORP forwarding entries on startup.
	 *
	 * @param retain if true, then retain the XORP forwarding entries,
	 * otherwise delete them.
	 */
	set_unicast_forwarding_entries_retain_on_startup6 ? retain:bool;

	/**
	 * Set the IPv6 unicast forwarding engine whether to retain existing
	 * XORP forwarding entries on shutdown.
	 *
	 * @param retain if true, then retain the XORP forwarding entries,
	 * otherwise delete them.
	 */
	set_unicast_forwarding_entries_retain_on_shutdown6 ? retain:bool;

	/**
	 * Set the IPv6 unicast forwarding table ID to be used.
	 *
	 * @param is_configured if true, the forwarding table ID is configured,
	 * otherwise the default table should be used.
	 * @param table_id the IPv6 unicast forwarding table ID to be used.
	 */
	set_unicast_forwarding_table_id6 ? is_configured:bool & table_id:u32;

#endif //ipv6
}
