/* $XORP: xorp/xrl/interfaces/vrrp.xif,v 1.2 2008/10/09 17:52:40 abittau Exp $ */

interface vrrp/0.1 {
    /**
     * Create a VRRP instance.
     *
     * @param ifname the interface name.
     * @param vifname the vif name.
     * @param vrid the VRRP router ID.
     */
    add_vrid	    ? ifname:txt			\
		    & vifname:txt			\
		    & vrid:u32;

    /**
     * Remove a VRRP instance.
     *
     * @param ifname the interface name.
     * @param vifname the vif name.
     * @param vrid the VRRP router ID.
     */
    delete_vrid	    ? ifname:txt			\
		    & vifname:txt			\
		    & vrid:u32;

    /**
     * Set the router's priority.
     *
     * @param ifname the interface on which VRRP is running.
     * @param vifname the vif on which VRRP is running.
     * @param vrid the VRRP router ID.
     * @param priority the new priority value.
     */
    set_priority    ? ifname:txt			\
		    & vifname:txt			\
		    & vrid:u32				\
		    & priority:u32;

    /**
     * Set the advertisement interval.
     *
     * @param ifname the interface on which VRRP is running.
     * @param vifname the vif on which VRRP is running.
     * @param vrid the VRRP router ID.
     * @param interval the new advertisement interval.
     */
    set_interval    ? ifname:txt			\
		    & vifname:txt			\
		    & vrid:u32				\
		    & interval:u32;

    /**
     * Set whether a high priority backup router should preempt a low priority
     * router that is acting as a master.
     *
     * @param ifname the interface on which VRRP is running.
     * @param vifname the vif on which VRRP is running.
     * @param vrid the VRRP router ID.
     * @param preempt true if preemption should occur.
     */
    set_preempt	    ? ifname:txt			\
		    & vifname:txt			\
		    & vrid:u32				\
		    & preempt:bool;

    /**
     * Start or stop a VRRP instance.
     *
     * @param ifname the interface on which VRRP is running.
     * @param vifname the vif on which VRRP is running.
     * @param vrid the VRRP router ID.
     * @param disable if true, stop VRRP.  Start it otherwise.
     */
    set_disable	    ? ifname:txt			\
		    & vifname:txt			\
		    & vrid:u32				\
		    & disable:bool;

    /**
     * Add an IP to the virtual router.
     *
     * @param ifname the interface on which VRRP is running.
     * @param vifname the vif on which VRRP is running.
     * @param vrid the VRRP router ID.
     * @param ip the IP address to add.
     */
    add_ip	    ? ifname:txt			\
		    & vifname:txt			\
		    & vrid:u32				\
		    & ip:ipv4;

    set_prefix	    ? ifname:txt & vifname:txt & vrid:u32 & ip:ipv4 & prefix_len:u32;
    
    /**
     * Remove an IP from the virtual router.
     *
     * @param ifname the interface on which VRRP is running.
     * @param vifname the vif on which VRRP is running.
     * @param vrid the VRRP router ID.
     * @param ip the IP address to remove.
     */
    delete_ip	    ? ifname:txt			\
		    & vifname:txt			\
		    & vrid:u32				\
		    & ip:ipv4;

    /**
     * Get the physical interfaces on which VRRP is running.
     *
     * @param ifs a list of interface names (strings).
     */
    get_ifs	    -> ifs:list<txt>;

    /**
     * For a given physical interface, get the virtual interfaces on which VRRP
     * is running.
     *
     * @param ifname the physical interface name.
     * @param vifs a list of virtual interface names (strings).
     */
    get_vifs	    ? ifname:txt			\
		    -> vifs:list<txt>;

    /**
     * Get the virtual router IDs of all the VRRP instances running on a network
     * interface.
     *
     * @param ifname the physical interface name.
     * @param vifname the logical interface name.
     * @param vrids a list of VRRP router IDs (integers).
     */
    get_vrids       ? ifname:txt			\
		    & vifname:txt			\
		    -> vrids:list<u32>;

    /**
     * Get state information from a particular VRRP instance.
     *
     * @param ifname the interface on which the VRRP instance is running.
     * @param vifname the vif on which the instance is running.
     * @param vrid the virtual router ID of the VRRP instance.
     * @param state the state of the router (initialize, master, backup).
     * @param master the IP address of the master.  Only valid when running.
     */
    get_vrid_info   ? ifname:txt			\
		    & vifname:txt			\
		    & vrid:u32				\
		    -> state:txt			\
		    & master:ipv4;
}
