summaryrefslogtreecommitdiff
path: root/suhosin_rfc1867.h
diff options
context:
space:
mode:
authorStefan Esser2010-02-21 11:44:54 +0100
committerStefan Esser2010-02-21 11:44:54 +0100
commit36dbfacbe64697d959f524e537b15b73c090d898 (patch)
treef1c7ce1409b0e7765fc72d550546967fcf0f9717 /suhosin_rfc1867.h
Inital commit
Diffstat (limited to 'suhosin_rfc1867.h')
-rw-r--r--suhosin_rfc1867.h88
1 files changed, 88 insertions, 0 deletions
diff --git a/suhosin_rfc1867.h b/suhosin_rfc1867.h
new file mode 100644
index 0000000..1ddaab3
--- /dev/null
+++ b/suhosin_rfc1867.h
@@ -0,0 +1,88 @@
1/*
2 +----------------------------------------------------------------------+
3 | Suhosin Version 1 |
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2006-2007 The Hardened-PHP Project |
6 | Copyright (c) 2007 SektionEins GmbH |
7 +----------------------------------------------------------------------+
8 | This source file is subject to version 3.01 of the PHP license, |
9 | that is bundled with this package in the file LICENSE, and is |
10 | available through the world-wide-web at the following url: |
11 | http://www.php.net/license/3_01.txt |
12 | If you did not receive a copy of the PHP license and are unable to |
13 | obtain it through the world-wide-web, please send a note to |
14 | license@php.net so we can mail you a copy immediately. |
15 +----------------------------------------------------------------------+
16 | Author: Stefan Esser <sesser@sektioneins.de> |
17 +----------------------------------------------------------------------+
18*/
19
20/* $Id: suhosin_rfc1867.h,v 1.1.1.1 2007-11-28 01:15:35 sesser Exp $ */
21
22#ifndef SUHOSIN_RFC1867_H
23#define SUHOSIN_RFC1867_H
24
25#include "rfc1867.h"
26#include "SAPI.h"
27
28#define MULTIPART_CONTENT_TYPE "multipart/form-data"
29#ifdef MULTIPART_EVENT_START
30#define HAVE_RFC1867_CALLBACK 1
31#else
32#define HAVE_RFC1867_CALLBACK 0
33
34#define MULTIPART_EVENT_START 0
35#define MULTIPART_EVENT_FORMDATA 1
36#define MULTIPART_EVENT_FILE_START 2
37#define MULTIPART_EVENT_FILE_DATA 3
38#define MULTIPART_EVENT_FILE_END 4
39#define MULTIPART_EVENT_END 5
40
41typedef struct _multipart_event_start {
42 size_t content_length;
43} multipart_event_start;
44
45typedef struct _multipart_event_formdata {
46 size_t post_bytes_processed;
47 char *name;
48 char **value;
49 size_t length;
50 size_t *newlength;
51} multipart_event_formdata;
52
53typedef struct _multipart_event_file_start {
54 size_t post_bytes_processed;
55 char *name;
56 char **filename;
57} multipart_event_file_start;
58
59typedef struct _multipart_event_file_data {
60 size_t post_bytes_processed;
61 off_t offset;
62 char *data;
63 size_t length;
64 size_t *newlength;
65} multipart_event_file_data;
66
67typedef struct _multipart_event_file_end {
68 size_t post_bytes_processed;
69 char *temp_filename;
70 int cancel_upload;
71} multipart_event_file_end;
72
73typedef struct _multipart_event_end {
74 size_t post_bytes_processed;
75} multipart_event_end;
76
77#endif
78
79SAPI_POST_HANDLER_FUNC(suhosin_rfc1867_post_handler);
80
81void destroy_uploaded_files_hash(TSRMLS_D);
82#if !HAVE_RFC1867_CALLBACK
83extern PHP_SUHOSIN_API int (*php_rfc1867_callback)(unsigned int event, void *event_data, void **extra TSRMLS_DC);
84#else
85extern PHPAPI int (*php_rfc1867_callback)(unsigned int event, void *event_data, void **extra TSRMLS_DC);
86#endif
87
88#endif /* SUHOSIN_RFC1867_H */