summaryrefslogtreecommitdiffstats
path: root/network/akgnet_common.hh
blob: aaf8ca6d960f4f06d0a3ee5e965bf15dddf35621 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/*
* This file is part of rasdaman community.
*
* Rasdaman community is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Rasdaman community is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with rasdaman community.  If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
rasdaman GmbH.
*
* For more information please see <http://www.rasdaman.org>
* or contact Peter Baumann via <baumann@rasdaman.com>.
/
/**
 * INCLUDE: akgnet_common.hh
 *
 * MODULE:  akg network
 * CLASS:   
 *
 * COMMENTS:
 * Namespace akg
 * Contains common definitions for the whole package
 * 
*/

#ifndef AKGNET_COMMON_HH
#define AKGNET_COMMON_HH

#if defined(DECALPHA) || defined(LINUX)
 #ifndef _XOPEN_SOURCE_EXTENDED
  #define _XOPEN_SOURCE_EXTENDED // for gethostid
 #endif //_XOPEN_SOURCE_EXTENDED
#endif //DECALPHA || LINUX


#include<stdio.h>
#include<stdlib.h>
#include<errno.h>

#if defined(DECALPHA)
  #include<strings.h>
  #include <arpa/inet.h>
#endif
#include<string.h>



#include<unistd.h>
#include<sys/types.h>
#include<sys/socket.h>
#include<netinet/in.h>
#include<netdb.h>
#include <fcntl.h>
#include <sys/time.h>
#include <time.h>


#include <iostream>

//##### System dependent data types #############

#ifdef X86 
 #define akgSocklen_t socklen_t
#endif

#ifdef AIX
 #define akgSocklen_t socklen_t
#endif

#ifdef SOLARIS
 #define akgSocklen_t socklen_t
 #define INADDR_NONE  ((uint32_t) 0xffffffff)
#endif

#ifdef DECALPHA 
 #define akgSocklen_t size_t
 typedef in_addr_t  uint32_t;
#endif 

#ifndef akgSocklen_t
 #error "What Operating System is this?"
#endif
//##### Debugging stuff ########################

#define DBTALK(a)
//#define DBTALK(a) cout<<a<<endl

using namespace std;
//##############################################

#endif