]> git.saurik.com Git - apple/mdnsresponder.git/blob - mDNSMacOSX/dnssd_analytics.h
mDNSResponder-1310.40.42.tar.gz
[apple/mdnsresponder.git] / mDNSMacOSX / dnssd_analytics.h
1 /*
2 * Copyright (c) 2019 Apple Inc. All rights reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 #ifndef __DNSSD_ANALYTICS_H__
18 #define __DNSSD_ANALYTICS_H__
19
20 #include "DNSCommon.h"
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 #if MDNSRESPONDER_SUPPORTS(APPLE, ANALYTICS)
27
28 extern void
29 dnssd_analytics_init(void);
30
31 #endif // ANALYTICS
32
33 #if MDNSRESPONDER_SUPPORTS(APPLE, CACHE_ANALYTICS)
34
35 typedef enum {
36 CacheRequestType_multicast,
37 CacheRequestType_unicast
38 } CacheRequestType;
39
40 typedef enum {
41 CacheState_hit,
42 CacheState_miss
43 } CacheState;
44
45 extern void
46 dnssd_analytics_update_cache_request(CacheRequestType inType, CacheState inState);
47
48 extern void
49 dnssd_analytics_update_cache_usage_counts(uint32_t inHitMulticastCount, uint32_t inMissMulticastCount, uint32_t inHitUnicastCount, uint32_t inMissUnicastCount);
50
51 #endif // CACHE_ANALYTICS
52
53 #if MDNSRESPONDER_SUPPORTS(APPLE, WAB_ANALYTICS)
54
55 typedef enum {
56 WABUsageKind_results,
57 WABUsageKind_session,
58 WABUsageKind_operation
59 } WABUsageKind;
60
61 typedef enum {
62 WABUsageType_enumeration,
63 WABUsageType_query,
64 WABUsageType_push,
65 WABUsageType_llq
66 } WABUsageType;
67
68 typedef enum {
69 // Kind: results
70 // Type: enumeration, query, llq
71 WABUsageEvent_positive,
72 WABUsageEvent_negative,
73 WABUsageEvent_null,
74 WABUsageEvent_error,
75
76 // Kind: session
77 // Type: push, llq
78 WABUsageEvent_connected,
79 WABUsageEvent_session,
80 WABUsageEvent_reset,
81 WABUsageEvent_idledOut,
82 WABUsageEvent_goAway,
83 WABUsageEvent_resumedGood,
84 WABUsageEvent_resumedBad,
85
86 // Kind: operation
87 // Type: push, llq
88 WABUsageEvent_succeeded,
89 WABUsageEvent_rejected,
90 WABUsageEvent_dsoni,
91 WABUsageEvent_answered
92 } WABUsageEvent;
93
94 extern void
95 dnssd_analytics_post_WAB_usage_event_count(WABUsageKind inKind, WABUsageType inType, WABUsageEvent inEvent, uint64_t inEventCount);
96
97 #endif // WAB_ANALYTICS
98
99 #ifdef __cplusplus
100 }
101 #endif
102
103 #endif // __DNSSD_ANALYTICS_H__