<?xml version='1.0' encoding='utf-8'?>

<creole>
    <containers>
        <container name='proxy'>
            <package>cntlm</package>
            <file filelist='cntlm' name='/etc/cntlm.conf'/>
            <service servicelist='cntlm'>cntlm</service>
            <service_access service='cntlm'>
                <port port_type="SymLinkOption">cntlm_port</port>
            </service_access>
            <service_restriction service='cntlm'>
                <!--interface-->
                <ip service_restrictionlist='cntlm_eth0' interface='eth0' netmask='adresse_network_eth0' netmask_type='SymLinkOption' ip_type='SymLinkOption'>adresse_netmask_eth0</ip>
                <ip interface='eth1' netmask='adresse_network_eth1' netmask_type='SymLinkOption' ip_type='SymLinkOption'>adresse_netmask_eth1</ip>
                <ip interface='eth2' netmask='adresse_network_eth2' netmask_type='SymLinkOption' ip_type='SymLinkOption'>adresse_netmask_eth2</ip>
                <ip interface='eth3' netmask='adresse_network_eth3' netmask_type='SymLinkOption' ip_type='SymLinkOption'>adresse_netmask_eth3</ip>
                <ip interface='eth4' netmask='adresse_network_eth4' netmask_type='SymLinkOption' ip_type='SymLinkOption'>adresse_netmask_eth4</ip>
                <!--vlan-->
                <ip service_restrictionlist='cntlm_eth0' interface='eth0' netmask='vlan_netmask_eth0' netmask_type='SymLinkOption' ip_type='SymLinkOption'>vlan_netmask_eth0</ip>
                <ip interface='eth1' netmask='vlan_netmask_eth1' netmask_type='SymLinkOption' ip_type='SymLinkOption'>vlan_netmask_eth1</ip>
                <ip interface='eth2' netmask='vlan_netmask_eth2' netmask_type='SymLinkOption' ip_type='SymLinkOption'>vlan_netmask_eth2</ip>
                <ip interface='eth3' netmask='vlan_netmask_eth3' netmask_type='SymLinkOption' ip_type='SymLinkOption'>vlan_netmask_eth3</ip>
                <ip interface='eth4' netmask='vlan_netmask_eth4' netmask_type='SymLinkOption' ip_type='SymLinkOption'>vlan_netmask_eth4</ip>
            </service_restriction>
        </container>
    </containers>

    <variables>
        <family name='Interface-0'>
            <variable name='activer_cntlm_eth0' type='oui/non' description="Activer le proxy NTLM sur cette interface" mode="expert"/>
        </family>
        <family name='Interface-1'>
            <variable name='activer_cntlm_eth1' type='oui/non' description="Activer le proxy NTLM sur cette interface" mode="expert"/>
        </family>
        <family name='Interface-2'>
            <variable name='activer_cntlm_eth2' type='oui/non' description="Activer le proxy NTLM sur cette interface" mode="expert"/>
        </family>
        <family name='Interface-3'>
            <variable name='activer_cntlm_eth3' type='oui/non' description="Activer le proxy NTLM sur cette interface" mode="expert"/>
        </family>
        <family name='Interface-4'>
            <variable name='activer_cntlm_eth4' type='oui/non' description="Activer le proxy NTLM sur cette interface" mode="expert"/>
        </family>

        <family name='proxy authentifié'>
            <variable name='activer_cntlm' type='oui/non' description="Activer le proxy NTLM">
                <value>non</value>
            </variable>
            <variable name='cntlm_port' type='port' description="Port d'écoute du proxy NTLM" mode='expert'>
                <value>3127</value>
            </variable>
        </family>
    </variables>

    <constraints>
        <condition name='disabled_if_not_in' source='activer_cntlm'>
            <param>oui</param>
            <target type='servicelist'>cntlm</target>
            <target type='filelist'>cntlm</target>
            <target type='variable'>cntlm_port</target>
            <target>activer_cntlm_eth0</target>
            <target>activer_cntlm_eth1</target>
            <target>activer_cntlm_eth2</target>
            <target>activer_cntlm_eth3</target>
            <target>activer_cntlm_eth4</target>
        </condition>
        <condition name='disabled_if_not_in' source='squid_auth_eth1'>
            <param>oui</param>
            <target>activer_cntlm_eth1</target>
        </condition>
        <condition name='disabled_if_not_in' source='squid_auth_eth2'>
            <param>oui</param>
            <target>activer_cntlm_eth2</target>
        </condition>
        <condition name='disabled_if_not_in' source='squid_auth_eth3'>
            <param>oui</param>
            <target>activer_cntlm_eth3</target>
        </condition>
        <condition name='disabled_if_not_in' source='squid_auth_eth4'>
            <param>oui</param>
            <target>activer_cntlm_eth4</target>
        </condition>
        <condition name='disabled_if_not_in' source='nombre_interfaces' >
            <param>1</param>
            <target type='service_restrictionlist'>cntlm_eth0</target>
        </condition>
        <condition name='disabled_if_not_in' source='type_squid_auth'>
            <param>NTLM/SMB</param>
            <param>NTLM/KERBEROS</param>
            <target type='variable'>activer_cntlm</target>
        </condition>
        <fill name='calc_val' target='activer_cntlm_eth0'>
            <param type='eole' name='valeur'>activer_cntlm</param>
        </fill>
        <fill name='calc_val' target='activer_cntlm_eth1'>
            <param type='eole' name='valeur'>activer_cntlm</param>
        </fill>
        <fill name='calc_val' target='activer_cntlm_eth2'>
            <param type='eole' name='valeur'>activer_cntlm</param>
        </fill>
        <fill name='calc_val' target='activer_cntlm_eth3'>
            <param type='eole' name='valeur'>activer_cntlm</param>
        </fill>
        <fill name='calc_val' target='activer_cntlm_eth4'>
            <param type='eole' name='valeur'>activer_cntlm</param>
        </fill>
        <fill name='calc_multi_condition' target='wpad_proxyport_eth0'>
            <param>non</param>
            <param type='eole' name='condition_1' hidden="False">activer_cntlm_eth0</param>
            <param name='match'>3128</param>
            <param name='mismatch' type='eole' hidden="False">cntlm_port</param>
        </fill>
        <fill name='calc_multi_condition' target='wpad_proxyport_eth1'>
            <param>non</param>
            <param type='eole' name='condition_1' hidden="False">activer_cntlm_eth1</param>
            <param name='match'>3128</param>
            <param name='mismatch' type='eole' hidden="False">cntlm_port</param>
        </fill>
        <fill name='calc_multi_condition' target='wpad_proxyport_eth2'>
            <param>non</param>
            <param type='eole' name='condition_1' hidden="False">activer_cntlm_eth2</param>
            <param name='match'>3128</param>
            <param name='mismatch' type='eole' hidden="False">cntlm_port</param>
        </fill>
        <fill name='calc_multi_condition' target='wpad_proxyport_eth3'>
            <param>non</param>
            <param type='eole' name='condition_1' hidden="False">activer_cntlm_eth3</param>
            <param name='match'>3128</param>
            <param name='mismatch' type='eole' hidden="False">cntlm_port</param>
        </fill>
        <fill name='calc_multi_condition' target='wpad_proxyport_eth4'>
            <param>non</param>
            <param type='eole' name='condition_1' hidden="False">activer_cntlm_eth4</param>
            <param name='match'>3128</param>
            <param name='mismatch' type='eole' hidden="False">cntlm_port</param>
        </fill>
    </constraints>

    <help>
        <variable name="activer_cntlm">CNTLM est un proxy permettant de s'authentifier en NTLM / NTLM Session Response / NTLMv2. L'authentification se fera sur le premier domaine spécifié.</variable>
    </help>

</creole>

