Go to the documentation of this file.00001 #ifndef I4HTTOOLS_H
00002 #define I4HTTOOLS_H
00003
00004 #include <stdio.h>
00005 #include <sys/socket.h>
00006 #include <netinet/in.h>
00007
00026 #define EBADREQUEST 400
00027
00029 #define EFORBIDDEN 403
00030
00032 #define ENOTFOUND 404
00033
00035 #define EERROR 500
00036
00050 void badreq(FILE *client, const char *relPath, uint16_t port);
00051
00065 void forbidden(FILE *client,const char *fullPath, const char *relPath, uint16_t port);
00066
00080 void notfound(FILE *client, const char *fullPath, const char *relPath, uint16_t port);
00081
00082
00096 void internalServerError(FILE *client, const char *fullPath, const char *relPath, uint16_t port);
00097
00098
00111 void errorpage(FILE *client, int statusCode,
00112 const char *fullPath, const char *relPath, uint16_t port);
00113
00128 int checkpath(const char *relPath);
00129
00141 void printconn(FILE* stream,FILE* peer,const char *msg);
00142
00143 #endif