xref: /openbsd/usr.bin/rdist/types.h (revision db3296cf)
1 /*	$OpenBSD: types.h,v 1.5 2003/05/14 01:34:35 millert Exp $	*/
2 
3 #ifndef __myTYPES_H__
4 #define __myTYPES_H__
5 
6 /*
7  * $From: types.h,v 1.5 1999/08/04 15:57:31 christos Exp $
8  */
9 
10 /*
11  * Dist Options.
12  *
13  * WARNING: This values are used by the server (rdistd)
14  */
15 #define DO_VERIFY		0x0000001
16 #define DO_WHOLE		0x0000002
17 #define DO_YOUNGER		0x0000004
18 #define DO_COMPARE		0x0000008
19 #define DO_REMOVE		0x0000010
20 #define DO_FOLLOW		0x0000020
21 #define DO_IGNLNKS		0x0000040
22 #define DO_QUIET		0x0000100
23 #define DO_CHKNFS		0x0000200
24 #define DO_CHKREADONLY		0x0000400
25 #define DO_NOEXEC		0x0000800
26 #define DO_SAVETARGETS		0x0001000
27 #define DO_NODESCEND		0x0002000
28 #define DO_NOCHKOWNER		0x0004000
29 #define DO_NOCHKMODE		0x0008000
30 #define DO_NOCHKGROUP		0x0010000
31 #define DO_CHKSYM		0x0020000
32 #define DO_NUMCHKGROUP		0x0040000
33 #define DO_NUMCHKOWNER		0x0080000
34 #define DO_HISTORY		0x0100000
35 #define DO_UPDATEPERM		0x0200000
36 #define DO_DEFGROUP		0x0400000
37 #define DO_DEFOWNER		0x0800000
38 #define DO_SPARSE		0x1000000	/* XXX not implemented */
39 
40 /*
41  * Dist option information
42  */
43 typedef long		opt_t;
44 struct _distoptinfo {
45 	opt_t		do_value;
46 	char	       *do_name;
47 	char	       *do_arg;
48 	size_t	       arg_size;
49 };
50 typedef struct _distoptinfo DISTOPTINFO;
51 
52 	/* Debug Message types */
53 #define DM_CALL		0x01
54 #define DM_PROTO	0x02
55 #define DM_CHILD	0x04
56 #define DM_MISC		0x10
57 #define DM_ALL		0x17
58 
59 /*
60  * Description of a message type
61  */
62 struct _msgtype {
63 	int		mt_type;		/* Type (bit) */
64 	char	       *mt_name;		/* Name of message type */
65 };
66 typedef struct _msgtype MSGTYPE;
67 
68 /*
69  * Message Type definitions
70  */
71 #define MT_DEBUG	0x0001			/* Debugging messages */
72 #define MT_NERROR	0x0002			/* Normal errors */
73 #define MT_FERROR	0x0004			/* Fatal errors */
74 #define MT_WARNING	0x0010			/* Warning messages */
75 #define MT_CHANGE	0x0020			/* Something changed */
76 #define MT_INFO		0x0040			/* General information */
77 #define MT_NOTICE	0x0100			/* Notice's */
78 #define MT_SYSLOG	0x0200			/* System log, but not user */
79 #define MT_REMOTE	0x0400			/* Ensure msg to remote */
80 #define MT_NOREMOTE	0x1000			/* Don't log to remote host */
81 #define MT_VERBOSE	0x2000			/* Verbose messages */
82 #define MT_ALL		(MT_NERROR|MT_FERROR|\
83 			 MT_WARNING|MT_CHANGE|\
84 			 MT_INFO|MT_NOTICE|\
85 			 MT_SYSLOG|MT_VERBOSE)
86 
87 /*
88  * Description of message facilities
89  */
90 typedef struct _msgfacility MSGFACILITY;
91 
92 struct _msgfacility {
93 	/* compile time initialized data */
94 	int		mf_msgfac;		/* One of MF_* from below */
95 	char	       *mf_name;		/* Name of this facility */
96 	void	      (*mf_sendfunc)		/* Function to send msg */
97 			(MSGFACILITY *, int, int, char *);
98 	/* run time initialized data */
99 	int		mf_msgtypes;		/* Bitmask of MT_* from above*/
100 	char	       *mf_filename;		/* Name of file */
101 	FILE	       *mf_fptr;		/* File pointer to output to */
102 };
103 
104 /*
105  * Message Facilities
106  */
107 #define MF_STDOUT	1			/* Standard Output */
108 #define MF_NOTIFY	2			/* Notify mail service */
109 #define MF_FILE		3			/* A normal file */
110 #define MF_SYSLOG	4			/* syslog() */
111 
112 #endif	/* __myTYPES_H__ */
113