1a192e900Samaguire#!/sbin/sh
2a192e900Samaguire#
3a192e900Samaguire# CDDL HEADER START
4a192e900Samaguire#
5a192e900Samaguire# The contents of this file are subject to the terms of the
6a192e900Samaguire# Common Development and Distribution License (the "License").
7a192e900Samaguire# You may not use this file except in compliance with the License.
8a192e900Samaguire#
9a192e900Samaguire# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10a192e900Samaguire# or http://www.opensolaris.org/os/licensing.
11a192e900Samaguire# See the License for the specific language governing permissions
12a192e900Samaguire# and limitations under the License.
13a192e900Samaguire#
14a192e900Samaguire# When distributing Covered Code, include this CDDL HEADER in each
15a192e900Samaguire# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16a192e900Samaguire# If applicable, add the following below this CDDL HEADER, with the
17a192e900Samaguire# fields enclosed by brackets "[]" replaced with your own identifying
18a192e900Samaguire# information: Portions Copyright [yyyy] [name of copyright owner]
19a192e900Samaguire#
20a192e900Samaguire# CDDL HEADER END
21a192e900Samaguire#
22a192e900Samaguire#
23f4b3ec61Sdh155122# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
24a192e900Samaguire# Use is subject to license terms.
25a192e900Samaguire#
26a192e900Samaguire# ident	"%Z%%M%	%I%	%E% SMI"
27a192e900Samaguire
28a192e900Samaguire. /lib/svc/share/smf_include.sh
29a192e900Samaguire. /lib/svc/share/routing_include.sh
30a192e900Samaguire
31f4b3ec61Sdh155122smf_configure_ip || exit $SMF_EXIT_OK
32a192e900Samaguire
33a192e900Samaguiredaemon_args=`get_daemon_args $SMF_FMRI`
34a192e900Samaguireoptions="sqp:Ptv"
35a192e900Samaguire
36a192e900Samaguire#
37a192e900Samaguire# Handle upgrade - routing/daemon-args property must be mapped to properties
38a192e900Samaguire# in routeadm property group.  Note the SMF-incompatible -t option is not
39a192e900Samaguire# supported, since it requires that in.ripngd run in the foreground.
40a192e900Samaguire#
41a192e900Samaguireif [ -n "$daemon_args" ]; then
42a192e900Samaguire	set_daemon_boolean_property "$SMF_FMRI" "$daemon_args" \
43*794ca8faSamaguire	    "$options" "q" quiet_mode true false
44a192e900Samaguire	set_daemon_boolean_property "$SMF_FMRI" "$daemon_args" \
45*794ca8faSamaguire	    "$options" "s" supply_routes true false
46a192e900Samaguire	set_daemon_value_property "$SMF_FMRI" "$daemon_args" \
47a192e900Samaguire	    "$options" "p" udp_port 521
48a192e900Samaguire	set_daemon_boolean_property "$SMF_FMRI" "$daemon_args" \
49a192e900Samaguire	    "$options" "P" poison_reverse false true
50a192e900Samaguire	set_daemon_boolean_property "$SMF_FMRI" "$daemon_args" \
51a192e900Samaguire	    "$options" "v" verbose true false
52a192e900Samaguire	set_daemon_nonoption_properties "$SMF_FMRI" "$daemon_args" \
53a192e900Samaguire	    "$options" "log_file"
54a192e900Samaguire	clear_daemon_args $SMF_FMRI
55a192e900Samaguirefi
56a192e900Samaguire
57a192e900Samaguire#
58a192e900Samaguire# Assemble arguments to daemon from properties
59a192e900Samaguire#
60a192e900Samaguireargs="`get_daemon_option_from_boolean_property $SMF_FMRI \
61*794ca8faSamaguire	quiet_mode -q true`"
62a192e900Samaguireargs="$args `get_daemon_option_from_boolean_property $SMF_FMRI \
63a192e900Samaguire	supply_routes -s true`"
64a192e900Samaguireargs="$args `get_daemon_option_from_property $SMF_FMRI udp_port p 521`"
65a192e900Samaguireargs="$args `get_daemon_option_from_boolean_property $SMF_FMRI \
66a192e900Samaguire	poison_reverse -P false`"
67a192e900Samaguireargs="$args `get_daemon_option_from_boolean_property $SMF_FMRI \
68a192e900Samaguire	verbose -v true`"
69a192e900Samaguireargs="$args `get_daemon_nonoption_property $SMF_FMRI log_file`"
70a192e900Samaguire
71a192e900Samaguire/usr/lib/inet/in.ripngd $args
72a192e900Samaguire
73a192e900Samaguire[ "$?" = 0 ] || exit $SMF_EXIT_ERR_FATAL
74a192e900Samaguire
75a192e900Samaguireexit "$SMF_EXIT_OK"
76