1 /* $NetBSD: sup.h,v 1.10 2002/07/10 18:53:59 wiz Exp $ */
4 * Copyright (c) 1992 Carnegie Mellon University
7 * Permission to use, copy, modify and distribute this software and its
8 * documentation is hereby granted, provided that both the copyright
9 * notice and this permission notice appear in all copies of the
10 * software, derivative works or modified versions, and any portions
11 * thereof, and that both notices appear in supporting documentation.
13 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
14 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
15 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
17 * Carnegie Mellon requests users of this software to return to
19 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
20 * School of Computer Science
21 * Carnegie Mellon University
22 * Pittsburgh PA 15213-3890
24 * any improvements or extensions that they make and grant Carnegie Mellon
25 * the rights to redistribute these changes.
27 /* sup.h -- declarations for sup, supnamesrv, supfilesrv
29 * VERSION NUMBER for any program is given by: a.b (c)
30 * where a = PROTOVERSION is the protocol version #
31 * b = PGMVERSION is program # within protocol
32 * c = scmversion is communication module version
33 * (i.e. operating system for which scm is configured)
34 **********************************************************************
36 * 13-Sep-92 Mary Thompson (mrt) at Carnegie-Mellon University
37 * Changed name of DEFDIR from /usr/cs to /usr.
39 * 7-July-93 Nate Williams at Montana State University
40 * Modified SUP to use gzip based compression when sending files
41 * across the network to save BandWidth
43 * Revision 1.10 92/08/11 12:06:42 mrt
44 * Added definition for DEBUGFPORTNUM, the debugging port number.
45 * Changed so that last and when file names could include
46 * the relase name if any.
49 * Revision 1.9 91/04/29 14:39:03 mja
50 * Reduce MAXCHILDREN from 8 to 3.
52 * Revision 1.8 89/08/23 14:55:30 gm0w
53 * Moved coll.dir from supservers to supfiles.
56 * 18-Mar-88 Glenn Marcy (gm0w) at Carnegie-Mellon University
57 * Added host=<hostfile> support to releases file.
59 * 27-Dec-87 Glenn Marcy (gm0w) at Carnegie-Mellon University
60 * Added crosspatch support. Removed nameserver support.
62 * 27-Jun-87 Glenn Marcy (gm0w) at Carnegie-Mellon University
63 * Added TREELIST and other changes for "release" support.
65 * 25-May-87 Doug Philips (dwp) at Carnegie-Mellon University
66 * Version 6 of the network protocol, better support to reflect errors
67 * back to server logfile.
69 * 21-May-87 Chriss Stephens (chriss) at Carnegie Mellon University
70 * Merged divergent CS and EE versions.
72 * 19-Sep-86 Mike Accetta (mja) at Carnegie-Mellon University
73 * Added FILESUPTDEFAULT definition.
75 * 07-Jun-86 Glenn Marcy (gm0w) at Carnegie-Mellon University
76 * Removed FILESRVBUSYWAIT. Now uses exponential backoff.
78 * 30-May-86 Glenn Marcy (gm0w) at Carnegie-Mellon University
79 * Added numeric port numbers to use when port names are not in the
82 * 04-Jan-86 Glenn Marcy (gm0w) at Carnegie-Mellon University
83 * Update protocol version to 5 for name server protocol change to
84 * allow multiple repositories per collection. Added FILESRVBUSYWAIT
85 * of 5 minutes. Added FILELOCK file to indicate collections that
86 * should be exclusively locked when upgraded.
88 * 22-Sep-85 Glenn Marcy (gm0w) at Carnegie-Mellon University
89 * Merged 4.1 and 4.2 versions together.
91 * 04-Jun-85 Steven Shafer (sas) at Carnegie-Mellon University
92 * Created for 4.2 BSD.
94 **********************************************************************
97 /* PGMVERSION is defined separately in each program */
98 extern char scmversion
[]; /* string version of scm */
99 #define PROTOVERSION 8 /* version of network protocol */
100 #define SCANVERSION 2 /* version of scan file format */
102 /* TCP servers for name server and file server */
103 #define FILEPORT "supfilesrv"
104 #define FILEPORTNUM 871
105 #define DEBUGFPORT "supfiledbg"
106 #define DEBUGFPORTNUM 1127
108 /* Default directory for system sup information */
111 #define DEFDIR "/etc"
113 #define DEFDIR "/usr"
120 /* Data files used in scan.c */
122 #define FILELIST DEFSCAN "supscan/%s/%s"
123 #define FILESCAN DEFSCAN "supscan/%s/%s"
124 #define FILEHOST DEFSCAN "supscan/%s/%s"
126 #define FILELIST DEFSCAN "sup/%s/%s"
127 #define FILESCAN DEFSCAN "sup/%s/%s"
128 #define FILEHOST DEFSCAN "sup/%s/%s"
130 #define FILELISTDEF "list"
131 #define FILESCANDEF "scan"
132 #define FILEHOSTDEF "host"
133 #define DEFRELEASE "default"
135 /* Data files used in sup.c */
136 #define FILEBASEDEFAULT DEFDIR "/%s" /* also supfilesrv and supscan */
138 #define FILESUPDEFAULT "%s/supfiles/coll.list"
139 #define FILESUPTDEFAULT "%s/supfiles/coll.what"
140 #define FILEHOSTS "%s/supfiles/coll.host"
142 #define FILESUPDEFAULT "%s/lib/supfiles/coll.list"
143 #define FILESUPTDEFAULT "%s/lib/supfiles/coll.what"
144 #define FILEHOSTS "%s/lib/supfiles/coll.host"
146 #define FILEBKDIR "%s/BACKUP"
147 #define FILEBACKUP "%s/BACKUP/%s"
148 #define FILELAST DEFSCAN "sup/%s/last%s"
149 #define FILELASTTEMP DEFSCAN "sup/%s/last%s.temp"
150 #define FILELOCK DEFSCAN "sup/%s/lock" /* also supfilesrv */
151 #define FILEREFUSE DEFSCAN "sup/%s/refuse"
152 #define FILEWHEN DEFSCAN "sup/%s/when%s"
154 /* Data files used in supfilesrv.c */
155 #define FILEXPATCH "%s/sup/xpatch.host"
157 #define FILEDIRS "%s/supfiles/coll.dir" /* also supscan */
159 #define FILEDIRS "%s/lib/supfiles/coll.dir" /* also supscan */
161 #define FILECRYPT DEFSCAN "sup/%s/crypt"
162 #define FILELOGFILE DEFSCAN "sup/%s/logfile"
164 #define FILEPREFIX DEFSCAN "supscan/%s/prefix" /* also supscan */
165 #define FILERELEASES DEFSCAN "supscan/%s/releases" /* also supscan */
167 #define FILEPREFIX DEFSCAN "sup/%s/prefix" /* also supscan */
168 #define FILERELEASES DEFSCAN "sup/%s/releases" /* also supscan */
172 #define STRINGLENGTH 2000
174 /* Password transmission encryption key */
175 #define PSWDCRYPT "SuperMan"
176 /* Test string for encryption */
177 #define CRYPTTEST "Hello there, Sailor Boy!"
179 /* Default login account for file server */
181 #define DEFUSER "anon"
184 /* subroutine return codes */
185 #define SCMOK (1) /* routine performed correctly */
186 #define SCMEOF (0) /* read EOF on network connection */
187 #define SCMERR (-1) /* error occurred during routine */
189 /* data structure for describing a file being upgraded */
192 /* fields for file information */
193 char *Tname
; /* path component name */
194 int Tflags
; /* flags of file */
195 int Tmode
; /* st_mode of file */
196 char *Tuser
; /* owner of file */
197 int Tuid
; /* owner id of file */
198 char *Tgroup
; /* group of file */
199 int Tgid
; /* group id of file */
200 int Tctime
; /* inode modification time */
201 int Tmtime
; /* data modification time */
202 struct treestruct
*Tlink
; /* tree of link names */
203 struct treestruct
*Texec
; /* tree of execute commands */
204 /* fields for sibling AVL tree */
205 int Tbf
; /* balance factor */
206 struct treestruct
*Tlo
,*Thi
; /* ordered sibling tree */
208 typedef struct treestruct TREE
;
210 /* data structure to represent a list of trees to upgrade */
213 struct tliststruct
*TLnext
; /* next entry in tree list */
214 /* fields for tree information */
215 char *TLname
; /* release name for tree */
216 char *TLprefix
; /* prefix of tree */
217 char *TLlist
; /* name of list file */
218 char *TLscan
; /* name of scan file */
219 char *TLhost
; /* name of host file */
220 TREE
*TLtree
; /* tree of files to upgrade */
222 typedef struct tliststruct TREELIST
;
224 /* bitfield not defined in stat.h */
225 #define S_IMODE 07777 /* part of st_mode that chmod sets */
227 /* flag bits for files */
228 #define FNEW 01 /* ctime of file has changed */
229 #define FBACKUP 02 /* backup of file is allowed */
230 #define FNOACCT 04 /* don't set file information */
231 #define FUPDATE 010 /* only set file information */
232 #define FNEEDED 0100000 /* file needed for upgrade */
234 /* version 3 compatibility */
235 #define FCOMPAT 0010000 /* Added to detect execute commands to send */
237 /* message types now obsolete */
238 #define MSGFEXECQ (115)
239 #define MSGFEXECNAMES (116)
241 /* flag bits for files in list of all files */
246 #define ALLNOACCT 020
247 #define ALLSLINK 0100
249 /* flag bits for file mode word */
250 #define MODELINK 010000
251 #define MODEDIR 040000
252 #define MODESYM 0100000
253 #define MODENOACCT 0200000
254 #define MODEUPDATE 01000000
256 /* blocking factor for filenames in list of all file names */
259 /* end version 3 compatibility */
261 #define MAXCHILDREN 3 /* maximum number of children allowed
262 to sup at the same time */