rasdaman complete source
rasmgr.hh
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 /
38 #ifndef RASMGR_HH
39 #define RASMGR_HH
40 
41 #include<iostream>
42 #include<stdio.h>
43 #include<errno.h>
44 #include<stdlib.h>
45 #include<unistd.h>
46 #include<sys/types.h>
47 #include<sys/socket.h>
48 #include<netinet/in.h>
49 #include<netdb.h>
50 #include<signal.h>
51 #include<sys/wait.h>
52 
53 #include<string.h>
54 
55 #ifdef AIX
56 #include<strings.h>
57 #include<time.h>
58 #endif
59 
60 #include<stdlib.h>
61 #include<fstream>
62 #include <fcntl.h>
63 #include<sys/time.h>
64 
65 #include <vector>
66 #include <list>
67 #include <iterator>
68 
69 #include "rasmgr_protocol.hh" // protocol keyword definitions
70 
71 // clear this def for production release!
72 // #define TALK(a) cout<<a<<endl << flush;
73 //#define TALK(a) { /* TALK (a) */ }
74 
75 void exitbyerror(const char* text);
76 
77 char *strtolwr(char*); // should be somewhere in the C-library, but can't find it
78 
79 #ifdef RASMGR_IHC
80 #define INCLUDE_HIDDEN_COMMANDS
81 #endif
82 
83 // global defs -- PB 2003-jun-05
84 //------------
85 
87 #define HOSTNAME "localhost"
88 #define RPCIF 0x29990000
90 #define RPCVERS 1
92 
93 // rasmgr return codes
94 // note: these were from -3 to +2 for errors, and none for OK from W.Schatz. I ordered them to 0 for ok, <0 for errors.
95 #define RASMGR_RESULT_OK 0
96 #define RASMGR_RESULT_NO_MD5 1
97 #define RASMGR_RESULT_ILL_ARGS 2
98 #define RASMGR_RESULT_LICENSE_FAIL 3
99 #define RASMGR_RESULT_NOT_ALONE 4
100 #define RASMGR_RESULT_AUTH_CORRUPT 5
101 #define RASMGR_RESULT_AUTH_OTHERHOST 6
102 #define RASMGR_RESULT_AUTH_INCOMPAT 7
103 #define RASMGR_RESULT_NO_SLAVE_IN_TEST 8
104 #define RASMGR_EXIT_FAILURE 9 // was: EXIT_FAILURE from stdlib.h
105 #define RASMGR_RESULT_INTERNAL 10
106 
107 // these should be still more global, they are part of the c/s protocol
108 // indicator for server type
109 #define SERVERTYPE_FLAG_RPC 'r'
110 #define SERVERTYPE_FLAG_HTTP 'h'
111 #define SERVERTYPE_FLAG_RNP 'n'
112 
113 // output depending on verbose cmd line flag
114 #define VLOG if (config.isVerbose()) RMInit::logOut
115 
116 #endif // RASMGR_HH
void exitbyerror(const char *text)
char * strtolwr(char *)