<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<!--
	License: CDDL 1.0   (see http://opensource.org/licenses/cddl-1.0)
	Copyright 2016 Jens Elkner
-->
<service_bundle type='manifest' name='LNFarpwatch:arpwatch'>
	<service name='network/arpwatch' type='service' version='1'>
		<!-- arpwatch datafiles are expected to be local to this machine -->
		<dependency name='fs-local' grouping='require_all'
			restart_on='none'
			type='service'>
			<service_fmri value='svc:/system/filesystem/local' />
		</dependency>

		<dependency name='identity' grouping='optional_all'
			restart_on='refresh'
			type='service'>
			<service_fmri value='svc:/system/identity:domain' />
		</dependency>

		<dependency name='network-service' grouping='require_all'
			restart_on='none'
			type='service'>
			<service_fmri value='svc:/network/service' />
		</dependency>

		<exec_method type='method' name='start'
			exec='/lib/svc/method/arpwatch start'
			timeout_seconds='60'>
			<method_context>
				<method_credential user='arpwatchd' group='daemon'
					privileges='basic,net_rawaccess,sys_resource,!proc_info,!proc_session,!file_link_any'
					limit_privileges='basic,net_rawaccess,sys_resource,!proc_info,!proc_session,!file_link_any'
				/>
			</method_context>
		</exec_method>

		<exec_method type='method' name='stop' exec=':kill'
			timeout_seconds='60' />

		<property_group name='config' type='application'>
			<stability value='Evolving' />
			<propval name='all_bogons' type='boolean' value='false' />
			<propval name='no_rdns' type='boolean' value='false' />
			<propval name='vendors' type='astring' value='' />
			<propval name='datafile' type='astring' value='' />
			<propval name='interface' type='astring' value='' />
			<propval name='log_facility' type='astring' value=''/>
			<propval name='email' type='astring' value='' />
			<propval name='no_bogon_check' type='boolean' value='false' />
			<propval name='local_nets' type='astring' value='' />
			<propval name='no_promiscuous' type='boolean' value='false' />
			<propval name='no_newstations' type='boolean' value='false' />
			<propval name='excludes' type='astring' value='' />
			<propval name='value_authorization' type='astring'
				value='solaris.smf.value.arpwatch' />
		</property_group>

		<property_group name='startd' type='framework'>
			<!-- sub-process core dumps shouldn't restart session -->
			<propval name='ignore_error' type='astring' value='core,signal' />
		</property_group>

		<!--
			Assign the profile 'Network Management' or 'Network Observability'
			to all users, which should be able to manage this service. E.g.:
			usermod -P +'Network Observability' jdoe
		-->
		<property_group name='general' type='framework'>
			<!-- autorizations required to start stop service -->
			<propval name='action_authorization' type='astring'
				value='solaris.smf.manage.arpwatch' />
			<!-- autorizations required to modify config/* props -->
			<propval name='value_authorization' type='astring'
				value='solaris.smf.value.arpwatch' />
			<propval name='enabled' type='boolean' value='false' />
		</property_group>

		<instance name='default' enabled='false'>
			<property_group name='config' type='application'>
				<stability value='Evolving' />
			</property_group>
		</instance>

		<stability value='Evolving' />
		<template>
			<common_name>
				<loctext xml:lang='C'>
Arpwatch</loctext>
			</common_name>
			<documentation>
				<manpage title='arpwatch' section='1M' manpath='/usr/man' />
			</documentation>
			<pg_pattern name='config' type='application' required='true'
				target='this'>
				<prop_pattern name='all_bogons' type='boolean' required='false'>
					<description>
						<loctext xml:lang='C'>
Set whether even bogon packets should be processed (default: false - see option -a).
						</loctext>
                    </description>
					<visibility value='readwrite'/>
					<cardinality min='1' max='1'/>
				</prop_pattern>
				<prop_pattern name='no_rdns' type='boolean' required='false'>
					<description>
						<loctext xml:lang='C'>
Don't lookup the hostnames of IP adresses when creating reports, i.e. use IPs as is (default: false - see option -D).
						</loctext>
                    </description>
					<visibility value='readwrite'/>
					<cardinality min='1' max='1'/>
				</prop_pattern>
				<prop_pattern name='vendors' type='astring' required='false'>
					<description>
						<loctext xml:lang='C'>
The vendor ethernet block list to use (if empty (default), /var/arpwatch/ethercodes.dat will be used - see option -e ...).
						</loctext>
					</description>
					<visibility value='readwrite'/>
					<cardinality min='1' max='1'/>
				</prop_pattern>
				<prop_pattern name='datafile' type='astring' required='false'>
					<description>
						<loctext xml:lang='C'>
Arpwatch's database file (if empty (default), /var/arpwatch/arp.dat will be used - see option -f ...). If you use more than one instance, set this explicitly to different file to avoid, that one instance overwrites the data of the other(s).
						</loctext>
					</description>
					<visibility value='readwrite'/>
					<cardinality min='1' max='1'/>
				</prop_pattern>
				<prop_pattern name='interface' type='astring' required='false'>
					<description>
						<loctext xml:lang='C'>
Set the name of the interface this instance should be listen on. If unset (default), the default aka primary interface will be used (see option -i ...).
						</loctext>
                    </description>
					<visibility value='readwrite'/>
					<cardinality min='1' max='1'/>
				</prop_pattern>
				<prop_pattern name='log_facility' type='astring' required='false'>
					<description>
						<loctext xml:lang='C'>
The syslog facility to use (see option -l ...). If unset (default), the default (DAEMON) will be used.
						</loctext>
                    </description>
					<visibility value='readwrite'/>
					<cardinality min='1' max='1'/>
				</prop_pattern>
				<prop_pattern name='email' type='astring' required='false'>
					<description>
						<loctext xml:lang='C'>
The e-mail address, to which reports should be send. If unset (default) no reports will be sent.
						</loctext>
                    </description>
					<visibility value='readwrite'/>
					<cardinality min='1' max='1'/>
				</prop_pattern>
				<prop_pattern name='no_bogon_check' type='boolean' required='false'>
					<description>
						<loctext xml:lang='C'>
No bogon check (default: false - see option -N).
						</loctext>
                    </description>
					<visibility value='readwrite'/>
					<cardinality min='1' max='1'/>
				</prop_pattern>
				<prop_pattern name='local_nets' type='astring' required='false'>
					<description>
						<loctext xml:lang='C'>
Addional subnets, which should be treated as local/non-bogon (see option -n). If more than one are needed, just separate them with a comma (','). Default: empty.
						</loctext>
                    </description>
					<visibility value='readwrite'/>
					<cardinality min='1' max='1'/>
				</prop_pattern>
				<prop_pattern name='no_promiscuous' type='boolean' required='false'>
					<description>
						<loctext xml:lang='C'>
Use no-promiscuous-mode. Default is false, i.e. use promiscuous mode. NOTE: Because this service gets started with net_rawaccess privilege, there is no need to run it as user root to be able to use the promiscuous mode (see option -p).
						</loctext>
                    </description>
					<visibility value='readwrite'/>
					<cardinality min='1' max='1'/>
				</prop_pattern>
				<prop_pattern name='no_newstations' type='boolean' required='false'>
					<description>
						<loctext xml:lang='C'>
Don't report new stations (default is false - see option -S).
						</loctext>
                    </description>
					<visibility value='readwrite'/>
					<cardinality min='1' max='1'/>
				</prop_pattern>
				<prop_pattern name='excludes' type='astring' required='false'>
					<description>
						<loctext xml:lang='C'>
The name of the file containing the ethernet addresses to exclude from processing/reporting (default is empty, i.e. no excludes - see option -X ...).
						</loctext>
                    </description>
					<visibility value='readwrite'/>
					<cardinality min='1' max='1'/>
				</prop_pattern>
			</pg_pattern>
		</template>
	</service>
</service_bundle>
