rasdaman complete source
server.h
Go to the documentation of this file.
1 /*
2 * This file is part of rasdaman community.
3 *
4 * Rasdaman community is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * Rasdaman community is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
18 rasdaman GmbH.
19 *
20 * For more information please see <http://www.rasdaman.org>
21 * or contact Peter Baumann via <baumann@rasdaman.com>.
22 */
23 /*------------------------------------------------------------------------*/
24 /* server.h - server structures. */
25 /*------------------------------------------------------------------------*/
26 
27 
28 #ifndef _SERVER_H
29 #define _SERVER_H
30 
31 #include <sys/types.h>
32 #include <unistd.h>
33 #include <limits.h>
34 #include <errno.h>
35 
36 #include <stdio.h>
37 #include <stdlib.h>
38 #include <stdarg.h>
39 
40 #include <signal.h>
41 #include <sys/stat.h>
42 #include <sys/wait.h>
43 
44 #ifndef AIX
45 #include <sys/fcntl.h>
46 #endif
47 
48 #include <fcntl.h>
49 #include <string.h>
50 #include <strings.h>
51 #include <sys/time.h>
52 #include <time.h>
53 
54 #include <sys/socket.h>
55 #include <netinet/in.h>
56 #include <arpa/inet.h>
57 #include <netdb.h>
58 
59 #include "types.h"
60 #include "http.h"
61 
63 {
64  char *Database;
65  int Command;
66  char *QueryString;
68  char *ClientID;
69  int Endianess;
71  char *BinData;
73  char *Capability;
74 };
75 
76 union WhichArg
77 {
78  int Code;
79 };
80 
81 struct ToDoArgs
82 {
83  int What;
84  union WhichArg Which;
85 };
86 
87 struct FDsets
88 {
89  int MaxFD;
90  fd_set Read;
91  fd_set Write;
92 };
93 
94 struct LogFile
95 {
96  char *Filename;
97  int FD;
98  int State;
99 };
100 
101 
102 struct Logging
103 {
104  int Mode;
105  struct LogFile Server;
106  struct LogFile Access;
107  struct LogFile Comm;
108 };
109 
110 struct ChildBase
111 {
112  struct ChildBase *next;
113  struct ChildBase *prev;
114  pid_t PId;
115  int PD[2];
117 };
118 
119 
120 struct Host
121 {
122  char *Name;
123  char IPAddrString[ 16 ];
124 #ifdef NO_in_addr_t
125  unsigned long IPAddress;
126 #else
127  in_addr_t IPAddress;
128 #endif
129 };
130 
131 
132 struct HTTPMode
133 {
134  int Protocol;
136 };
137 
138 
140 {
141  /* Client Host Infos */
142  struct Host Host;
144  /* Socket */
145  int SockFD;
146  struct sockaddr_in Socket;
147  int SockSize;
148  /* select() timeout */
149  struct timeval TimeOut;
150 
151  struct HTTPMode Comm;
152  /* Request */
153  struct ReqInfo Request;
154  /* Response */
157  /* Pipe to Parent process */
158  int Pipe;
160 };
161 
162 
164 {
165  pid_t PId;
166  /* -- Config.Information */
167  struct Host Host;
168  int Port;
170  char *Directory;
171  char *ConfigFile;
172  char *PidFile;
173  //char *CacheFile;
174  size_t MaxURLLength;
175  /* -- Status Information */
176  int Status;
178  struct FDsets PipeSets;
179  /* -- Global Data */
180  struct Logging Log;
181  struct CacheNode *Cache;
182  /* -- Server Socket */
183  int SockFD;
184  struct sockaddr_in Socket;
185  /* -- Client Information */
187 };
188 
189 
190 #endif /* _SERVER_H not defined */
int SockSize
Definition: server.h:147
union WhichArg Which
Definition: server.h:84
int FD
Definition: server.h:97
Definition: server.h:62
pid_t PId
Definition: server.h:165
int Endianess
Definition: server.h:69
struct ChildBase * next
Definition: server.h:112
int Status
Definition: server.h:176
int State
Definition: server.h:98
struct LogFile Server
Definition: server.h:105
char IPAddrString[16]
Definition: server.h:123
in_addr_t IPAddress
Definition: server.h:127
int MaxFD
Definition: server.h:89
struct HTTPMode Comm
Definition: server.h:151
int Port
Definition: server.h:168
char * ClientID
Definition: server.h:68
char * ConfigFile
Definition: server.h:171
struct FDsets PipeSets
Definition: server.h:178
int Command
Definition: server.h:65
struct CacheNode * Cache
Definition: server.h:181
int Mode
Definition: server.h:104
struct timeval TimeOut
Definition: server.h:149
char * AdminMailAddress
Definition: server.h:169
int Pipe
Definition: server.h:158
int ClientType
Definition: server.h:143
char * PidFile
Definition: server.h:172
char * BinData
Definition: server.h:71
int SockFD
Definition: server.h:183
char * Database
Definition: server.h:64
struct ChildBase * prev
Definition: server.h:113
#define PIPE_BUFFSIZE
Definition: defs.h:46
int NumberOfQueryParams
Definition: server.h:70
int What
Definition: server.h:83
int Protocol
Definition: server.h:134
int Code
Definition: server.h:78
struct Logging Log
Definition: server.h:180
int ClientType
Definition: server.h:67
char * Directory
Definition: server.h:170
struct sockaddr_in Socket
Definition: server.h:146
Definition: server.h:163
fd_set Write
Definition: server.h:91
struct sockaddr_in Socket
Definition: server.h:184
struct LogFile Comm
Definition: server.h:107
Definition: server.h:132
Definition: http.h:53
Definition: server.h:139
struct HTTPMsg Response
Definition: server.h:155
Definition: server.h:76
int ConnStatus
Definition: server.h:135
int SockFD
Definition: server.h:145
int RespStatus
Definition: server.h:156
pid_t PId
Definition: server.h:114
Definition: server.h:81
Definition: server.h:120
int PipeStatus
Definition: server.h:116
fd_set Read
Definition: server.h:90
char * Filename
Definition: server.h:96
int BinDataSize
Definition: server.h:72
char * Name
Definition: server.h:122
char * Capability
Definition: server.h:73
struct ReqInfo Request
Definition: server.h:153
Definition: server.h:102
int PD[2]
Definition: server.h:115
Definition: server.h:110
struct ClientBase Client
Definition: server.h:186
Definition: http.h:104
char * QueryString
Definition: server.h:66
Definition: server.h:94
struct LogFile Access
Definition: server.h:106
char PipeBuffer[PIPE_BUFFSIZE]
Definition: server.h:159
size_t MaxURLLength
Definition: server.h:174
struct ChildBase * ChildList
Definition: server.h:177
Definition: server.h:87