Print this page
remove support for non-ANSI compilation
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/head/sac.h
+++ new/usr/src/head/sac.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License, Version 1.0 only
6 6 * (the "License"). You may not use this file except in compliance
7 7 * with the License.
8 8 *
9 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 * or http://www.opensolaris.org/os/licensing.
11 11 * See the License for the specific language governing permissions
12 12 * and limitations under the License.
↓ open down ↓ |
12 lines elided |
↑ open up ↑ |
13 13 *
14 14 * When distributing Covered Code, include this CDDL HEADER in each
15 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 * If applicable, add the following below this CDDL HEADER, with the
17 17 * fields enclosed by brackets "[]" replaced with your own identifying
18 18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 19 *
20 20 * CDDL HEADER END
21 21 */
22 22 /*
23 + * Copyright 2014 Garrett D'Amore <garrett@damore.org>
24 + *
23 25 * Copyright (c) 1997-1998 by Sun Microsystems, Inc.
24 26 * All rights reserved.
25 27 */
26 28
27 29 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
28 30 /* All Rights Reserved */
29 31
30 32
31 33 #ifndef _SAC_H
32 34 #define _SAC_H
33 35
34 -#pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.4 */
35 -
36 36 #include <sys/types.h>
37 37
38 38 #ifdef __cplusplus
39 39 extern "C" {
40 40 #endif
41 41
42 42 #define IDLEN 4 /* length in bytes of a utmp id */
43 43 #define SC_WILDC 0xff /* wild character for utmp ids */
44 44 #define PMTAGSIZE 14 /* maximum length in bytes for */
45 45 /* a port monitor tag */
46 46
47 47 /*
48 48 * values for rflag in doconfig()
49 49 */
50 50
51 51 #define NOASSIGN 0x1 /* don't allow assign operations */
52 52 #define NORUN 0x2 /* don't allow run or runwait operations */
53 53
54 54
55 55 /*
56 56 * message to SAC (header only). This header is forever fixed. The
57 57 * size field (pm_size) defines the size of the data portion of the
58 58 * message, which follows the header. The form of this optional
59 59 * data portion is defined strictly by the message type (pm_type).
60 60 */
61 61
62 62 struct pmmsg {
63 63 char pm_type; /* type of message */
64 64 uchar_t pm_state; /* current state of port monitor */
65 65 char pm_maxclass; /* max message class this PM */
66 66 /* understands */
67 67 char pm_tag[PMTAGSIZE + 1]; /* port monitor's tag */
68 68 int pm_size; /* size of optional data portion */
69 69 };
70 70
71 71
72 72
73 73 /*
74 74 * pm_type values
75 75 */
76 76
77 77 #define PM_STATUS 1 /* status response */
78 78 #define PM_UNKNOWN 2 /* an unknown message was received */
79 79
80 80 /*
81 81 * pm_state values
82 82 */
83 83
84 84 /*
85 85 * Class 1 responses
86 86 */
87 87
88 88 #define PM_STARTING 1 /* port monitor in starting state */
89 89 #define PM_ENABLED 2 /* port monitor in enabled state */
90 90 #define PM_DISABLED 3 /* port monitor in disabled state */
91 91 #define PM_STOPPING 4 /* port monitor in stopping state */
92 92
93 93 /*
94 94 * message to port monitor
95 95 */
96 96
97 97 struct sacmsg {
98 98 int sc_size; /* size of optional data portion */
99 99 char sc_type; /* type of message */
100 100 };
101 101
102 102
103 103
104 104 /*
105 105 * sc_type values
106 106 * These represent commands that the SAC sends to a port monitor. These
107 107 * commands are divided into "classes" for extensibility. Each subsequent
108 108 * "class" is a superset of the previous "classes" plus the new commands
109 109 * defined within that "class". The header for all commands is identical;
110 110 * however, a command may be defined such that an optional data portion may
111 111 * be sent in addition to the header. The format of this optional data piece
112 112 * is self-defining based on the command. Important note: the first message
113 113 * sent by the SAC will always be a class 1 message. The port monitor
114 114 * response will indicate the maximum class that it is able to understand.
115 115 * Another note is that port monitors should only respond to a message with
116 116 * an equivalent class response (i.e. a class 1 command causes a class 1
117 117 * response).
118 118 */
119 119
120 120 /*
121 121 * Class 1 commands (currently, there are only class 1 commands)
122 122 */
123 123
124 124 #define SC_STATUS 1 /* status request */
125 125 #define SC_ENABLE 2 /* enable request */
126 126 #define SC_DISABLE 3 /* disable request */
127 127 #define SC_READDB 4 /* read pmtab request */
128 128
129 129 /*
130 130 * `errno' values for Saferrno, note that Saferrno is used by
131 131 * both pmadm and sacadm and these values are shared between
132 132 * them
133 133 */
134 134
135 135 #define E_BADARGS 1 /* bad args or ill-formed command line */
↓ open down ↓ |
90 lines elided |
↑ open up ↑ |
136 136 #define E_NOPRIV 2 /* user not privileged for operation */
137 137 #define E_SAFERR 3 /* generic SAF error */
138 138 #define E_SYSERR 4 /* system error */
139 139 #define E_NOEXIST 5 /* invalid specification */
140 140 #define E_DUP 6 /* entry already exists */
141 141 #define E_PMRUN 7 /* port monitor is running */
142 142 #define E_PMNOTRUN 8 /* port monitor is not running */
143 143 #define E_RECOVER 9 /* in recovery */
144 144 #define E_SACNOTRUN 10 /* sac daemon is not running */
145 145
146 -#ifdef __STDC__
147 146 extern int doconfig(int, char *, long);
148 -#else
149 -extern int doconfig();
150 -#endif
151 147
152 148 #ifdef __cplusplus
153 149 }
154 150 #endif
155 151
156 152 #endif /* _SAC_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX