summaryrefslogtreecommitdiffstats
path: root/mDNSResponder/mDNSCore
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2018-09-19 08:57:22 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-09-20 11:23:34 +0200
commit272360946778648e9090941ad1aa43b60d5031a3 (patch)
tree89ba96a3f9d797190a8d423232f1c04c3d0c8432 /mDNSResponder/mDNSCore
parentmDNSResponder: Update to v878.20.3 (diff)
downloadrtems-libbsd-272360946778648e9090941ad1aa43b60d5031a3.tar.bz2
mDNSResponder: Update to v878.30.4
The sources can be obtained via: https://opensource.apple.com/tarballs/mDNSResponder/mDNSResponder-878.30.4.tar.gz Close #3522.
Diffstat (limited to 'mDNSResponder/mDNSCore')
-rwxr-xr-xmDNSResponder/mDNSCore/mDNS.c15
-rwxr-xr-xmDNSResponder/mDNSCore/mDNSEmbeddedAPI.h6
-rwxr-xr-xmDNSResponder/mDNSCore/uDNS.c15
3 files changed, 27 insertions, 9 deletions
diff --git a/mDNSResponder/mDNSCore/mDNS.c b/mDNSResponder/mDNSCore/mDNS.c
index 0d4d8ae4..72375d94 100755
--- a/mDNSResponder/mDNSCore/mDNS.c
+++ b/mDNSResponder/mDNSCore/mDNS.c
@@ -1,6 +1,6 @@
/* -*- Mode: C; tab-width: 4 -*-
*
- * Copyright (c) 2002-2015 Apple Inc. All rights reserved.
+ * Copyright (c) 2002-2017 Apple Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -4170,12 +4170,12 @@ mDNSexport void AnswerCurrentQuestionWithResourceRecord(mDNS *const m, CacheReco
responseLatencyMs = 0;
}
- MetricsUpdateUDNSQueryStats(queryName, q->qtype, &rr->resrec, q->metrics.querySendCount, responseLatencyMs, isForCellular);
+ MetricsUpdateDNSQueryStats(queryName, q->qtype, &rr->resrec, q->metrics.querySendCount, responseLatencyMs, isForCellular);
q->metrics.answered = mDNStrue;
}
if (q->metrics.querySendCount > 0)
{
- MetricsUpdateUDNSResolveStats(queryName, &rr->resrec, isForCellular);
+ MetricsUpdateDNSResolveStats(queryName, &rr->resrec, isForCellular);
}
}
#endif
@@ -8944,6 +8944,13 @@ mDNSlocal void mDNSCoreReceiveResponse(mDNS *const m,
response->h.numAuthorities, response->h.numAuthorities == 1 ? "y, " : "ies,",
response->h.numAdditionals, response->h.numAdditionals == 1 ? " " : "s", end - response->data, LLQType);
+#if AWD_METRICS
+ if (mDNSSameIPPort(srcport, UnicastDNSPort))
+ {
+ MetricsUpdateDNSResponseSize((mDNSu32)(end - (mDNSu8 *)response));
+ }
+#endif
+
// According to RFC 2181 <http://www.ietf.org/rfc/rfc2181.txt>
// When a DNS client receives a reply with TC
// set, it should ignore that response, and query again, using a
@@ -12127,7 +12134,7 @@ mDNSexport mStatus mDNS_StopQuery_internal(mDNS *const m, DNSQuestion *const que
queryName = question->metrics.originalQName ? question->metrics.originalQName : &question->qname;
isForCell = (question->qDNSServer && question->qDNSServer->cellIntf);
durationMs = ((m->timenow - question->metrics.firstQueryTime) * 1000) / mDNSPlatformOneSecond;
- MetricsUpdateUDNSQueryStats(queryName, question->qtype, mDNSNULL, question->metrics.querySendCount, durationMs, isForCell);
+ MetricsUpdateDNSQueryStats(queryName, question->qtype, mDNSNULL, question->metrics.querySendCount, durationMs, isForCell);
}
#endif
// Take care to cut question from list *before* calling UpdateQuestionDuplicates
diff --git a/mDNSResponder/mDNSCore/mDNSEmbeddedAPI.h b/mDNSResponder/mDNSCore/mDNSEmbeddedAPI.h
index 0e96058d..72ff7ca1 100755
--- a/mDNSResponder/mDNSCore/mDNSEmbeddedAPI.h
+++ b/mDNSResponder/mDNSCore/mDNSEmbeddedAPI.h
@@ -1,6 +1,6 @@
/* -*- Mode: C; tab-width: 4 -*-
*
- * Copyright (c) 2002-2015 Apple Inc. All rights reserved.
+ * Copyright (c) 2002-2017 Apple Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1896,7 +1896,7 @@ typedef enum { DNSSECValNotRequired = 0, DNSSECValRequired, DNSSECValInProgress,
// RFC 4122 defines it to be 16 bytes
#define UUID_SIZE 16
-#define AWD_METRICS (USE_AWD && TARGET_OS_EMBEDDED)
+#define AWD_METRICS (USE_AWD && TARGET_OS_IOS)
#if AWD_METRICS
typedef struct
@@ -2039,7 +2039,7 @@ struct DNSQuestion_struct
domainname *qnameOrig; // Copy of the original question name if it is not fully qualified
mDNSQuestionCallback *QuestionCallback;
void *QuestionContext;
-#if TARGET_OS_EMBEDDED
+#if AWD_METRICS
uDNSMetrics metrics; // Data used for collecting unicast DNS query metrics.
#endif
#if USE_DNS64
diff --git a/mDNSResponder/mDNSCore/uDNS.c b/mDNSResponder/mDNSCore/uDNS.c
index dc87724c..4d011427 100755
--- a/mDNSResponder/mDNSCore/uDNS.c
+++ b/mDNSResponder/mDNSCore/uDNS.c
@@ -1,6 +1,6 @@
/* -*- Mode: C; tab-width: 4 -*-
*
- * Copyright (c) 2002-2015 Apple Inc. All rights reserved.
+ * Copyright (c) 2002-2017 Apple Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,10 @@
#endif
#include "uDNS.h"
+#if AWD_METRICS
+#include "Metrics.h"
+#endif
+
#if (defined(_MSC_VER))
// Disable "assignment within conditional expression".
// Other compilers understand the convention that if you place the assignment expression within an extra pair
@@ -1329,6 +1333,12 @@ mDNSlocal void tcpCallback(TCPSocket *sock, void *context, mDNSBool ConnectionEs
err = mDNSSendDNSMessage(m, &tcpInfo->request, end, mDNSInterface_Any, mDNSNULL, &tcpInfo->Addr, tcpInfo->Port, sock, AuthInfo, mDNSfalse);
if (err) { debugf("ERROR: tcpCallback: mDNSSendDNSMessage - %d", err); err = mStatus_UnknownErr; goto exit; }
+#if AWD_METRICS
+ if (mDNSSameIPPort(tcpInfo->Port, UnicastDNSPort))
+ {
+ MetricsUpdateDNSQuerySize((mDNSu32)(end - (mDNSu8 *)&tcpInfo->request));
+ }
+#endif
// Record time we sent this question
if (q)
@@ -4758,9 +4768,10 @@ mDNSexport void uDNS_CheckCurrentQuestion(mDNS *const m)
else
{
err = mDNSSendDNSMessage(m, &m->omsg, end, q->qDNSServer->interface, q->LocalSocket, &q->qDNSServer->addr, q->qDNSServer->port, mDNSNULL, mDNSNULL, q->UseBackgroundTrafficClass);
-#if TARGET_OS_EMBEDDED
+#if AWD_METRICS
if (!err)
{
+ MetricsUpdateDNSQuerySize((mDNSu32)(end - (mDNSu8 *)&m->omsg));
if (q->metrics.answered)
{
q->metrics.querySendCount = 0;