
/*
 * Static Routes XRL interface.
 */


interface static_routes/0.1 {

	/**
	 * Enable/disable/start/stop StaticRoutes.
	 *
	 * @param enable if true, then enable StaticRoutes, otherwise
	 * disable it.
	 */
	enable_static_routes	? enable:bool;
	start_static_routes;
	stop_static_routes;

	/**
	 * Add/replace/delete a static route.
	 *
	 * @param unicast if true, then the route would be used for unicast
	 * routing.
	 * @param multicast if true, then the route would be used in the
	 * MRIB (Multicast Routing Information Base) for multicast purpose
	 * (e.g., computing the Reverse-Path Forwarding information).
	 * @param network the network address prefix this route applies to.
	 * @param nexthop the address of the next-hop router for this route.
	 * @param metric the metric distance for this route.
	 */
	add_route4	? unicast:bool & multicast:bool & network:ipv4net \
			& nexthop:ipv4 & metric:u32;

	add_route6	? unicast:bool & multicast:bool & network:ipv6net \
			& nexthop:ipv6 & metric:u32;

	replace_route4	? unicast:bool & multicast:bool & network:ipv4net \
			& nexthop:ipv4 & metric:u32;

	replace_route6	? unicast:bool & multicast:bool & network:ipv6net \
			& nexthop:ipv6 & metric:u32;

	delete_route4	? unicast:bool & multicast:bool & network:ipv4net \
			& nexthop:ipv4;

	delete_route6	? unicast:bool & multicast:bool & network:ipv6net \
			& nexthop:ipv6;

	/**
	 * Add/replace/delete multicast routes
	 */
	add_mcast_route4 ? mcast_addr:ipv4 & input_if:txt & input_ip:ipv4 & output_ifs:txt & distance:u32;
	replace_mcast_route4 ? mcast_addr:ipv4 & input_if:txt & input_ip:ipv4 & output_ifs:txt & distance:u32;
	delete_mcast_route4 ? mcast_addr:ipv4 & input_ip:ipv4;

	/**
	 * Add/replace/delete a backup static route.
	 *
	 * @param unicast if true, then the route would be used for unicast
	 * routing.
	 * @param multicast if true, then the route would be used in the
	 * MRIB (Multicast Routing Information Base) for multicast purpose
	 * (e.g., computing the Reverse-Path Forwarding information).
	 * @param network the network address prefix this route applies to.
	 * @param nexthop the address of the next-hop router for this route.
	 * @param metric the metric distance for this route.
	 */
	add_backup_route4	? unicast:bool & multicast:bool		\
				& network:ipv4net & nexthop:ipv4 & metric:u32;

	add_backup_route6	? unicast:bool & multicast:bool		\
				& network:ipv6net & nexthop:ipv6 & metric:u32;

	replace_backup_route4	? unicast:bool & multicast:bool		\
				& network:ipv4net & nexthop:ipv4 & metric:u32;

	replace_backup_route6	? unicast:bool & multicast:bool		\
				& network:ipv6net & nexthop:ipv6 & metric:u32;

	delete_backup_route4	? unicast:bool & multicast:bool		\
				& network:ipv4net & nexthop:ipv4;

	delete_backup_route6	? unicast:bool & multicast:bool		\
				& network:ipv6net & nexthop:ipv6;

	/**
	 * Add/replace/delete a static route by explicitly specifying the
	 * network interface toward the destination.
	 *
	 * @param unicast if true, then the route would be used for unicast
	 * routing.
	 * @param multicast if true, then the route would be used in the
	 * MRIB (Multicast Routing Information Base) for multicast purpose
	 * (e.g., computing the Reverse-Path Forwarding information).
	 * @param network the network address prefix this route applies to.
	 * @param nexthop the address of the next-hop router for this route.
	 * @param ifname of the name of the physical interface toward the
	 * destination.
	 * @param vifname of the name of the virtual interface toward the
	 * destination.
	 * @param metric the metric distance for this route.
	 */
	add_interface_route4	? unicast:bool & multicast:bool		\
				& network:ipv4net & nexthop:ipv4	\
				& ifname:txt & vifname:txt & metric:u32;

	add_interface_route6	? unicast:bool & multicast:bool		\
				& network:ipv6net & nexthop:ipv6	\
				& ifname:txt & vifname:txt & metric:u32;

	replace_interface_route4 ? unicast:bool & multicast:bool	\
				& network:ipv4net & nexthop:ipv4	\
				& ifname:txt & vifname:txt & metric:u32;

	replace_interface_route6 ? unicast:bool & multicast:bool	\
				& network:ipv6net & nexthop:ipv6	\
				& ifname:txt & vifname:txt & metric:u32;

	delete_interface_route4	? unicast:bool & multicast:bool		\
				& network:ipv4net & nexthop:ipv4	\
				& ifname:txt & vifname:txt;

	delete_interface_route6	? unicast:bool & multicast:bool		\
				& network:ipv6net & nexthop:ipv6	\
				& ifname:txt & vifname:txt;

	/**
	 * Add/replace/delete a backup static route by explicitly specifying
	 * the network interface toward the destination.
	 *
	 * @param unicast if true, then the route would be used for unicast
	 * routing.
	 * @param multicast if true, then the route would be used in the
	 * MRIB (Multicast Routing Information Base) for multicast purpose
	 * (e.g., computing the Reverse-Path Forwarding information).
	 * @param network the network address prefix this route applies to.
	 * @param nexthop the address of the next-hop router for this route.
	 * @param ifname of the name of the physical interface toward the
	 * destination.
	 * @param vifname of the name of the virtual interface toward the
	 * destination.
	 * @param metric the metric distance for this route.
	 */
	add_backup_interface_route4	? unicast:bool & multicast:bool	\
				& network:ipv4net & nexthop:ipv4	\
				& ifname:txt & vifname:txt & metric:u32;

	add_backup_interface_route6	? unicast:bool & multicast:bool	\
				& network:ipv6net & nexthop:ipv6	\
				& ifname:txt & vifname:txt & metric:u32;

	replace_backup_interface_route4	? unicast:bool & multicast:bool	\
				& network:ipv4net & nexthop:ipv4	\
				& ifname:txt & vifname:txt & metric:u32;

	replace_backup_interface_route6	? unicast:bool & multicast:bool	\
				& network:ipv6net & nexthop:ipv6	\
				& ifname:txt & vifname:txt & metric:u32;

	delete_backup_interface_route4	? unicast:bool & multicast:bool	\
				& network:ipv4net & nexthop:ipv4	\
				& ifname:txt & vifname:txt;

	delete_backup_interface_route6	? unicast:bool & multicast:bool	\
				& network:ipv6net & nexthop:ipv6	\
				& ifname:txt & vifname:txt;

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