Back to server-slide describe
[hcoop/zz_old/domtool2-proto.git] / src / msgTypes.sml
CommitLineData
d330d9b8 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
9f063ecc 23datatype socket_permission =
24 Any
25 | Client
26 | Server
27 | Nada
28
e5f8cb7b 29datatype query =
30 QApt of string
31 (* Is this apt package installed? *)
891b033c 32 | QCron of string
33 (* Is this user allowed to use cron? *)
34 | QFtp of string
35 (* Is this user allowed to use FTP? *)
4ee81d53 36 | QTrustedPath of string
37 (* Is this user restricted to trusted-path executables? *)
9f063ecc 38 | QSocket of string
39 (* What socket permissions does this user have? *)
5514f5b5 40 | QFirewall of string
41 (* What firewall rules does this user have? *)
e5f8cb7b 42
d330d9b8 43datatype msg =
44 MsgOk
45 (* Your request was processed successfully. *)
46 | MsgError of string
47 (* Your request went wrong in some way. *)
48 | MsgConfig of string
49 (* Configuration source code *)
50 | MsgFile of Slave.file_status
51 (* The status of a configuration file has changed. *)
52 | MsgDoFiles
53 (* Perform the actions associated with the MsgFiles sent previously. *)
e2130d9c 54 | MsgGrant of Acl.acl
d1aa6a21 55 (* Grant a permission *)
56 | MsgRevoke of Acl.acl
57 (* Revoke a permission *)
646381db 58 | MsgListPerms of string
59 (* List all of a user's permissions *)
60 | MsgPerms of (string * string list) list
61 (* A response to MsgListPerms, giving a permission class and all values
62 * for which the user is authorized in that class *)
d0e75410 63 | MsgWhoHas of {class : string, value : string}
64 (* Which users have this permission? *)
65 | MsgWhoHasResponse of string list
66 (* These are the users! *)
c8a739af 67 | MsgMultiConfig of string list
68 (* Multiple Domtool sources in dependency order *)
aba1f07e 69 | MsgRmdom of string list
70 (* Remove all configuration associated with some domains and revoke
71 * rights to those domains from all users. *)
f92c6883 72 | MsgRegenerate
73 (* Make a clean slate of it and reprocess all configuration from scratch. *)
aba1f07e 74 | MsgRmuser of string
75 (* Remove all ACL entries for a user, and remove all domains to which
76 * that user and no one else has rights. *)
2bc895e7 77 | MsgCreateDbUser of {dbtype : string, passwd : string option}
634d7082 78 (* Request creation of a user for the named DBMS type *)
57645bc0 79 | MsgCreateDb of {dbtype : string, dbname : string}
a71b2f2b 80 (* Request creation of a DBMS database *)
81 | MsgDropDb of {dbtype : string, dbname : string}
82 (* Request dropping of a DBMS database *)
c45f1662 83 | MsgNewMailbox of {domain : string, user : string,
84 passwd : string, mailbox : string}
85 (* Request creation of a new vmail mapping *)
86 | MsgPasswdMailbox of {domain : string, user : string, passwd : string}
87 (* Change a vmail account's password *)
88 | MsgRmMailbox of {domain : string, user : string}
89 (* Remove a vmail mapping *)
0a58b2f3 90 | MsgListMailboxes of string
91 (* List all mailboxes for a domain *)
1850d85f 92 | MsgMailboxes of {user : string, mailbox : string} list
0a58b2f3 93 (* Reply to MsgListMailboxes *)
bb8cc8c9 94 | MsgSaQuery of string
95 (* Check on the SpamAsssassin filtering status of a user or e-mail address *)
96 | MsgSaStatus of bool
97 (* Response to MsgSaQuery *)
98 | MsgSaSet of string * bool
99 (* Set the filtering status of a user or e-mail address *)
c685120e 100 | MsgSmtpLogReq of string
101 (* Request all current SMTP log lines about a domain *)
102 | MsgSmtpLogRes of string
103 (* One line of a response to MsgSmtpLogReq *)
dc6789fc 104 | MsgDbPasswd of {dbtype : string, passwd : string}
105 (* Change a DBMS user's password *)
4c68bd31 106 | MsgShutdown
107 (* Halt the server *)
8301e970 108 | MsgYes
109 | MsgNo
110 (* Answers to boolean queries *)
e5f8cb7b 111 | MsgQuery of query
112 (* Ask for host-specific information *)
9f063ecc 113 | MsgSocket of socket_permission
114 (* Answer to a QSocket query *)
5514f5b5 115 | MsgFirewall of string list
116 (* Answer to a QFirewall query *)
b4f5896d 117 | MsgRegenerateTc
118 (* MsgRegenerate without actual publishing of configuration *)
962530dd 119 | MsgGrantDb of {dbtype : string, dbname : string}
120 (* Grant all allowed privileges on a DBMS database to the user *)
62492205 121 | MsgMysqlFixperms
122 (* Run the script to grant DROP privileges on MySQL tables to owning users *)
f4f354c1 123 | MsgDescribe of string
124 (* Ask for a listing of all of a domain's real configuration *)
125 | MsgDescription of string
126 (* Reply to MsgDescribe *)
d330d9b8 127
128end