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