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