Changeset 9991 for source/ariba/utility
- Timestamp:
- Jul 28, 2011, 2:03:14 PM (13 years ago)
- Location:
- source/ariba/utility/transport/tcpip/protlib
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/utility/transport/tcpip/protlib/address.cpp
r9686 r9991 91 91 Log(DEBUG_LOG,LOG_NORMAL,"hostaddress","::operator==()" << haddr->get_ip_str()<<"=="<<this->get_ip_str()); 92 92 if (!ipv4flag) 93 Log(DEBUG_LOG,LOG_NORMAL,"hostaddress","::operator==(), v6=" << IN6_ARE_ADDR_EQUAL( ipv6addr.s6_addr, haddr->ipv6addr.s6_addr));93 Log(DEBUG_LOG,LOG_NORMAL,"hostaddress","::operator==(), v6=" << IN6_ARE_ADDR_EQUAL(&ipv6addr, &(haddr->ipv6addr))); 94 94 #endif 95 95 return ipv4flag ? (ipv4addr.s_addr==haddr->ipv4addr.s_addr) : 96 IN6_ARE_ADDR_EQUAL( ipv6addr.s6_addr, haddr->ipv6addr.s6_addr);96 IN6_ARE_ADDR_EQUAL(&ipv6addr, &(haddr->ipv6addr)); 97 97 } else return false; 98 98 } // end operator== … … 177 177 bool hostaddress::is_ip_unspec() const { 178 178 if (ipv4flag) return (ipv4addr.s_addr==0); 179 else return IN6_IS_ADDR_UNSPECIFIED( ipv6addr.s6_addr);179 else return IN6_IS_ADDR_UNSPECIFIED(&ipv6addr); 180 180 // never reached 181 181 return true; … … 225 225 in = ipv4addr; 226 226 return true; 227 } else if (IN6_IS_ADDR_V4MAPPED( ipv6addr.s6_addr)) {227 } else if (IN6_IS_ADDR_V4MAPPED(&ipv6addr)) { 228 228 memcpy(&(in.s_addr),ipv6addr.s6_addr+12,4); 229 229 return true; -
source/ariba/utility/transport/tcpip/protlib/address.h
r9686 r9991 1306 1306 hostaddress::is_mapped_ip() const 1307 1307 { 1308 return (ipv4flag) ? false : IN6_IS_ADDR_V4MAPPED( ipv6addr.s6_addr);1308 return (ipv4flag) ? false : IN6_IS_ADDR_V4MAPPED(&ipv6addr); 1309 1309 } // end is_mapped_ip 1310 1310 -
source/ariba/utility/transport/tcpip/protlib/eclock_gettime.c
r9686 r9991 38 38 /* struct timezone tz = { 0, DST_NONE }; */ 39 39 static struct timeval tv; 40 typedef int clockid_t;41 40 42 41 /* syntax for clock_gettime: -
source/ariba/utility/transport/tcpip/protlib/fastqueue.c
r9686 r9991 58 58 #define qerr(errnr) fprintf(stderr,"queue.c: %s\n",queue_errmsg[errnr]) 59 59 60 #ifdef __linux__61 62 // not needed for Linux63 //#define pthread_mutexattr_settype pthread_mutexattr_setkind_np64 60 65 61 #define PTHREAD_MUTEX_NORMAL PTHREAD_MUTEX_TIMED_NP … … 74 70 #define clock_gettime(clock_id, tspec) eclock_gettime(tspec) 75 71 76 #elif _DECTHREADS_VERSION < 314126L77 78 #define pthread_mutexattr_settype pthread_mutexattr_settype_np79 #define PTHREAD_MUTEX_NORMAL PTHREAD_MUTEX_NORMAL_NP80 #define PTHREAD_MUTEX_ERRORCHECK PTHREAD_MUTEX_ERRORCHECK_NP81 #endif82 72 /*************** typedefs *****************/ 83 73 -
source/ariba/utility/transport/tcpip/protlib/logfile.h
r9686 r9991 53 53 namespace log { 54 54 55 static const pthread_mutex_t initlogmutex= 56 #ifdef _DEBUG 57 // PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP; // use this for debugging, it will return errors on potential deadlock situations 58 PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; 59 #else // should be recursive mutex because sometimes error log output sometimes occurs 60 // while objects contents are logged 61 PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; // PTHREAD_MUTEX_INITIALIZER; 62 #endif 55 static const pthread_mutex_t initlogmutex= 56 #ifdef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP 57 PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; 58 #else 59 PTHREAD_RECURSIVE_MUTEX_INITIALIZER; 60 #endif 63 61 64 62 #undef ERROR_LOG -
source/ariba/utility/transport/tcpip/protlib/threads.h
r9686 r9991 71 71 template <class T> void *thread_starter(void *thread_object) { 72 72 73 #ifdef PTHREAD_CANCEL_ENABLE 73 74 pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); 75 #endif 76 #ifdef PTHREAD_CANCEL_DEFERRED 74 77 pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL); 78 #endif 75 79 76 80 (static_cast<T*>(thread_object))->start_processing(); … … 537 541 thread_object.unlock(); 538 542 if (kill) { 543 544 #ifdef PTHREAD_CANCEL_ENABLE 539 545 for (unsigned i = 0; i < pthreads.size(); i++) 540 546 pthread_cancel( pthreads[i] ); 541 547 542 548 sleepuntilstop(); 549 #endif 543 550 544 551 for (unsigned i = 0; i < pthreads.size(); i++) -
source/ariba/utility/transport/tcpip/protlib/tp_over_udp.cpp
r9686 r9991 41 41 #include <arpa/inet.h> /* inet_addr */ 42 42 43 #ifndef IPPROTO_IPV6 44 // v6 structs not defined in netinet/in.h, pull in here 45 #include <linux/ipv6.h> 46 #endif 47 43 48 #include <fcntl.h> 44 49 #include <sys/poll.h>
Note:
See TracChangeset
for help on using the changeset viewer.