Fix missing copyright info
[hcoop/domtool2.git] / src / msgTypes.sml
CommitLineData
36e42cb8
AC
1(* HCoop Domtool (http://hcoop.sourceforge.net/)
2 * Copyright (c) 2006, Adam Chlipala
617696c6 3 * Copyright (c) 2011,2014 Clinton Ebadi <clinton@unknownlamer.org>
36e42cb8
AC
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
22structure MsgTypes = struct
23
737c68d4
AC
24datatype socket_permission =
25 Any
26 | Client
27 | Server
28 | Nada
29
a95a0107
AC
30datatype query =
31 QApt of string
32 (* Is this apt package installed? *)
d351d679
AC
33 | QCron of string
34 (* Is this user allowed to use cron? *)
35 | QFtp of string
36 (* Is this user allowed to use FTP? *)
4d5126e1
AC
37 | QTrustedPath of string
38 (* Is this user restricted to trusted-path executables? *)
737c68d4
AC
39 | QSocket of string
40 (* What socket permissions does this user have? *)
167cffff 41 | QFirewall of {node : string, user : string}
f9548f16 42 (* What firewall rules does this user have? *)
991d8e66
CE
43 | QAptExists of string
44 (* Does this apt package exist *)
a95a0107 45
36e42cb8
AC
46datatype 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. *)
5ee41dd0 57 | MsgGrant of Acl.acl
411a85f2
AC
58 (* Grant a permission *)
59 | MsgRevoke of Acl.acl
60 (* Revoke a permission *)
08a04eb4
AC
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 *)
094877b1
AC
66 | MsgWhoHas of {class : string, value : string}
67 (* Which users have this permission? *)
68 | MsgWhoHasResponse of string list
69 (* These are the users! *)
c53e82e4
AC
70 | MsgMultiConfig of string list
71 (* Multiple Domtool sources in dependency order *)
e69e60cc
AC
72 | MsgRmdom of string list
73 (* Remove all configuration associated with some domains and revoke
74 * rights to those domains from all users. *)
1824f573
AC
75 | MsgRegenerate
76 (* Make a clean slate of it and reprocess all configuration from scratch. *)
e69e60cc
AC
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. *)
21d921a5 80 | MsgCreateDbUser of {dbtype : string, passwd : string option}
d541c618 81 (* Request creation of a user for the named DBMS type *)
fe789bea 82 | MsgCreateDb of {dbtype : string, dbname : string, encoding : string option}
35659203
AC
83 (* Request creation of a DBMS database *)
84 | MsgDropDb of {dbtype : string, dbname : string}
85 (* Request dropping of a DBMS database *)
08688401
AC
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 | MsgRmMailbox of {domain : string, user : string}
92 (* Remove a vmail mapping *)
1d3ef80e
AC
93 | MsgListMailboxes of string
94 (* List all mailboxes for a domain *)
2fc6b0dd 95 | MsgMailboxes of {user : string, mailbox : string} list
1d3ef80e 96 (* Reply to MsgListMailboxes *)
2e96b9d4
AC
97 | MsgSaQuery of string
98 (* Check on the SpamAsssassin filtering status of a user or e-mail address *)
99 | MsgSaStatus of bool
100 (* Response to MsgSaQuery *)
101 | MsgSaSet of string * bool
102 (* Set the filtering status of a user or e-mail address *)
2bc5ed22
AC
103 | MsgSmtpLogReq of string
104 (* Request all current SMTP log lines about a domain *)
105 | MsgSmtpLogRes of string
106 (* One line of a response to MsgSmtpLogReq *)
86aa5de7
AC
107 | MsgDbPasswd of {dbtype : string, passwd : string}
108 (* Change a DBMS user's password *)
9f27d58f
AC
109 | MsgShutdown
110 (* Halt the server *)
75585a67
AC
111 | MsgYes
112 | MsgNo
113 (* Answers to boolean queries *)
a95a0107
AC
114 | MsgQuery of query
115 (* Ask for host-specific information *)
737c68d4
AC
116 | MsgSocket of socket_permission
117 (* Answer to a QSocket query *)
f9548f16
AC
118 | MsgFirewall of string list
119 (* Answer to a QFirewall query *)
fb6fac97
AC
120 | MsgRegenerateTc
121 (* MsgRegenerate without actual publishing of configuration *)
99cc4144
AC
122 | MsgGrantDb of {dbtype : string, dbname : string}
123 (* Grant all allowed privileges on a DBMS database to the user *)
00a077ab
AC
124 | MsgMysqlFixperms
125 (* Run the script to grant DROP privileges on MySQL tables to owning users *)
1ffc47a6
AC
126 | MsgDescribe of string
127 (* Ask for a listing of all of a domain's real configuration *)
128 | MsgDescription of string
129 (* Reply to MsgDescribe *)
563e7792
AC
130 | MsgReUsers
131 (* Rerun all callbacks for cases where the set of users has changed *)
9b8c6dc8
AC
132 | MsgVmailChanged
133 (* Server tells slave that vmail user information has changed *)
73b95423
CE
134 | MsgFirewallRegen
135 (* Regenerate firewall on user machines *)
f296c496
CE
136 | MsgAptQuery of {section : string, description : string}
137 (* Answer to QAptExists query *)
36e42cb8
AC
138
139end