Mercurial > dovecot > original-hg > dovecot-1.2
annotate src/master/master-login-interface.h @ 8971:163c3f85a3aa HEAD
namespaces: list=children wasn't working correctly.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Mon, 20 Apr 2009 13:28:00 -0400 |
parents | 29b623366e1e |
children | 05eec45994d9 |
rev | line source |
---|---|
6410
e4eb71ae8e96
Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents:
5887
diff
changeset
|
1 #ifndef MASTER_LOGIN_INTERFACE_H |
e4eb71ae8e96
Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents:
5887
diff
changeset
|
2 #define MASTER_LOGIN_INTERFACE_H |
1035
fe49ece0f3ea
We have now separate "userdb" and "passdb". They aren't tied to each others
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
3 |
fe49ece0f3ea
We have now separate "userdb" and "passdb". They aren't tied to each others
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
4 #include "network.h" |
fe49ece0f3ea
We have now separate "userdb" and "passdb". They aren't tied to each others
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
5 |
1273
2cf2e08a6ee9
Somewhat working code to support loading Dovecot from inetd and such. It
Timo Sirainen <tss@iki.fi>
parents:
1124
diff
changeset
|
6 #define LOGIN_MASTER_SOCKET_FD 3 |
1035
fe49ece0f3ea
We have now separate "userdb" and "passdb". They aren't tied to each others
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
7 |
2779
1fd55b4341b9
Added version to login <-> master communication as well.
Timo Sirainen <tss@iki.fi>
parents:
2097
diff
changeset
|
8 /* Increase the version number every time master_login_request |
1fd55b4341b9
Added version to login <-> master communication as well.
Timo Sirainen <tss@iki.fi>
parents:
2097
diff
changeset
|
9 (or something else) is changed. */ |
4649
a3d6a3462745
Send inode number in login requests and verify that they match.
Timo Sirainen <tss@iki.fi>
parents:
4538
diff
changeset
|
10 #define MASTER_LOGIN_PROTOCOL_VERSION 3 |
4538
9d9e72374164
Fixes to login process handling, especially with
Timo Sirainen <tss@iki.fi>
parents:
3863
diff
changeset
|
11 |
7928
9e226056a208
Send login command OK reply in IMAP/POP3 process.
Timo Sirainen <tss@iki.fi>
parents:
7927
diff
changeset
|
12 /* This should be kept in sync with LOGIN_MAX_INBUF_SIZE. Multiply it by two |
9e226056a208
Send login command OK reply in IMAP/POP3 process.
Timo Sirainen <tss@iki.fi>
parents:
7927
diff
changeset
|
13 to make sure there's space to transfer the command tag */ |
9e226056a208
Send login command OK reply in IMAP/POP3 process.
Timo Sirainen <tss@iki.fi>
parents:
7927
diff
changeset
|
14 #define MASTER_LOGIN_MAX_DATA_SIZE (4096*2) |
7927
2351a81ce699
If commands are pipelined after the login command, pass them to the
Timo Sirainen <tss@iki.fi>
parents:
6410
diff
changeset
|
15 |
4538
9d9e72374164
Fixes to login process handling, especially with
Timo Sirainen <tss@iki.fi>
parents:
3863
diff
changeset
|
16 enum master_login_state { |
9d9e72374164
Fixes to login process handling, especially with
Timo Sirainen <tss@iki.fi>
parents:
3863
diff
changeset
|
17 /* process is accepting new connections */ |
9d9e72374164
Fixes to login process handling, especially with
Timo Sirainen <tss@iki.fi>
parents:
3863
diff
changeset
|
18 LOGIN_STATE_LISTENING = 0, |
9d9e72374164
Fixes to login process handling, especially with
Timo Sirainen <tss@iki.fi>
parents:
3863
diff
changeset
|
19 /* process isn't accepting new connections, but it'd be able to kill |
9d9e72374164
Fixes to login process handling, especially with
Timo Sirainen <tss@iki.fi>
parents:
3863
diff
changeset
|
20 some connections which haven't logged in yet */ |
9d9e72374164
Fixes to login process handling, especially with
Timo Sirainen <tss@iki.fi>
parents:
3863
diff
changeset
|
21 LOGIN_STATE_FULL_PRELOGINS, |
9d9e72374164
Fixes to login process handling, especially with
Timo Sirainen <tss@iki.fi>
parents:
3863
diff
changeset
|
22 /* process is handling only logged in users */ |
9d9e72374164
Fixes to login process handling, especially with
Timo Sirainen <tss@iki.fi>
parents:
3863
diff
changeset
|
23 LOGIN_STATE_FULL_LOGINS, |
9d9e72374164
Fixes to login process handling, especially with
Timo Sirainen <tss@iki.fi>
parents:
3863
diff
changeset
|
24 |
9d9e72374164
Fixes to login process handling, especially with
Timo Sirainen <tss@iki.fi>
parents:
3863
diff
changeset
|
25 LOGIN_STATE_COUNT |
9d9e72374164
Fixes to login process handling, especially with
Timo Sirainen <tss@iki.fi>
parents:
3863
diff
changeset
|
26 }; |
1035
fe49ece0f3ea
We have now separate "userdb" and "passdb". They aren't tied to each others
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
27 |
2779
1fd55b4341b9
Added version to login <-> master communication as well.
Timo Sirainen <tss@iki.fi>
parents:
2097
diff
changeset
|
28 struct master_login_request { |
1fd55b4341b9
Added version to login <-> master communication as well.
Timo Sirainen <tss@iki.fi>
parents:
2097
diff
changeset
|
29 uint32_t version; |
4538
9d9e72374164
Fixes to login process handling, especially with
Timo Sirainen <tss@iki.fi>
parents:
3863
diff
changeset
|
30 /* if fd == -1, tag is used as master_login_state */ |
2779
1fd55b4341b9
Added version to login <-> master communication as well.
Timo Sirainen <tss@iki.fi>
parents:
2097
diff
changeset
|
31 uint32_t tag; |
1fd55b4341b9
Added version to login <-> master communication as well.
Timo Sirainen <tss@iki.fi>
parents:
2097
diff
changeset
|
32 |
1fd55b4341b9
Added version to login <-> master communication as well.
Timo Sirainen <tss@iki.fi>
parents:
2097
diff
changeset
|
33 uint32_t auth_pid; |
1fd55b4341b9
Added version to login <-> master communication as well.
Timo Sirainen <tss@iki.fi>
parents:
2097
diff
changeset
|
34 uint32_t auth_id; |
7927
2351a81ce699
If commands are pipelined after the login command, pass them to the
Timo Sirainen <tss@iki.fi>
parents:
6410
diff
changeset
|
35 /* request follows this many bytes of client input */ |
7928
9e226056a208
Send login command OK reply in IMAP/POP3 process.
Timo Sirainen <tss@iki.fi>
parents:
7927
diff
changeset
|
36 uint16_t data_size; |
9e226056a208
Send login command OK reply in IMAP/POP3 process.
Timo Sirainen <tss@iki.fi>
parents:
7927
diff
changeset
|
37 uint16_t cmd_tag_size; |
1035
fe49ece0f3ea
We have now separate "userdb" and "passdb". They aren't tied to each others
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
38 |
4649
a3d6a3462745
Send inode number in login requests and verify that they match.
Timo Sirainen <tss@iki.fi>
parents:
4538
diff
changeset
|
39 ino_t ino; |
a3d6a3462745
Send inode number in login requests and verify that they match.
Timo Sirainen <tss@iki.fi>
parents:
4538
diff
changeset
|
40 |
2097
4e77cb0aff21
Added %l, %r and %P variables and mail_log_prefix setting.
Timo Sirainen <tss@iki.fi>
parents:
1273
diff
changeset
|
41 struct ip_addr local_ip, remote_ip; |
1035
fe49ece0f3ea
We have now separate "userdb" and "passdb". They aren't tied to each others
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
42 }; |
fe49ece0f3ea
We have now separate "userdb" and "passdb". They aren't tied to each others
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
43 |
5846
21e529b8a701
Initial implementation for mail_max_user_connections setting.
Timo Sirainen <tss@iki.fi>
parents:
5632
diff
changeset
|
44 enum master_login_status { |
21e529b8a701
Initial implementation for mail_max_user_connections setting.
Timo Sirainen <tss@iki.fi>
parents:
5632
diff
changeset
|
45 MASTER_LOGIN_STATUS_OK, |
21e529b8a701
Initial implementation for mail_max_user_connections setting.
Timo Sirainen <tss@iki.fi>
parents:
5632
diff
changeset
|
46 MASTER_LOGIN_STATUS_INTERNAL_ERROR, |
21e529b8a701
Initial implementation for mail_max_user_connections setting.
Timo Sirainen <tss@iki.fi>
parents:
5632
diff
changeset
|
47 /* user reached max. simultaneous connections */ |
21e529b8a701
Initial implementation for mail_max_user_connections setting.
Timo Sirainen <tss@iki.fi>
parents:
5632
diff
changeset
|
48 MASTER_LOGIN_STATUS_MAX_CONNECTIONS |
21e529b8a701
Initial implementation for mail_max_user_connections setting.
Timo Sirainen <tss@iki.fi>
parents:
5632
diff
changeset
|
49 }; |
21e529b8a701
Initial implementation for mail_max_user_connections setting.
Timo Sirainen <tss@iki.fi>
parents:
5632
diff
changeset
|
50 |
1035
fe49ece0f3ea
We have now separate "userdb" and "passdb". They aren't tied to each others
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
51 struct master_login_reply { |
fe49ece0f3ea
We have now separate "userdb" and "passdb". They aren't tied to each others
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
52 unsigned int tag; |
5846
21e529b8a701
Initial implementation for mail_max_user_connections setting.
Timo Sirainen <tss@iki.fi>
parents:
5632
diff
changeset
|
53 enum master_login_status status; |
8092
29b623366e1e
Pass the created mail process PID back to login process so it can log it.
Timo Sirainen <tss@iki.fi>
parents:
7943
diff
changeset
|
54 /* PID of the post-login mail process handling this connection */ |
29b623366e1e
Pass the created mail process PID back to login process so it can log it.
Timo Sirainen <tss@iki.fi>
parents:
7943
diff
changeset
|
55 pid_t mail_pid; |
1035
fe49ece0f3ea
We have now separate "userdb" and "passdb". They aren't tied to each others
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
56 }; |
fe49ece0f3ea
We have now separate "userdb" and "passdb". They aren't tied to each others
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
57 |
fe49ece0f3ea
We have now separate "userdb" and "passdb". They aren't tied to each others
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
58 #endif |