<?xml version="1.0"?>
<instances>

	<instance id="oracletest" port="9000" socket="/tmp/test.socket" dbase="oracle">
		<users>
			<user user="test" password="test"/>
		</users>
		<connections>
                        <connection string="oracle_sid=(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = oracle)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ora1)));user=@HOSTNAME@;password=testpassword"/>
		</connections>
	</instance>

	<instance id="mysqltest" port="9000" socket="/tmp/test.socket" dbase="mysql">
		<users>
			<user user="test" password="test"/>
		</users>
		<connections>
			<connection string="host=mysql;user=testuser;password=testpassword;db=@HOSTNAME@;foundrows=yes"/>
		</connections>
	</instance>

	<instance id="postgresqltest" port="9000" socket="/tmp/test.socket" dbase="postgresql">
		<users>
			<user user="test" password="test"/>
		</users>
		<connections>
			<connection string="host=postgresql;user=testuser;password=testpassword;db=@HOSTNAME@;lastinsertidfunction=testfunc();typemangling=lookup;tablemangling=lookup"/>
		</connections>
	</instance>

	<instance id="sqlitetest" port="9000" socket="/tmp/test.socket" dbase="sqlite">
		<users>
			<user user="test" password="test"/>
		</users>
		<connections>
			<connection string="db=/usr/local/firstworks/etc/sqlrelay.conf.d/sqlite/var/@HOSTNAME@;"/>
		</connections>
	</instance>

	<instance id="freetdstest" port="9000" socket="/tmp/test.socket" dbase="freetds">
		<users>
			<user user="test" password="test"/>
		</users>
		<connections>
			<connection string="freetds=/usr/local/firstworks/etc/sqlrelay.conf.d/freetds;server=sap;user=testuser;password=testpassword;db=@HOSTNAME@"/>
		</connections>
	</instance>

	<instance id="saptest" port="9000" socket="/tmp/test.socket" dbase="sap">
		<users>
			<user user="test" password="test"/>
		</users>
		<connections>
			<connection string="sybase=/opt/sap;lang=en_US;server=SAP;user=testuser;password=testpassword;db=@HOSTNAME@"/>
		</connections>
	</instance>

	<instance id="db2test" port="9000" socket="/tmp/test.socket" dbase="db2">
		<users>
			<user user="test" password="test"/>
		</users>
		<connections>
			<connection string="user=db2inst1;password=testpassword;db=@SHORTHOSTNAME@;lang=C;timeout=120"/>
		</connections>
	</instance>

	<instance id="firebirdtest" port="9000" socket="/tmp/test.socket" dbase="firebird">
		<users>
			<user user="test" password="test"/>
		</users>
		<connections>
			<connection string="user=testuser;password=testpassword;db=firebird:/u02/@HOSTNAME@.gdb;dialect=3"/>
		</connections>
	</instance>

	<instance id="informixtest" port="9000" socket="/tmp/test.socket" dbase="informix">
		<users>
			<user user="test" password="test"/>
		</users>
		<connections>
			<connection string="informixdir=/opt/informix;servername=ol_informix1210;user=testuser;password=testpassword;db=@HOSTNAME@"/>
		</connections>
	</instance>

	<instance id="routermaster" port="" socket="/tmp/routermaster.socket" dbase="mysql">
		<users>
			<user user="test" password="test"/>
		</users>
		<connections>
			<connection string="host=mysqlmaster;user=testuser;password=testpassword;db=@HOSTNAME@"/>
		</connections>
	</instance>

	<instance id="routerslave" port="" socket="/tmp/routerslave.socket" dbase="mysql">
		<users>
			<user user="test" password="test"/>
		</users>
		<connections>
			<connection string="host=mysqlslave;user=testuser;password=testpassword;db=@HOSTNAME@"/>
		</connections>
	</instance>

	<instance id="routertest" port="9000" socket="/tmp/test.socket" dbase="router">
		<users>
			<user user="test" password="test"/>
		</users>
		<filters>
			<filter module="regex" pattern=".*junktable"/>
		</filters>
		<routers>
			<router module="regex" connectionid="master">
				<pattern pattern="^drop "/>
				<pattern pattern="^create "/>
				<pattern pattern="^insert "/>
				<pattern pattern="^update "/>
				<pattern pattern="^delete "/>
			</router>
			<router module="regex" connectionid="slave">
				<pattern pattern=".*"/>
			</router>
		</routers>
		<connections>
			<connection connectionid="master" string="socket=/tmp/routermaster.socket;user=test;password=test;fetchatonce=100"/>
			<connection connectionid="slave" string="socket=/tmp/routerslave.socket;user=test;password=test"/>
		</connections>
	</instance>

	<instance id="extensionstest"
			addresses="0.0.0.0"
			port="9000"
			socket="/tmp/test.socket"
			dbase="oracle8"
			connections="0"
			maxconnections="15"
			maxqueuelength="0"
			growby="1"
			ttl="0"
			endofsession="commit"
			sessiontimeout="600"
			runasuser="nobody"
			runasgroup="nobody"
			cursors="0"
			maxcursors="15"
			cursors_growby="1"
			authtier="listener and connection"
			handoff="proxy"
			deniedips=""
			allowedips=""
			maxlisteners="1000"
			fakeinputbindvariables="yes"
			translatebindvariables="yes"
			ignoreselectdatabase="yes"
			isolationlevel="read committed"
			passwordpath="/usr/local/firstworks/etc/sqlrelay.conf.d/extensions">
		<auths>
			<auth module="userlist">
				<user user="test"
					password="[test.pwd]"/>
				<user user="rot16test"
					password="hej72juij"
					passwordencryptionid="rot16"/>
				<user user="rot13test"
					password="ebg46grfg"
					passwordencryptionid="rot13"/>
				<user user="rot10test"
					password="byd10docd"
					passwordencryptionid="rot10"/>
				<user user="md5test"
					password="82da61aa724b5d149a9c5dc8682c2a45"
					passwordencryptionid="md5"/>
				<user user="sha1test"
					password="12c4c60ee087ae0f12dc6abc88495e459f6f2654"
					passwordencryptionid="sha1"/>
				<user user="sha256test"
					password="894152e00f8e37cf7b2f914362e2e0580c7b4be72c0eea8a3ceee615135305bc"
					passwordencryptionid="sha256"/>
				<user user="crypttest"
					password="LlHuF6J06d6"
					passwordencryptionid="crypt"/>
				<user user="aes128test"
					password="[aes128testcred]"
					passwordencryptionid="aes128"/>
			</auth>
		</auths>
		<passwordencryptions>
			<passwordencryption module="rot"
						id="rot16"
						count="16"/>
			<passwordencryption module="rot"
						id="rot13"
						count="13"/>
			<passwordencryption module="rot"
						id="rot10"
						count="10"/>
			<passwordencryption module="md5"
						id="md5"/>
			<passwordencryption module="sha1"
						id="sha1"/>
			<passwordencryption module="sha256"
						id="sha256"/>
			<passwordencryption module="crypt"
						id="crypt"
						salt="sr"/>
			<passwordencryption module="aes128"
						id="aes128"
		keypath="/usr/local/firstworks/etc/sqlrelay.conf.d/extensions"
						keybinext="aes128"
						keyhexext="aes128hex"
		credpath="/usr/local/firstworks/etc/sqlrelay.conf.d/extensions"
						credbin="no"
						credhexext="aes128"
						key="[aes128testkey]"/>
		</passwordencryptions>
		<session>
			<start>
				<runquery>
				alter session set
					nls_date_format=
						'DD/MM/YYYY HH24:MI:SS'
				</runquery>
				<runquery>
				alter session set
					nls_timestamp_format=
						'DD/MM/YYYY HH24:MI:SS.FF'
				</runquery>
			</start>
			<end>
				<runquery>
				alter session set
					nls_date_format=
						'DD-MON-YYYY'
				</runquery>
				<runquery>
				alter session set
					nls_timestamp_format=
						'DD-MON-YY HH.MI.SS.FF AM'
				</runquery>
			</end>
		</session>
		<translations>
			<translation module="normalize"/>
		</translations>
		<filters>
			<filter module="string"
				pattern="badstring"
				error="badstring encountered"/>
			<filter module="regex"
				pattern=".*badregex"
				error="badregex encountered"
				errornumber="100"/>
			<filter module="patterns">
				<pattern pattern=".*badpattern"
						type="regex"/>
			</filter>
		</filters>
		<queries>
			<query module="sqlrcmdcstat"/>
			<query module="sqlrcmdgstat"/>
		</queries>
		<loggers>
			<logger module="debug"/>
			<logger module="custom_nw"/>
			<logger module="custom_sc"/>
			<logger module="custom_sc"
				path="/usr/local/firstworks/var/log/sqlrelay"/>
			<logger module="custom_sc"
				path="/usr/local/firstworks/var/log/sqlrelay"
				name="sc.log"/>
			<logger module="custom_sc"
				path="/usr/local/firstworks/var/log/sqlrelay"
				name="sc-info.log"
				loglevel="info"/>
			<logger module="custom_sc"
				path="/usr/local/firstworks/var/log/sqlrelay"
				name="sc-warning.log"
				loglevel="warning"/>
			<logger module="custom_sc"
				path="/usr/local/firstworks/var/log/sqlrelay"
				name="sc-error.log"
				loglevel="error"/>
			<logger module="slowqueries"/>
		</loggers>
		<connections>
                        <connection string="oracle_sid=(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = oracle)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ora1)));user=@HOSTNAME@;password=[testuser.pwd];lastinsertidfunction=last_insert_id();droptemptables=yes;faketransactionblocks=yes;autocommit=yes;fetchatonce=5;maxselectlistsize=-1;maxitembuffersize=6000" passwordencryptionid="rot16"/>
		</connections>
	</instance>

	<instance id="tlstest" port="9000"
		socket="/tmp/test.socket"
		tls="yes"
		tlscert="/usr/local/firstworks/etc/sqlrelay.conf.d/server.pem"
		tlspassword="password"
		tlsvalidate="yes"
		tlsca="/usr/local/firstworks/etc/sqlrelay.conf.d/ca.pem">
		<users>
			<user user="client.localdomain"/>
		</users>
		<connections>
                        <connection string="oracle_sid=(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = oracle)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ora1)));user=@HOSTNAME@;password=testpassword"/>
		</connections>
	</instance>

	<instance id="mysqlprotocoltest" dbase="mysql">
		<listeners>
			<listener protocol="mysql" port="3306"/>
		</listeners>
		<auths>
			<auth module="mysql_userlist">
				<user user="testuser" password="testpassword"/>
			</auth>
		</auths>
		<connections>
			<connection string="host=mysql;user=testuser;password=testpassword;db=@HOSTNAME@;foundrows=yes"/>
		</connections>
	</instance>

</instances>
