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;
55 void CleanUpRequest(struct http_request *Req);
56 int SendBuffer(struct socket *sock, const char *Buffer,const size_t Length);
57 int SendBuffer_async(struct socket *sock, const char *Buffer,const size_t Length);
58 void Send403(struct socket *sock);
59 void Send304(struct socket *sock);
60 void Send50x(struct socket *sock);
64 int AcceptConnections(const int CPUNR,struct socket *Socket);
68 int WaitForHeaders(const int CPUNR);
69 void StopWaitingForHeaders(const int CPUNR);
70 int InitWaitHeaders(int ThreadCount);
74 int DataSending(const int CPUNR);
75 void StopDataSending(const int CPUNR);
76 int InitDataSending(int ThreadCount);
81 int Userspace(const int CPUNR);
82 void StopUserspace(const int CPUNR);
83 void InitUserspace(const int CPUNR);
88 void time_Unix2RFC(const time_t Zulu,char *Buffer);
89 void UpdateCurrentDate(void);
90 time_t mimeTime_to_UnixTime(char *Q);
91 extern int CurrentTime_i;
95 void ParseHeader(char *Buffer,const int length, struct http_request *Head);
96 char *ResolveMimeType(const char *File,__kernel_size_t *Len);
97 void AddMimeType(const char *Ident,const char *Type);
98 void SendHTTPHeader(struct http_request *Request);
104 struct file *OpenFileForSecurity(char *Filename);
105 void AddDynamicString(const char *String);
106 void GetSecureString(char *String);
111 int Logging(const int CPUNR);
112 void StopLogging(const int CPUNR);
115 /* Other prototypes */