/* $XORP: xorp/etc/templates/pimsm6.tp,v 1.35 2008/05/02 00:00:53 pavlin Exp $ */

protocols {
    pimsm6 {
	targetname:			txt = "PIMSM_6";
	disable:			toggle = false;
	enabled:			bool;		/* %deprecated */

	interface @: txt {
	    vif @: txt {
		disable:		toggle = false;
		enabled:		bool;		/* %deprecated */
		enable-ip-router-alert-option-check:	bool; /* %deprecated */
		dr-priority:		u32 = 1;
		hello-period:		u32 = 30;
		hello-triggered-delay:	u32 = 5;
		alternative-subnet @: ipv6net {
		}
	    }
	}

	static-rps {
	    rp @: ipv6 {
		group-prefix @: ipv6net {
		    rp-priority:	u32 = 192;
		    hash-mask-len:	u32 = 126;
		}
	    }
	}

	bootstrap {
	    disable:			toggle = false;
	    enabled:			bool;		/* %deprecated */

	    cand-bsr {
		scope-zone @: ipv6net {
		    is-scope-zone:	bool = false;
		    cand-bsr-by-vif-name: txt;
		    cand-bsr-by-vif-addr: ipv6 = ::;
		    bsr-priority:	u32 = 1;
		    hash-mask-len:	u32 = 126;
		}
	    }

	    cand-rp {
		group-prefix @: ipv6net {
		    is-scope-zone:	bool = false;
		    cand-rp-by-vif-name: txt;
		    cand-rp-by-vif-addr: ipv6 = ::;
		    rp-priority:	u32 = 192;
		    rp-holdtime:	u32 = 150;
		}
	    }
	}

	switch-to-spt-threshold {
	    disable:			toggle = false;
	    enabled:			bool;		/* %deprecated */
	    interval:			u32 = 100;
	    bytes:			u32 = 0;
	}

	traceoptions {
	    flag {
		all {
		    disable:		toggle = false;
		    enabled:		bool;		/* %deprecated */
		}
	    }
	}
    }
}

protocols {
    pimsm6 {
	%help:		short		"Configure the IPv6 PIM-SM protocol";
	%modinfo:	provides	pimsm6;
	%modinfo:	depends		mfea6;
	%modinfo:	depends		mld;
	%modinfo:	depends		rib;
	%modinfo:	path		"pim/xorp_pimsm6";
	%modinfo:	default_targetname "pim";
	%modinfo:	status_method	xrl "$(pimsm6.targetname)/common/0.1/get_status->status:u32&reason:txt";
	%modinfo:	startup_method	xrl "$(pimsm6.targetname)/pim/0.1/start_pim";
	%modinfo:	shutdown_method	xrl "$(pimsm6.targetname)/common/0.1/shutdown";

	%mandatory:	$(@.targetname);

	targetname {
	    %user-hidden: "XRL target name";
	    %help:	short "XRL target name";
	    %set:;
	}

	disable {
	    %help:	short "Disable the IPv6 PIM-SM protocol";
	    %create:;
	    %set:	xrl "$(pimsm6.targetname)/pim/0.1/enable_pim?enable:bool=`~$(@)`";
	    %delete:	xrl "$(pimsm6.targetname)/pim/0.1/enable_pim?enable:bool=`~$(DEFAULT)`";
	}

	enabled {
	    %deprecated: "Statement 'enabled: true/false' is replaced with 'disable: false/true'";
	    %help:	short "Enable the IPv6 PIM-SM protocol";
	    %create:;
	    %set:	xrl "$(pimsm6.targetname)/pim/0.1/enable_pim?enable:bool=$(@)";
	}

	interface @ {
	    %help:	short "Configure IPv6 PIM-SM on a network interface";
	    %delete: xrl "$(pimsm6.targetname)/pim/0.1/stop_vif?vif_name:txt=$(interface.@)";
	    vif @ {
		%help:	short "Configure IPv6 PIM-SM on a virtual interface";
		%activate: xrl "$(pimsm6.targetname)/pim/0.1/start_vif?vif_name:txt=$(vif.@)";
		%update: xrl "$(pimsm6.targetname)/pim/0.1/start_vif?vif_name:txt=$(vif.@)";
		%delete: xrl "$(pimsm6.targetname)/pim/0.1/stop_vif?vif_name:txt=$(vif.@)";

		disable {
		    %help:	short "Disable IPv6 PIM-SM on an interface";
		    %set:	xrl "$(pimsm6.targetname)/pim/0.1/enable_vif?vif_name:txt=$(vif.@)&enable:bool=`~$(@)`";
		    %delete:	xrl "$(pimsm6.targetname)/pim/0.1/enable_vif?vif_name:txt=$(vif.@)&enable:bool=`~$(DEFAULT)`";
		}

		enabled {
		    %deprecated: "Statement 'enabled: true/false' is replaced with 'disable: false/true'";
		    %help:	short "Enable IPv6 PIM-SM on an interface";
		    %set:	xrl "$(pimsm6.targetname)/pim/0.1/enable_vif?vif_name:txt=$(vif.@)&enable:bool=$(@)";
		    %delete:	xrl "$(pimsm6.targetname)/pim/0.1/enable_vif?vif_name:txt=$(vif.@)&enable:bool=`~$(DEFAULT)`";
		}

		enable-ip-router-alert-option-check {
		    %deprecated: "IP Router Alert is no longer required for PIM";
		    %help:	short "Enable the IP Router Alert option check";
		    %create:;
		    %set:;
		    %delete:;
		}

		dr-priority {
		    %help:	short "Set the Designated Router election priority";
		    %create:	xrl "$(pimsm6.targetname)/pim/0.1/set_vif_dr_priority?vif_name:txt=$(vif.@)&dr_priority:u32=$(@)";
		    %set:	xrl "$(pimsm6.targetname)/pim/0.1/set_vif_dr_priority?vif_name:txt=$(vif.@)&dr_priority:u32=$(@)";
		    %delete:	xrl "$(pimsm6.targetname)/pim/0.1/set_vif_dr_priority?vif_name:txt=$(vif.@)&dr_priority:u32=$(DEFAULT)";
		}

		hello-period {
		    %help:	short "Set the Hello messages period (in seconds)";
		    %allow-range: $(@) "1" "18724" %help: "The Hello messages period (in seconds)";
		    %create:	xrl "$(pimsm6.targetname)/pim/0.1/set_vif_hello_period?vif_name:txt=$(vif.@)&hello_period:u32=$(@)";
		    %set:	xrl "$(pimsm6.targetname)/pim/0.1/set_vif_hello_period?vif_name:txt=$(vif.@)&hello_period:u32=$(@)";
		    %delete:	xrl "$(pimsm6.targetname)/pim/0.1/set_vif_hello_period?vif_name:txt=$(vif.@)&hello_period:u32=$(DEFAULT)";
		}

		hello-triggered-delay {
		    %help:	short "Set the randomized triggered delay of the Hello messages (in seconds)";
		    %allow-range: $(@) "1" "255" %help: "The randomized triggered delay of the Hello messages (in seconds)";
		    %create:	xrl "$(pimsm6.targetname)/pim/0.1/set_vif_hello_triggered_delay?vif_name:txt=$(vif.@)&hello_triggered_delay:u32=$(@)";
		    %set:	xrl "$(pimsm6.targetname)/pim/0.1/set_vif_hello_triggered_delay?vif_name:txt=$(vif.@)&hello_triggered_delay:u32=$(@)";
		    %delete:	xrl "$(pimsm6.targetname)/pim/0.1/set_vif_hello_triggered_delay?vif_name:txt=$(vif.@)&hello_triggered_delay:u32=$(DEFAULT)";
		}

		alternative-subnet @ {
		    %help:	short "Fake a subnet to appear directly-connected";
		    %create:	xrl "$(pimsm6.targetname)/pim/0.1/add_alternative_subnet6?vif_name:txt=$(vif.@)&subnet:ipv6net=$(alternative-subnet.@)";
		    %delete:	xrl "$(pimsm6.targetname)/pim/0.1/delete_alternative_subnet6?vif_name:txt=$(vif.@)&subnet:ipv6net=$(alternative-subnet.@)";
		}
	    }
	}

	static-rps {
	    %help:	short "Configure the set of static RPs";
	    %activate:	xrl "$(pimsm6.targetname)/pim/0.1/config_static_rp_done";
	    %update:	xrl "$(pimsm6.targetname)/pim/0.1/config_static_rp_done";
	    %delete:	xrl "$(pimsm6.targetname)/pim/0.1/delete_config_all_static_rps";
	    %delete:	xrl "$(pimsm6.targetname)/pim/0.1/config_static_rp_done";
	    rp @ {
		%help:	short "Configure a static RP";
		%delete:	xrl "$(pimsm6.targetname)/pim/0.1/delete_config_all_static_group_prefixes_rp6?rp_addr:ipv6=$(rp.@)";
		%delete:	xrl "$(pimsm6.targetname)/pim/0.1/config_static_rp_done";

		group-prefix @ {
		    %help:	short "Configure the group prefix address covered by the RP";
		    %create:	xrl "$(pimsm6.targetname)/pim/0.1/add_config_static_rp6?group_prefix:ipv6net=$(group-prefix.@)&rp_addr:ipv6=$(rp.@)&rp_priority:u32=$(@.rp-priority)&hash_mask_len:u32=$(@.hash-mask-len)";
		    %delete:	xrl "$(pimsm6.targetname)/pim/0.1/delete_config_static_rp6?group_prefix:ipv6net=$(group-prefix.@)&rp_addr:ipv6=$(rp.@)";
		    %delete:	xrl "$(pimsm6.targetname)/pim/0.1/config_static_rp_done";

		    rp-priority {
			%help:	short "Configure the RP priority";
			%allow-range: $(@) "0" "255" %help: "The RP priority";
			%create:;
			%set:	xrl "$(pimsm6.targetname)/pim/0.1/add_config_static_rp6?group_prefix:ipv6net=$(group-prefix.@)&rp_addr:ipv6=$(rp.@)&rp_priority:u32=$(group-prefix.@.rp-priority)&hash_mask_len:u32=$(group-prefix.@.hash-mask-len)";
			%delete:	xrl "$(pimsm6.targetname)/pim/0.1/add_config_static_rp6?group_prefix:ipv6net=$(group-prefix.@)&rp_addr:ipv6=$(rp.@)&rp_priority:u32=$(DEFAULT)&hash_mask_len:u32=$(group-prefix.@.hash-mask-len)";
			%delete:	xrl "$(pimsm6.targetname)/pim/0.1/config_static_rp_done";
		    }

		    hash-mask-len {
			%help:	short "Configure the hash mask length for the hash function";
			%allow-range: $(@) "8" "128" %help: "The hash mask length for the hash function";
			%create:;
			%set:	xrl "$(pimsm6.targetname)/pim/0.1/add_config_static_rp6?group_prefix:ipv6net=$(group-prefix.@)&rp_addr:ipv6=$(rp.@)&rp_priority:u32=$(group-prefix.@.rp-priority)&hash_mask_len:u32=$(group-prefix.@.hash-mask-len)";
			%delete:	xrl "$(pimsm6.targetname)/pim/0.1/add_config_static_rp6?group_prefix:ipv6net=$(group-prefix.@)&rp_addr:ipv6=$(rp.@)&rp_priority:u32=$(group-prefix.@.rp-priority)&hash_mask_len:u32=$(DEFAULT)";
			%delete:	xrl "$(pimsm6.targetname)/pim/0.1/config_static_rp_done";
		    }
		}
	    }
	}

	bootstrap {
	    %help:	short "Configure the IPv6 Bootstrap mechanism";
	    %activate:	xrl "$(pimsm6.targetname)/pim/0.1/stop_bsr";
	    %activate:	xrl "$(pimsm6.targetname)/pim/0.1/start_bsr";
	    %update:	xrl "$(pimsm6.targetname)/pim/0.1/stop_bsr";
	    %update:	xrl "$(pimsm6.targetname)/pim/0.1/start_bsr";
	    %delete:	xrl "$(pimsm6.targetname)/pim/0.1/stop_bsr";

	    disable {
		%help:	short "Disable the IPv6 Bootstrap mechanism";
		%create: xrl "$(pimsm6.targetname)/pim/0.1/enable_bsr?enable:bool=`~$(@)`";
		%set:	xrl "$(pimsm6.targetname)/pim/0.1/enable_bsr?enable:bool=`~$(@)`";
		%delete: xrl "$(pimsm6.targetname)/pim/0.1/enable_bsr?enable:bool=`~$(DEFAULT)`";
	    }

	    enabled {
		%deprecated: "Statement 'enabled: true/false' is replaced with 'disable: false/true'";
		%help:	short "Enable the IPv6 Bootstrap mechanism";
		%create: xrl "$(pimsm6.targetname)/pim/0.1/enable_bsr?enable:bool=$(@)";
		%set:	xrl "$(pimsm6.targetname)/pim/0.1/enable_bsr?enable:bool=$(@)";
	    }

	    cand-bsr {
		%help:	short "Configure this router as a Candidate-BSR";
		scope-zone @ {
		    %help:	short "Configure a scope zone in this Candidate-BSR";
		    %mandatory: $(@.cand-bsr-by-vif-name);

		    %create:	xrl "$(pimsm6.targetname)/pim/0.1/add_config_cand_bsr6?scope_zone_id:ipv6net=$(scope-zone.@)&is_scope_zone:bool=$(@.is-scope-zone)&vif_name:txt=$(@.cand-bsr-by-vif-name)&vif_addr:ipv6=$(@.cand-bsr-by-vif-addr)&bsr_priority:u32=$(@.bsr-priority)&hash_mask_len:u32=$(@.hash-mask-len)";
		    %update:	xrl "$(pimsm6.targetname)/pim/0.1/add_config_cand_bsr6?scope_zone_id:ipv6net=$(scope-zone.@)&is_scope_zone:bool=$(@.is-scope-zone)&vif_name:txt=$(@.cand-bsr-by-vif-name)&vif_addr:ipv6=$(@.cand-bsr-by-vif-addr)&bsr_priority:u32=$(@.bsr-priority)&hash_mask_len:u32=$(@.hash-mask-len)";
		    %delete:	xrl "$(pimsm6.targetname)/pim/0.1/delete_config_cand_bsr6?scope_zone_id:ipv6net=$(scope-zone.@)&is_scope_zone:bool=$(@.is-scope-zone)";

		    is-scope-zone {
			%help:	short "Flag to indicate a scoped or global zone";
			%set:;
		    }

		    cand-bsr-by-vif-name {
			%help:	short "Specify the virtual interface with the address of the Candidate-BSR";
			%set:;
		    }

		    cand-bsr-by-vif-addr {
			%help:	short "Specify the virtual interface's address to use as the Candidate-BSR";
			%set:;
		    }

		    bsr-priority {
			%help:	short "Configure the Candidate-BSR priority";
			%allow-range: $(@) "0" "255" %help: "The Candidate-BSR priority";
			%set:;
		    }

		    hash-mask-len {
			%help:	short "Configure the hash mask length for the hash function";
			%allow-range: $(@) "8" "128" %help: "The hash mask length for the hash function";
			%set:;
		    }
		}
	    }

	    cand-rp {
		%help:	short "Configure this router as a Candidate-RP";
		group-prefix @ {
		    %help:	short "Configure a scope zone in this Candidate-RP";
		    %mandatory:	$(@.cand-rp-by-vif-name);

		    %create: xrl "$(pimsm6.targetname)/pim/0.1/add_config_cand_rp6?group_prefix:ipv6net=$(group-prefix.@)&is_scope_zone:bool=$(@.is-scope-zone)&vif_name:txt=$(@.cand-rp-by-vif-name)&vif_addr:ipv6=$(@.cand-rp-by-vif-addr)&rp_priority:u32=$(@.rp-priority)&rp_holdtime:u32=$(@.rp-holdtime)";
		    %update: xrl "$(pimsm6.targetname)/pim/0.1/add_config_cand_rp6?group_prefix:ipv6net=$(group-prefix.@)&is_scope_zone:bool=$(@.is-scope-zone)&vif_name:txt=$(@.cand-rp-by-vif-name)&vif_addr:ipv6=$(@.cand-rp-by-vif-addr)&rp_priority:u32=$(@.rp-priority)&rp_holdtime:u32=$(@.rp-holdtime)";
		    %delete:	xrl "$(pimsm6.targetname)/pim/0.1/delete_config_cand_rp6?group_prefix:ipv6net=$(group-prefix.@)&is_scope_zone:bool=$(@.is-scope-zone)&vif_name:txt=$(@.cand-rp-by-vif-name)&vif_addr:ipv6=$(@.cand-rp-by-vif-addr)";

		    is-scope-zone {
			%help:	short "Flag to indicate a scoped or global zone";
			%set:;
		    }

		    cand-rp-by-vif-name {
			%help:	short "Specify the virtual interface with the address of the Candidate-RP";
			%set:;
		    }

		    cand-rp-by-vif-addr {
			%help:	short "Specify the virtual interface's address to use as the Candidate-RP";
			%set:;
		    }

		    rp-priority {
			%help:	short "Configure the Candidate-RP priority";
			%allow-range: $(@) "0" "255" %help: "The Candidate-RP priority";
			%set:;
		    }

		    rp-holdtime {
			%help:	short "Configure the Candidate-RP holdtime";
			%allow-range: $(@) "0" "65535" %help: "The Candidate-RP holdtime (in seconds)";
			%set:;
		    }
		}
	    }
	}

	switch-to-spt-threshold {
	    %help:	short "Configure the shortest-path switch threshold";
	    %activate:	xrl "$(pimsm6.targetname)/pim/0.1/set_switch_to_spt_threshold?is_enabled:bool=`~$(@.disable)`&interval_sec:u32=$(@.interval)&bytes:u32=$(@.bytes)";
	    %update:	xrl "$(pimsm6.targetname)/pim/0.1/set_switch_to_spt_threshold?is_enabled:bool=`~$(@.disable)`&interval_sec:u32=$(@.interval)&bytes:u32=$(@.bytes)";
	    %delete: xrl "$(pimsm6.targetname)/pim/0.1/reset_switch_to_spt_threshold";

	    disable {
		%help:	short "Disable the shortest-path switching";
		%set:;
	    }

	    enabled {
		%deprecated: "Statement 'enabled: true/false' is replaced with 'disable: false/true'";
		%help:	short "Enable the shortest-path switching";
		%set:;
	    }

	    interval {
		%help:	short "The frequency of measuring the bandwidth threshold (sec)";
		%allow-range: $(@) "3" "2147483647" %help: "The frequency of measuring the bandwidth threshold (sec)";
		%set:;
	    }

	    bytes {
		%help:	short "The bandwidth threshold (in bytes) per interval";
		%set:;
	    }
	}

	traceoptions {
	    %help:	short "Configure the tracing options";
	    flag {
		%help:	short "Configure the tracing operation to perform";
		all {
		    %help:	short	"Configure all tracing operations";

		    disable {
			%help:	short	"Disable all tracing operations";
			%set:	xrl "$(pimsm6.targetname)/pim/0.1/log_trace_all?enable:bool=`~$(@)`";
			%delete: xrl "$(pimsm6.targetname)/pim/0.1/log_trace_all?enable:bool=$(DEFAULT)";
		    }

		    enabled {
			%deprecated: "Statement 'enabled: true/false' is replaced with 'disable: false/true'";
			%help:	short	"Enable all tracing operations";
			%set:	xrl "$(pimsm6.targetname)/pim/0.1/log_trace_all?enable:bool=$(@)";
		    }
		}
	    }
	}
    }
}
