hcoop: allow proxying to marsh
[hcoop/domtool2.git] / src / msgTypes.sml
1 (* HCoop Domtool (http://hcoop.sourceforge.net/)
2 * Copyright (c) 2006, Adam Chlipala
3 * Copyright (c) 2011,2014 Clinton Ebadi <clinton@unknownlamer.org>
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 *)
19
20 (* Network message data structures *)
21
22 structure MsgTypes = struct
23
24 datatype socket_permission =
25 Any
26 | Client
27 | Server
28 | Nada
29
30 datatype query =
31 QApt of string
32 (* Is this apt package installed? *)
33 | QCron of string
34 (* Is this user allowed to use cron? *)
35 | QFtp of string
36 (* Is this user allowed to use FTP? *)
37 | QTrustedPath of string
38 (* Is this user restricted to trusted-path executables? *)
39 | QSocket of string
40 (* What socket permissions does this user have? *)
41 | QFirewall of {node : string, user : string}
42 (* What firewall rules does this user have? *)
43 | QAptExists of string
44 (* Does this apt package exist *)
45
46 datatype msg =
47 MsgOk
48 (* Your request was processed successfully. *)
49 | MsgError of string
50 (* Your request went wrong in some way. *)
51 | MsgConfig of string
52 (* Configuration source code *)
53 | MsgFile of Slave.file_status
54 (* The status of a configuration file has changed. *)
55 | MsgDoFiles
56 (* Perform the actions associated with the MsgFiles sent previously. *)
57 | MsgGrant of Acl.acl
58 (* Grant a permission *)
59 | MsgRevoke of Acl.acl
60 (* Revoke a permission *)
61 | MsgListPerms of string
62 (* List all of a user's permissions *)
63 | MsgPerms of (string * string list) list
64 (* A response to MsgListPerms, giving a permission class and all values
65 * for which the user is authorized in that class *)
66 | MsgWhoHas of {class : string, value : string}
67 (* Which users have this permission? *)
68 | MsgWhoHasResponse of string list
69 (* These are the users! *)
70 | MsgMultiConfig of string list
71 (* Multiple Domtool sources in dependency order *)
72 | MsgRmdom of string list
73 (* Remove all configuration associated with some domains and revoke
74 * rights to those domains from all users. *)
75 | MsgRegenerate
76 (* Make a clean slate of it and reprocess all configuration from scratch. *)
77 | MsgRmuser of string
78 (* Remove all ACL entries for a user, and remove all domains to which
79 * that user and no one else has rights. *)
80 | MsgCreateDbUser of {dbtype : string, passwd : string option}
81 (* Request creation of a user for the named DBMS type *)
82 | MsgCreateDb of {dbtype : string, dbname : string, encoding : string option}
83 (* Request creation of a DBMS database *)
84 | MsgDropDb of {dbtype : string, dbname : string}
85 (* Request dropping of a DBMS database *)
86 | MsgNewMailbox of {domain : string, user : string,
87 passwd : string, mailbox : string}
88 (* Request creation of a new vmail mapping *)
89 | MsgPasswdMailbox of {domain : string, user : string, passwd : string}
90 (* Change a vmail account's password *)
91 | MsgPortalPasswdMailbox of {domain : string, user : string, oldpasswd : string, newpasswd : string}
92 (* Change a vmail account's password if the old password matches *)
93 | MsgRmMailbox of {domain : string, user : string}
94 (* Remove a vmail mapping *)
95 | MsgListMailboxes of string
96 (* List all mailboxes for a domain *)
97 | MsgMailboxes of {user : string, mailbox : string} list
98 (* Reply to MsgListMailboxes *)
99 | MsgSaQuery of string
100 (* Check on the SpamAsssassin filtering status of a user or e-mail address *)
101 | MsgSaStatus of bool
102 (* Response to MsgSaQuery *)
103 | MsgSaSet of string * bool
104 (* Set the filtering status of a user or e-mail address *)
105 | MsgSaChanged
106 (* Reload spamassassin addrs *)
107 | MsgSmtpLogReq of string
108 (* Request all current SMTP log lines about a domain *)
109 | MsgSmtpLogRes of string
110 (* One line of a response to MsgSmtpLogReq *)
111 | MsgDbPasswd of {dbtype : string, passwd : string}
112 (* Change a DBMS user's password *)
113 | MsgShutdown
114 (* Halt the server *)
115 | MsgYes
116 | MsgNo
117 (* Answers to boolean queries *)
118 | MsgQuery of query
119 (* Ask for host-specific information *)
120 | MsgSocket of socket_permission
121 (* Answer to a QSocket query *)
122 | MsgFirewall of string list
123 (* Answer to a QFirewall query *)
124 | MsgRegenerateTc
125 (* MsgRegenerate without actual publishing of configuration *)
126 | MsgGrantDb of {dbtype : string, dbname : string}
127 (* Grant all allowed privileges on a DBMS database to the user *)
128 | MsgMysqlFixperms
129 (* Run the script to grant DROP privileges on MySQL tables to owning users *)
130 | MsgDescribe of string
131 (* Ask for a listing of all of a domain's real configuration *)
132 | MsgDescription of string
133 (* Reply to MsgDescribe *)
134 | MsgReUsers
135 (* Rerun all callbacks for cases where the set of users has changed *)
136 | MsgVmailChanged
137 (* Server tells slave that vmail user information has changed *)
138 | MsgFirewallRegen
139 (* Regenerate firewall on user machines *)
140 | MsgAptQuery of {section : string, description : string}
141 (* Answer to QAptExists query *)
142
143 end