/* $XORP: xorp/etc/templates/fea.tp,v 1.41 2008/04/26 00:59:41 pavlin Exp $ */

fea {
    targetname:			txt = "fea";

    unicast-forwarding4 {
	disable:		toggle = false;
	table-id:		u32;
	forwarding-entries {
	    retain-on-startup:	bool = false;
	    retain-on-shutdown:	bool = false;
	}
    }
    enable-unicast-forwarding4:	bool;		/* %deprecated */

    unicast-forwarding6 {
	disable:		toggle = false;
	table-id:		u32;
	forwarding-entries {
	    retain-on-startup:	bool = false;
	    retain-on-shutdown:	bool = false;
	}
    }
    enable-unicast-forwarding6:	bool;		/* %deprecated */

    click {
	disable:			toggle = false;
	enabled:			bool;	/* %deprecated */
	duplicate-routes-to-kernel:	bool = false;

	kernel-click {
	    disable:				bool = false;
	    enabled:				bool;	/* %deprecated */
	    install-on-startup:	bool = false;
	    kernel-click-modules:		txt = "/usr/local/click/linuxmodule/proclikefs.o:/usr/local/click/linuxmodule/click.o";
	    mount-directory:	txt = "/click";
	    kernel-click-config-generator-file:	txt = "/usr/local/xorp/fea/xorp_fea_click_config_generator";
	}

	user-click {
	    disable:			bool = false;
	    enabled:			bool;	/* %deprecated */
	    command-file:		txt = "/usr/local/bin/click";
	    command-extra-arguments:	txt = "-R";
	    command-execute-on-startup:	bool = true;
	    control-address:		ipv4 = 127.0.0.1;
	    control-socket-port:	u32 = 13000;
	    startup-config-file:	txt = "/dev/null";
	    user-click-config-generator-file:	txt = "/usr/local/xorp/fea/xorp_fea_click_config_generator";
	}
    }
}

fea {
    %help:	short		"Configure the Forwarding Engine Abstraction";
    %modinfo:	provides	fea;
    %modinfo:	depends		firewall;
    %modinfo:	path		"fea/xorp_fea";
    %modinfo:	default_targetname "fea";

    %mandatory:	$(@.targetname);

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

    unicast-forwarding4 {
	%help:		short "Configure IPv4 unicast forwarding";
	disable {
	    %help:	short "Disable IPv4 unicast forwarding";
	    %set:	xrl "$(fea.targetname)/fti/0.2/set_unicast_forwarding_enabled4?enabled:bool=`~$(@)`";
	    %delete:	xrl "$(fea.targetname)/fti/0.2/set_unicast_forwarding_enabled4?enabled:bool=`~$(DEFAULT)`";
	}

	table-id {
	    %help:	short "Configure IPv4 unicast forwarding table ID";
	    %set:	xrl "$(fea.targetname)/fti/0.2/set_unicast_forwarding_table_id4?is_configured:bool=true&table_id:u32=$(@)";
	    %delete:	xrl "$(fea.targetname)/fti/0.2/set_unicast_forwarding_table_id4?is_configured:bool=false&table_id:u32=0";
	}

	forwarding-entries {
	    %help:	short "Configure IPv4 forwarding entries properties";
	    retain-on-startup {
		%help:	short "Retain IPv4 unicast forwarding entries on startup";
		%set:	xrl "$(fea.targetname)/fti/0.2/set_unicast_forwarding_entries_retain_on_startup4?retain:bool=$(@)";
		%delete:	xrl "$(fea.targetname)/fti/0.2/set_unicast_forwarding_entries_retain_on_startup4?retain:bool=$(DEFAULT)";
	    }
	    retain-on-shutdown {
		%help:	short "Retain IPv4 unicast forwarding entries on shutdown";
		%set:	xrl "$(fea.targetname)/fti/0.2/set_unicast_forwarding_entries_retain_on_shutdown4?retain:bool=$(@)";
		%delete:	xrl "$(fea.targetname)/fti/0.2/set_unicast_forwarding_entries_retain_on_shutdown4?retain:bool=$(DEFAULT)";
	    }
	}
    }

    enable-unicast-forwarding4 {
	%deprecated: "Statement 'enable-unicast-forwarding4: true/false' is replaced with 'unicast-forwarding4 { disable: false/true }'";
	%help:		short "Enable IPv4 unicast forwarding";
	%set:		xrl "$(fea.targetname)/fti/0.2/set_unicast_forwarding_enabled4?enabled:bool=$(@)";
	%delete:	xrl "$(fea.targetname)/fti/0.2/set_unicast_forwarding_enabled4?enabled:bool=`~$(DEFAULT)`";
    }

    unicast-forwarding6 {
	%help:		short "Configure IPv6 unicast forwarding";
	disable {
	    %help:	short "Disable IPv6 unicast forwarding";
	    %set:	xrl "$(fea.targetname)/fti/0.2/set_unicast_forwarding_enabled6?enabled:bool=`~$(@)`";
	    %delete:	xrl "$(fea.targetname)/fti/0.2/set_unicast_forwarding_enabled6?enabled:bool=`~$(DEFAULT)`";
	}

	table-id {
	    %help:	short "Configure IPv6 unicast forwarding table ID";
	    %set:	xrl "$(fea.targetname)/fti/0.2/set_unicast_forwarding_table_id6?is_configured:bool=true&table_id:u32=$(@)";
	    %delete:	xrl "$(fea.targetname)/fti/0.2/set_unicast_forwarding_table_id6?is_configured:bool=false&table_id:u32=0";
	}

	forwarding-entries {
	    %help:	short "Configure IPv6 forwarding entries properties";
	    retain-on-startup {
		%help:	short "Retain IPv6 unicast forwarding entries on startup";
		%set:	xrl "$(fea.targetname)/fti/0.2/set_unicast_forwarding_entries_retain_on_startup6?retain:bool=$(@)";
		%delete:	xrl "$(fea.targetname)/fti/0.2/set_unicast_forwarding_entries_retain_on_startup6?retain:bool=$(DEFAULT)";
	    }
	    retain-on-shutdown {
		%help:	short "Retain IPv6 unicast forwarding entries on shutdown";
		%set:	xrl "$(fea.targetname)/fti/0.2/set_unicast_forwarding_entries_retain_on_shutdown6?retain:bool=$(@)";
		%delete:	xrl "$(fea.targetname)/fti/0.2/set_unicast_forwarding_entries_retain_on_shutdown6?retain:bool=$(DEFAULT)";
	    }
	}
    }

    enable-unicast-forwarding6 {
	%deprecated: "Statement 'enable-unicast-forwarding6: true/false' is replaced with 'unicast-forwarding6 { disable: false/true }'";
	%help:		short "Enable IPv6 unicast forwarding";
	%set:		xrl "$(fea.targetname)/fti/0.2/set_unicast_forwarding_enabled6?enabled:bool=$(@)";
	%delete:	xrl "$(fea.targetname)/fti/0.2/set_unicast_forwarding_enabled6?enabled:bool=`~$(DEFAULT)`";
    }

    click {
	%help:		short "Configure Click FEA support";
	%create:	xrl "$(fea.targetname)/fea_click/0.1/load_click";
	%activate:	xrl "$(fea.targetname)/fea_click/0.1/start_click";
	%delete:	xrl "$(fea.targetname)/fea_click/0.1/unload_click";

	disable {
	    %help:	short "Disable Click FEA support";
	    %set:	xrl "$(fea.targetname)/fea_click/0.1/enable_click?enable:bool=`~$(@)`";
	    %delete:	xrl "$(fea.targetname)/fea_click/0.1/enable_click?enable:bool=`~$(DEFAULT)`";
	}

	enabled {
	    %deprecated: "Statement 'enabled: true/false' is replaced with 'disable: false/true'";
	    %help:	short "Enable Click FEA support";
	    %set:	xrl "$(fea.targetname)/fea_click/0.1/enable_click?enable:bool=$(@)";
	}

	duplicate-routes-to-kernel {
	    %help:	short "Enable duplicating the Click routes to the system kernel";
	    %set:	xrl "$(fea.targetname)/fea_click/0.1/enable_duplicate_routes_to_kernel?enable:bool=$(@)";
	    %delete:	xrl "$(fea.targetname)/fea_click/0.1/enable_duplicate_routes_to_kernel?enable:bool=$(DEFAULT)";
	}

	kernel-click {
	    disable {
		%help:	short "Disable kernel-level Click FEA support";
		%set:		xrl "$(fea.targetname)/fea_click/0.1/enable_kernel_click?enable:bool=`~$(@)`";
		%delete:	xrl "$(fea.targetname)/fea_click/0.1/enable_kernel_click?enable:bool=`~$(DEFAULT)`";
	    }

	    enabled {
		%deprecated: "Statement 'enabled: true/false' is replaced with 'disable: false/true'";
		%help:	short "Enable kernel-level Click FEA support";
		%set:		xrl "$(fea.targetname)/fea_click/0.1/enable_kernel_click?enable:bool=$(@)";
	    }

	    install-on-startup {
		%help:	short "Enable installing kernel-level Click on startup";
		%set:		xrl "$(fea.targetname)/fea_click/0.1/enable_kernel_click_install_on_startup?enable:bool=$(@)";
		%delete:	xrl "$(fea.targetname)/fea_click/0.1/enable_kernel_click_install_on_startup?enable:bool=$(DEFAULT)";
	    }

	    kernel-click-modules {
		%help:	short "Specify the list of kernel Click modules (separated by colon) to load on startup (if installing kernel-level Click on startup is enabled)";
		%set:		xrl "$(fea.targetname)/fea_click/0.1/set_kernel_click_modules?modules:txt=$(@)";
		%delete:	xrl "$(fea.targetname)/fea_click/0.1/set_kernel_click_modules?modules:txt=$(DEFAULT)";
	    }

	    mount-directory {
		%help:	short "Specify the kernel-level Click mount directory";
		%set:		xrl "$(fea.targetname)/fea_click/0.1/set_kernel_click_mount_directory?directory:txt=$(@)";
		%delete:	xrl "$(fea.targetname)/fea_click/0.1/set_kernel_click_mount_directory?directory:txt=$(DEFAULT)";
	    }

	    kernel-click-config-generator-file {
		%help:	short "Specify the external program to generate the kernel-level Click configuration";
		%set:	xrl "$(fea.targetname)/fea_click/0.1/set_kernel_click_config_generator_file?kernel_click_config_generator_file:txt=$(@)";
	    }
	}

	user-click {
	    disable {
		%help:	short "Disable user-level Click FEA support";
		%set:		xrl "$(fea.targetname)/fea_click/0.1/enable_user_click?enable:bool=`~$(@)`";
		%delete:	xrl "$(fea.targetname)/fea_click/0.1/enable_user_click?enable:bool=`~$(DEFAULT)`";
	    }

	    enabled {
		%deprecated: "Statement 'enabled: true/false' is replaced with 'disable: false/true'";
		%help:	short "Enable user-level Click FEA support";
		%set:		xrl "$(fea.targetname)/fea_click/0.1/enable_user_click?enable:bool=$(@)";
	    }

	    command-file {
		%help:	short "Specify the user-level Click command file";
		%set:	xrl "$(fea.targetname)/fea_click/0.1/set_user_click_command_file?user_click_command_file:txt=$(@)";
	    }

	    command-extra-arguments {
		%help:	short "Specify the extra arguments to the user-level Click command";
		%set:	xrl "$(fea.targetname)/fea_click/0.1/set_user_click_command_extra_arguments?user_click_command_extra_arguments:txt=$(@)";
	    }

	    command-execute-on-startup {
		%help:	short "Specify whether to execute on startup the user-level Click command";
		%set:	xrl "$(fea.targetname)/fea_click/0.1/set_user_click_command_execute_on_startup?user_click_command_execute_on_startup:bool=$(@)";
	    }

	    control-address {
		%help:	short "Specify the address to use for control access to the user-level Click";
		%set:	xrl "$(fea.targetname)/fea_click/0.1/set_user_click_control_address?user_click_control_address:ipv4=$(@)";
	    }

	    control-socket-port {
		%help:	short "Specify the socket port to use for control access to the user-level Click";
		%allow-range: $(@) "1" "65535" %help: "The control socket port";
		%set:	xrl "$(fea.targetname)/fea_click/0.1/set_user_click_control_socket_port?user_click_control_socket_port:u32=$(@)";
	    }

	    startup-config-file {
		%help:	short "Specify the configuration file to be used by user-level Click on startup";
		%set:	xrl "$(fea.targetname)/fea_click/0.1/set_user_click_startup_config_file?user_click_startup_config_file:txt=$(@)";
	    }

	    user-click-config-generator-file {
		%help:	short "Specify the external program to generate the user-level Click configuration";
		%set:	xrl "$(fea.targetname)/fea_click/0.1/set_user_click_config_generator_file?user_click_config_generator_file:txt=$(@)";
	    }
	}
    }
}
