Socket permission querying
[hcoop/domtool2.git] / src / msgTypes.sml
... / ...
CommitLineData
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
23datatype socket_permission =
24 Any
25 | Client
26 | Server
27 | Nada
28
29datatype query =
30 QApt of string
31 (* Is this apt package installed? *)
32 | QCron of string
33 (* Is this user allowed to use cron? *)
34 | QFtp of string
35 (* Is this user allowed to use FTP? *)
36 | QTrustedPath of string
37 (* Is this user restricted to trusted-path executables? *)
38 | QSocket of string
39 (* What socket permissions does this user have? *)
40
41datatype msg =
42 MsgOk
43 (* Your request was processed successfully. *)
44 | MsgError of string
45 (* Your request went wrong in some way. *)
46 | MsgConfig of string
47 (* Configuration source code *)
48 | MsgFile of Slave.file_status
49 (* The status of a configuration file has changed. *)
50 | MsgDoFiles
51 (* Perform the actions associated with the MsgFiles sent previously. *)
52 | MsgGrant of Acl.acl
53 (* Grant a permission *)
54 | MsgRevoke of Acl.acl
55 (* Revoke a permission *)
56 | MsgListPerms of string
57 (* List all of a user's permissions *)
58 | MsgPerms of (string * string list) list
59 (* A response to MsgListPerms, giving a permission class and all values
60 * for which the user is authorized in that class *)
61 | MsgWhoHas of {class : string, value : string}
62 (* Which users have this permission? *)
63 | MsgWhoHasResponse of string list
64 (* These are the users! *)
65 | MsgMultiConfig of string list
66 (* Multiple Domtool sources in dependency order *)
67 | MsgRmdom of string list
68 (* Remove all configuration associated with some domains and revoke
69 * rights to those domains from all users. *)
70 | MsgRegenerate
71 (* Make a clean slate of it and reprocess all configuration from scratch. *)
72 | MsgRmuser of string
73 (* Remove all ACL entries for a user, and remove all domains to which
74 * that user and no one else has rights. *)
75 | MsgCreateDbUser of {dbtype : string, passwd : string option}
76 (* Request creation of a user for the named DBMS type *)
77 | MsgCreateDbTable of {dbtype : string, dbname : string}
78 (* Request creation of a DBMS table *)
79 | MsgNewMailbox of {domain : string, user : string,
80 passwd : string, mailbox : string}
81 (* Request creation of a new vmail mapping *)
82 | MsgPasswdMailbox of {domain : string, user : string, passwd : string}
83 (* Change a vmail account's password *)
84 | MsgRmMailbox of {domain : string, user : string}
85 (* Remove a vmail mapping *)
86 | MsgListMailboxes of string
87 (* List all mailboxes for a domain *)
88 | MsgMailboxes of {user : string, mailbox : string} list
89 (* Reply to MsgListMailboxes *)
90 | MsgSaQuery of string
91 (* Check on the SpamAsssassin filtering status of a user or e-mail address *)
92 | MsgSaStatus of bool
93 (* Response to MsgSaQuery *)
94 | MsgSaSet of string * bool
95 (* Set the filtering status of a user or e-mail address *)
96 | MsgSmtpLogReq of string
97 (* Request all current SMTP log lines about a domain *)
98 | MsgSmtpLogRes of string
99 (* One line of a response to MsgSmtpLogReq *)
100 | MsgDbPasswd of {dbtype : string, passwd : string}
101 (* Change a DBMS user's password *)
102 | MsgShutdown
103 (* Halt the server *)
104 | MsgYes
105 | MsgNo
106 (* Answers to boolean queries *)
107 | MsgQuery of query
108 (* Ask for host-specific information *)
109 | MsgSocket of socket_permission
110 (* Answer to a QSocket query *)
111
112end