Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 1 | /* |
| 2 | include/types/proto_http.h |
| 3 | This file contains HTTP protocol definitions. |
| 4 | |
| 5 | Copyright (C) 2000-2006 Willy Tarreau - w@1wt.eu |
| 6 | |
| 7 | This library is free software; you can redistribute it and/or |
| 8 | modify it under the terms of the GNU Lesser General Public |
| 9 | License as published by the Free Software Foundation, version 2.1 |
| 10 | exclusively. |
| 11 | |
| 12 | This library is distributed in the hope that it will be useful, |
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 | Lesser General Public License for more details. |
| 16 | |
| 17 | You should have received a copy of the GNU Lesser General Public |
| 18 | License along with this library; if not, write to the Free Software |
| 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 20 | */ |
| 21 | |
| 22 | #ifndef _TYPES_PROTO_HTTP_H |
| 23 | #define _TYPES_PROTO_HTTP_H |
| 24 | |
Willy Tarreau | e3ba5f0 | 2006-06-29 18:54:54 +0200 | [diff] [blame] | 25 | #include <common/config.h> |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 26 | |
| 27 | /* |
| 28 | * FIXME: break this into HTTP state and TCP socket state. |
| 29 | * See server.h for the other end. |
| 30 | */ |
| 31 | |
| 32 | /* different possible states for the client side */ |
| 33 | #define CL_STHEADERS 0 |
| 34 | #define CL_STDATA 1 |
| 35 | #define CL_STSHUTR 2 |
| 36 | #define CL_STSHUTW 3 |
| 37 | #define CL_STCLOSE 4 |
| 38 | |
| 39 | /* |
| 40 | * FIXME: break this into HTTP state and TCP socket state. |
| 41 | * See client.h for the other end. |
| 42 | */ |
| 43 | |
| 44 | /* different possible states for the server side */ |
| 45 | #define SV_STIDLE 0 |
| 46 | #define SV_STCONN 1 |
| 47 | #define SV_STHEADERS 2 |
| 48 | #define SV_STDATA 3 |
| 49 | #define SV_STSHUTR 4 |
| 50 | #define SV_STSHUTW 5 |
| 51 | #define SV_STCLOSE 6 |
| 52 | |
| 53 | |
Willy Tarreau | 58f10d7 | 2006-12-04 02:26:12 +0100 | [diff] [blame] | 54 | /* Possible states while parsing HTTP messages (request|response) */ |
| 55 | #define HTTP_PA_EMPTY 0 /* leading LF, before start line */ |
| 56 | #define HTTP_PA_START 1 /* inside start line */ |
| 57 | #define HTTP_PA_STRT_LF 2 /* LF after start line */ |
| 58 | #define HTTP_PA_HEADER 3 /* inside a header */ |
| 59 | #define HTTP_PA_HDR_LF 4 /* LF after a header */ |
| 60 | #define HTTP_PA_HDR_LWS 5 /* LWS after a header */ |
| 61 | #define HTTP_PA_LFLF 6 /* after double LF/CRLF at the end of headers */ |
| 62 | #define HTTP_PA_ERROR 7 /* syntax error in the message */ |
| 63 | #define HTTP_PA_CR_SKIP 0x10 /* ORed with other values when a CR was skipped */ |
| 64 | #define HTTP_PA_LF_EXP 0x20 /* ORed with other values when a CR is seen and |
| 65 | * an LF is expected before entering the |
| 66 | * designated state. */ |
| 67 | |
Willy Tarreau | c0dde7a | 2007-01-01 21:38:07 +0100 | [diff] [blame^] | 68 | /* various data sources for the responses */ |
| 69 | #define DATA_SRC_NONE 0 |
| 70 | #define DATA_SRC_STATS 1 |
| 71 | |
| 72 | /* data transmission states for the stats responses */ |
| 73 | enum { |
| 74 | DATA_ST_INIT = 0, |
| 75 | DATA_ST_HEAD, |
| 76 | DATA_ST_INFO, |
| 77 | DATA_ST_LIST, |
| 78 | DATA_ST_END, |
| 79 | DATA_ST_FIN, |
| 80 | }; |
| 81 | |
| 82 | /* data transmission states for the stats responses inside a proxy */ |
| 83 | enum { |
| 84 | DATA_ST_PX_INIT = 0, |
| 85 | DATA_ST_PX_TH, |
| 86 | DATA_ST_PX_FE, |
| 87 | DATA_ST_PX_SV, |
| 88 | DATA_ST_PX_BE, |
| 89 | DATA_ST_PX_END, |
| 90 | DATA_ST_PX_FIN, |
| 91 | }; |
| 92 | |
Willy Tarreau | 58f10d7 | 2006-12-04 02:26:12 +0100 | [diff] [blame] | 93 | |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 94 | #endif /* _TYPES_PROTO_HTTP_H */ |
| 95 | |
| 96 | /* |
| 97 | * Local variables: |
| 98 | * c-indent-level: 8 |
| 99 | * c-basic-offset: 8 |
| 100 | * End: |
| 101 | */ |