xref: /illumos-gate/usr/src/cmd/nlsadmin/nlsadmin.h (revision 7c478bd9)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate  *
4*7c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate  * with the License.
8*7c478bd9Sstevel@tonic-gate  *
9*7c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate  * and limitations under the License.
13*7c478bd9Sstevel@tonic-gate  *
14*7c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate  *
20*7c478bd9Sstevel@tonic-gate  * CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate  */
22*7c478bd9Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
23*7c478bd9Sstevel@tonic-gate /*	  All Rights Reserved  	*/
26*7c478bd9Sstevel@tonic-gate #ident	"%Z%%M%	%I%	%E% SMI"	/* SVr4.0	*/
28*7c478bd9Sstevel@tonic-gate /*
29*7c478bd9Sstevel@tonic-gate  * nlsadmin.h:  nlsadmin defines and structs
30*7c478bd9Sstevel@tonic-gate  */
32*7c478bd9Sstevel@tonic-gate #define VERSION		4		/* current database version */
33*7c478bd9Sstevel@tonic-gate #define MAXNAMESZ	15
34*7c478bd9Sstevel@tonic-gate #define SVC_CODE_SZ	14
35*7c478bd9Sstevel@tonic-gate #define DEFAULTID	"listen"	/* default id for servers */
36*7c478bd9Sstevel@tonic-gate #define LISTENTYPE	"listen"	/* pm type for listener service */
37*7c478bd9Sstevel@tonic-gate #define	ROOT		(uid_t) 0
39*7c478bd9Sstevel@tonic-gate #define NLPSSRV		"/usr/lib/saf/nlps_server"	/* full path of nlps server */
40*7c478bd9Sstevel@tonic-gate #define LISTENCMD	"/usr/lib/saf/listen"		/* full path of the listener */
41*7c478bd9Sstevel@tonic-gate #define	NLPSSVCCODE	"0"		/* (string!) protoserv service code */
42*7c478bd9Sstevel@tonic-gate #define	TTYSVCCODE	"1"		/* (string!) ttyserv service code */
44*7c478bd9Sstevel@tonic-gate /*
45*7c478bd9Sstevel@tonic-gate  * bit flags for argument processing
46*7c478bd9Sstevel@tonic-gate  */
48*7c478bd9Sstevel@tonic-gate #define NONE    0x0000
49*7c478bd9Sstevel@tonic-gate #define	CMDFLAG	0x0001
50*7c478bd9Sstevel@tonic-gate #define	PIPFLAG	0x0002
51*7c478bd9Sstevel@tonic-gate #define	VERFLAG	0x0004
52*7c478bd9Sstevel@tonic-gate #define DISFLAG 0x0008
53*7c478bd9Sstevel@tonic-gate #define ENAFLAG 0x0010
54*7c478bd9Sstevel@tonic-gate #define KILFLAG 0x0020
55*7c478bd9Sstevel@tonic-gate #define ADRFLAG 0x0040
56*7c478bd9Sstevel@tonic-gate #define REMFLAG 0x0080
57*7c478bd9Sstevel@tonic-gate #define STAFLAG 0x0100
58*7c478bd9Sstevel@tonic-gate #define VBSFLAG 0x0200
59*7c478bd9Sstevel@tonic-gate #define NETFLAG 0x0400
60*7c478bd9Sstevel@tonic-gate #define ZZZFLAG 0x0800
61*7c478bd9Sstevel@tonic-gate #define INIFLAG	0x1000
63*7c478bd9Sstevel@tonic-gate /*
64*7c478bd9Sstevel@tonic-gate  * other misc defines
65*7c478bd9Sstevel@tonic-gate  */
67*7c478bd9Sstevel@tonic-gate #define INCONSISTENT	1
68*7c478bd9Sstevel@tonic-gate #define MISSINGARG	2
69*7c478bd9Sstevel@tonic-gate #define USAGE		3
71*7c478bd9Sstevel@tonic-gate #define NOTLISTEN	1
72*7c478bd9Sstevel@tonic-gate #define BADPMFMT	2
73*7c478bd9Sstevel@tonic-gate #define BADLISFMT	3
75*7c478bd9Sstevel@tonic-gate #define CFLAG		0x1
76*7c478bd9Sstevel@tonic-gate #define PFLAG		0x2
77*7c478bd9Sstevel@tonic-gate #define DFLAG		0x4
79*7c478bd9Sstevel@tonic-gate extern  char    *optarg;
80*7c478bd9Sstevel@tonic-gate extern  int     optind;
81*7c478bd9Sstevel@tonic-gate extern  int     errno;
83*7c478bd9Sstevel@tonic-gate /*
84*7c478bd9Sstevel@tonic-gate  * error returns from nlsadmin (1 is reserved for passing non-error
85*7c478bd9Sstevel@tonic-gate  * information (-q))
86*7c478bd9Sstevel@tonic-gate  */
88*7c478bd9Sstevel@tonic-gate #define NLS_OK		0		/* no error */
89*7c478bd9Sstevel@tonic-gate #define NLS_FAILED	2		/* failure in command */
90*7c478bd9Sstevel@tonic-gate #define NLS_PERM	3		/* must be root */
91*7c478bd9Sstevel@tonic-gate #define NLS_SERV	4		/* error in service code */
92*7c478bd9Sstevel@tonic-gate #define	NLS_CMD		5		/* command line error */
93*7c478bd9Sstevel@tonic-gate #define	NLS_SYSERR	6		/* system error during cmd */
94*7c478bd9Sstevel@tonic-gate #define	NLS_BADPM	7		/* bad port monitor */
96*7c478bd9Sstevel@tonic-gate /*
97*7c478bd9Sstevel@tonic-gate  * command lines for SAC functions
98*7c478bd9Sstevel@tonic-gate  */
100*7c478bd9Sstevel@tonic-gate #define SAC_LSPM	"/usr/sbin/sacadm -L -p %s 2>/dev/null"
101*7c478bd9Sstevel@tonic-gate #define SAC_LSTY	"/usr/sbin/sacadm -L -t %s 2>/dev/null"
102*7c478bd9Sstevel@tonic-gate #define SAC_KILLPM	"/usr/sbin/sacadm -k -p %s 2>/dev/null"
103*7c478bd9Sstevel@tonic-gate #define SAC_STARTPM	"/usr/sbin/sacadm -s -p %s 2>/dev/null"
104*7c478bd9Sstevel@tonic-gate #define SAC_ENABLPM	"/usr/sbin/sacadm -e -p %s 2>/dev/null"
105*7c478bd9Sstevel@tonic-gate #define SAC_ADDPM	"/usr/sbin/sacadm -a -p %s -t %s -c \"%s\" -v %d 2>/dev/null"
106*7c478bd9Sstevel@tonic-gate #define PM_DISABLE	"/usr/sbin/pmadm -d -p %s -s %s 2>/dev/null"
107*7c478bd9Sstevel@tonic-gate #define PM_ENABLE	"/usr/sbin/pmadm -e -p %s -s %s 2>/dev/null"
108*7c478bd9Sstevel@tonic-gate #define PM_LSALL	"/usr/sbin/pmadm -L -p %s 2>/dev/null"
109*7c478bd9Sstevel@tonic-gate #define PM_LSONE	"/usr/sbin/pmadm -L -p %s -s %s 2>/dev/null"
110*7c478bd9Sstevel@tonic-gate #define PM_REMSVC	"/usr/sbin/pmadm -r -p %s -s %s 2>/dev/null"
111*7c478bd9Sstevel@tonic-gate #define PM_ADDSVC	"/usr/sbin/pmadm -a -p %s -s %s -i %s -m %s -v %d -y \"%s\" 2>/dev/null"
112*7c478bd9Sstevel@tonic-gate #define PM_ADDSVCF	"/usr/sbin/pmadm -a -p %s -s %s -i %s -f %s -m %s -v %d -y \"%s\" 2>/dev/null"