| 1 | /*- |
|---|
| 2 | * Copyright (c) 2006 Verdens Gang AS |
|---|
| 3 | * Copyright (c) 2006-2009 Linpro AS |
|---|
| 4 | * All rights reserved. |
|---|
| 5 | * |
|---|
| 6 | * Author: Poul-Henning Kamp <phk@phk.freebsd.dk> |
|---|
| 7 | * |
|---|
| 8 | * Redistribution and use in source and binary forms, with or without |
|---|
| 9 | * modification, are permitted provided that the following conditions |
|---|
| 10 | * are met: |
|---|
| 11 | * 1. Redistributions of source code must retain the above copyright |
|---|
| 12 | * notice, this list of conditions and the following disclaimer. |
|---|
| 13 | * 2. Redistributions in binary form must reproduce the above copyright |
|---|
| 14 | * notice, this list of conditions and the following disclaimer in the |
|---|
| 15 | * documentation and/or other materials provided with the distribution. |
|---|
| 16 | * |
|---|
| 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND |
|---|
| 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
|---|
| 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
|---|
| 20 | * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE |
|---|
| 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
|---|
| 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
|---|
| 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
|---|
| 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
|---|
| 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
|---|
| 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
|---|
| 27 | * SUCH DAMAGE. |
|---|
| 28 | * |
|---|
| 29 | * $Id$ |
|---|
| 30 | * |
|---|
| 31 | * Argument list: |
|---|
| 32 | * --------------------------------------- |
|---|
| 33 | * a Http header name |
|---|
| 34 | * b session field name |
|---|
| 35 | * c Request(1)/Response(2) bitfield |
|---|
| 36 | * d (obsolete) |
|---|
| 37 | * e Supress header in filter ops |
|---|
| 38 | * f unused |
|---|
| 39 | * g unused |
|---|
| 40 | * |
|---|
| 41 | * see [RFC2616 13.5.1 End-to-end and Hop-by-hop Headers] |
|---|
| 42 | * |
|---|
| 43 | */ |
|---|
| 44 | |
|---|
| 45 | #ifndef HTTPH_R_PASS |
|---|
| 46 | #define HTTPH_R_PASS (1 << 0) /* Request (c->b) in pass mode */ |
|---|
| 47 | #define HTTPH_A_PASS (1 << 1) /* Response (b->c)in pass mode */ |
|---|
| 48 | #define HTTPH_R_PIPE (1 << 2) /* Request (c->b) in pipe mode */ |
|---|
| 49 | #define HTTPH_R_FETCH (1 << 3) /* Request (c->b) for fetch */ |
|---|
| 50 | #define HTTPH_A_INS (1 << 4) /* Response (b->o) for insert */ |
|---|
| 51 | #define HTTPH_A_DELIVER (1 << 5) /* Response (o->c) for deliver */ |
|---|
| 52 | #endif |
|---|
| 53 | |
|---|
| 54 | HTTPH("Keep-Alive", H_Keep_Alive, 3, 3, HTTPH_R_PASS | HTTPH_A_PASS | HTTPH_R_FETCH, 0, 0) /* RFC2068 */ |
|---|
| 55 | HTTPH("Accept", H_Accept, 1, 0, 0, 0, 0) /* RFC2616 14.1 */ |
|---|
| 56 | HTTPH("Accept-Charset", H_Accept_Charset, 1, 0, 0, 0, 0) /* RFC2616 14.2 */ |
|---|
| 57 | HTTPH("Accept-Encoding", H_Accept_Encoding, 1, 0, 0, 0, 0) /* RFC2616 14.3 */ |
|---|
| 58 | HTTPH("Accept-Language", H_Accept_Language, 1, 0, 0, 0, 0) /* RFC2616 14.4 */ |
|---|
| 59 | HTTPH("Accept-Ranges", H_Accept_Ranges, 2, 3, HTTPH_R_PASS | HTTPH_A_PASS | HTTPH_R_FETCH | HTTPH_A_INS, 0, 0) /* RFC2616 14.5 */ |
|---|
| 60 | HTTPH("Age", H_Age, 2, 0, HTTPH_A_INS, 0, 0) /* RFC2616 14.6 */ |
|---|
| 61 | HTTPH("Allow", H_Allow, 2, 0, 0, 0, 0) /* RFC2616 14.7 */ |
|---|
| 62 | HTTPH("Authorization", H_Authorization, 1, 0, 0, 0, 0) /* RFC2616 14.8 */ |
|---|
| 63 | HTTPH("Cache-Control", H_Cache_Control, 3, 3, HTTPH_R_PASS | HTTPH_R_FETCH, 0, 0) /* RFC2616 14.9 */ |
|---|
| 64 | HTTPH("Connection", H_Connection, 3, 3, HTTPH_R_PASS | HTTPH_A_PASS | HTTPH_R_FETCH | HTTPH_A_INS, 0, 0) /* RFC2616 14.10 */ |
|---|
| 65 | HTTPH("Content-Encoding", H_Content_Encoding, 2, 0, 0, 0, 0) /* RFC2616 14.11 */ |
|---|
| 66 | HTTPH("Content-Langugae", H_Content_Language, 2, 0, 0, 0, 0) /* RFC2616 14.12 */ |
|---|
| 67 | HTTPH("Content-Length", H_Content_Length, 2, 2, HTTPH_R_FETCH | HTTPH_A_INS, 0, 0) /* RFC2616 14.13 */ |
|---|
| 68 | HTTPH("Content-Location", H_Content_Location, 2, 0, 0, 0, 0) /* RFC2616 14.14 */ |
|---|
| 69 | HTTPH("Content-MD5", H_Content_MD5, 2, 0, 0, 0, 0) /* RFC2616 14.15 */ |
|---|
| 70 | HTTPH("Content-Range", H_Content_Range, 2, 3, HTTPH_R_PASS | HTTPH_A_PASS | HTTPH_R_FETCH | HTTPH_A_INS, 0, 0) /* RFC2616 14.16 */ |
|---|
| 71 | HTTPH("Content-Type", H_Content_Type, 2, 0, 0, 0, 0) /* RFC2616 14.17 */ |
|---|
| 72 | HTTPH("Date", H_Date, 2, 0, HTTPH_A_DELIVER, 0, 0) /* RFC2616 14.18 */ |
|---|
| 73 | HTTPH("ETag", H_ETag, 2, 0, 0, 0, 0) /* RFC2616 14.19 */ |
|---|
| 74 | HTTPH("Expect", H_Expect, 1, 0, 0, 0, 0) /* RFC2616 14.20 */ |
|---|
| 75 | HTTPH("Expires", H_Expires, 2, 0, 0, 0, 0) /* RFC2616 14.21 */ |
|---|
| 76 | HTTPH("From", H_From, 1, 0, 0, 0, 0) /* RFC2616 14.22 */ |
|---|
| 77 | HTTPH("Host", H_Host, 1, 0, 0, 0, 0) /* RFC2616 14.23 */ |
|---|
| 78 | HTTPH("If-Match", H_If_Match, 1, 1, HTTPH_R_FETCH, 0, 0) /* RFC2616 14.24 */ |
|---|
| 79 | HTTPH("If-Modified-Since", H_If_Modified_Since, 1, 1, HTTPH_R_FETCH, 0, 0) /* RFC2616 14.25 */ |
|---|
| 80 | HTTPH("If-None-Match", H_If_None_Match, 1, 1, HTTPH_R_FETCH, 0, 0) /* RFC2616 14.26 */ |
|---|
| 81 | HTTPH("If-Range", H_If_Range, 1, 1, HTTPH_R_FETCH, 0, 0) /* RFC2616 14.27 */ |
|---|
| 82 | HTTPH("If-Unmodified-Since", H_If_Unmodifed_Since, 1, 1, HTTPH_R_FETCH, 0, 0) /* RFC2616 14.28 */ |
|---|
| 83 | HTTPH("Last-Modified", H_Last_Modified, 2, 0, 0, 0, 0) /* RFC2616 14.29 */ |
|---|
| 84 | HTTPH("Location", H_Location, 2, 0, 0, 0, 0) /* RFC2616 14.30 */ |
|---|
| 85 | HTTPH("Max-Forwards", H_Max_Forwards, 1, 0, 0, 0, 0) /* RFC2616 14.31 */ |
|---|
| 86 | HTTPH("Pragma", H_Pragma, 1, 0, 0, 0, 0) /* RFC2616 14.32 */ |
|---|
| 87 | HTTPH("Proxy-Authenticate", H_Proxy_Authenticate, 2, 3, HTTPH_R_FETCH | HTTPH_A_INS, 0, 0) /* RFC2616 14.33 */ |
|---|
| 88 | HTTPH("Proxy-Authorization", H_Proxy_Authorization, 1, 3, HTTPH_R_FETCH | HTTPH_A_INS, 0, 0) /* RFC2616 14.34 */ |
|---|
| 89 | HTTPH("Range", H_Range, 1, 0, HTTPH_R_FETCH | HTTPH_A_INS, 0, 0) /* RFC2616 14.35 */ |
|---|
| 90 | HTTPH("Referer", H_Referer, 1, 0, 0, 0, 0) /* RFC2616 14.36 */ |
|---|
| 91 | HTTPH("Retry-After", H_Retry_After, 2, 0, 0, 0, 0) /* RFC2616 14.37 */ |
|---|
| 92 | HTTPH("Server", H_Server, 2, 0, 0, 0, 0) /* RFC2616 14.38 */ |
|---|
| 93 | HTTPH("TE", H_TE, 1, 3, HTTPH_R_PASS | HTTPH_A_PASS | HTTPH_R_FETCH | HTTPH_A_INS, 0, 0) /* RFC2616 14.39 */ |
|---|
| 94 | HTTPH("Trailer", H_Trailer, 1, 3, HTTPH_R_PASS | HTTPH_A_PASS | HTTPH_R_FETCH | HTTPH_A_INS, 0, 0) /* RFC2616 14.40 */ |
|---|
| 95 | HTTPH("Transfer-Encoding", H_Transfer_Encoding, 2, 3, HTTPH_R_PASS | HTTPH_A_PASS | HTTPH_R_FETCH | HTTPH_A_INS, 0, 0) /* RFC2616 14.41 */ |
|---|
| 96 | HTTPH("Upgrade", H_Upgrade, 2, 3, HTTPH_R_PASS | HTTPH_A_PASS | HTTPH_R_FETCH | HTTPH_A_INS, 0, 0) /* RFC2616 14.42 */ |
|---|
| 97 | HTTPH("User-Agent", H_User_Agent, 1, 0, 0, 0, 0) /* RFC2616 14.43 */ |
|---|
| 98 | HTTPH("Vary", H_Vary, 2, 0, 0, 0, 0) /* RFC2616 14.44 */ |
|---|
| 99 | HTTPH("Via", H_Via, 2, 0, 0, 0, 0) /* RFC2616 14.45 */ |
|---|
| 100 | HTTPH("Warning", H_Warning, 2, 0, 0, 0, 0) /* RFC2616 14.46 */ |
|---|
| 101 | HTTPH("WWW-Authenticate", H_WWW_Authenticate, 2, 0, 0, 0, 0) /* RFC2616 14.47 */ |
|---|