#ifndef _INCLUDE_GUARD_PROTOTYPES_H
|
#ifndef _INCLUDE_GUARD_PROTOTYPES_H
|
#define _INCLUDE_GUARD_PROTOTYPES_H
|
#define _INCLUDE_GUARD_PROTOTYPES_H
|
|
|
|
|
#include <linux/config.h>
|
#include <linux/config.h>
|
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
#include <linux/net.h>
|
#include <linux/net.h>
|
#include <linux/time.h>
|
#include <linux/time.h>
|
#include <linux/types.h>
|
#include <linux/types.h>
|
#include <linux/wait.h>
|
#include <linux/wait.h>
|
#include <net/sock.h>
|
#include <net/sock.h>
|
#include <asm/uaccess.h>
|
#include <asm/uaccess.h>
|
|
|
#include "structure.h"
|
#include "structure.h"
|
|
|
|
|
/* General defines and stuff */
|
/* General defines and stuff */
|
|
|
|
|
#define CONFIG_KHTTPD_NUMCPU 16 /* Maximum number of threads */
|
#define CONFIG_KHTTPD_NUMCPU 16 /* Maximum number of threads */
|
|
|
#ifdef OOPSTRACE
|
#ifdef OOPSTRACE
|
#define EnterFunction(x) printk("Enter: %s, %s line %i\n",x,__FILE__,__LINE__)
|
#define EnterFunction(x) printk("Enter: %s, %s line %i\n",x,__FILE__,__LINE__)
|
#define LeaveFunction(x) printk("Leave: %s, %s line %i\n",x,__FILE__,__LINE__)
|
#define LeaveFunction(x) printk("Leave: %s, %s line %i\n",x,__FILE__,__LINE__)
|
#else
|
#else
|
#define EnterFunction(x) do {} while (0)
|
#define EnterFunction(x) do {} while (0)
|
#define LeaveFunction(x) do {} while (0)
|
#define LeaveFunction(x) do {} while (0)
|
#endif
|
#endif
|
|
|
|
|
|
|
/* sockets.c */
|
/* sockets.c */
|
int StartListening(const int Port);
|
int StartListening(const int Port);
|
void StopListening(void);
|
void StopListening(void);
|
|
|
extern struct socket *MainSocket;
|
extern struct socket *MainSocket;
|
|
|
|
|
/* sysctl.c */
|
/* sysctl.c */
|
void StartSysctl(void);
|
void StartSysctl(void);
|
void EndSysctl(void);
|
void EndSysctl(void);
|
|
|
extern int sysctl_khttpd_stop;
|
extern int sysctl_khttpd_stop;
|
|
|
|
|
/* main.c */
|
/* main.c */
|
|
|
|
|
extern struct khttpd_threadinfo threadinfo[CONFIG_KHTTPD_NUMCPU];
|
extern struct khttpd_threadinfo threadinfo[CONFIG_KHTTPD_NUMCPU];
|
extern char CurrentTime[];
|
extern char CurrentTime[];
|
extern atomic_t ConnectCount;
|
extern atomic_t ConnectCount;
|
extern struct wait_queue main_wait[CONFIG_KHTTPD_NUMCPU];
|
extern struct wait_queue main_wait[CONFIG_KHTTPD_NUMCPU];
|
|
|
/* misc.c */
|
/* misc.c */
|
|
|
void CleanUpRequest(struct http_request *Req);
|
void CleanUpRequest(struct http_request *Req);
|
int SendBuffer(struct socket *sock, const char *Buffer,const size_t Length);
|
int SendBuffer(struct socket *sock, const char *Buffer,const size_t Length);
|
int SendBuffer_async(struct socket *sock, const char *Buffer,const size_t Length);
|
int SendBuffer_async(struct socket *sock, const char *Buffer,const size_t Length);
|
void Send403(struct socket *sock);
|
void Send403(struct socket *sock);
|
void Send304(struct socket *sock);
|
void Send304(struct socket *sock);
|
void Send50x(struct socket *sock);
|
void Send50x(struct socket *sock);
|
|
|
/* accept.c */
|
/* accept.c */
|
|
|
int AcceptConnections(const int CPUNR,struct socket *Socket);
|
int AcceptConnections(const int CPUNR,struct socket *Socket);
|
|
|
/* waitheaders.c */
|
/* waitheaders.c */
|
|
|
int WaitForHeaders(const int CPUNR);
|
int WaitForHeaders(const int CPUNR);
|
void StopWaitingForHeaders(const int CPUNR);
|
void StopWaitingForHeaders(const int CPUNR);
|
int InitWaitHeaders(int ThreadCount);
|
int InitWaitHeaders(int ThreadCount);
|
|
|
/* datasending.c */
|
/* datasending.c */
|
|
|
int DataSending(const int CPUNR);
|
int DataSending(const int CPUNR);
|
void StopDataSending(const int CPUNR);
|
void StopDataSending(const int CPUNR);
|
int InitDataSending(int ThreadCount);
|
int InitDataSending(int ThreadCount);
|
|
|
|
|
/* userspace.c */
|
/* userspace.c */
|
|
|
int Userspace(const int CPUNR);
|
int Userspace(const int CPUNR);
|
void StopUserspace(const int CPUNR);
|
void StopUserspace(const int CPUNR);
|
void InitUserspace(const int CPUNR);
|
void InitUserspace(const int CPUNR);
|
|
|
|
|
/* rfc_time.c */
|
/* rfc_time.c */
|
|
|
void time_Unix2RFC(const time_t Zulu,char *Buffer);
|
void time_Unix2RFC(const time_t Zulu,char *Buffer);
|
void UpdateCurrentDate(void);
|
void UpdateCurrentDate(void);
|
time_t mimeTime_to_UnixTime(char *Q);
|
time_t mimeTime_to_UnixTime(char *Q);
|
extern int CurrentTime_i;
|
extern int CurrentTime_i;
|
|
|
/* rfc.c */
|
/* rfc.c */
|
|
|
void ParseHeader(char *Buffer,const int length, struct http_request *Head);
|
void ParseHeader(char *Buffer,const int length, struct http_request *Head);
|
char *ResolveMimeType(const char *File,__kernel_size_t *Len);
|
char *ResolveMimeType(const char *File,__kernel_size_t *Len);
|
void AddMimeType(const char *Ident,const char *Type);
|
void AddMimeType(const char *Ident,const char *Type);
|
void SendHTTPHeader(struct http_request *Request);
|
void SendHTTPHeader(struct http_request *Request);
|
|
|
|
|
|
|
/* security.c */
|
/* security.c */
|
|
|
struct file *OpenFileForSecurity(char *Filename);
|
struct file *OpenFileForSecurity(char *Filename);
|
void AddDynamicString(const char *String);
|
void AddDynamicString(const char *String);
|
void GetSecureString(char *String);
|
void GetSecureString(char *String);
|
|
|
|
|
/* logging.c */
|
/* logging.c */
|
|
|
int Logging(const int CPUNR);
|
int Logging(const int CPUNR);
|
void StopLogging(const int CPUNR);
|
void StopLogging(const int CPUNR);
|
|
|
|
|
/* Other prototypes */
|
/* Other prototypes */
|
|
|
|
|
|
|
#endif
|
#endif
|
|
|