00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef CEYLAN_SYSTEM_SPECIFIC_SOCKET_ADDRESS_H_
00028 #define CEYLAN_SYSTEM_SPECIFIC_SOCKET_ADDRESS_H_
00029
00030
00031
00032
00033
00034 #ifdef CEYLAN_USES_CONFIG_H
00035 #include "CeylanConfig.h"
00036 #endif // CEYLAN_USES_CONFIG_H
00037
00038
00039 #if CEYLAN_USES_NETWORK
00040
00041
00042
00043 extern "C"
00044 {
00045
00046 #ifdef CEYLAN_USES_STRING_H
00047 #include <string.h>
00048 #endif // CEYLAN_USES_STRING_H
00049
00050
00051 #ifdef CEYLAN_USES_RESOLV_H
00052 #include <resolv.h>
00053 #endif // CEYLAN_USES_RESOLV_H
00054
00055 #ifdef CEYLAN_USES_ARPA_INET_H
00056 #include <arpa/inet.h>
00057 #endif // CEYLAN_USES_ARPA_INET_H
00058
00059 #ifdef CEYLAN_USES_NETINET_IN_H
00060 #include <netinet/in.h>
00061 #endif // CEYLAN_USES_NETINET_IN_H
00062
00063 #ifdef CEYLAN_USES_WINSOCK2_H
00064 #include <WinSock2.h>
00065 #endif // CEYLAN_USES_WINSOCK2_H
00066
00067 }
00068
00069
00070
00071
00072 namespace Ceylan
00073 {
00074
00075
00076
00077 namespace Network
00078 {
00079
00080
00081
00090 class SystemSpecificSocketAddress
00091 {
00092
00093
00094 public:
00095
00096
00098 SystemSpecificSocketAddress()
00099 {
00100 blank() ;
00101 }
00102
00103
00104
00105 ~SystemSpecificSocketAddress() throw()
00106 {
00107
00108 }
00109
00110
00112 void blank()
00113 {
00114
00115
00116
00117 #ifdef CEYLAN_USES_MEMSET
00118
00119
00120 ::memset( & _socketAddress, 0 ,
00121 sizeof( _socketAddress ) ) ;
00122
00123
00124 #else // CEYLAN_USES_MEMSET
00125
00126 #ifdef CEYLAN_USES_BZERO
00127
00128
00129 ::bzero( & _socketAddress, sizeof( _socketAddress ) ) ;
00130
00131 #else // CEYLAN_USES_BZERO
00132
00133 #error No memset nor bzero function available for your architecture.
00134
00135 #endif // CEYLAN_USES_BZERO
00136
00137 #endif // CEYLAN_USES_MEMSET
00138
00139 }
00140
00141
00143 sockaddr_in _socketAddress ;
00144
00145
00146
00147 private:
00148
00149
00150
00159 SystemSpecificSocketAddress(
00160 const SystemSpecificSocketAddress & source ) ;
00161
00162
00171 SystemSpecificSocketAddress & operator = (
00172 const SystemSpecificSocketAddress & source ) ;
00173
00174
00175 } ;
00176
00177
00178 }
00179
00180 }
00181
00182
00183 #endif // CEYLAN_USES_NETWORK
00184
00185
00186
00187 #endif // CEYLAN_SYSTEM_SPECIFIC_SOCKET_ADDRESS_H_
00188