1 #ifndef _INCLUDE_GUARD_PROTOTYPES_H
2 #define _INCLUDE_GUARD_PROTOTYPES_H
5 #include <linux/config.h>
6 #include <linux/kernel.h>
8 #include <linux/time.h>
9 #include <linux/types.h>
10 #include <linux/wait.h>
12 #include <asm/uaccess.h>
14 #include "structure.h"
17 /* General defines and stuff */
20 #define CONFIG_KHTTPD_NUMCPU 16 /* Maximum number of threads */
23 #define EnterFunction(x) printk("Enter: %s, %s line %i\n",x,__FILE__,__LINE__)
24 #define LeaveFunction(x) printk("Leave: %s, %s line %i\n",x,__FILE__,__LINE__)
26 #define EnterFunction(x) do {} while (0)
27 #define LeaveFunction(x) do {} while (0)
33 int StartListening(const int Port);
34 void StopListening(void);
36 extern struct socket *MainSocket;
40 void StartSysctl(void);
43 extern int sysctl_khttpd_stop;
49 extern struct khttpd_threadinfo threadinfo[CONFIG_KHTTPD_NUMCPU];
50 extern char CurrentTime[];
51 extern atomic_t ConnectCount;
52 extern struct wait_queue main_wait[CONFIG_KHTTPD_NUMCPU];
56 void CleanUpRequest(struct http_request *Req);
57 int SendBuffer(struct socket *sock, const char *Buffer,const size_t Length);
58 int SendBuffer_async(struct socket *sock, const char *Buffer,const size_t Length);
59 void Send403(struct socket *sock);
60 void Send304(struct socket *sock);
61 void Send50x(struct socket *sock);
65 int AcceptConnections(const int CPUNR,struct socket *Socket);
69 int WaitForHeaders(const int CPUNR);
70 void StopWaitingForHeaders(const int CPUNR);
71 int InitWaitHeaders(int ThreadCount);
75 int DataSending(const int CPUNR);
76 void StopDataSending(const int CPUNR);
77 int InitDataSending(int ThreadCount);
82 int Userspace(const int CPUNR);
83 void StopUserspace(const int CPUNR);
84 void InitUserspace(const int CPUNR);
89 void time_Unix2RFC(const time_t Zulu,char *Buffer);
90 void UpdateCurrentDate(void);
91 time_t mimeTime_to_UnixTime(char *Q);
92 extern int CurrentTime_i;
96 void ParseHeader(char *Buffer,const int length, struct http_request *Head);
97 char *ResolveMimeType(const char *File,__kernel_size_t *Len);
98 void AddMimeType(const char *Ident,const char *Type);
99 void SendHTTPHeader(struct http_request *Request);
105 struct file *OpenFileForSecurity(char *Filename);
106 void AddDynamicString(const char *String);
107 void GetSecureString(char *String);
112 int Logging(const int CPUNR);
113 void StopLogging(const int CPUNR);
116 /* Other prototypes */