_ZN5resip4Data15PreallocateTypeC2Ei:
   32|      2|{}
_ZN5resip4Data4initENS_13DataLocalSizeILi16EEE:
  214|     28|{
  215|     28|   return true;
  216|     28|}
_ZN5resip4DataC2EPKcm:
  251|      2|{
  252|      2|   initFromString(str, length);
  253|      2|}
_ZN5resip4DataC2ENS0_9ShareEnumEPKcm:
  306|    187|   : mBuf(const_cast<char*>(buffer)),
  307|    187|     mSize(length),
  308|    187|     mCapacity(mSize),
  309|    187|     mShareEnum(se)
  310|    187|{
  311|       |   resip_assert(buffer);
  ------------------
  |  |   96|    187|#define resip_assert(x)                                                        \
  |  |   97|    187|{                                                                              \
  |  |   98|    187|   if ( !(x) )                                                                 \
  |  |  ------------------
  |  |  |  Branch (98:9): [True: 0, False: 187]
  |  |  ------------------
  |  |   99|    187|   {                                                                           \
  |  |  100|      0|      syslog( RESIP_ASSERT_SYSLOG_PRIORITY, "assertion failed: %s:%d: %s", __FILE__, __LINE__, #x );                 \
  |  |  ------------------
  |  |  |  |   95|      0|#define RESIP_ASSERT_SYSLOG_PRIORITY (LOG_DAEMON | LOG_CRIT)
  |  |  ------------------
  |  |  101|      0|   }                                                                           \
  |  |  102|    187|   {                                                                           \
  |  |  103|    187|      assert( (x) );                                                           \
  |  |  104|    187|   }                                                                           \
  |  |  105|    187|}
  ------------------
  312|    187|}
_ZN5resip4DataC2EPKc:
  346|     50|{
  347|     50|   initFromString(str, str ? (Data::size_type)strlen(str) : 0);
  ------------------
  |  Branch (347:24): [True: 50, False: 0]
  ------------------
  348|     50|}
_ZN5resip4DataC2ERKS0_:
  366|      2|{
  367|      2|   initFromString(data.mBuf, data.mSize);
  368|      2|}
_ZN5resip4Data4copyEPKcm:
  702|     10|{
  703|     10|   if (mShareEnum == Data::Share || mCapacity < length+1)
  ------------------
  |  Branch (703:8): [True: 0, False: 10]
  |  Branch (703:37): [True: 0, False: 10]
  ------------------
  704|      0|   {
  705|       |      // will alloc length+1, so the term NULL below is safe
  706|      0|      resize(length, false);
  707|      0|   }
  708|       |   // {buf} might be part of ourselves already, in which case {length}
  709|       |   // is smaller than our capacity, so resize above won't happen, so
  710|       |   // just memmove (not memcpy) and everything good
  711|     10|   mSize = length;
  712|     10|   if (mSize>0)
  ------------------
  |  Branch (712:8): [True: 6, False: 4]
  ------------------
  713|      6|   {
  714|      6|      memmove(mBuf, buf, mSize);
  715|      6|   }
  716|       |   // DONT do term NULL until after copy, because may be shifting contents
  717|       |   // down and don't want to put NULL in middle of it
  718|     10|   mBuf[mSize] = 0;
  719|     10|   return *this;
  720|     10|}
_ZN5resipeqERKNS_4DataEPKc:
  754|      8|{
  755|      8|   resip_assert(rhs); // .dlb. not consistent with constructor
  ------------------
  |  |   96|      8|#define resip_assert(x)                                                        \
  |  |   97|      8|{                                                                              \
  |  |   98|      8|   if ( !(x) )                                                                 \
  |  |  ------------------
  |  |  |  Branch (98:9): [True: 0, False: 8]
  |  |  ------------------
  |  |   99|      8|   {                                                                           \
  |  |  100|      0|      syslog( RESIP_ASSERT_SYSLOG_PRIORITY, "assertion failed: %s:%d: %s", __FILE__, __LINE__, #x );                 \
  |  |  ------------------
  |  |  |  |   95|      0|#define RESIP_ASSERT_SYSLOG_PRIORITY (LOG_DAEMON | LOG_CRIT)
  |  |  ------------------
  |  |  101|      0|   }                                                                           \
  |  |  102|      8|   {                                                                           \
  |  |  103|      8|      assert( (x) );                                                           \
  |  |  104|      8|   }                                                                           \
  |  |  105|      8|}
  ------------------
  756|      8|   if (strncmp(lhs.mBuf, rhs, lhs.mSize) != 0)
  ------------------
  |  Branch (756:8): [True: 6, False: 2]
  ------------------
  757|      6|   {
  758|      6|      return false;
  759|      6|   }
  760|      2|   return strlen(rhs) == lhs.mSize;
  761|      8|}
_ZN5resip4Data9truncate2Em:
  956|      2|{
  957|      2|   if (len < mSize)
  ------------------
  |  Branch (957:8): [True: 0, False: 2]
  ------------------
  958|      0|   {
  959|       |      // NOTE: Do not write terminating NULL, to avoid un-doing Share
  960|      0|      mSize = len;
  961|      0|   }
  962|      2|   return *this;
  963|      2|}
_Z24urlNonEncodedCharsInitFnv:
 1399|      2|{
 1400|       |   // query part of HTTP URL can be a pchar, slash, or question
 1401|       |   // pchar is unreserved, subdelims, colon, at-sign
 1402|       |
 1403|    514|   for (int i = 0; i < 256; ++i)
  ------------------
  |  Branch (1403:20): [True: 512, False: 2]
  ------------------
 1404|    512|   {
 1405|    512|      unsigned char c(i);
 1406|    512|      urlNonEncodedChars[c] = (isalpha(c) ||  // unreserved
  ------------------
  |  Branch (1406:32): [True: 104, False: 408]
  ------------------
 1407|    408|                               isdigit(c) ||  // unreserved
  ------------------
  |  Branch (1407:32): [True: 20, False: 388]
  ------------------
 1408|    388|                               c == '-' ||  // these first 4 are unreserved
  ------------------
  |  Branch (1408:32): [True: 2, False: 386]
  ------------------
 1409|    386|                               c == '_' ||
  ------------------
  |  Branch (1409:32): [True: 2, False: 384]
  ------------------
 1410|    384|                               c == '.' ||
  ------------------
  |  Branch (1410:32): [True: 2, False: 382]
  ------------------
 1411|    382|                               c == '~' ||
  ------------------
  |  Branch (1411:32): [True: 2, False: 380]
  ------------------
 1412|    380|                               c == '!' ||  // these are subdelims (allowed in pchars)
  ------------------
  |  Branch (1412:32): [True: 2, False: 378]
  ------------------
 1413|    378|                               c == '$' ||
  ------------------
  |  Branch (1413:32): [True: 2, False: 376]
  ------------------
 1414|       |//                               c == '&' ||  // while these are allowed subdelims, this is an error
 1415|       |//                               c == '+' ||  // I believe this is an error as well.
 1416|    376|                               c == '\'' ||
  ------------------
  |  Branch (1416:32): [True: 2, False: 374]
  ------------------
 1417|    374|                               c == '(' ||
  ------------------
  |  Branch (1417:32): [True: 2, False: 372]
  ------------------
 1418|    372|                               c == ')' ||
  ------------------
  |  Branch (1418:32): [True: 2, False: 370]
  ------------------
 1419|    370|                               c == '*' ||
  ------------------
  |  Branch (1419:32): [True: 2, False: 368]
  ------------------
 1420|    368|                               c == ',' ||
  ------------------
  |  Branch (1420:32): [True: 2, False: 366]
  ------------------
 1421|    366|                               c == ';' ||
  ------------------
  |  Branch (1421:32): [True: 2, False: 364]
  ------------------
 1422|    364|                               c == '=' ||
  ------------------
  |  Branch (1422:32): [True: 2, False: 362]
  ------------------
 1423|    362|                               c == ':' ||   // next two explicitly allowed in pchar
  ------------------
  |  Branch (1423:32): [True: 2, False: 360]
  ------------------
 1424|    360|                               c == '@' ||   
  ------------------
  |  Branch (1424:32): [True: 2, False: 358]
  ------------------
 1425|    358|                               c == '/' ||   // next two explicitly allowed in query in addition to pchar
  ------------------
  |  Branch (1425:32): [True: 2, False: 356]
  ------------------
 1426|    356|                               c == '?');    
  ------------------
  |  Branch (1426:32): [True: 2, False: 354]
  ------------------
 1427|    512|   }
 1428|       |
 1429|      2|   return false;
 1430|      2|}
_ZN5resip4Data14initFromStringEPKcm:
  274|     54|{
  275|     54|   mSize = len;
  276|     54|   if(len > 0)
  ------------------
  |  Branch (276:7): [True: 46, False: 8]
  ------------------
  277|     46|   {
  278|     46|      resip_assert(str);
  ------------------
  |  |   96|     46|#define resip_assert(x)                                                        \
  |  |   97|     46|{                                                                              \
  |  |   98|     46|   if ( !(x) )                                                                 \
  |  |  ------------------
  |  |  |  Branch (98:9): [True: 0, False: 46]
  |  |  ------------------
  |  |   99|     46|   {                                                                           \
  |  |  100|      0|      syslog( RESIP_ASSERT_SYSLOG_PRIORITY, "assertion failed: %s:%d: %s", __FILE__, __LINE__, #x );                 \
  |  |  ------------------
  |  |  |  |   95|      0|#define RESIP_ASSERT_SYSLOG_PRIORITY (LOG_DAEMON | LOG_CRIT)
  |  |  ------------------
  |  |  101|      0|   }                                                                           \
  |  |  102|     46|   {                                                                           \
  |  |  103|     46|      assert( (x) );                                                           \
  |  |  104|     46|   }                                                                           \
  |  |  105|     46|}
  ------------------
  279|     46|   }
  280|     54|   size_t bytes = len + 1;
  281|     54|   if(bytes <= len)
  ------------------
  |  Branch (281:7): [True: 0, False: 54]
  ------------------
  282|      0|   {
  283|       |      // integer overflow
  284|      0|      throw std::bad_alloc();
  285|      0|   }
  286|     54|   if(bytes > LocalAlloc)
  ------------------
  |  Branch (286:7): [True: 6, False: 48]
  ------------------
  287|      6|   {
  288|      6|      mBuf = new char[bytes];
  289|      6|      mCapacity = mSize;
  290|      6|      mShareEnum = Take;
  291|      6|   }
  292|     48|   else
  293|     48|   {
  294|     48|      mBuf = mPreBuffer;
  295|     48|      mCapacity = LocalAlloc;
  296|     48|      mShareEnum = Borrow;
  297|     48|   }
  298|     54|   if(str)
  ------------------
  |  Branch (298:7): [True: 54, False: 0]
  ------------------
  299|     54|   {
  300|     54|      memcpy(mBuf, str, len);
  301|     54|   }
  302|     54|   mBuf[mSize] = 0;
  303|     54|}

_ZN5resip4DataD2Ev:
  319|    195|      {
  320|    195|         if (mShareEnum == Take)
  ------------------
  |  Branch (320:14): [True: 2, False: 193]
  ------------------
  321|      2|         {
  322|      2|            delete[] mBuf;
  323|      2|         }
  324|    195|      }
_ZN5resip13DataLocalSizeILi16EEC2Em:
   44|     28|      explicit DataLocalSize(size_t) noexcept {}
_ZN5resip4DataC2Ev:
   97|     10|         : mBuf(mPreBuffer),
   98|     10|           mSize(0),
   99|     10|           mCapacity(LocalAlloc),
  100|     10|           mShareEnum(Borrow)
  101|     10|      {
  102|     10|         mBuf[mSize] = 0;
  103|     10|      }
_ZN5resip4DataaSERKS0_:
  428|      6|      {
  429|      6|         if (&data==this)
  ------------------
  |  Branch (429:14): [True: 0, False: 6]
  ------------------
  430|      0|             return *this;
  431|      6|         return copy(data.mBuf,data.mSize);
  432|      6|      }
_ZN5resip4DataaSEPKc:
  452|      4|      {
  453|      4|         return copy(str, (size_type)strlen(str));
  454|      4|      }
_ZNK5resip4Data5emptyEv:
  595|    189|      bool empty() const noexcept { return mSize == 0; }
_ZNK5resip4Data4sizeEv:
  603|    352|      size_type size() const noexcept { return mSize; }
_ZNK5resip4Data4dataEv:
  613|    970|      {
  614|    970|         return mBuf;
  615|    970|      }
_ZN5resip4Data5clearEv:
  804|      2|      Data& clear() { return truncate2(0); };

_ZN5resip7DnsUtil13isIpV4AddressERKNS_4DataE:
  291|    187|{
  292|       |   // ok, this is fairly monstrous but it works. It is also more than 10 times 
  293|       |   // faster than the commented-out code below, in the worst case scenario.
  294|       |
  295|    187|   const char* first = ipAddress.data();
  296|    187|   const char* end = first + ipAddress.size();
  297|    187|   int octets = 0;
  298|    254|   while(octets++ < 4)
  ------------------
  |  Branch (298:10): [True: 246, False: 8]
  ------------------
  299|    246|   {
  300|    246|      const char* last=first;
  301|       |
  302|       |      // .bwc. I have tried using std::bitset instead of the 0 <= *last <= 9
  303|       |      // check, but it is slower.
  304|    672|      while(last != end && *last >= '0' && *last <= '9' && last - first <= 3)
  ------------------
  |  Branch (304:13): [True: 617, False: 55]
  |  Branch (304:28): [True: 474, False: 143]
  |  Branch (304:44): [True: 432, False: 42]
  |  Branch (304:60): [True: 426, False: 6]
  ------------------
  305|    426|      {
  306|       |         // Skip at most 3 decimals, without going past the end of the buffer.
  307|    426|         ++last;
  308|    426|      }
  309|       |
  310|       |      // last should now point to either a '.', or the end of the buffer.
  311|       |
  312|    246|      switch(last-first) // number of decimals in this octet
  313|    246|      {
  314|     39|         case 2:
  ------------------
  |  Branch (314:10): [True: 39, False: 207]
  ------------------
  315|     39|            if(*first == '0')
  ------------------
  |  Branch (315:16): [True: 4, False: 35]
  ------------------
  316|      4|            {
  317|       |               // Two-decimal octet can't begin with 0...
  318|       |               // ?bwc? Maybe let this slide?
  319|      4|               return false;
  320|      4|            }
  321|    115|         case 1:
  ------------------
  |  Branch (321:10): [True: 80, False: 166]
  ------------------
  322|       |            // ... but a one-decimal octet can begin with a 0.
  323|    115|            break; // x. or xx.
  324|     64|         case 3:
  ------------------
  |  Branch (324:10): [True: 64, False: 182]
  ------------------
  325|       |            // xxx. (could be too large)
  326|       |            // .bwc. I have tried implementing this with a reinterpret_cast 
  327|       |            // and a UInt32 comparison (accounting for endianness), and memcmp, 
  328|       |            // but both appear to be slower, even when using 
  329|       |            // "255.255.255.255" (which maximizes the number of comparisons).
  330|     64|            if(*first != '1')
  ------------------
  |  Branch (330:16): [True: 49, False: 15]
  ------------------
  331|     49|            {
  332|     49|               if(*first == '2')
  ------------------
  |  Branch (332:19): [True: 41, False: 8]
  ------------------
  333|     41|               {
  334|       |                  // Might have overflow if first digit is 2
  335|     41|                  if(*(first+1)>'5' || (*(first+1)=='5' && *(first+2)>'5'))
  ------------------
  |  Branch (335:22): [True: 1, False: 40]
  |  Branch (335:41): [True: 16, False: 24]
  |  Branch (335:60): [True: 2, False: 14]
  ------------------
  336|      3|                  {
  337|      3|                     return false;
  338|      3|                  }
  339|     41|               }
  340|      8|               else
  341|      8|               {
  342|       |                  // First digit greater than 2 means overflow, 0 not allowed.
  343|      8|                  return false;
  344|      8|               }
  345|     49|            }
  346|     53|            break;
  347|     63|         default:
  ------------------
  |  Branch (347:10): [True: 63, False: 183]
  ------------------
  348|     63|            return false;
  349|    246|      }
  350|       |
  351|    168|      if(octets < 4)
  ------------------
  |  Branch (351:10): [True: 160, False: 8]
  ------------------
  352|    160|      {
  353|    160|         if(last != end && *last == '.')
  ------------------
  |  Branch (353:13): [True: 129, False: 31]
  |  Branch (353:28): [True: 59, False: 70]
  ------------------
  354|     59|         {
  355|       |            // Skip over the '.'
  356|     59|            ++last;
  357|     59|         }
  358|    101|         else
  359|    101|         {
  360|    101|            return false;
  361|    101|         }
  362|    160|      }
  363|     67|      first = last; // is now pointing at either the first digit in the next
  364|       |                     // octet, or the end of the buffer.
  365|     67|   }
  366|       |
  367|      8|   return first==end;
  368|       |//   unsigned int p1,p2,p3,p4;
  369|       |//   int count=0;
  370|       |//   int result = sscanf( ipAddress.c_str(),
  371|       |//                        "%u.%u.%u.%u%n",
  372|       |//                        &p1, &p2, &p3, &p4, &count );
  373|       |//
  374|       |//   if ( (result == 4) && (p1 <= 255) && (p2 <= 255) && (p3 <= 255) && (p4 <= 255) && (count == int(ipAddress.size())) )
  375|       |//   {
  376|       |//      return true;
  377|       |//   }
  378|       |//   else
  379|       |//   {
  380|       |//      return false;
  381|       |//   }
  382|    187|}
_ZN5resip7DnsUtil13isIpV6AddressERKNS_4DataE:
  387|    187|{
  388|    187|   if (ipAddress.empty())
  ------------------
  |  Branch (388:8): [True: 0, False: 187]
  ------------------
  389|      0|   {
  390|      0|      return false;
  391|      0|   }
  392|       |
  393|       |   // first character must be a hex digit or colon
  394|    187|   if (!isxdigit(static_cast< unsigned char >(*ipAddress.data())) &&
  ------------------
  |  Branch (394:8): [True: 27, False: 160]
  ------------------
  395|     27|       *ipAddress.data() != ':')
  ------------------
  |  Branch (395:8): [True: 24, False: 3]
  ------------------
  396|     24|   {
  397|     24|      return false;
  398|     24|   }
  399|       |
  400|    163|   switch (ipAddress.size())
  401|    163|   {
  402|      6|      case 1:
  ------------------
  |  Branch (402:7): [True: 6, False: 157]
  ------------------
  403|      6|         return false;
  404|     27|      case 2:
  ------------------
  |  Branch (404:7): [True: 27, False: 136]
  ------------------
  405|     27|         return (*(ipAddress.data()+1) == ':' ||
  ------------------
  |  Branch (405:18): [True: 2, False: 25]
  ------------------
  406|     25|                 *(ipAddress.data()+0) == ':');
  ------------------
  |  Branch (406:18): [True: 1, False: 24]
  ------------------
  407|     39|      case 3:
  ------------------
  |  Branch (407:7): [True: 39, False: 124]
  ------------------
  408|     39|         return (*(ipAddress.data()+2) == ':' ||
  ------------------
  |  Branch (408:18): [True: 2, False: 37]
  ------------------
  409|     37|                 *(ipAddress.data()+1) == ':' ||
  ------------------
  |  Branch (409:18): [True: 1, False: 36]
  ------------------
  410|     36|                 *(ipAddress.data()+0) == ':');
  ------------------
  |  Branch (410:18): [True: 0, False: 36]
  ------------------
  411|     29|      case 4:
  ------------------
  |  Branch (411:7): [True: 29, False: 134]
  ------------------
  412|     29|         return (*(ipAddress.data()+3) == ':' ||
  ------------------
  |  Branch (412:18): [True: 2, False: 27]
  ------------------
  413|     27|                 *(ipAddress.data()+2) == ':' ||
  ------------------
  |  Branch (413:18): [True: 1, False: 26]
  ------------------
  414|     26|                 *(ipAddress.data()+1) == ':' ||
  ------------------
  |  Branch (414:18): [True: 1, False: 25]
  ------------------
  415|     25|                 *(ipAddress.data()+0) == ':');
  ------------------
  |  Branch (415:18): [True: 1, False: 24]
  ------------------
  416|     62|      default:
  ------------------
  |  Branch (416:7): [True: 62, False: 101]
  ------------------
  417|       |
  418|     62|         return (*(ipAddress.data()+4) == ':' ||
  ------------------
  |  Branch (418:18): [True: 1, False: 61]
  ------------------
  419|     61|                 *(ipAddress.data()+3) == ':' ||
  ------------------
  |  Branch (419:18): [True: 2, False: 59]
  ------------------
  420|     59|                 *(ipAddress.data()+2) == ':' ||
  ------------------
  |  Branch (420:18): [True: 1, False: 58]
  ------------------
  421|     58|                 *(ipAddress.data()+1) == ':' ||
  ------------------
  |  Branch (421:18): [True: 2, False: 56]
  ------------------
  422|     56|                 *(ipAddress.data()+0) == ':');
  ------------------
  |  Branch (422:18): [True: 0, False: 56]
  ------------------
  423|    163|   }
  424|    163|}

_ZN5resip20LogStaticInitializerC2Ev:
  113|     22|{
  114|     22|   if (mInstanceCounter++ == 0)
  ------------------
  |  Branch (114:8): [True: 2, False: 20]
  ------------------
  115|      2|   {
  116|      2|#ifdef LOG_ENABLE_THREAD_SETTING
  117|      2|         Log::mLevelKey = new ThreadIf::TlsKey;
  118|      2|         ThreadIf::tlsKeyCreate(*Log::mLevelKey, freeThreadSetting);
  119|      2|#endif
  120|       |
  121|      2|         Log::mLocalLoggerKey = new ThreadIf::TlsKey;
  122|      2|         ThreadIf::tlsKeyCreate(*Log::mLocalLoggerKey, freeLocalLogger);
  123|      2|   }
  124|     22|}
_ZN5resip3Log23parseSyslogFacilityNameERKNS_4DataE:
  174|      2|{
  175|      2|#ifndef WIN32
  176|       |   /* In theory, some platforms may not have all the log facilities
  177|       |      defined in syslog.h.  Only LOG_USER and LOG_LOCAL[0-7] are considered
  178|       |      mandatory.
  179|       |      If the compile fails with errors in this method, then the unsupported
  180|       |      facility names could be wrapped in conditional logic.
  181|       |   */
  182|      2|   if(facilityName == "LOG_AUTH")
  ------------------
  |  Branch (182:7): [True: 0, False: 2]
  ------------------
  183|      0|   {
  184|      0|      return LOG_AUTH;
  185|      0|   }
  186|      2|   else if(facilityName == "LOG_AUTHPRIV")
  ------------------
  |  Branch (186:12): [True: 0, False: 2]
  ------------------
  187|      0|   {
  188|      0|      return LOG_AUTHPRIV;
  189|      0|   }
  190|      2|   else if(facilityName == "LOG_CRON")
  ------------------
  |  Branch (190:12): [True: 0, False: 2]
  ------------------
  191|      0|   {
  192|      0|      return LOG_CRON;
  193|      0|   }
  194|      2|   else if(facilityName == "LOG_DAEMON")
  ------------------
  |  Branch (194:12): [True: 2, False: 0]
  ------------------
  195|      2|   {
  196|      2|      return LOG_DAEMON;
  197|      2|   }
  198|      0|   else if(facilityName == "LOG_FTP")
  ------------------
  |  Branch (198:12): [True: 0, False: 0]
  ------------------
  199|      0|   {
  200|      0|      return LOG_FTP;
  201|      0|   }
  202|      0|   else if(facilityName == "LOG_KERN")
  ------------------
  |  Branch (202:12): [True: 0, False: 0]
  ------------------
  203|      0|   {
  204|      0|      return LOG_KERN;
  205|      0|   }
  206|      0|   else if(facilityName == "LOG_LOCAL0")
  ------------------
  |  Branch (206:12): [True: 0, False: 0]
  ------------------
  207|      0|   {
  208|      0|      return LOG_LOCAL0;
  209|      0|   }
  210|      0|   else if(facilityName == "LOG_LOCAL1")
  ------------------
  |  Branch (210:12): [True: 0, False: 0]
  ------------------
  211|      0|   {
  212|      0|      return LOG_LOCAL1;
  213|      0|   }
  214|      0|   else if(facilityName == "LOG_LOCAL2")
  ------------------
  |  Branch (214:12): [True: 0, False: 0]
  ------------------
  215|      0|   {
  216|      0|      return LOG_LOCAL2;
  217|      0|   }
  218|      0|   else if(facilityName == "LOG_LOCAL3")
  ------------------
  |  Branch (218:12): [True: 0, False: 0]
  ------------------
  219|      0|   {
  220|      0|      return LOG_LOCAL3;
  221|      0|   }
  222|      0|   else if(facilityName == "LOG_LOCAL4")
  ------------------
  |  Branch (222:12): [True: 0, False: 0]
  ------------------
  223|      0|   {
  224|      0|      return LOG_LOCAL4;
  225|      0|   }
  226|      0|   else if(facilityName == "LOG_LOCAL5")
  ------------------
  |  Branch (226:12): [True: 0, False: 0]
  ------------------
  227|      0|   {
  228|      0|      return LOG_LOCAL5;
  229|      0|   }
  230|      0|   else if(facilityName == "LOG_LOCAL6")
  ------------------
  |  Branch (230:12): [True: 0, False: 0]
  ------------------
  231|      0|   {
  232|      0|      return LOG_LOCAL6;
  233|      0|   }
  234|      0|   else if(facilityName == "LOG_LOCAL7")
  ------------------
  |  Branch (234:12): [True: 0, False: 0]
  ------------------
  235|      0|   {
  236|      0|      return LOG_LOCAL7;
  237|      0|   }
  238|      0|   else if(facilityName == "LOG_LPR")
  ------------------
  |  Branch (238:12): [True: 0, False: 0]
  ------------------
  239|      0|   {
  240|      0|      return LOG_LPR;
  241|      0|   }
  242|      0|   else if(facilityName == "LOG_MAIL")
  ------------------
  |  Branch (242:12): [True: 0, False: 0]
  ------------------
  243|      0|   {
  244|      0|      return LOG_MAIL;
  245|      0|   }
  246|      0|   else if(facilityName == "LOG_NEWS")
  ------------------
  |  Branch (246:12): [True: 0, False: 0]
  ------------------
  247|      0|   {
  248|      0|      return LOG_NEWS;
  249|      0|   }
  250|      0|   else if(facilityName == "LOG_SYSLOG")
  ------------------
  |  Branch (250:12): [True: 0, False: 0]
  ------------------
  251|      0|   {
  252|      0|      return LOG_SYSLOG;
  253|      0|   }
  254|      0|   else if(facilityName == "LOG_USER")
  ------------------
  |  Branch (254:12): [True: 0, False: 0]
  ------------------
  255|      0|   {
  256|      0|      return LOG_USER;
  257|      0|   }
  258|      0|   else if(facilityName == "LOG_UUCP")
  ------------------
  |  Branch (258:12): [True: 0, False: 0]
  ------------------
  259|      0|   {
  260|      0|      return LOG_UUCP;
  261|      0|   }
  262|      0|#endif
  263|       |   // Nothing matched or syslog not supported on this platform
  264|      0|   return -1;
  265|      2|}
_ZN5resip3Log10initializeENS0_4TypeENS0_5LevelERKNS_4DataEPKcPNS_14ExternalLoggerES5_NS0_16MessageStructureES5_:
  274|      2|{
  275|      2|   {
  276|      2|      Lock lock(_mutex);
  277|      2|      mDefaultLoggerData.reset();   
  278|       |
  279|      2|      mDefaultLoggerData.set(type, level, logFileName, externalLogger, messageStructure, instanceName);
  280|       |
  281|      2|      ParseBuffer pb(appName);
  282|      2|      pb.skipToEnd();
  283|       |#ifdef _WIN32
  284|       |      pb.skipBackToChar('\\');
  285|       |#else
  286|      2|      pb.skipBackToChar('/');
  287|      2|#endif
  288|      2|      mAppName = pb.position();
  289|       |
  290|      2|      mInstanceName = instanceName;
  291|       |
  292|      2|#ifndef WIN32
  293|      2|      if (!syslogFacilityName.empty())
  ------------------
  |  Branch (293:11): [True: 2, False: 0]
  ------------------
  294|      2|      {
  295|      2|         mSyslogFacility = parseSyslogFacilityName(syslogFacilityName);
  296|      2|         if(mSyslogFacility == -1)
  ------------------
  |  Branch (296:13): [True: 0, False: 2]
  ------------------
  297|      0|         {
  298|      0|            mSyslogFacility = LOG_DAEMON;
  299|      0|            if(type == Log::Syslog)
  ------------------
  |  Branch (299:16): [True: 0, False: 0]
  ------------------
  300|      0|            {
  301|      0|               syslog(LOG_DAEMON | LOG_ERR, "invalid syslog facility name specified (%s), falling back to LOG_DAEMON", syslogFacilityName.c_str());
  302|      0|            }
  303|      0|         }
  304|      2|      }
  305|       |#else
  306|       |      if (type == Syslog)
  307|       |      {
  308|       |         std::cerr << "syslog not supported on windows, using cout!" << std::endl;
  309|       |         type = Cout;
  310|       |      }
  311|       |#endif
  312|       |
  313|      2|      char buffer[1024];  
  314|      2|      buffer[1023] = '\0';
  315|      2|      if(gethostname(buffer, sizeof(buffer)) == -1)
  ------------------
  |  Branch (315:10): [True: 0, False: 2]
  ------------------
  316|      0|      {
  317|      0|         mHostname = "?";
  318|      0|      }
  319|      2|      else
  320|      2|      {
  321|      2|         mHostname = buffer;
  322|      2|      }
  323|       |
  324|       |#ifdef USE_FQDN_FOR_JSON_CEE_HOSTNAME
  325|       |      // Note: for Windows users, you must call initNetwork to initialize WinSock before calling 
  326|       |      //       Log::initialize in order for getaddrinfo to be successful
  327|       |      {
  328|       |         struct addrinfo hints;
  329|       |         struct addrinfo* info = nullptr;
  330|       |
  331|       |         memset (&hints, 0, sizeof (hints));
  332|       |         hints.ai_family = AF_UNSPEC;    /*either IPV4 or IPV6 */
  333|       |         hints.ai_socktype = SOCK_STREAM;
  334|       |         hints.ai_flags = AI_CANONNAME;
  335|       |
  336|       |         if (getaddrinfo(buffer, 0, &hints, &info) == 0
  337|       |             && info != nullptr) 
  338|       |         {
  339|       |            mFqdn = info->ai_canonname;
  340|       |            freeaddrinfo(info);
  341|       |         }
  342|       |         else
  343|       |         {
  344|       |            mFqdn = mHostname;
  345|       |         }
  346|       |      }
  347|       |#else
  348|      2|      mFqdn = mHostname;
  349|      2|#endif
  350|       |
  351|      2|   }
  352|       |
  353|       |   // pre declare to prevent msvc build error C2121
  354|      2|#ifdef RESIPROCATE_VERSION_STR
  355|      2|#define STREAM_RESIPROCATE_VERSION_STR << RESIPROCATE_VERSION_STR
  356|       |#else 
  357|       |#define STREAM_RESIPROCATE_VERSION_STR << "UNKNOWN"
  358|       |#endif  // RESIPROCATE_VERSION_STR
  359|      2|#ifdef ENABLE_LOG_REPOSITORY_DETAILS
  360|      2|#define STREAM_ENABLE_LOG_REPOSITORY_DETAILS << " git-commit=" << RESIPROCATE_GIT_ID << " git-branch=" << RESIPROCATE_BRANCH_NAME
  361|       |#else
  362|       |#define STREAM_ENABLE_LOG_REPOSITORY_DETAILS << " git repository details unknown"
  363|       |#endif  // ENABLE_LOG_REPOSITORY_DETAILS
  364|       |
  365|      2|   GenericLog(resip::Subsystem::NONE,
  ------------------
  |  |  151|      2|   do                                                                   \
  |  |  152|      2|   {                                                                    \
  |  |  153|      2|      if (genericLogCheckLevel(level_, system_))                        \
  |  |  ------------------
  |  |  |  Branch (153:11): [True: 0, False: 2]
  |  |  ------------------
  |  |  154|      2|      {                                                                 \
  |  |  155|      0|         resip::Log::Guard _resip_log_guard(level_, system_, __FILE__, __LINE__, __func__); \
  |  |  156|      0|         _resip_log_guard.asStream()  args_;                            \
  |  |  157|      0|      }                                                                 \
  |  |  158|      2|   } while (false)
  |  |  ------------------
  |  |  |  Branch (158:13): [Folded, False: 2]
  |  |  ------------------
  ------------------
  366|      2|              resip::Log::Info,
  367|      2|              << "logger initialized app=" << appName
  368|      2|              << " version="
  369|      2|              STREAM_RESIPROCATE_VERSION_STR
  370|      2|              STREAM_ENABLE_LOG_REPOSITORY_DETAILS
  371|      2|              );
  372|       |
  373|      2|#undef LOG_ENABLE_LOG_REPOSITORY_DETAILS
  374|      2|#undef LOG_RESIPROCATE_VERSION_STR
  375|      2|}
_ZN5resip3Log9isLoggingENS0_5LevelERKNS_9SubsystemE:
  972|      2|{
  973|      2|   if (sub.getLevel() != Log::None)
  ------------------
  |  Branch (973:8): [True: 0, False: 2]
  ------------------
  974|      0|   {
  975|      0|      return level <= sub.getLevel();
  976|      0|   }
  977|      2|   else
  978|      2|   {
  979|      2|      return (level <= Log::getLoggerData().mLevel);
  980|      2|   }
  981|      2|}
_ZN5resip3Log10ThreadData3setENS0_4TypeENS0_5LevelEPKcPNS_14ExternalLoggerENS0_16MessageStructureERKNS_4DataE:
 1266|      2|{
 1267|      2|   mType = type;
 1268|      2|   mLevel = level;
 1269|       |
 1270|      2|   if (logFileName)
  ------------------
  |  Branch (1270:8): [True: 0, False: 2]
  ------------------
 1271|      0|   {
 1272|       |#ifdef USE_FMT
 1273|       |      fmt::memory_buffer _loggingFilename;
 1274|       |      fmt::format_to(std::back_inserter(_loggingFilename),
 1275|       |                     logFileName,
 1276|       |#ifdef WIN32
 1277|       |                     fmt::arg("pid", (int)GetCurrentProcess()),
 1278|       |#else
 1279|       |                     fmt::arg("pid", getpid()),
 1280|       |#endif
 1281|       |                     fmt::arg("timestamp", time(0)));
 1282|       |      mLogFileName = Data(_loggingFilename.data(), _loggingFilename.size());
 1283|       |#else
 1284|      0|      mLogFileName = logFileName;
 1285|      0|      mLogFileName.replace("{timestamp}", Data((uint64_t)time(0)));
 1286|       |#ifdef WIN32
 1287|       |      mLogFileName.replace("{pid}", Data((uint64_t)GetCurrentProcess()));
 1288|       |#else
 1289|      0|      mLogFileName.replace("{pid}", Data(getpid()));
 1290|      0|#endif
 1291|      0|#endif
 1292|      0|   }
 1293|      2|   else
 1294|      2|   {
 1295|      2|      mLogFileName.clear();
 1296|      2|   }
 1297|      2|   mExternalLogger = pExternalLogger;
 1298|      2|   mMessageStructure = messageStructure;
 1299|      2|   mInstanceName = instanceName;
 1300|      2|}
_ZN5resip3Log10ThreadData5resetEv:
 1304|      2|{
 1305|      2|   delete mLogger;
 1306|       |   mLogger = NULL;
 1307|      2|}

_ZN5resip3Log10ThreadDataC2EiNS0_4TypeENS0_5LevelEPKcPNS_14ExternalLoggerENS0_16MessageStructureERKNS_4DataE:
  305|      2|               : mLevel(level),
  306|      2|                 mMaxLineCount(0),
  307|      2|                 mMaxByteCount(0),
  308|      2|                 mExternalLogger(pExternalLogger),
  309|      2|                 mMessageStructure(messageStructure),
  310|      2|                 mInstanceName(instanceName),
  311|      2|                 mKeepAllLogFiles(false),
  312|      2|                 mKeepAllLogFilesSet(false),
  313|      2|                 mId(id),
  314|      2|                 mType(type),
  315|      2|                 mLogger(NULL),
  316|      2|                 mLineCount(0)
  317|      2|            {
  318|      2|               if (logFileName)
  ------------------
  |  Branch (318:20): [True: 0, False: 2]
  ------------------
  319|      0|               {
  320|      0|                  mLogFileName = logFileName;
  321|      0|               }
  322|      2|            }
_ZN5resip3Log13getLoggerDataEv:
  375|      2|      {
  376|      2|         ThreadData* pData = static_cast<ThreadData*>(ThreadIf::tlsGetValue(*Log::mLocalLoggerKey));
  377|      2|         return pData?*pData:mDefaultLoggerData;
  ------------------
  |  Branch (377:17): [True: 0, False: 2]
  ------------------
  378|      2|      }
_ZN5resip3Log14LocalLoggerMapC2Ev:
  385|      2|            : mLastLocalLoggerId(0) {};

Log.cxx:_ZL20genericLogCheckLevelN5resip3Log5LevelERKNS_9SubsystemE:
  145|      2|{
  146|      2|   return resip::Log::isLogging(level, sub);
  147|      2|}

_ZN5resip11ParseBufferC2ERKNS_4DataES3_:
   37|      2|   : mBuff(data.data()),
   38|      2|     mPosition(mBuff),
   39|      2|     mEnd(mBuff + data.size()),
   40|      2|     mErrorContext(errorContext)
   41|      2|{}
_ZN5resip11ParseBuffer14skipBackToCharEc:
  505|      2|{
  506|     18|   while (!bof())
  ------------------
  |  Branch (506:11): [True: 18, False: 0]
  ------------------
  507|     18|   {
  508|     18|      if (*(--mPosition) == c)
  ------------------
  |  Branch (508:11): [True: 2, False: 16]
  ------------------
  509|      2|      {
  510|      2|         return ++mPosition;
  511|      2|      }
  512|     18|   }
  513|      0|   return mBuff;
  514|      2|}

_ZNK5resip11ParseBuffer8positionEv:
  114|      2|      CurrentPosition position() const { return CurrentPosition(*this); }
_ZN5resip11ParseBuffer15CurrentPositionC2ERKS0_:
   52|      4|               mPb(pb)
   53|      4|            {}
_ZNK5resip11ParseBuffer15CurrentPositioncvPKcEv:
   56|      2|            {
   57|      2|               return mPb.mPosition;
   58|      2|            }
_ZNK5resip11ParseBuffer3bofEv:
  111|     18|      bool bof() const { return mPosition <= mBuff;}
_ZN5resip11ParseBuffer9skipToEndEv:
  196|      2|      {
  197|      2|         mPosition = mEnd;
  198|      2|         return CurrentPosition(*this);
  199|      2|      }

_ZNK5resip9Subsystem8getLevelEv:
   56|      2|      Log::Level getLevel() const { return mLevel; }
_ZN5resip9SubsystemC2EPKc:
   59|     34|      explicit Subsystem(const char* rhs) : mSubsystem(rhs), mLevel(Log::None) {};

_ZN5resip8ThreadIf12tlsKeyCreateERjPFvPvE:
  131|      4|{
  132|       |#if defined(WIN32)
  133|       |   key = TlsAlloc();
  134|       |   if (key!=TLS_OUT_OF_INDEXES)
  135|       |   {
  136|       |      Lock lock(*mTlsDestructorsMutex);
  137|       |      (*mTlsDestructors)[key] = destructor;
  138|       |      return 0;
  139|       |   }
  140|       |   else
  141|       |   {
  142|       |      return GetLastError();
  143|       |   }
  144|       |#else
  145|      4|   return pthread_key_create(&key, destructor);
  146|      4|#endif
  147|      4|}
_ZN5resip8ThreadIf11tlsGetValueEj:
  180|      2|{
  181|       |#if defined(WIN32)
  182|       |   return TlsGetValue(key);
  183|       |#else
  184|      2|   return pthread_getspecific(key);
  185|      2|#endif
  186|      2|}

LLVMFuzzerInitialize:
   11|      2|extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv) {
   12|      2|   resip::Log::initialize(resip::Log::Cout, resip::Log::None, *argv[0]);
   13|      2|   return 0;
   14|      2|}
LLVMFuzzerTestOneInput:
   18|    187|                                      unsigned long size) {
   19|       |
   20|    187|   const resip::Data buffer(resip::Data::Share, reinterpret_cast<const char*>(data), size);
   21|       |
   22|    187|   fuzzDnsUtil(buffer);
   23|       |
   24|    187|   return 0;
   25|    187|}
fuzzUtil.cxx:_ZL11fuzzDnsUtilRKN5resip4DataE:
    6|    187|{
    7|    187|   resip::DnsUtil::isIpV4Address(buffer);
    8|    187|   resip::DnsUtil::isIpV6Address(buffer);
    9|    187|}

