/src/lighttpd1.4/src/http_kv.h
Line | Count | Source |
1 | | #ifndef INCLUDED_HTTP_KV_H |
2 | | #define INCLUDED_HTTP_KV_H |
3 | | #include "first.h" |
4 | | |
5 | | #include "buffer.h" |
6 | | |
7 | | /* sources: |
8 | | * - [RFC2616], Section 9 |
9 | | * (or http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-22) |
10 | | * - http://tools.ietf.org/html/draft-ietf-httpbis-method-registrations-11, Appendix A |
11 | | * |
12 | | * http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-22, Section 8.1 defines |
13 | | * a new registry (not available yet): |
14 | | * http://www.iana.org/assignments/http-methods |
15 | | */ |
16 | | |
17 | | typedef enum { |
18 | | HTTP_METHOD_PRI = -2, /* [RFC7540], Section 3.5 */ |
19 | | HTTP_METHOD_UNSET = -1, |
20 | | HTTP_METHOD_GET, /* [RFC2616], Section 9.3 */ |
21 | | HTTP_METHOD_HEAD, /* [RFC2616], Section 9.4 */ |
22 | | HTTP_METHOD_QUERY, /* [RFCxxxx], Section 2 */ |
23 | | HTTP_METHOD_POST, /* [RFC2616], Section 9.5 */ |
24 | | HTTP_METHOD_PUT, /* [RFC2616], Section 9.6 */ |
25 | | HTTP_METHOD_DELETE, /* [RFC2616], Section 9.7 */ |
26 | | HTTP_METHOD_CONNECT, /* [RFC2616], Section 9.9 */ |
27 | | HTTP_METHOD_OPTIONS, /* [RFC2616], Section 9.2 */ |
28 | | HTTP_METHOD_TRACE, /* [RFC2616], Section 9.8 */ |
29 | | HTTP_METHOD_ACL, /* [RFC3744], Section 8.1 */ |
30 | | HTTP_METHOD_BASELINE_CONTROL, /* [RFC3253], Section 12.6 */ |
31 | | HTTP_METHOD_BIND, /* [RFC5842], Section 4 */ |
32 | | HTTP_METHOD_CHECKIN, /* [RFC3253], Section 4.4 and [RFC3253], Section 9.4 */ |
33 | | HTTP_METHOD_CHECKOUT, /* [RFC3253], Section 4.3 and [RFC3253], Section 8.8 */ |
34 | | HTTP_METHOD_COPY, /* [RFC4918], Section 9.8 */ |
35 | | HTTP_METHOD_LABEL, /* [RFC3253], Section 8.2 */ |
36 | | HTTP_METHOD_LINK, /* [RFC2068], Section 19.6.1.2 */ |
37 | | HTTP_METHOD_LOCK, /* [RFC4918], Section 9.10 */ |
38 | | HTTP_METHOD_MERGE, /* [RFC3253], Section 11.2 */ |
39 | | HTTP_METHOD_MKACTIVITY, /* [RFC3253], Section 13.5 */ |
40 | | HTTP_METHOD_MKCALENDAR, /* [RFC4791], Section 5.3.1 */ |
41 | | HTTP_METHOD_MKCOL, /* [RFC4918], Section 9.3 */ |
42 | | HTTP_METHOD_MKREDIRECTREF, /* [RFC4437], Section 6 */ |
43 | | HTTP_METHOD_MKWORKSPACE, /* [RFC3253], Section 6.3 */ |
44 | | HTTP_METHOD_MOVE, /* [RFC4918], Section 9.9 */ |
45 | | HTTP_METHOD_ORDERPATCH, /* [RFC3648], Section 7 */ |
46 | | HTTP_METHOD_PATCH, /* [RFC5789], Section 2 */ |
47 | | HTTP_METHOD_PROPFIND, /* [RFC4918], Section 9.1 */ |
48 | | HTTP_METHOD_PROPPATCH, /* [RFC4918], Section 9.2 */ |
49 | | HTTP_METHOD_REBIND, /* [RFC5842], Section 6 */ |
50 | | HTTP_METHOD_REPORT, /* [RFC3253], Section 3.6 */ |
51 | | HTTP_METHOD_SEARCH, /* [RFC5323], Section 2 */ |
52 | | HTTP_METHOD_UNBIND, /* [RFC5842], Section 5 */ |
53 | | HTTP_METHOD_UNCHECKOUT, /* [RFC3253], Section 4.5 */ |
54 | | HTTP_METHOD_UNLINK, /* [RFC2068], Section 19.6.1.3 */ |
55 | | HTTP_METHOD_UNLOCK, /* [RFC4918], Section 9.11 */ |
56 | | HTTP_METHOD_UPDATE, /* [RFC3253], Section 7.1 */ |
57 | | HTTP_METHOD_UPDATEREDIRECTREF, /* [RFC4437], Section 7 */ |
58 | | HTTP_METHOD_VERSION_CONTROL /* [RFC3253], Section 3.5 */ |
59 | | } http_method_t; |
60 | | |
61 | | typedef enum { |
62 | | HTTP_VERSION_UNSET = -1 |
63 | | ,HTTP_VERSION_1_0 |
64 | | ,HTTP_VERSION_1_1 |
65 | | ,HTTP_VERSION_2 |
66 | | ,HTTP_VERSION_3 |
67 | | } http_version_t; |
68 | | |
69 | | __attribute_pure__ |
70 | | __attribute_returns_nonnull__ |
71 | | const buffer *http_version_buf (http_version_t i); |
72 | | |
73 | | __attribute_pure__ |
74 | | __attribute_returns_nonnull__ |
75 | | const buffer *http_method_buf (http_method_t i); |
76 | | |
77 | | __attribute_nonnull__() |
78 | | __attribute_pure__ |
79 | | http_method_t http_method_key_get (const char *s, size_t slen); |
80 | | |
81 | 0 | #define http_method_get_or_head(method) ((method) <= HTTP_METHOD_HEAD) |
82 | | #define http_method_get_head_query(method) ((method) <= HTTP_METHOD_QUERY) |
83 | | #define http_method_get_head_query_post(method) ((method) <= HTTP_METHOD_POST) |
84 | | |
85 | | __attribute_nonnull__() |
86 | | static inline void http_version_append (buffer * const b, const http_version_t version); |
87 | | static inline void http_version_append (buffer * const b, const http_version_t version) |
88 | 0 | { |
89 | 0 | buffer_append_buffer(b, http_version_buf(version)); |
90 | 0 | } Unexecuted instantiation: fuzz_request.c:http_version_append Unexecuted instantiation: request.c:http_version_append Unexecuted instantiation: http_header.c:http_version_append Unexecuted instantiation: http_kv.c:http_version_append |
91 | | |
92 | | __attribute_nonnull__() |
93 | | static inline void http_method_append (buffer * const b, const http_method_t method); |
94 | | static inline void http_method_append (buffer * const b, const http_method_t method) |
95 | 0 | { |
96 | 0 | buffer_append_buffer(b, http_method_buf(method)); |
97 | 0 | } Unexecuted instantiation: fuzz_request.c:http_method_append Unexecuted instantiation: request.c:http_method_append Unexecuted instantiation: http_header.c:http_method_append Unexecuted instantiation: http_kv.c:http_method_append |
98 | | |
99 | | |
100 | | #endif |