comparison src/imap/ngx_imap.h @ 419:47709bff4468

nginx-0.0.10-2004-09-09-19:40:48 import
author Igor Sysoev <igor@sysoev.ru>
date Thu, 09 Sep 2004 15:40:48 +0000
parents cf072d26d6d6
children 01456a419cf9
comparison
equal deleted inserted replaced
418:cf072d26d6d6 419:47709bff4468
2 #define _NGX_IMAP_H_INCLUDED_ 2 #define _NGX_IMAP_H_INCLUDED_
3 3
4 4
5 #include <ngx_config.h> 5 #include <ngx_config.h>
6 #include <ngx_core.h> 6 #include <ngx_core.h>
7 #include <ngx_event.h>
8 #include <ngx_event_connect.h>
7 9
8 10
9 typedef struct { 11 typedef struct {
10 ngx_connection_t *connection; 12 ngx_peer_connection_t upstream;
11 13
12 ngx_buf_t *downstream_buffer; 14 ngx_buf_t *buffer;
13 ngx_buf_t *upstream_buffer;
14 } ngx_imap_proxy_ctx_t; 15 } ngx_imap_proxy_ctx_t;
15 16
16 17
17 typedef struct { 18 typedef struct {
18 uint32_t signature; /* "IMAP" */ 19 uint32_t signature; /* "IMAP" */
19 20
20 ngx_connection_t *connection; 21 ngx_connection_t *connection;
21 ngx_imap_proxy_ctx_t *proxy; 22 ngx_buf_t *buffer;
23
24 ngx_imap_proxy_ctx_t *proxy;
25
26 ngx_uint_t command;
27 ngx_array_t args;
28
29 /* used to parse IMAP/POP3 command */
30
31 ngx_uint_t state;
32 u_char *arg_start;
33 u_char *arg_end;
22 } ngx_imap_session_t; 34 } ngx_imap_session_t;
23 35
24 36
25 #define NGX_POP3_USER 1 37 #define NGX_POP3_USER 1
26 #define NGX_POP3_PASS 2 38 #define NGX_POP3_PASS 2
27 #define NGX_POP3_APOP 3 39 #define NGX_POP3_APOP 3
28 #define NGX_POP3_STAT 4 40 #define NGX_POP3_STAT 4
29 #define NGX_POP3_LIST 5 41 #define NGX_POP3_LIST 5
30 #define NGX_POP3_RETR 6 42 #define NGX_POP3_RETR 6
31 #define NGX_POP3_DELE 7 43 #define NGX_POP3_DELE 7
32 #define NGX_POP3_NOOP 8 44 #define NGX_POP3_NOOP 8
33 #define NGX_POP3_RSET 9 45 #define NGX_POP3_RSET 9
34 #define NGX_POP3_TOP 10 46 #define NGX_POP3_TOP 10
35 #define NGX_POP3_UIDL 11 47 #define NGX_POP3_UIDL 11
36 #define NGX_POP3_QUIT 12 48 #define NGX_POP3_QUIT 12
49
50
51 #define NGX_IMAP_PARSE_INVALID_COMMAND 10
52
53
54 #define NGX_IMAP_PROXY_INVALID 10
55 #define NGX_IMAP_PROXY_ERROR 11
37 56
38 57
39 void ngx_imap_init_connection(ngx_connection_t *c); 58 void ngx_imap_init_connection(ngx_connection_t *c);
40 void ngx_imap_close_connection(ngx_connection_t *c); 59 void ngx_imap_close_connection(ngx_connection_t *c);
41 60
61 void ngx_imap_proxy_init(ngx_imap_session_t *s);
62
63 ngx_int_t ngx_pop3_parse_command(ngx_imap_session_t *s);
64
42 65
43 #endif /* _NGX_IMAP_H_INCLUDED_ */ 66 #endif /* _NGX_IMAP_H_INCLUDED_ */