1ad37b92 |
1 | /* -*-c-*- |
2 | * |
3 | * $Id* |
4 | * |
5 | * Main header file for `become' |
6 | * |
c758e654 |
7 | * (c) 1998 EBI |
1ad37b92 |
8 | */ |
9 | |
10 | /*----- Licensing notice --------------------------------------------------* |
11 | * |
12 | * This file is part of `become' |
13 | * |
14 | * `Become' is free software; you can redistribute it and/or modify |
15 | * it under the terms of the GNU General Public License as published by |
16 | * the Free Software Foundation; either version 2 of the License, or |
17 | * (at your option) any later version. |
18 | * |
19 | * `Become' is distributed in the hope that it will be useful, |
20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
22 | * GNU General Public License for more details. |
23 | * |
24 | * You should have received a copy of the GNU General Public License |
25 | * along with `become'; if not, write to the Free Software Foundation, |
26 | * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
27 | */ |
28 | |
29 | /*----- Revision history --------------------------------------------------* |
30 | * |
31 | * $Log: become.h,v $ |
b0f66028 |
32 | * Revision 1.4 2003/11/29 23:39:16 mdw |
33 | * Debianization. |
34 | * |
af8ffe6c |
35 | * Revision 1.3 1998/04/23 13:21:28 mdw |
36 | * Disable trace constants for networking when it's not compiled in. |
37 | * |
c758e654 |
38 | * Revision 1.2 1998/01/12 16:45:42 mdw |
39 | * Fix copyright date. |
40 | * |
1ad37b92 |
41 | * Revision 1.1 1997/08/07 09:40:01 mdw |
42 | * Added. No idea why this wasn't done before. |
43 | * |
44 | */ |
45 | |
46 | #ifndef BECOME_H |
47 | #define BECOME_H |
48 | |
49 | #ifdef __cplusplus |
50 | extern "C" { |
51 | #endif |
52 | |
53 | /*----- Required headers --------------------------------------------------*/ |
54 | |
55 | #include <sys/types.h> |
56 | #include <sys/socket.h> |
57 | #include <netinet/in.h> |
58 | #include <arpa/inet.h> |
59 | |
60 | #ifndef CONFIG_H |
61 | # include "config.h" |
62 | #endif |
63 | |
64 | /*----- Tracing levels ----------------------------------------------------*/ |
65 | |
66 | #define TRACE_SILENT 0u |
67 | #define TRACE_MISC 1u |
68 | #define TRACE_SETUP 2u |
af8ffe6c |
69 | #define TRACE_RULE 4u |
70 | #ifndef NONETWORK |
71 | # define TRACE_DAEMON 8u |
72 | # define TRACE_CHECK 16u |
73 | # define TRACE_CLIENT 32u |
74 | # define TRACE_RAND 64u |
75 | # define TRACE_CRYPTO 128u |
76 | #else |
77 | # define TRACE_DAEMON 0 |
78 | # define TRACE_CHECK 0 |
79 | # define TRACE_CLIENT 0 |
80 | # define TRACE_RAND 0 |
81 | # define TRACE_CRYPTO 0 |
82 | #endif |
1ad37b92 |
83 | #define TRACE_YACC 256u |
84 | #define TRACE_DEBUG 512u |
85 | |
86 | #define TRACE_PRIV ( TRACE_RAND | TRACE_CRYPTO | TRACE_YACC | \ |
87 | TRACE_DEBUG ) |
88 | #define TRACE_DFL ( TRACE_MISC | TRACE_SETUP | TRACE_CLIENT | \ |
89 | TRACE_DAEMON | TRACE_CHECK ) |
90 | #define TRACE_ALL 0xFFFFu |
91 | |
b0f66028 |
92 | /*----- Other magic constants ---------------------------------------------*/ |
93 | |
94 | #define SERVER_PORT 35523 /* Not allocated properly */ |
95 | |
1ad37b92 |
96 | /*----- Type definitions --------------------------------------------------*/ |
97 | |
98 | /* --- Request buffer (plaintext) --- */ |
99 | |
100 | #define CMDLEN_MAX 1016 /* Max length of command */ |
101 | |
102 | typedef struct request { |
103 | struct in_addr host; /* Requesting host */ |
104 | uid_t from; /* Current user ID */ |
105 | uid_t to; /* Requested UID */ |
106 | char cmd[CMDLEN_MAX]; /* Command string requested */ |
107 | } request; |
108 | |
109 | /*----- That's all, folks -------------------------------------------------*/ |
110 | |
111 | #ifdef __cplusplus |
112 | } |
113 | #endif |
114 | |
115 | #endif |