1*3e95bd4aSAnders Persson#!/sbin/sh
2*3e95bd4aSAnders Persson#
3*3e95bd4aSAnders Persson# CDDL HEADER START
4*3e95bd4aSAnders Persson#
5*3e95bd4aSAnders Persson# The contents of this file are subject to the terms of the
6*3e95bd4aSAnders Persson# Common Development and Distribution License (the "License").
7*3e95bd4aSAnders Persson# You may not use this file except in compliance with the License.
8*3e95bd4aSAnders Persson#
9*3e95bd4aSAnders Persson# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*3e95bd4aSAnders Persson# or http://www.opensolaris.org/os/licensing.
11*3e95bd4aSAnders Persson# See the License for the specific language governing permissions
12*3e95bd4aSAnders Persson# and limitations under the License.
13*3e95bd4aSAnders Persson#
14*3e95bd4aSAnders Persson# When distributing Covered Code, include this CDDL HEADER in each
15*3e95bd4aSAnders Persson# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*3e95bd4aSAnders Persson# If applicable, add the following below this CDDL HEADER, with the
17*3e95bd4aSAnders Persson# fields enclosed by brackets "[]" replaced with your own identifying
18*3e95bd4aSAnders Persson# information: Portions Copyright [yyyy] [name of copyright owner]
19*3e95bd4aSAnders Persson#
20*3e95bd4aSAnders Persson# CDDL HEADER END
21*3e95bd4aSAnders Persson#
22*3e95bd4aSAnders Persson#
23*3e95bd4aSAnders Persson# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
24*3e95bd4aSAnders Persson#
25*3e95bd4aSAnders Persson
26*3e95bd4aSAnders Persson. /lib/svc/share/smf_include.sh
27*3e95bd4aSAnders Persson
28*3e95bd4aSAnders Perssonfilter_name=`svcprop -p socket-filter/name $SMF_FMRI 2>/dev/null`
29*3e95bd4aSAnders Perssonif [ -z "$filter_name" ]; then
30*3e95bd4aSAnders Persson	echo "socket-filter/name is missing"
31*3e95bd4aSAnders Persson	exit $SMF_EXIT_ERR_CONFIG
32*3e95bd4aSAnders Perssonfi
33*3e95bd4aSAnders Persson
34*3e95bd4aSAnders Perssoncase "$1" in
35*3e95bd4aSAnders Perssonstart)
36*3e95bd4aSAnders Persson	mod_name=`svcprop -p socket-filter/module_name $SMF_FMRI 2>/dev/null`
37*3e95bd4aSAnders Persson	type=`svcprop -p socket-filter/attach_semantics $SMF_FMRI 2>/dev/null`
38*3e95bd4aSAnders Persson	order=`svcprop -p socket-filter/order_hint $SMF_FMRI 2>/dev/null`
39*3e95bd4aSAnders Persson	socktups=`svcprop -p socket-filter/socket_tuples $SMF_FMRI 2>/dev/null`
40*3e95bd4aSAnders Persson
41*3e95bd4aSAnders Persson	/sbin/soconfig -F $filter_name $mod_name $type $order $socktups
42*3e95bd4aSAnders Persson	if [ $? -ne 0 ]; then
43*3e95bd4aSAnders Persson		exit $SMF_EXIT_ERR_FATAL
44*3e95bd4aSAnders Persson	fi
45*3e95bd4aSAnders Persson	;;
46*3e95bd4aSAnders Perssonstop)
47*3e95bd4aSAnders Persson	/sbin/soconfig -F $filter_name
48*3e95bd4aSAnders Persson	;;
49*3e95bd4aSAnders Persson*)
50*3e95bd4aSAnders Persson	echo "Usage: $0 { start | stop }"
51*3e95bd4aSAnders Persson	exit 1
52*3e95bd4aSAnders Persson	;;
53*3e95bd4aSAnders Perssonesac
54*3e95bd4aSAnders Persson
55*3e95bd4aSAnders Perssonexit $SMF_EXIT_OK
56