<!-- Copyright (C) 2017  Patrick Reichenberger (University of Passau) <patrick.reichenberger@t-online.de>

 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
 as published by the Free Software Foundation; either version 2
 of the License, or (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-->

<core>
    <template>
        <!-- General information about the template -->
        <entity name="unit">S7-300</entity>
        <entity name="vendor">Siemens</entity>
        <entity name="description">Creates a simple device for IEC 60870-5-104</entity>
        <entity name="protocols">IEC104, SNMP</entity>
        <entity name="creator">Patrick Reichenberger</entity>
    </template>
    <databus>
        <!-- Core value that can be retrieved from the databus by key -->
        <key_value_mappings>
            <!-- SNMPv2-MIB -->
            <key name="SystemDescription">
                <value type="value">"Siemens, SIMATIC, S7-300"</value>
            </key>
            <key name="sysObjectID">
                <value type="value">"0.0"</value>
            </key>
            <key name="Uptime">
                <value type="function">conpot.emulators.misc.uptime.Uptime</value>
            </key>
            <key name="sysContact">
                <value type="value">"Corporate IT"</value>
            </key>
            <key name="sysName">
                <value type="value">"DE-BER01"</value>
            </key>
            <key name="sysLocation">
                <value type="value">"BER01, T2E"</value>
            </key>
            <key name="sysServices">
                <value type="value">"72"</value>
            </key>
            <!-- IF-MIB -->
            <key name="ifNumber">
                <value type="value">1</value>
            </key>
            <key name="ifIndex">
                <value type="value">1</value>
            </key>
            <key name="ifDescr">
                <value type="value">"Siemens, SIMATIC NET, CP 343-1 PN, 6GK7 343-1EX21-0XE0, HW: Version 2, FW: Version V1.2.3, Ethernet Port 1, Rack 0, 100Mbit"</value>
            </key>
            <key name="ifType">
                <value type="value">6</value>
            </key>
            <key name="ifMtu">
                <value type="value">1000</value>
            </key>
            <key name="ifSpeed">
                <value type="value">100000000</value>
            </key>
            <key name="ifPhysAddress">
                <value type="value">"\x00\x0e\x8c\x29\xc5\x1a"</value>
            </key>
            <key name="ifAdminStatus">
                <value type="value">1</value>
            </key>
            <key name="ifOperStatus">
                <value type="value">1</value>
            </key>
            <key name="ifLastChange">
                <value type="function">conpot.emulators.misc.uptime.Uptime</value>
            </key>
            <key name="FacilityName">
                <value type="value">"Compagnie Generale des Eaux"</value>
            </key>
            <key name="0">
                <value type="value">0</value>
            </key>
            <key name="1">
                <value type="value">1</value>
            </key>
            <key name="ifInOctets">
                <value type="value">1618895</value>
            </key>
            <key name="ifInUcastPkts">
                <value type="value">7018</value>
            </key>
            <key name="ifInNUcastPkts">
                <value type="value">291</value>
            </key>
            <key name="ifOutOctets">
                <value type="value">455107</value>
            </key>
            <key name="ifOutUcastPkts">
                <value type="value">872264</value>
            </key>
            <key name="ifOutUNcastPkts">
                <value type="value">143</value>
            </key>

            <!-- IP-MIB -->
            <key name="ipForwarding">
                <value type="value">2</value>
            </key>
            <key name="ipDefaultTTL">
                <value type="value">60</value>
            </key>
            <key name="ipInReceives">
                <value type="value">31271</value>
            </key>
            <key name="ipInHdrErrors">
                <value type="value">0</value>
            </key>
            <key name="ipInAddrErrors">
                <value type="value">0</value>
            </key>
            <key name="ipForwDatagrams">
                <value type="value">0</value>
            </key>
            <key name="ipInUnknownProtos">
                <value type="value">0</value>
            </key>
            <key name="ipInDiscards">
                <value type="value">0</value>
            </key>
            <key name="ipInDelivers">
                <value type="value">31282</value>
            </key>
            <key name="ipOutRequests">
                <value type="value">69023</value>
            </key>
            <key name="ipOutDiscards">
                <value type="value">0</value>
            </key>
            <key name="ipOutNoRoutes">
                <value type="value">0</value>
            </key>
            <key name="ipReasmTimeout">
                <value type="value">60</value>
            </key>
            <key name="ipReasmReqds">
                <value type="value">7</value>
            </key>
            <key name="ipReasmOKs">
                <value type="value">3</value>
            </key>
            <key name="ipReasmFails">
                <value type="value">0</value>
            </key>
            <key name="ipFragOKs">
                <value type="value">0</value>
            </key>
            <key name="ipFragFails">
                <value type="value">0</value>
            </key>
            <key name="ipFragCreates">
                <value type="value">0</value>
            </key>
            <key name="ipAdEntAddr">
                <value type="value">"217.172.190.137"</value>
            </key>
            <key name="ipAdEntIfIndex">
                <value type="value">1</value>
            </key>
            <key name="ipAdEntNetMask">
                <value type="value">"255.255.255.255"</value>
            </key>
            <key name="ipAdEntBcastAddr">
                <value type="value">1</value>
            </key>
            <key name="ipAdEntReasmMaxSize">
                <value type="value">65528</value>
            </key>
            <key name="ipRoutingDiscards">
                <value type="value">0</value>
            </key>
            <key name="icmpInMsgs">
                <value type="value">4</value>
            </key>
            <key name="icmpInErrors">
                <value type="value">0</value>
            </key>
            <key name="icmpInDestUnreachs">
                <value type="value">1</value>
            </key>
            <key name="icmpInTimeExcds">
                <value type="value">0</value>
            </key>
            <key name="icmpInParmProbs">
                <value type="value">0</value>
            </key>
            <key name="icmpInSrcQuenchs">
                <value type="value">0</value>
            </key>
            <key name="icmpInRedirects">
                <value type="value">0</value>
            </key>
            <key name="icmpInEchos">
                <value type="value">0</value>
            </key>
            <key name="icmpInEchoReps">
                <value type="value">0</value>
            </key>
            <key name="icmpInTimestamps">
                <value type="value">0</value>
            </key>
            <key name="icmpInTimestampReps">
                <value type="value">0</value>
            </key>
            <key name="icmpInAddrMasks">
                <value type="value">0</value>
            </key>
            <key name="icmpInAddrMaskReps">
                <value type="value">0</value>
            </key>
            <key name="icmpOutMsgs">
                <value type="value">0</value>
            </key>
            <key name="icmpOutErrors">
                <value type="value">0</value>
            </key>
            <key name="icmpOutDestUnreachs">
                <value type="value">144</value>
            </key>
            <key name="icmpOutTimeExcds">
                <value type="value">0</value>
            </key>
            <key name="icmpOutParmProbs">
                <value type="value">0</value>
            </key>
            <key name="icmpOutSrcQuenchs">
                <value type="value">0</value>
            </key>
            <key name="icmpOutRedirects">
                <value type="value">0</value>
            </key>
            <key name="icmpOutEchos">
                <value type="value">0</value>
            </key>
            <key name="icmpOutEchoReps">
                <value type="value">0</value>
            </key>
            <key name="icmpOutTimestamps">
                <value type="value">0</value>
            </key>
            <key name="icmpOutTimestampReps">
                <value type="value">0</value>
            </key>
            <key name="icmpOutAddrMasks">
                <value type="value">0</value>
            </key>
            <key name="icmpOutAddrMaskReps">
                <value type="value">0</value>
            </key>

            <!-- TCP-MIB -->
            <key name="tcpRtoAlgorithm">
                <value type="value">2</value>
            </key>
            <key name="tcpRtoMin">
                <value type="value">0</value>
            </key>
            <key name="tcpRtoMax">
                <value type="value">100</value>
            </key>
            <key name="tcpMaxConn">
                <value type="value">-1</value>
            </key>
            <key name="tcpActiveOpens">
                <value type="value">0</value>
            </key>
            <key name="tcpPassiveOpens">
                <value type="value">101</value>
            </key>
            <key name="tcpAttemptFails">
                <value type="value">42</value>
            </key>
            <key name="tcpEstabResets">
                <value type="value">45</value>
            </key>
            <key name="tcpCurrEstab">
                <value type="value">0</value>
            </key>
            <key name="tcpInSegs">
                <value type="value">30321</value>
            </key>
            <key name="tcpOutSegs">
                <value type="value">67821</value>
            </key>
            <key name="tcpRetransSegs">
                <value type="value">2511</value>
            </key>
            <key name="tcpConnState">
                <value type="value">2</value>
            </key>
            <key name="tcpConnLocalAddress">
                <value type="value">"217.172.190.137"</value>
            </key>
            <key name="tcpConnLocalPort">
                <value type="value">2404</value>
            </key>
            <key name="tcpConnRemAddress">
                <value type="value">"0.0.0.0"</value>
            </key>
            <key name="tcpConnRemPort">
                <value type="value">0</value>
            </key>
            <key name="tcpInErrs">
                <value type="value">1</value>
            </key>
            <key name="tcpOutRsts">
                <value type="value">728</value>
            </key>
            <!-- UDP-MIB -->
            <key name="udpInDatagrams">
                <value type="value">1441</value>
            </key>
            <key name="udpNoPorts">
                <value type="value">1280</value>
            </key>
            <key name="udpInErrors">
                <value type="value">23</value>
            </key>
            <key name="udpOutDatagrams">
                <value type="value">47</value>
            </key>
            <key name="udpLocalAddress">
                <value type="value">"217.172.190.137"</value>
            </key>
            <key name="udpLocalPort">
                <value type="value">161</value>
            </key>
            <key name="SystemName">
                <value type="value">"CP 343-1 IT"</value>
            </key>


            <!-- IEC104 Protocol parameter -->
            <!-- Timeout of connection establishment -->
            <key name="T_0">
                <value type="value">30</value>
            </key>
            <!-- Timeout of send or test APDUs (Wartezeit auf Quittung) -->
            <key name="T_1">
                <value type="value">15</value>
            </key>
            <!-- Timeout for acknowledges in case of no data messages T_2 < T_1 (Quittieren nach x sek) -->
            <key name="T_2">
                <value type="value">10</value>
            </key>
            <!-- Timeout for sending test frames in case of a long idle state -->
            <key name="T_3">
                <value type="value">20</value>
            </key>
            <!-- Maximum difference receive sequence number to send state variable (Max. Anzahl unquittierter Telegramme) -->
            <!-- not implemented yet -->
            <key name="k">
                <value type="value">12</value>
            </key>
            <!-- Latest acknowledge after receiving w I-format APDUs (Quittieren nach w Telegrammen) -->
            <key name="w">
                <value type="value">8</value>
            </key>
            <!-- Maximum frame size (in bytes) -->
            <key name="MaxFrameSize">
                <value type="value">254</value>
            </key>

            <!-- Devices -->
            <!-- 13- -->
            <key name="13_20">
                <value type="value">1</value>
            </key>
            <key name="13_21">
                <value type="value">0</value>
            </key>
            <key name="13_22">
                <value type="value">0</value>
            </key>
            <key name="13_24">
                <value type="value">1</value>
            </key>
            <key name="13_25">
                <value type="value">1</value>
            </key>
            <key name="13_32">
                <value type="value">1</value>
            </key>
            <key name="13_33">
                <value type="value">1</value>
            </key>
            <key name="13_34">
                <value type="value">1</value>
            </key>
            <key name="13_35">
                <value type="value">1</value>
            </key>
            <key name="13_36">
                <value type="value">1</value>
            </key>
            <key name="13_37">
                <value type="value">1</value>
            </key>
            <key name="13_38">
                <value type="value">1</value>
            </key>
            <key name="13_39">
                <value type="value">1</value>
            </key>
            <key name="13_40">
                <value type="value">0</value>
            </key>
            <key name="13_41">
                <value type="value">1</value>
            </key>
            <key name="13_42">
                <value type="value">0</value>
            </key>

            <!-- 22- -->
            <key name="22_19">
                <value type="value">1</value>
            </key>
            <key name="22_20">
                <value type="value">1</value>
            </key>
            <key name="22_21">
                <value type="value">0</value>
            </key>
            <key name="22_22">
                <value type="value">0</value>
            </key>
            <key name="22_24">
                <value type="value">1</value>
            </key>
            <key name="22_25">
                <value type="value">1</value>
            </key>
            <key name="22_42">
                <value type="value">1</value>
            </key>
            <key name="22_43">
                <value type="value">1</value>
            </key>
            <key name="22_54">
                <value type="value">1</value>
            </key>

            <!-- 33- -->
            <key name="33_2">
                <value type="value">1</value>
            </key>
            <key name="33_3">
                <value type="value">2</value>
            </key>
            <key name="33_4">
                <value type="value">1</value>
            </key>
            <key name="33_5">
                <value type="value">2</value>
            </key>
            <key name="33_6">
                <value type="value">2</value>
            </key>
            <key name="33_7">
                <value type="value">1</value>
            </key>
            <key name="33_8">
                <value type="value">1</value>
            </key>
            <key name="33_9">
                <value type="value">1</value>
            </key>
            <key name="33_10">
                <value type="value">1</value>
            </key>
            <key name="33_11">
                <value type="value">1</value>
            </key>

            <!-- 60- -->
            <key name="60_6">
                <value type="value">2</value>
            </key>
            <key name="60_7">
                <value type="value">1</value>
            </key>
            <key name="60_8">
                <value type="value">1</value>
            </key>
            <key name="60_9">
                <value type="value">1</value>
            </key>
            <key name="60_20">
                <value type="value">1</value>
            </key>
            <key name="60_21">
                <value type="value">1</value>
            </key>
            <key name="60_32">
                <value type="value">1</value>
            </key>
            <key name="60_34">
                <value type="value">1</value>
            </key>
            <key name="60_35">
                <value type="value">1</value>
            </key>
            <key name="60_36">
                <value type="value">1</value>
            </key>

            <!-- 100- -->
            <key name="100_12">
                <value type="value">103</value>
            </key>
            <key name="100_13">
                <value type="value">31</value>
            </key>
            <key name="100_51">
                <value type="value">-49</value>
            </key>
            <key name="100_108">
                <value type="value">28871</value>
            </key>
            <key name="100_109">
                <value type="value">13781</value>
            </key>
            <key name="100_178">
                <value type="value">119</value>
            </key>
            <key name="100_179">
                <value type="value">219</value>
            </key>
            <key name="100_190">
                <value type="value">1009</value>
            </key>
            <key name="100_191">
                <value type="value">-2</value>
            </key>
            <key name="100_192">
                <value type="value">701</value>
            </key>
            <key name="100_193">
                <value type="value">441</value>
            </key>

            <!-- 101- -->
            <key name="101_63">
                <value type="value">103</value>
            </key>
            <key name="101_205">
                <value type="value">31</value>
            </key>
            <key name="101_100">
                <value type="value">5</value>
            </key>
            <key name="101_101">
                <value type="value">49</value>
            </key>
            <key name="101_102">
                <value type="value">119</value>
            </key>
            <key name="101_105">
                <value type="value">500</value>
            </key>
            <key name="101_106">
                <value type="value">1</value>
            </key>

            <!-- 107- -->
            <key name="107_3">
                <value type="value">16.2</value>
            </key>
            <key name="107_77">
                <value type="value">15.9</value>
            </key>
            <key name="107_78">
                <value type="value">512.1</value>
            </key>
            <key name="107_79">
                <value type="value">433.4</value>
            </key>
            <key name="107_90">
                <value type="value">344.4</value>
            </key>
            <key name="107_130">
                <value type="value">-0.44013</value>
            </key>
            <key name="107_131">
                <value type="value">43.0</value>
            </key>
            <key name="107_132">
                <value type="value">41.2</value>
            </key>
            <key name="107_141">
                <value type="value">12.1</value>
            </key>
            <key name="107_200">
                <value type="value">91</value>
            </key>
            <key name="107_201">
                <value type="value">98.8</value>
            </key>
            <key name="107_202">
                <value type="value">110</value>
            </key>
            <key name="107_203">
                <value type="value">85.1</value>
            </key>
            <key name="107_204">
                <value type="value">85.2</value>
            </key>
            <key name="107_205">
                <value type="value">410</value>
            </key>
            <key name="107_206">
                <value type="value">592</value>
            </key>
            <key name="107_207">
                <value type="value">1.5</value>
            </key>
            <key name="107_208">
                <value type="value">44.7</value>
            </key>
            <key name="107_209">
                <value type="value">11.9</value>
            </key>
            <key name="107_210">
                <value type="value">221.45</value>
            </key>
            <key name="107_211">
                <value type="value">13.4</value>
            </key>
            <key name="107_212">
                <value type="value">0.000402</value>
            </key>

            <!-- 109- -->
            <key name="109_3">
                <value type="value">16.2</value>
            </key>
            <key name="109_7">
                <value type="value">15.9</value>
            </key>
            <key name="109_8">
                <value type="value">880</value>
            </key>
            <key name="109_10">
                <value type="value">344.4</value>
            </key>
            <key name="109_40">
                <value type="value">41.2</value>
            </key>
            <key name="109_41">
                <value type="value">12.1</value>
            </key>

            <key name="empty">
                <value type="value">""</value>
            </key>
        </key_value_mappings>
    </databus>
</core>
