/[resiprocate]/main/rutil/compat.hxx
ViewVC logotype

Log of /main/rutil/compat.hxx

Parent Directory Parent Directory | Revision Log Revision Log


Links to HEAD: (view) (download) (annotate)
Sticky Revision:

Revision 11236 - (view) (download) (annotate) - [select for diffs]
Modified Mon Sep 15 17:20:14 2014 UTC (5 years, 1 month ago) by dpocock
File length: 11488 byte(s)
Diff to previous 11235
rutil: add support for MacTypes

Revision 11235 - (view) (download) (annotate) - [select for diffs]
Modified Mon Sep 15 17:20:11 2014 UTC (5 years, 1 month ago) by dpocock
File length: 11345 byte(s)
Diff to previous 10713
resip/stack: TcpBaseTransport: generalize support for SO_NOSIGPIPE

Revision 10713 - (view) (download) (annotate) - [select for diffs]
Modified Thu Dec 5 19:31:07 2013 UTC (5 years, 11 months ago) by dpocock
File length: 11184 byte(s)
Diff to previous 10670
rutil: add RESIP_MAX_SOCKADDR_SIZE

Revision 10670 - (view) (download) (annotate) - [select for diffs]
Modified Fri Nov 8 21:10:27 2013 UTC (6 years ago) by sgodin
File length: 11148 byte(s)
Diff to previous 10632
-avoid compiler warning if WIN32_LEAN_AND_MEAN is already defined 

Revision 10632 - (view) (download) (annotate) - [select for diffs]
Modified Wed Oct 9 10:51:41 2013 UTC (6 years, 1 month ago) by Dpocock
File length: 11113 byte(s)
Diff to previous 10618
rutil: move some compatibility code from resipfaststreams to compat.hxx

Revision 10618 - (view) (download) (annotate) - [select for diffs]
Modified Tue Oct 1 13:40:56 2013 UTC (6 years, 1 month ago) by Dpocock
File length: 9246 byte(s)
Diff to previous 10615
rutil: compat.hxx: add Int64

Revision 10615 - (view) (download) (annotate) - [select for diffs]
Modified Mon Sep 30 20:10:57 2013 UTC (6 years, 1 month ago) by dpocock
File length: 9176 byte(s)
Diff to previous 10613
rutil: compat.hxx: revert the core stdint change, leaving other enhancements intact

Revision 10613 - (view) (download) (annotate) - [select for diffs]
Modified Mon Sep 30 18:36:54 2013 UTC (6 years, 1 month ago) by dpocock
File length: 12043 byte(s)
Diff to previous 10612
rutil, resip/stack: add casts to UInt8

Revision 10612 - (view) (download) (annotate) - [select for diffs]
Modified Mon Sep 30 18:36:46 2013 UTC (6 years, 1 month ago) by dpocock
File length: 11899 byte(s)
Diff to previous 10611
rutil: compat.hxx: use third-party stdint.h and inttypes.h for Visual Studio

Revision 10611 - (view) (download) (annotate) - [select for diffs]
Modified Mon Sep 30 18:36:40 2013 UTC (6 years, 1 month ago) by dpocock
File length: 12115 byte(s)
Diff to previous 10608
rutil: compat.hxx: avoid defining __STDC_FORMAT_MACROS twice

Revision 10608 - (view) (download) (annotate) - [select for diffs]
Modified Mon Sep 30 15:57:48 2013 UTC (6 years, 1 month ago) by Dpocock
File length: 12079 byte(s)
Diff to previous 10607
rutil: compat.hxx: add inttypes definitions for Microsoft builds

Revision 10607 - (view) (download) (annotate) - [select for diffs]
Modified Mon Sep 30 15:49:02 2013 UTC (6 years, 1 month ago) by Dpocock
File length: 11906 byte(s)
Diff to previous 10604
rutil: compat.hxx: add more stdint types for Microsoft builds

Revision 10604 - (view) (download) (annotate) - [select for diffs]
Modified Mon Sep 30 13:32:08 2013 UTC (6 years, 1 month ago) by Dpocock
File length: 11800 byte(s)
Diff to previous 10599
rutil: compat.hxx: use stdint types as a base for other fixed types

Revision 10599 - (view) (download) (annotate) - [select for diffs]
Modified Sun Sep 29 10:46:54 2013 UTC (6 years, 1 month ago) by dpocock
File length: 8973 byte(s)
Diff to previous 10441
rutil: add ntoh64 and hton64

Revision 10441 - (view) (download) (annotate) - [select for diffs]
Modified Tue Sep 10 15:04:43 2013 UTC (6 years, 2 months ago) by sgodin
File length: 8255 byte(s)
Diff to previous 10434
-fix up compilation issues with new snprintf definition for Windows 

Revision 10434 - (view) (download) (annotate) - [select for diffs]
Modified Tue Sep 10 11:24:07 2013 UTC (6 years, 2 months ago) by Dpocock
File length: 8214 byte(s)
Diff to previous 10433
rutil: compat.hxx: add snprintf for Visual C

Revision 10433 - (view) (download) (annotate) - [select for diffs]
Modified Tue Sep 10 11:16:57 2013 UTC (6 years, 2 months ago) by Dpocock
File length: 7654 byte(s)
Diff to previous 9850
rutil: Data: use of fixed-size integer types for methods that work with fixed buffer sizes

Revision 9850 - (view) (download) (annotate) - [select for diffs]
Modified Mon Aug 6 15:58:11 2012 UTC (7 years, 3 months ago) by sgodin
File length: 7624 byte(s)
Diff to previous 9501
-2nd attempt at fix for RESIP_DEPRECATED macro - http://stackoverflow.com/questions/295120/c-mark-as-deprecated

Revision 9501 - (view) (download) (annotate) - [select for diffs]
Modified Sun Apr 8 14:00:34 2012 UTC (7 years, 7 months ago) by dpocock
File length: 7609 byte(s)
Diff to previous 9491
Fix typos reported in lintian

Revision 9491 - (view) (download) (annotate) - [select for diffs]
Modified Sat Apr 7 10:36:40 2012 UTC (7 years, 7 months ago) by dpocock
File length: 7609 byte(s)
Diff to previous 9367
Include config.h from more places where it is needed

Revision 9367 - (view) (download) (annotate) - [select for diffs]
Modified Wed Feb 1 16:12:20 2012 UTC (7 years, 9 months ago) by sgodin
File length: 7559 byte(s)
Diff to previous 9118
-merge work from resip-b-TKLC-perf_work branch

Merge Notes:

Various optimizations of Data
=============================

Made Data smaller, without sacrificing functionality. Data is 20 (56 vs 36) 
bytes smaller on 64-bit libs, and 4 (36 vs 32) bytes smaller on 32-bit libs. 
This was accomplished by making mSize, mCapacity, and mShareEnum 4-bytes on 
64-bit platforms (mShareEnum could be one byte, but it turns out this imposes a 
detectable performance penalty), and by having mShareEnum do double-duty as a 
null-terminator for mPreBuffer (Borrow==0), instead of requiring an extra byte 
at the end of mPreBuffer.

Several very simple functions have been inlined.

Functionality enhancements to a couple of functions:

- Data::md5() has been changed to Data::md5(Data::EncodingType type=HEX); this 
allows the output of md5() to be encoded as hex or Base64, or not encoded at all 
(binary).

- Data::replace(const Data& match, const Data& target) has been updated to 
Data::replace(const Data& match, const Data& target, int max=INT_MAX); this 
allows the maximum number of replacements to be specified.

Lastly, a few specialized hashing and comparison functions have been added:

- Data::caseInsensitiveTokenHash(); this is a case-insensitive hash that assumes 
that the Data is an RFC 3261 token (eg; branch params). This character set has 
the property that no character is equal to any other character when bit 6 is 
masked out, except for the alphabetical characters. (For alphabetical 
characters, bit 6 specifies whether the character is upper/lower case) This 
means that we can mask out bit 6, and then use a case-sensitive hash algorithm 
on the resulting characters, without hurting the collision properties of the 
hash, and get a case-insensitive hash as a result. This hash function is based 
on the Hsieh hash.

- bool Data::caseInsensitiveTokenCompare(const Data& rhs); this is an equality 
comparison that assumes that both Datas are RFC 3261 tokens (eg; branch 
parameters). This function takes advantage of the same properties of the RFC 
3261 token character set as caseInsensitiveTokenHash(), by using a bitmask 
instead of a true lowercase() operation. This ends up being faster than 
strncasecmp().

- Data& schemeLowercase(); this is a variant of lowercase() that assumes the 
Data is an RFC 3261 scheme. This character set has the property that setting bit 
6 is a no-op, except for alphabetical characters (0-9, '+', '-', and '.' all 
already have bit 6 set). Setting bit 6 on a alphabetical character is equivalent 
to lower-casing the character. Note: There is no corresponding schemeUppercase() 
function, because clearing bit 6 will convert 0-9, '+', '-', and '.' into 
unprintable characters (well, '-' is turned into a CR, but you get the point).



Performance improvements to ParseBuffer
=======================================

- Most functions that returned a Pointer now return a much more lightweight
   CurrentPosition object.
- Allow some of the simpler functions to be inlined
- Integer parsing code is more efficient, and overflow detection is better


Performance enhancements to DnsUtil
===================================

- DnsUtil::inet_ntop(): For some reason, the stock system inet_ntop 
  is dreadfully inefficient on OS X. A dirt-simple hand-rolled 
  implementation was 5-6 times as fast. This is shocking. The Linux 
  implementation is plenty efficient, though, so we're using 
  preprocessor to activate the hand-rolled code.

- DnsUtil::isIpV4Address(): The implementation uses 
  sscanf(), which is pretty expensive. Hand-rolled some code that 
  is much faster.


Reduced the memory footprint associated with storing URIs
=========================================================
- Removed the AOR cacheing stuff from Uri; it was horrifically inefficient. Checking
  for staleness of the cache was nearly as expensive as regenerating the AOR from 
  scratch. Not to mention that the AOR cacheing stuff took up a whopping 148 bytes
  of space on 64-bit platforms (4 Datas, and an int).

- Reworked the host canonicalization cache to take up less space, and be faster.
  Previously, the canonicalized host was put in a separate Data. We now canonicalize
  in-place, and use a bool to denote whether canonicalization has been performed yet.
  This saves us 32 bytes.

- Changed Data Uri::mEmbeddedHeadersText to an auto_ptr<>, since in most cases Uris don't
  use it. Also use auto_ptr for mEmbeddedHeaders (was already a pointer, for consistency).


Change how branch parameters are encoded.
=========================================

Old format: z9hG4bK-d8754z-<branch>-<transportseq>-<clientData>-<sigcompCompartment>-d8754z-

New Format: z9hG4bK-524287-<transportseq>-<clientData>-<sigcompComprtment>-<branch>

This format encodes faster, parses faster (with _much_ simpler code), and takes up
less space on the wire. We may decide to tweak the new resip cookie; I chose 
something that we can use memcmp instead of strncasecmp with, but the token character
set has a bunch of characters that aren't alphanumeric we could use.

Also, some other small optimizations; avoid copies associated with calling
Data::base64encode()/base64decode() on empty Datas, and reorder the SIP cookie
comparisons to be more efficient.


State shedding modifications to TransactionState
================================================
In a number of cases, we were preserving state (in the form of SipMessages
and DnsResults) in cases where we did not really need them any more. For
example, once we have transmitted a response, there is no need
to preserve the full SipMessage for this response (the raw retransmit buffer
is sufficient). Also, INVITE requests do not need to be maintained once
a final response comes in (since there is no possibility that we'll need to
send a simulated 408 or 503 to the TU, nor will we need to construct a CANCEL
request using the INVITE, nor will we need to retransmit). Similarly, once we
have received a final response for a NIT transaction, we no longer need to
maintain the original request or the retransmit buffer. Lastly, if we are
using a reliable transport, we do not need to maintain retransmit buffers
(although we may need to maintain full original requests for simulated
responses and such).

This change has basically no impact on reliable NIT performance, but a huge
impact on non-reliable and INVITE performance. Prior to this change, either
NIT UDP or INVITE TCP testStack would exhaust main memory on my laptop (with
4GB of main memory), bringing progress to a complete halt on runs longer than
15 seconds or so. I did not bother trying INVITE UDP, but that works now too.


Reduction in buffer reallocations while encoding a SipMessage
=============================================================
TransportSelector now keeps a moving average of the outgoing message size,
which is used to preallocate the buffers into which SipMessages are encoded.

This ends up making a small difference in testStack when linked against google
malloc, but a larger difference when linked against OS X's (horrible) standard
malloc.


Multiple Threads in the Stack
=============================
Allow transaction processing, transport processing, and DNS processing to be 
broken off into separate threads.

- SipStack::run() causes the creation and run of three threads; a 
TransactionControllerThread, and TransportSelectorThread, and a DnsThread. You 
continue to use stuff like StackThread and EventStackThread to give cycles to 
the rest of the stack (mainly processing app timers and statistics logging); the 
SipStack is smart enough to unhook these three things from the normal event loop 
API when they have their own threads. In other words, to use the new 
multi-threaded mode, all you have to do is throw in a call to SipStack::run() 
before you fire up your normal SipStack processing, and a 
SipStack::shutdownAndJoinThreads() when you're done.

- In the Connection read/write code, process reads/writes until EAGAIN, or we 
run out of stuff to send. Gives a healthy performance boost on connection-based 
transports.

- In TransactionController, put transaction timers in their own fifo. This 
prevents timers from firing late when the state machine fifo gets congested. 
Also, process at most 16 TransactionMessages from the state machine fifo at a 
time, to prevent starving other parts of the system.

- Unhook the TransactionController's processing loop from that of the 
TransportSelector. This simplifies this API considerably, but required the 
addition of a new feature to Fifo. Fifo can now take an (optional) 
AsyncProcessHandler* that will be notified when the fifo goes from empty to 
non-empty. Actually pretty useful.

- Allow setPollGrp() to be called multiple times on the various classes that 
have this function. This allows the FdPollGrp to be re-set when the SipStack 
enters multithreaded mode.

- Added a "multithreadedstack" --thread-type option to testStack. Exercise this 
option in testStackStd.sh

- Added the ability to run any of the existing Transport objects in their own 
thread, by a combination of a new transport flag 
(RESIP_TRANSPORT_FLAG_OWNTHREAD), and a new TransportThread class. Added support 
for this mode to testStack using the --tf option. Also exercised this feature in 
testStackStd.sh.

- Installed SelectInterruptors at the TransportSelector, each Transport object, 
and the DnsStub (this last one required moving SelectInterruptor to rutil). This 
is critical to making multithreaded mode work in a performant manner, and 
imposes almost no performance penalty due to the way they are invoked.

- SipStack now creates its own SelectInterruptor if one is not supplied 
externally. This is because it is critical to be able to wake the 
TransactionController up when new work comes down from the TU, or from the 
transports.


New congestion-management framework
===================================
Notable features include:
* Allow testStack, tfm/repro/sanityTests, and repro to be run with a congestion 
   manager with the --use-congestion-manager flag.

* Efficient wait-time estimation in AbstractFifo; keeps track of how rapidly
   messages are consumed, allowing good estimates of how long a new message will
   take to be serviced. More efficient than the time-depth logic in 
   TimeLimitFifo, and a better predictor too.

* The ability to shed load at the transport level when the TransactionController
   is congested, in a very efficient manner, using new functionality in Helper
   and SipMessage (Helper::makeRawResponse() and 
   SipMessage::encodeSingleHeader())

* The ability to shed load coming from the TU when the TransactionController is 
   congested. This is crucial when congestion is being caused by a TU trying to 
   do too much.

* Changed the way load-shedding is handled for TransactionUsers to use the new
   API

* A flexible congestion-management API, allowing load-shedding decisions to be
   made in an arbitrary fashion.

* A generalized CongestionManager implementation that is powerful enough to be
   useful.

* The TransactionController will now defer retransmissions of requests if 
   sufficiently congested (ie; the response is probably stuck in mStateMacFifo)

* The TransactionController now determines its hostname with a single call to 
   DnsUtil::getLocalHostName() on construction, for use in 503s. Previously, it 
   would make this call every time a 503 was sent; this call blocks sometimes!

* Don't call DnsResult::blacklistLast() on a Retry-After: 0

* Several fixes the the processing loop in testStack that were causing 
   starvation of one type of work or another when congestion occurred.


Other Misc Enhancements
=======================
-Small efficiency improvement in Random::getCryptoRandom(int)
 Random::getCryptoRandom(unsigned int len) was implemented by calling 
 Random::getCryptoRandom() repeatedly, and collecting the return values 
 in a buffer. In the openssl case, we now use a single call to RAND_bytes().
-Use a priority_queue instead of a multiset for storing timers.
-Slight refactoring of Timer so that transaction timers and payload timers (ie; 
 timers that carry a Message*) are separate classes. Transaction timers no longer 
 have an unused Message* member, and payload timers no longer have the unused 
 transaction-id, Timer::Type, and duration. This saves a _lot_ of memory for apps 
 that use lots of app timers with long lifetimes.
-Less wasteful population of Call-IDs: 
 When generating Call-IDs, Helper was computing an md5 hash of the hostname and 
 some salt, hex-encoding it, and then Base64 encoding the hex data. We now Base64 
 encode the md5 hash directly. This is less computationally expensive, requires 
 less memory because the resulting string is half the size, and requires fewer 
 bytes on the wire.
-Make TransactionMap case-insensitive; Data::caseInsensitiveTokenHash() is fast
 enough that performance actually increases a little.
-std::bitset-based parsing in a number of places.
-Don't check whether the encoding tables are initted for every single
 character; check once before the encode operation begins. Also, checking
 the value of a static bool to determine whether an init has been carried
 out is pointless; that bool might not be initted yet, and it could have
 any value. The static init code now copes with both accesses to the encoding
 tables during static initialization, and from multiple threads during runtime.
-Don't bother generating a transaction identifier unless the parse fails
 to extract one.
-Some refactoring of the FdPollGrp stuff. Now is compatible with cares, using
 a bit of a hack. Also compatible with being driven with the old buildFdSet()/
 select()/process(FdSet&) call sequence, although this is now deprecated.
 Fixing these compatibility problems allowed us to switch over to using FdPollGrp
 in all cases, instead of having dual mode everywhere.
-Buffer classes for Fifo to reduce lock contention. Using them in a few places, will
 use them in more once we phase out TimeLimitFifo with the new congestion management
 code.
-Use the --ignore-case option for generation of ParameterHash.cxx, instead of the
 nasty sed rewriting we are using now. Should also be slightly faster, since gperf
 handles case-insensitive hashing more efficiently than our hack was.
-Adding a local memory pool to SipMessage, to cut down (dramatically) on
 heap allocation overhead. Some minor refactoring to free up wasted space
 in SipMessage as well (makes more room for the pool). Changing the way
 the start-line is stored to no longer use a full-blown ParserContainer+
 HeaderFieldValueList. Lots of opportunistic doxygen merging.
 Up to 20K NIT transactions per second on my machine, roughly a doubling
 in performance.


Bug Fixes
=========
-Use getaddrinfo() instead of the non-threadsafe gethostbyname().
-Remove unused (and non-threadsafe) Timer::mTimerCount/Timer::mId.
 Previously, all timers were assigned a "unique" (not really, more on that in a 
 moment) integer identifier. There is no place in the resip codebase that 
 actually uses this identifier in any way. For transaction timers, this 
 identifier is in principle unnecessary, since there is more than sufficient 
 identifier information present already (the transaction id and timer type). When 
 passing a Message* into the timer queue, a unique identifier already exists; the 
 Message* itself (if potential use of this Message* bugs you, you can always turn 
 it into a handle by applying some sort of transformation to it). This identifier 
 is unnecessary in every case I can think of. In addition, the values are 
 assigned simply by incrementing a global variable (Timer::mTimerCount), with no 
 threadsafety measures whatsoever, so it is not even guaranteed to be unique. 
 Because of all this, it has been removed. As a bonus, this saves some memory; 8 
 bytes per timer on 64-bit platforms, which adds up to around 3MB when testStack 
 steady state has close to 400000 timers in the timer queues at any given point. 
 This could be an even larger amount for TUs that schedule lots of long-lifetime 
 timers (Timer C, for instance).
-Get rid of a wasteful double-encode, in Message.cxx
-minor windows build fixes to avoid file in use errors when building dum test projects
-fix testDigestAuthentiation for recent lowercase nonce change
-fixed a nasty bug in NameAddr - where unknown parameters uri parameters on a 
 NameAddr/Uri with no angle brackets are treated as NameAddr parameters.  When this is
 done, the memory for these parameters was only a temporary Data object.
-fix bug in Data.  If Data is wrapping memory allocated externally (ie. Share mode = BORROW)
 and you start appending to it.  It is possible that the append method will write a NULL
 character off the end of the buffer.  Changed the resize condition to make the buffer
 larger 1 character sooner, to accommodate for this.

Revision 9118 - (view) (download) (annotate) - [select for diffs]
Modified Mon Apr 25 15:24:00 2011 UTC (8 years, 6 months ago) by bcampen
File length: 7307 byte(s)
Diff to previous 8862
Creating a cross-platform "deprecated" function attribute macro.


Revision 8862 - (view) (download) (annotate) - [select for diffs]
Modified Tue Nov 16 08:08:00 2010 UTC (8 years, 11 months ago) by arosenberg
File length: 6782 byte(s)
Diff to previous 8818
Fix Mac include collision error. This was due to improper logic when searching for either Mac SDK or iPhone SDK

Revision 8818 - (view) (download) (annotate) - [select for diffs]
Modified Fri Sep 24 21:19:02 2010 UTC (9 years, 1 month ago) by arosenberg
File length: 6782 byte(s)
Diff to previous 8609
Rework xcode build to not need the prefix header since it was creating differences than the command line build. Add the include for the TARGET macros to ares_init.c so that it can tell if Mac or iPhone build. Expand the compat.hxx section to cover TARGET_OS_IPHONE and also have very clear instructions on how to force using the system SDK's for the UInt32 defines if you get collisions. XCode file now builds standard 32/64 bit bundle libs.

Revision 8609 - (view) (download) (annotate) - [select for diffs]
Modified Mon Sep 21 18:33:16 2009 UTC (10 years, 1 month ago) by bcampen
File length: 6521 byte(s)
Diff to previous 8502
Don't unset USE_IPV6 in here; it is entirely possible that someone else's build system
will want to use this flag. We really need to rename this to RESIP_USE_IPV6.


Revision 8502 - (view) (download) (annotate) - [select for diffs]
Modified Fri May 29 13:14:14 2009 UTC (10 years, 5 months ago) by sgodin
File length: 6512 byte(s)
Diff to previous 8289
fix for compiling with IPV6 under VS2008

Revision 8289 - (view) (download) (annotate) - [select for diffs]
Modified Wed Nov 12 20:04:55 2008 UTC (11 years ago) by sgodin
File length: 6302 byte(s)
Diff to previous 8284
-added winsock2.h include for WIN32 so that IPPROTO_IPV6 is defined 
 before checking if new warning is needed

Revision 8284 - (view) (download) (annotate) - [select for diffs]
Modified Tue Nov 11 23:03:35 2008 UTC (11 years ago) by bcampen
File length: 6278 byte(s)
Diff to previous 8161
Disable IPV6 code when platform doesn't support it, and add a build warning.


Revision 8161 - (view) (download) (annotate) - [select for diffs]
Modified Fri Jul 25 20:54:42 2008 UTC (11 years, 3 months ago) by jmatthewsr
File length: 5482 byte(s)
Diff to previous 7315
Stream performance enhancements for encoding objects.  New encoding code should use 'EncodeStream','resipCerr' and 'resipCout' for encoding any resip objects.  Merge from b-jmatthewsr-streamperf2 -r 8137:8160.  

Revision 7315 - (view) (download) (annotate) - [select for diffs]
Modified Fri Oct 12 21:10:27 2007 UTC (12 years, 1 month ago) by bcampen
File length: 5460 byte(s)
Diff to previous 6823
Work on the doxygen in rutil.

Revision 6823 - (view) (download) (annotate) - [select for diffs]
Modified Wed Nov 22 20:45:46 2006 UTC (12 years, 11 months ago) by sgodin
File length: 5330 byte(s)
Diff to previous 6568
- on windows don't define strcasecmp if already defined

Revision 6568 - (view) (download) (annotate) - [select for diffs]
Modified Tue Sep 12 23:11:06 2006 UTC (13 years, 2 months ago) by adam
File length: 5277 byte(s)
Diff to previous 6541
Tiny tweaks here and there to allow rutil, resip, and dum to build under MinGW.

Getting repro compiled in MinGW is still a work in progress, mostly because
bdb is being a pain in the rear.


Revision 6541 - (view) (download) (annotate) - [select for diffs]
Modified Mon Aug 28 23:25:16 2006 UTC (13 years, 2 months ago) by derek
File length: 5247 byte(s)
Diff to previous 6069
don't include winsock2 when uncessarily and use LEAN_AND_MEAN for windows.h
Windows is a mess wrt to winsopck vs wincock2...the end result is that Socket.hxx needs to be inlcuded beofre compat.hxx.  Since Socket includes comapt, don't include compat.hxx in the same file as socket.hxx

Revision 6069 - (view) (download) (annotate) - [select for diffs]
Modified Thu Mar 9 23:06:59 2006 UTC (13 years, 8 months ago) by jason
File length: 5302 byte(s)
Diff to previous 5934
mods for Solaris - tested for Solaris 10 on x86
fixed numerous compiler errors/warnings



Revision 5934 - (view) (download) (annotate) - [select for diffs]
Modified Thu Feb 16 23:58:28 2006 UTC (13 years, 8 months ago) by dworley
File length: 5376 byte(s)
Diff to previous 5930
Start cleaning up svn:mime-type in files.


Revision 5930 - (view) (download) (annotate) - [select for diffs]
Modified Thu Feb 16 22:39:14 2006 UTC (13 years, 8 months ago) by dworley
File length: 5376 byte(s)
Diff to previous 5777
Start cleaning up svn:eol-style and EOLs in files.
Note that text and program files that can be used on both Un*x and Windows
should have svn:eol-style=native so they check out correctly on both
platforms.


Revision 5777 - (view) (download) (annotate) - [select for diffs]
Modified Thu Jan 5 01:36:53 2006 UTC (13 years, 10 months ago) by derek
File length: 5376 byte(s)
Diff to previous 5554
added support for wince Visual Studio 8; no strftime on wince, so this must be provided to link
scripts to run known good tests in resip/stack/test, rutil/test. added a check target to main/Makefile to run aformentioned scripts.



Revision 5554 - (view) (download) (annotate) - [select for diffs]
Modified Wed Oct 19 13:21:12 2005 UTC (14 years ago) by sgodin
File length: 5310 byte(s)
Diff to previous 5546
- Moved u_int32_t for Win32 to namespace resip - getting it right this time : )\
- BerkeleyDb.cxx - force u_int32_t from global namespace, since DB.h define of u_int32_t 
  conflicts with compat.hxx new define of resip::u_int32_t


Revision 5546 - (view) (download) (annotate) - [select for diffs]
Modified Tue Oct 18 17:57:04 2005 UTC (14 years ago) by sgodin
File length: 5358 byte(s)
Diff to previous 5451
Moved u_int32_t for Win32 to namespace resip

Revision 5451 - (view) (download) (annotate) - [select for diffs]
Modified Fri Sep 23 20:06:57 2005 UTC (14 years, 1 month ago) by jason
File length: 5356 byte(s)
Diff to previous 5338
remove another #include config.hxx in .hxx


Revision 5338 - (view) (download) (annotate) - [select for diffs]
Modified Tue Aug 30 05:09:14 2005 UTC (14 years, 2 months ago) by sailesh
File length: 5421 byte(s)
Diff to previous 5330
Changes to compat.hxx and udp.h to fix compatibility with Mac OS X headers.

Unfortunately there are 3 very different environment for compiling under OS X that we must support.

Environment 1: command line ./configure & make. In this enviornment none of the native Mac OS X headers are included. Here __APPLE__ is defined but TARGET_OS_MAC is not.

Environment 2: application built with CodeWarrior or XCode using Mac OS 10.3 headers or above. Typical Mac OS X end point developers will have this environment. Mac OS X native headers will be already included by the time resip headers are included. Here __APPLE__ and TARGET_OS_MAC are defined. MAC_OS_X_VERSION_MIN_REQUIRED will be set to the SDK they are targetting.

Environment 3: same as Environment 2 except targgeting 10.2 or less. The socket headers in this SDK are completely different from 10.3 or above. Only Mac developers (such as XTen) maintaining older applications will be using this environment.

In this commit I'm ifdef-ing out typedef for UInt32 which conflicts with the native Mac OS definition. This is a problem for Environment 2 and 3.

Some of these problems would also occur in Environment 1 if we were building under 10.2 or less. BUT: when we detect that we're in Environment 1 (i.e. __APPLE__ defined but TARGET_OS_MAC not defined) we automatically assume that we're in 10.3 or above.

Thus if at a later time we need to have Enviornment 1 compiling on 10.2 or less all we have to do is make sure to include <TargetConditionals.h> at the top of compat.hxx and we'll pop into Environment 3.

I hope this makes things a lot more clear on why compat.hxx has to be the way it is.
thanks sailesh@xten.com



Revision 5330 - (view) (download) (annotate) - [select for diffs]
Modified Fri Aug 26 23:58:52 2005 UTC (14 years, 2 months ago) by derek
File length: 5097 byte(s)
Diff to previous 5329
fixed for windows

Revision 5329 - (view) (download) (annotate) - [select for diffs]
Modified Fri Aug 26 23:48:57 2005 UTC (14 years, 2 months ago) by derek
File length: 5033 byte(s)
Diff to previous 5316
fixed for windows

Revision 5316 - (view) (download) (annotate) - [select for diffs]
Modified Fri Aug 26 00:41:47 2005 UTC (14 years, 2 months ago) by fluffy
File length: 5031 byte(s)
Diff to previous 5295
major reorg of compat.hxx

Revision 5295 - (view) (download) (annotate) - [select for diffs]
Modified Mon Aug 22 00:30:05 2005 UTC (14 years, 2 months ago) by jason
File length: 5506 byte(s)
Copied from: branches/b-directory-reorg/rutil/compat.hxx revision 5294
Diff to previous 5283
merged 5270:HEAD from b-directory-reorg

Revision 5283 - (view) (download) (annotate) - [select for diffs]
Modified Fri Aug 19 01:27:14 2005 UTC (14 years, 2 months ago) by derek
Original Path: branches/b-directory-reorg/rutil/compat.hxx
File length: 5506 byte(s)
Diff to previous 5276
finished resip/sip -> resip/stack rename

Revision 5276 - (view) (download) (annotate) - [select for diffs]
Modified Fri Aug 19 00:23:17 2005 UTC (14 years, 2 months ago) by jason
Original Path: branches/b-directory-reorg/rutil/compat.hxx
File length: 5504 byte(s)
Diff to previous 5275
compiles now

Revision 5275 - (view) (download) (annotate) - [select for diffs]
Modified Thu Aug 18 23:56:48 2005 UTC (14 years, 2 months ago) by jason
Original Path: branches/b-directory-reorg/rutil/compat.hxx
File length: 5506 byte(s)
Diff to previous 5274
initial reorg - more to come

Revision 5274 - (view) (download) (annotate) - [select for diffs]
Modified Thu Aug 18 23:53:59 2005 UTC (14 years, 2 months ago) by jason
Original Path: branches/b-directory-reorg/resip/sip/os/compat.hxx
File length: 5506 byte(s)
Diff to previous 5272
initial reorg - more to come

Revision 5272 - (view) (download) (annotate) - [select for diffs]
Modified Thu Aug 18 23:49:50 2005 UTC (14 years, 2 months ago) by jason
Original Path: branches/b-directory-reorg/resip/resiprocate/os/compat.hxx
File length: 5506 byte(s)
Diff to previous 5271
initial reorg - more to come

Revision 5271 - (view) (download) (annotate) - [select for diffs]
Modified Thu Aug 18 23:43:07 2005 UTC (14 years, 2 months ago) by jason
Original Path: branches/b-directory-reorg/sip/resiprocate/os/compat.hxx
File length: 5506 byte(s)
Diff to previous 5259
new directory reorg proposal

Revision 5259 - (view) (download) (annotate) - [select for diffs]
Modified Wed Aug 17 23:36:07 2005 UTC (14 years, 2 months ago) by jason
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 5506 byte(s)
Diff to previous 5201
added preliminary stun server support in UdpTransport - disabled by default


Revision 5201 - (view) (download) (annotate) - [select for diffs]
Modified Wed Aug 3 19:11:05 2005 UTC (14 years, 3 months ago) by sailesh
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 5504 byte(s)
Diff to previous 5038
Adding define for socklen_t for Mac OS 10.2 and less.

Revision 5038 - (view) (download) (annotate) - [select for diffs]
Modified Fri Jul 8 04:18:36 2005 UTC (14 years, 4 months ago) by sailesh
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 5415 byte(s)
Diff to previous 4827
Fix for Mac OS X. On 10.2 we can't include nameser_compat. We check MAC_OS_X_VERSION_MIN_REQUIRED to see which version of the OS we're compiling against. Unfortunately this macro is not defined when compiling from the command line. Thus if it's not defined we're goign to assume that we're compiling on 10.3 ore greater.

Revision 4827 - (view) (download) (annotate) - [select for diffs]
Modified Tue Jun 7 06:41:17 2005 UTC (14 years, 5 months ago) by sailesh
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 5370 byte(s)
Diff to previous 4762
Modified the Mac project to link against the 10.2.8 SDK headers.

Revision 4762 - (view) (download) (annotate) - [select for diffs]
Modified Thu May 26 23:29:14 2005 UTC (14 years, 5 months ago) by greg
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 5305 byte(s)
Diff to previous 4756
Pull in TargetConditionals.h on the mac.  Remove old cruft.


Revision 4756 - (view) (download) (annotate) - [select for diffs]
Modified Thu May 26 04:04:44 2005 UTC (14 years, 5 months ago) by sailesh
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 5299 byte(s)
Diff to previous 4740
UInt32 is already defined on Mac when including Carbon APIs.

Revision 4740 - (view) (download) (annotate) - [select for diffs]
Modified Tue May 24 21:30:57 2005 UTC (14 years, 5 months ago) by daniel
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 5270 byte(s)
Diff to previous 4599
AresDns.hxx/cxx: Redefined lookup and ares callback methonds.
DnsInterface.hxx/cxx: Added dns caching support and  methods to (un)register blacklist listener.
DnsResult.hxx/cxx: Modified to use dns caching, blacklisting, and vip; removed dead code.
Makefile: Added dns cache related files.
Security.hxx/cxx: correctly handle default paths in the constructor
SipStack.hxx/cxx: Added blacklist listener registration and unregistration.
StatelessHandler.cxx: Got it to compile with USE_IPV6 defined.
TlsConnection.cxx: Make logging less verbose.
TransactionController.hxx/cxx: Added blacklist listener registration and unregistration.
TransactionState.cxx: Added whitelisting(vip) rules.
TransportSelector.hxx/cxx: Added blacklist listener registration and unregistration; refactor and clarify for IPv6
WinSecurity.hxx/cxx: since certificates are preloaded, don't query the filesystem cert store.
dum/ClientAuthManager.cxx: changed DebugLog to InfoLog in handle method.
dum/DialogUsageManager.cxx: changed DebugLog to InfoLog in internalProcess method.
dum/test/BasicCall.cxx: added keep-alive test case.
dum/test/basicRegister.cxx: updated commandline options and simplified for TLS/IPv6.
dum/test/testIdentity.cxx: added test for identity over TLS/IPv6.
external/ExternalDns.hxx: redefined ExternalDnsHandler and lookup methods in ExternalDns class.
os/Tuple.cxx: fix constructor to copy complete IPv6 address.
os/WinCompat.hxx/cxx: add support to determine local IPv6 address; now only used on Windows platform.
os/compat.hxx: added define for T_A.

Revision 4599 - (view) (download) (annotate) - [select for diffs]
Modified Wed May 11 23:10:19 2005 UTC (14 years, 6 months ago) by derek
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 5080 byte(s)
Diff to previous 4596
set svn:eol-style to LF

Revision 4596 - (view) (download) (annotate) - [select for diffs]
Modified Wed May 11 21:31:00 2005 UTC (14 years, 6 months ago) by derek
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 5080 byte(s)
Diff to previous 4433
fix eol conventions

Revision 4433 - (view) (download) (annotate) - [select for diffs]
Modified Mon Apr 25 04:12:21 2005 UTC (14 years, 6 months ago) by fluffy
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 5268 byte(s)
Diff to previous 3727
added pragam for wantings that windows SDK gives with viusal C++ version 8.0 

Revision 3727 - (view) (download) (annotate) - [select for diffs]
Modified Mon Dec 6 15:55:31 2004 UTC (14 years, 11 months ago) by sgodin
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 4935 byte(s)
Diff to previous 3718
Removed Win32 debug stuff just added - will not build, due to multiple definitions of new/delete.

Revision 3718 - (view) (download) (annotate) - [select for diffs]
Modified Sat Dec 4 21:47:50 2004 UTC (14 years, 11 months ago) by jason
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 5217 byte(s)
Diff to previous 2948
added windows memory leak debugging to compat.hxx


Revision 2948 - (view) (download) (annotate) - [select for diffs]
Modified Tue Jun 8 21:32:05 2004 UTC (15 years, 5 months ago) by derek
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 4935 byte(s)
Diff to previous 2937
Log::DEBUG, Log::CERR etc are now Log::Debug, Log::Cerr.
This is necessary for osX and there were some other macro collisions we were hacking around.  Basically, all upper case was just wrong.

Vairous other fixes to allow compilation on more platforms.

IPV6 for windows has been added to DnsUtil

Revision 2937 - (view) (download) (annotate) - [select for diffs]
Modified Thu Jun 3 23:12:34 2004 UTC (15 years, 5 months ago) by derek
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 4637 byte(s)
Diff to previous 2714
Inserter works on VC++ 2003.  Definfed REASONABLE_TEMPLATES in compat.hxx, reasonable being loosely defined as Inserter works.
Some project fixes(using managed extensions was turned on, ugh)

Revision 2714 - (view) (download) (annotate) - [select for diffs]
Modified Thu May 6 23:29:06 2004 UTC (15 years, 6 months ago) by bob
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 4150 byte(s)
Diff to previous 2646
Fixed typedef of ssize_t to comply with
   http://www.gnu.org/software/libc/manual/html_node/I-O-Primitives.html


Revision 2646 - (view) (download) (annotate) - [select for diffs]
Modified Sun Apr 18 18:22:04 2004 UTC (15 years, 6 months ago) by jason
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 4160 byte(s)
Diff to previous 2645
fix usage of std::min and std::max for WIN32


Revision 2645 - (view) (download) (annotate) - [select for diffs]
Modified Sun Apr 18 18:09:12 2004 UTC (15 years, 6 months ago) by jason
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 4497 byte(s)
Diff to previous 2600
add std::min and std::max for WIN32


Revision 2600 - (view) (download) (annotate) - [select for diffs]
Modified Sun Apr 11 20:43:43 2004 UTC (15 years, 7 months ago) by davidb
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 4159 byte(s)
Diff to previous 2335
moved UInt64 type to compat


Revision 2335 - (view) (download) (annotate) - [select for diffs]
Modified Sun Feb 8 00:23:31 2004 UTC (15 years, 9 months ago) by jason
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 4056 byte(s)
Diff to previous 1725
update to relative paths
fix some compile issues for gag on windows


Revision 1725 - (view) (download) (annotate) - [select for diffs]
Modified Sat Sep 13 21:23:34 2003 UTC (16 years, 2 months ago) by rjsparks
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 4015 byte(s)
Diff to previous 1473
Added a definition for the DNS AAAA record type
T_AAAA == 28


Revision 1473 - (view) (download) (annotate) - [select for diffs]
Modified Tue Jun 3 03:29:10 2003 UTC (16 years, 5 months ago) by ryker
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 3968 byte(s)
Diff to previous 1470
Minor cleanup and temporary hack for Solaris compilation.


Revision 1470 - (view) (download) (annotate) - [select for diffs]
Modified Mon Jun 2 21:14:36 2003 UTC (16 years, 5 months ago) by ryker
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 4130 byte(s)
Diff to previous 1468
Remove Sun-specific conditional code and replace with autoconf
probed results.  This might just work on another non-Sun platform too now.


Revision 1468 - (view) (download) (annotate) - [select for diffs]
Modified Mon Jun 2 20:52:32 2003 UTC (16 years, 5 months ago) by ryker
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 4163 byte(s)
Diff to previous 1383
Fix include guards to avoid macro namespace conflicts.  Some of these
are just style changes to make things consistent across the project.


Revision 1383 - (view) (download) (annotate) - [select for diffs]
Modified Wed Apr 30 15:53:04 2003 UTC (16 years, 6 months ago) by alan
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 4149 byte(s)
Diff to previous 1305
removed vocal2 references, added T_NAPTR and T_SRV defines if missing


Revision 1305 - (view) (download) (annotate) - [select for diffs]
Modified Tue Mar 25 06:33:48 2003 UTC (16 years, 7 months ago) by jason
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 4001 byte(s)
Diff to previous 1137
rename namespace to resip


Revision 1137 - (view) (download) (annotate) - [select for diffs]
Modified Fri Jan 31 23:41:29 2003 UTC (16 years, 9 months ago) by jason
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 4002 byte(s)
Diff to previous 1136
intel compiler (icc) compatibility stuff


Revision 1136 - (view) (download) (annotate) - [select for diffs]
Modified Fri Jan 31 20:58:18 2003 UTC (16 years, 9 months ago) by bko
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 3836 byte(s)
Diff to previous 1125
fixes for FreeBSD / gcc 2.9x compiling


Revision 1125 - (view) (download) (annotate) - [select for diffs]
Modified Sat Jan 25 23:39:10 2003 UTC (16 years, 9 months ago) by fluffy
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 3794 byte(s)
Diff to previous 1118
fixed to compile in windows.


Revision 1118 - (view) (download) (annotate) - [select for diffs]
Modified Sat Jan 25 03:41:15 2003 UTC (16 years, 9 months ago) by jason
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 3625 byte(s)
Diff to previous 1015
solaris compat


Revision 1015 - (view) (download) (annotate) - [select for diffs]
Modified Fri Jan 3 07:31:42 2003 UTC (16 years, 10 months ago) by fluffy
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 3283 byte(s)
Diff to previous 1007
windows ports for min/max stuff


Revision 1007 - (view) (download) (annotate) - [select for diffs]
Modified Thu Jan 2 23:22:02 2003 UTC (16 years, 10 months ago) by derekm
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 3293 byte(s)
Diff to previous 963
added min, max to compat

used where appropriate


Revision 963 - (view) (download) (annotate) - [select for diffs]
Modified Fri Dec 20 19:03:35 2002 UTC (16 years, 10 months ago) by jason
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 3000 byte(s)
Diff to previous 958
moved compatibility stuff into compat.hxx


Revision 958 - (view) (download) (annotate) - [select for diffs]
Modified Fri Dec 20 07:58:06 2002 UTC (16 years, 10 months ago) by fluffy
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 2828 byte(s)
Diff to previous 650
compile on mac os 10


Revision 650 - (view) (download) (annotate) - [select for diffs]
Modified Wed Nov 13 23:54:01 2002 UTC (17 years ago) by jason
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 2805 byte(s)
Diff to previous 637
fixes for qnx


Revision 637 - (view) (download) (annotate) - [select for diffs]
Modified Wed Nov 13 17:56:53 2002 UTC (17 years ago) by jason
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 2771 byte(s)
Diff to previous 377
fixed to compile on qnx/neutrino 6.0 with gcc 2.95


Revision 377 - (view) (download) (annotate) - [select for diffs]
Modified Fri Nov 1 07:10:46 2002 UTC (17 years ago) by fluffy
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 2713 byte(s)
Diff to previous 356
fixed to compile under windows


Revision 356 - (view) (download) (annotate) - [select for diffs]
Modified Thu Oct 31 01:13:25 2002 UTC (17 years ago) by jason
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 2655 byte(s)
Diff to previous 354
added opeartor== to URI


Revision 354 - (view) (download) (annotate) - [select for diffs]
Modified Thu Oct 31 01:08:45 2002 UTC (17 years ago) by jason
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 2922 byte(s)
Diff to previous 309
use srandom instead of srand


Revision 309 - (view) (download) (annotate) - [select for diffs]
Modified Sun Oct 13 16:21:12 2002 UTC (17 years, 1 month ago) by jason
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 2881 byte(s)
Diff to previous 304
use Data.data() rather than data.c_str() -- data never copies


Revision 304 - (view) (download) (annotate) - [select for diffs]
Modified Sun Oct 13 02:26:29 2002 UTC (17 years, 1 month ago) by fluffy
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 2820 byte(s)
Diff to previous 278
few windows updates


Revision 278 - (view) (download) (annotate) - [select for diffs]
Modified Sat Oct 5 04:47:57 2002 UTC (17 years, 1 month ago) by fluffy
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 2822 byte(s)
Diff to previous 270
fixed license statements


Revision 270 - (view) (download) (annotate) - [select for diffs]
Added Fri Oct 4 20:52:01 2002 UTC (17 years, 1 month ago) by jason
Original Path: main/sip/resiprocate/os/compat.hxx
File length: 449 byte(s)
added in common stuff for compatibility between o/s


This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.

  Diffs between and
  Type of Diff should be a

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27