react-native-zeroconf 0.17.3 → 1.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/NOTICE +2 -6
  2. package/README.md +1 -1
  3. package/android/CMakeLists.txt +64 -0
  4. package/android/build.gradle +1 -17
  5. package/android/generated/java/com/balthazargronon/RCTZeroconf/NativeZeroconfSpec.java +96 -0
  6. package/android/generated/jni/CMakeLists.txt +28 -0
  7. package/android/generated/jni/RNZeroconfSpec-generated.cpp +77 -0
  8. package/android/generated/jni/RNZeroconfSpec.h +31 -0
  9. package/android/generated/jni/react/renderer/components/RNZeroconfSpec/RNZeroconfSpecJSI.h +798 -0
  10. package/android/src/main/java/com/balthazargronon/RCTZeroconf/{ZeroconfModule.java → NsdHost.java} +97 -140
  11. package/android/src/main/java/com/balthazargronon/RCTZeroconf/NsdPayload.java +87 -0
  12. package/android/src/main/java/com/balthazargronon/RCTZeroconf/NsdPromise.java +40 -0
  13. package/android/src/main/java/com/balthazargronon/RCTZeroconf/Zeroconf.java +4 -6
  14. package/android/src/main/java/com/balthazargronon/RCTZeroconf/ZeroconfNativeSupport.java +60 -0
  15. package/android/src/main/java/com/balthazargronon/RCTZeroconf/ZeroconfOptions.java +15 -26
  16. package/android/src/main/java/com/balthazargronon/RCTZeroconf/ZeroconfReactPackage.java +5 -15
  17. package/android/src/main/java/com/balthazargronon/RCTZeroconf/nsd/NsdServiceImpl.java +90 -96
  18. package/android/src/main/jni/mdnsresponder/mDNSShared/dnssd_clientshim.c +31 -6
  19. package/cpp/Backend.cpp +16 -0
  20. package/cpp/Backend.h +116 -0
  21. package/cpp/ZeroconfModule.cpp +280 -0
  22. package/cpp/ZeroconfModule.h +144 -0
  23. package/cpp/android/NsdBackend.cpp +462 -0
  24. package/cpp/android/NsdBackend.h +61 -0
  25. package/cpp/android/ZeroconfAndroidModule.cpp +49 -0
  26. package/cpp/android/ZeroconfAndroidModule.h +15 -0
  27. package/cpp/apple/DispatchExecutor.cpp +66 -0
  28. package/cpp/apple/DispatchExecutor.h +37 -0
  29. package/cpp/apple/LocalNetworkAccess.h +19 -0
  30. package/cpp/apple/LocalNetworkAccess.mm +87 -0
  31. package/cpp/dnssd/DnssdBackend.cpp +976 -0
  32. package/cpp/dnssd/DnssdBackend.h +114 -0
  33. package/cpp/dnssd/Executor.h +28 -0
  34. package/cpp/embedded/EmbeddedExecutor.cpp +124 -0
  35. package/cpp/embedded/EmbeddedExecutor.h +57 -0
  36. package/ios/ZeroconfOnLoad.mm +34 -0
  37. package/ios/generated/ReactCodegen/RNZeroconfSpec/RNZeroconfSpec-generated.mm +140 -0
  38. package/ios/generated/ReactCodegen/RNZeroconfSpec/RNZeroconfSpec.h +189 -0
  39. package/ios/generated/ReactCodegen/RNZeroconfSpecJSI.h +798 -0
  40. package/lib/module/NativeZeroconf.js +15 -0
  41. package/lib/module/NativeZeroconf.js.map +1 -0
  42. package/lib/module/bridge.js +124 -0
  43. package/lib/module/bridge.js.map +1 -0
  44. package/{dist → lib/module}/index.js +149 -149
  45. package/lib/module/index.js.map +1 -0
  46. package/lib/module/package.json +1 -0
  47. package/lib/module/types.js +24 -0
  48. package/lib/module/types.js.map +1 -0
  49. package/lib/typescript/package.json +1 -0
  50. package/lib/typescript/src/NativeZeroconf.d.ts +75 -0
  51. package/lib/typescript/src/NativeZeroconf.d.ts.map +1 -0
  52. package/lib/typescript/src/bridge.d.ts +22 -0
  53. package/lib/typescript/src/bridge.d.ts.map +1 -0
  54. package/lib/typescript/src/index.d.ts +111 -0
  55. package/lib/typescript/src/index.d.ts.map +1 -0
  56. package/lib/typescript/src/types.d.ts +175 -0
  57. package/lib/typescript/src/types.d.ts.map +1 -0
  58. package/package.json +64 -29
  59. package/react-native-zeroconf.podspec +2 -1
  60. package/react-native.config.js +17 -0
  61. package/src/NativeZeroconf.ts +120 -0
  62. package/src/bridge.ts +153 -0
  63. package/src/index.ts +607 -0
  64. package/{index.d.ts → src/types.ts} +5 -99
  65. package/windows/RNZeroconf/RNZeroconf.vcxproj +17 -2
  66. package/windows/RNZeroconf/RNZeroconf.vcxproj.filters +0 -6
  67. package/windows/RNZeroconf/ReactPackageProvider.cpp +23 -20
  68. package/windows/RNZeroconf/WindowsBackend.cpp +156 -0
  69. package/windows/RNZeroconf/WindowsBackend.h +13 -0
  70. package/windows/RNZeroconf/ZeroconfCore.cpp +2 -2
  71. package/windows/RNZeroconf/ZeroconfCore.h +2 -2
  72. package/windows/RNZeroconf/ZeroconfWindowsModule.cpp +22 -0
  73. package/windows/RNZeroconf/ZeroconfWindowsModule.h +14 -0
  74. package/android/src/main/java/com/balthazargronon/RCTZeroconf/ZeroConfImplFactory.java +0 -56
  75. package/android/src/main/java/com/balthazargronon/RCTZeroconf/dnssd/DnssdImpl.java +0 -654
  76. package/android/src/main/java/com/github/druk/dnssd/BaseListener.java +0 -33
  77. package/android/src/main/java/com/github/druk/dnssd/BrowseListener.java +0 -67
  78. package/android/src/main/java/com/github/druk/dnssd/DNSRecord.java +0 -47
  79. package/android/src/main/java/com/github/druk/dnssd/DNSSD.java +0 -681
  80. package/android/src/main/java/com/github/druk/dnssd/DNSSDEmbedded.java +0 -198
  81. package/android/src/main/java/com/github/druk/dnssd/DNSSDException.java +0 -66
  82. package/android/src/main/java/com/github/druk/dnssd/DNSSDRecordRegistrar.java +0 -55
  83. package/android/src/main/java/com/github/druk/dnssd/DNSSDRegistration.java +0 -54
  84. package/android/src/main/java/com/github/druk/dnssd/DNSSDService.java +0 -35
  85. package/android/src/main/java/com/github/druk/dnssd/DomainListener.java +0 -57
  86. package/android/src/main/java/com/github/druk/dnssd/InternalBrowseListener.java +0 -76
  87. package/android/src/main/java/com/github/druk/dnssd/InternalDNSSD.java +0 -870
  88. package/android/src/main/java/com/github/druk/dnssd/InternalDNSSDRecordRegistrar.java +0 -30
  89. package/android/src/main/java/com/github/druk/dnssd/InternalDNSSDRegistration.java +0 -34
  90. package/android/src/main/java/com/github/druk/dnssd/InternalDNSSDService.java +0 -29
  91. package/android/src/main/java/com/github/druk/dnssd/InternalDomainListener.java +0 -62
  92. package/android/src/main/java/com/github/druk/dnssd/InternalQueryListener.java +0 -61
  93. package/android/src/main/java/com/github/druk/dnssd/InternalRegisterListener.java +0 -51
  94. package/android/src/main/java/com/github/druk/dnssd/InternalResolveListener.java +0 -58
  95. package/android/src/main/java/com/github/druk/dnssd/NSClass.java +0 -16
  96. package/android/src/main/java/com/github/druk/dnssd/NSType.java +0 -58
  97. package/android/src/main/java/com/github/druk/dnssd/QueryListener.java +0 -54
  98. package/android/src/main/java/com/github/druk/dnssd/RegisterListener.java +0 -46
  99. package/android/src/main/java/com/github/druk/dnssd/RegisterRecordListener.java +0 -35
  100. package/android/src/main/java/com/github/druk/dnssd/ResolveListener.java +0 -55
  101. package/android/src/main/java/com/github/druk/dnssd/TXTRecord.java +0 -293
  102. package/android/src/main/jni/Android.mk +0 -73
  103. package/android/src/main/jni/Application.mk +0 -3
  104. package/android/src/main/jni/DNSSD.java.h +0 -290
  105. package/android/src/main/jni/JNISupport.c +0 -1221
  106. package/ios/RNZeroconf/RNNetServiceSerializer.h +0 -31
  107. package/ios/RNZeroconf/RNNetServiceSerializer.m +0 -84
  108. package/ios/RNZeroconf/RNZeroconf.h +0 -17
  109. package/ios/RNZeroconf/RNZeroconf.m +0 -1025
  110. package/ios/RNZeroconf.xcodeproj/project.pbxproj +0 -261
  111. package/ios/RNZeroconf.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
  112. package/src/index.js +0 -563
  113. package/windows/RNZeroconf/RNZeroconf.cpp +0 -228
  114. package/windows/RNZeroconf/RNZeroconf.h +0 -70
@@ -1,30 +0,0 @@
1
- package com.github.druk.dnssd;
2
-
3
-
4
- class InternalDNSSDRecordRegistrar implements DNSSDRecordRegistrar {
5
-
6
- final private InternalDNSSDService.DnssdServiceListener listener;
7
- final private DNSSDRecordRegistrar originalService;
8
- private boolean isStopped = false;
9
-
10
- InternalDNSSDRecordRegistrar(InternalDNSSDService.DnssdServiceListener listener, DNSSDRecordRegistrar registration) {
11
- this.listener = listener;
12
- this.originalService = registration;
13
- }
14
-
15
- @Override
16
- public DNSRecord registerRecord(int flags, int ifIndex, String fullname, int rrtype, int rrclass, byte[] rData, int ttl) throws DNSSDException {
17
- return originalService.registerRecord(flags, ifIndex, fullname, rrtype, rrclass, rData, ttl);
18
- }
19
-
20
- @Override
21
- public void stop() {
22
- originalService.stop();
23
- synchronized (this) {
24
- if (!isStopped) {
25
- listener.onServiceStopped();
26
- isStopped = true;
27
- }
28
- }
29
- }
30
- }
@@ -1,34 +0,0 @@
1
- package com.github.druk.dnssd;
2
-
3
- class InternalDNSSDRegistration implements DNSSDRegistration {
4
-
5
- final private InternalDNSSDService.DnssdServiceListener listener;
6
- final private DNSSDRegistration originalDNSSDService;
7
- private boolean isStopped = false;
8
-
9
- InternalDNSSDRegistration(InternalDNSSDService.DnssdServiceListener listener, DNSSDRegistration registration) {
10
- this.listener = listener;
11
- this.originalDNSSDService = registration;
12
- }
13
-
14
- @Override
15
- public DNSRecord getTXTRecord() throws DNSSDException {
16
- return originalDNSSDService.getTXTRecord();
17
- }
18
-
19
- @Override
20
- public DNSRecord addRecord(int flags, int rrType, byte[] rData, int ttl) throws DNSSDException {
21
- return originalDNSSDService.addRecord(flags, rrType, rData, ttl);
22
- }
23
-
24
- @Override
25
- public void stop() {
26
- originalDNSSDService.stop();
27
- synchronized (this) {
28
- if (!isStopped) {
29
- listener.onServiceStopped();
30
- isStopped = true;
31
- }
32
- }
33
- }
34
- }
@@ -1,29 +0,0 @@
1
- package com.github.druk.dnssd;
2
-
3
-
4
- class InternalDNSSDService implements DNSSDService {
5
-
6
- final private DnssdServiceListener listener;
7
- final private DNSSDService originalDNSSDService;
8
- private boolean isStopped = false;
9
-
10
- interface DnssdServiceListener {
11
- void onServiceStarting();
12
- void onServiceStopped();
13
- }
14
-
15
- InternalDNSSDService(DnssdServiceListener listener, DNSSDService DNSSDService) {
16
- this.listener = listener;
17
- this.originalDNSSDService = DNSSDService;
18
- }
19
-
20
- public void stop() {
21
- originalDNSSDService.stop();
22
- synchronized (this) {
23
- if (!isStopped) {
24
- listener.onServiceStopped();
25
- isStopped = true;
26
- }
27
- }
28
- }
29
- }
@@ -1,62 +0,0 @@
1
- /* -*- Mode: Java; tab-width: 4 -*-
2
- *
3
- * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
-
18
-
19
- package com.github.druk.dnssd;
20
-
21
- //CHECKSTYLE:OFF
22
-
23
- /**
24
- A listener that receives results from {@link InternalDNSSD#enumerateDomains}.
25
- */
26
-
27
- interface InternalDomainListener extends BaseListener
28
- {
29
- /** Called to report discovered domains.<P>
30
-
31
- @param domainEnum
32
- The active domain enumerator.
33
- @param flags
34
- Possible values are: DNSSD.MORE_COMING, DNSSD.DEFAULT
35
- <P>
36
- @param ifIndex
37
- Specifies the interface on which the domain exists. (The index for a given
38
- interface is determined via the if_nametoindex() family of calls.)
39
- <P>
40
- @param domain
41
- The name of the domain.
42
- */
43
- void domainFound(DNSSDService domainEnum, int flags, int ifIndex, byte[] domain);
44
-
45
- /** Called to report that a domain has disappeared.<P>
46
-
47
- @param domainEnum
48
- The active domain enumerator.
49
- @param flags
50
- Possible values are: DNSSD.MORE_COMING, DNSSD.DEFAULT
51
- <P>
52
- @param ifIndex
53
- Specifies the interface on which the domain exists. (The index for a given
54
- interface is determined via the if_nametoindex() family of calls.)
55
- <P>
56
- @param domain
57
- The name of the domain.
58
- */
59
- void domainLost(DNSSDService domainEnum, int flags, int ifIndex, byte[] domain);
60
- }
61
-
62
- //CHECKSTYLE:ON
@@ -1,61 +0,0 @@
1
- /* -*- Mode: Java; tab-width: 4 -*-
2
- *
3
- * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
-
18
-
19
- package com.github.druk.dnssd;
20
-
21
- //CHECKSTYLE:OFF
22
-
23
- /** A listener that receives results from {@link InternalDNSSD#queryRecord}. */
24
-
25
- interface InternalQueryListener extends BaseListener
26
- {
27
- /** Called when a record query has been completed. Inspect flags
28
- parameter to determine nature of query event.<P>
29
-
30
- @param query
31
- The active query object.
32
- <P>
33
- @param flags
34
- If kDNSServiceFlagsAdd bit is set, this is a newly discovered answer;
35
- otherwise this is a previously discovered answer which has expired.
36
- Other possible values are DNSSD.MORE_COMING.
37
- <P>
38
- @param ifIndex
39
- The interface on which the query was resolved. (The index for a given
40
- interface is determined via the if_nametoindex() family of calls.)
41
- <P>
42
- @param fullName
43
- The resource record's full domain name.
44
- <P>
45
- @param rrtype
46
- The resource record's type (e.g. PTR, SRV, etc) as defined by RFC 1035 and its updates.
47
- <P>
48
- @param rrclass
49
- The class of the resource record, as defined by RFC 1035 and its updates.
50
- <P>
51
- @param rdata
52
- The raw rdata of the resource record.
53
- <P>
54
- @param ttl
55
- The resource record's time to live, in seconds.
56
- */
57
- void queryAnswered(DNSSDService query, int flags, int ifIndex, byte[] fullName,
58
- int rrtype, int rrclass, byte[] rdata, int ttl);
59
- }
60
-
61
- //CHECKSTYLE:ON
@@ -1,51 +0,0 @@
1
- /* -*- Mode: Java; tab-width: 4 -*-
2
- *
3
- * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
-
18
-
19
- package com.github.druk.dnssd;
20
-
21
- //CHECKSTYLE:OFF
22
-
23
- /** A listener that receives results from {@link InternalDNSSD#register}. */
24
-
25
- interface InternalRegisterListener extends BaseListener
26
- {
27
- /** Called when a registration has been completed.<P>
28
-
29
- @param registration
30
- The active registration.
31
- <P>
32
- @param flags
33
- Currently unused, reserved for future use.
34
- <P>
35
- @param serviceName
36
- The service name registered (if the application did not specify a name in
37
- DNSSD.register(), this indicates what name was automatically chosen).
38
- <P>
39
- @param regType
40
- The type of service registered, as it was passed to DNSSD.register().
41
- <P>
42
- @param domain
43
- The domain on which the service was registered. If the application did not
44
- specify a domain in DNSSD.register(), this is the default domain
45
- on which the service was registered.
46
- */
47
- void serviceRegistered(DNSSDRegistration registration, int flags, byte[] serviceName,
48
- byte[] regType, byte[] domain);
49
- }
50
-
51
- //CHECKSTYLE:ON
@@ -1,58 +0,0 @@
1
- /* -*- Mode: Java; tab-width: 4 -*-
2
- *
3
- * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
-
18
-
19
- package com.github.druk.dnssd;
20
-
21
- //CHECKSTYLE:OFF
22
-
23
- /** A listener that receives results from {@link InternalDNSSD#resolve}. */
24
-
25
- interface InternalResolveListener extends BaseListener
26
- {
27
- /** Called when a service has been resolved.<P>
28
-
29
- @param resolver
30
- The active resolver object.
31
- <P>
32
- @param flags
33
- Currently unused, reserved for future use.
34
- <P>
35
- @param fullName
36
- The full service domain name, in the form &lt;servicename&gt;.&lt;protocol&gt;.&lt;domain&gt;.
37
- (Any literal dots (".") are escaped with a backslash ("\."), and literal
38
- backslashes are escaped with a second backslash ("\\"), e.g. a web server
39
- named "Dr. Pepper" would have the fullname "Dr\.\032Pepper._http._tcp.local.").
40
- This is the appropriate format to pass to standard system DNS APIs such as
41
- res_query(), or to the special-purpose functions included in this API that
42
- take fullname parameters.
43
- <P>
44
- @param hostName
45
- The target hostname of the machine providing the service. This name can
46
- be passed to functions like queryRecord() to look up the host's IP address.
47
- <P>
48
- @param port
49
- The port number on which connections are accepted for this service.
50
- <P>
51
- @param txtRecord
52
- The service's primary txt record.
53
- */
54
- void serviceResolved(DNSSDService resolver, int flags, int ifIndex, byte[] fullName,
55
- byte[] hostName, int port, TXTRecord txtRecord);
56
- }
57
-
58
- //CHECKSTYLE:ON
@@ -1,16 +0,0 @@
1
- package com.github.druk.dnssd;
2
-
3
- // Copied from nameser.h
4
- @SuppressWarnings(value = "")
5
- public class NSClass {
6
-
7
- public final static int INVALID = 0; /* Cookie. */
8
- public final static int IN = 1; /* Internet. */
9
- public final static int CLASS2 = 2; /* unallocated/unsupported. */
10
- public final static int CHAOS = 3; /* MIT Chaos-net. */
11
- public final static int HS = 4; /* MIT Hesiod. */
12
- /* Query class values which do not appear in resource records */
13
- public final static int NONE = 254; /* for prereq. sections in update requests */
14
- public final static int ANY = 255; /* Wildcard match. */
15
- public final static int MAX = 65536;
16
- }
@@ -1,58 +0,0 @@
1
- package com.github.druk.dnssd;
2
-
3
- // Copied from nameser.h
4
- public class NSType {
5
-
6
- public final static int INVALID = 0; /* Cookie. */
7
- public final static int A = 1; /* Host address. */
8
- public final static int NS = 2; /* Authoritative server. */
9
- public final static int MD = 3; /* Mail destination. */
10
- public final static int MF = 4; /* Mail forwarder. */
11
- public final static int CNAME = 5; /* Canonical name. */
12
- public final static int SOA = 6; /* Start of authority zone. */
13
- public final static int MB = 7; /* Mailbox domain name. */
14
- public final static int MG = 8; /* Mail group member. */
15
- public final static int MR = 9; /* Mail rename name. */
16
- public final static int NULL = 10; /* Null resource record. */
17
- public final static int WKS = 11; /* Well known service. */
18
- public final static int PTR = 12; /* Domain name pointer. */
19
- public final static int HINFO = 13; /* Host information. */
20
- public final static int MINFO = 14; /* Mailbox information. */
21
- public final static int MX = 15; /* Mail routing information. */
22
- public final static int TXT = 16; /* Text strings. */
23
- public final static int RP = 17; /* Responsible person. */
24
- public final static int AFSDB = 18; /* AFS cell database. */
25
- public final static int X25 = 19; /* X_25 calling address. */
26
- public final static int ISDN = 20; /* ISDN calling address. */
27
- public final static int RT = 21; /* Router. */
28
- public final static int NSAP = 22; /* NSAP address. */
29
- public final static int NSAP_PTR = 23; /* Reverse NSAP lookup = deprecated). */
30
- public final static int SIG = 24; /* Security signature. */
31
- public final static int KEY = 25; /* Security key. */
32
- public final static int PX = 26; /* X.400 mail mapping. */
33
- public final static int GPOS = 27; /* Geographical position = withdrawn). */
34
- public final static int AAAA = 28; /* Ip6 Address. */
35
- public final static int LOC = 29; /* Location Information. */
36
- public final static int NXT = 30; /* Next domain (security). */
37
- public final static int EID = 31; /* Endpoint identifier. */
38
- public final static int NIMLOC = 32; /* Nimrod Locator. */
39
- public final static int SRV = 33; /* Server Selection. */
40
- public final static int ATMA = 34; /* ATM Address */
41
- public final static int NAPTR = 35; /* Naming Authority PoinTeR */
42
- public final static int KX = 36; /* Key Exchange */
43
- public final static int CERT = 37; /* Certification record */
44
- public final static int A6 = 38; /* IPv6 address = deprecates AAAA) */
45
- public final static int DNAME = 39; /* Non-terminal DNAME (for IPv6) */
46
- public final static int SINK = 40; /* Kitchen sink (experimentatl) */
47
- public final static int OPT = 41; /* EDNS0 option (meta-RR) */
48
- public final static int TKEY = 249; /* Transaction key */
49
- public final static int TSIG = 250; /* Transaction signature. */
50
- public final static int IXFR = 251; /* Incremental zone transfer. */
51
- public final static int AXFR = 252; /* Transfer zone of authority. */
52
- public final static int MAILB = 253; /* Transfer mailbox records. */
53
- public final static int MAILA = 254; /* Transfer mail agent records. */
54
- public final static int ANY = 255; /* Wildcard match. */
55
- public final static int ZXFR = 256; /* BIND-specific, nonstandard. */
56
- public final static int MAX = 65536;
57
-
58
- }
@@ -1,54 +0,0 @@
1
- /*
2
- * Copyright (C) 2016 Andriy Druk
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
- package com.github.druk.dnssd;
18
-
19
- /** A listener that receives results from {@link InternalDNSSD#queryRecord}. */
20
-
21
- public interface QueryListener extends BaseListener {
22
- /** Called when a record query has been completed. Inspect flags
23
- parameter to determine nature of query event.<P>
24
- * @param query
25
- The active query object.
26
- <P>
27
- * @param flags
28
- If kDNSServiceFlagsAdd bit is set, this is a newly discovered answer;
29
- otherwise this is a previously discovered answer which has expired.
30
- Other possible values are DNSSD.MORE_COMING.
31
- <P>
32
- * @param ifIndex
33
- The interface on which the query was resolved. (The index for a given
34
- interface is determined via the if_nametoindex() family of calls.)
35
- <P>
36
- * @param fullName
37
- The resource record's full domain name.
38
- <P>
39
- * @param rrtype
40
- The resource record's type (e.g. PTR, SRV, etc) as defined by RFC 1035 and its updates.
41
- <P>
42
- * @param rrclass
43
- The class of the resource record, as defined by RFC 1035 and its updates.
44
- <P>
45
- * @param rdata
46
- The raw rdata of the resource record.
47
- <P>
48
- * @param ttl
49
- The resource record's time to live, in seconds.
50
-
51
- */
52
- void queryAnswered(DNSSDService query, int flags, int ifIndex, String fullName, int rrtype, int rrclass, byte[] rdata, int ttl);
53
- }
54
-
@@ -1,46 +0,0 @@
1
- /*
2
- * Copyright (C) 2016 Andriy Druk
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
- package com.github.druk.dnssd;
18
-
19
-
20
- /** A listener that receives results from {@link InternalDNSSD#register}. */
21
-
22
- public interface RegisterListener extends BaseListener
23
- {
24
- /** Called when a registration has been completed.<P>
25
-
26
- @param registration
27
- The active registration.
28
- <P>
29
- @param flags
30
- Currently unused, reserved for future use.
31
- <P>
32
- @param serviceName
33
- The service name registered (if the application did not specify a name in
34
- DNSSD.register(), this indicates what name was automatically chosen).
35
- <P>
36
- @param regType
37
- The type of service registered, as it was passed to DNSSD.register().
38
- <P>
39
- @param domain
40
- The domain on which the service was registered. If the application did not
41
- specify a domain in DNSSD.register(), this is the default domain
42
- on which the service was registered.
43
- */
44
- void serviceRegistered(DNSSDRegistration registration, int flags, String serviceName, String regType, String domain);
45
- }
46
-
@@ -1,35 +0,0 @@
1
- /*
2
- * Copyright (C) 2016 Andriy Druk
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
- package com.github.druk.dnssd;
18
-
19
-
20
- /** A listener that receives results from {@link DNSSDRecordRegistrar#registerRecord}. */
21
-
22
- public interface RegisterRecordListener extends BaseListener
23
- {
24
- /** Called when a record registration succeeds.<P>
25
-
26
- @param record
27
- A {@link DNSRecord}.
28
- <P>
29
- @param flags
30
- Currently ignored, reserved for future use.
31
- <P>
32
- */
33
- void recordRegistered(DNSRecord record, int flags);
34
- }
35
-
@@ -1,55 +0,0 @@
1
- /*
2
- * Copyright (C) 2016 Andriy Druk
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
- package com.github.druk.dnssd;
18
-
19
-
20
- import java.util.Map;
21
-
22
- /** A listener that receives results from {@link InternalDNSSD#resolve}. */
23
-
24
- public interface ResolveListener extends BaseListener
25
- {
26
- /** Called when a service has been resolved.<P>
27
-
28
- @param resolver
29
- The active resolver object.
30
- <P>
31
- @param flags
32
- Currently unused, reserved for future use.
33
- <P>
34
- @param fullName
35
- The full service domain name, in the form &lt;servicename&gt;.&lt;protocol&gt;.&lt;domain&gt;.
36
- (Any literal dots (".") are escaped with a backslash ("\."), and literal
37
- backslashes are escaped with a second backslash ("\\"), e.g. a web server
38
- named "Dr. Pepper" would have the fullname "Dr\.\032Pepper._http._tcp.local.").
39
- This is the appropriate format to pass to standard system DNS APIs such as
40
- res_query(), or to the special-purpose functions included in this API that
41
- take fullname parameters.
42
- <P>
43
- @param hostName
44
- The target hostname of the machine providing the service. This name can
45
- be passed to functions like queryRecord() to look up the host's IP address.
46
- <P>
47
- @param port
48
- The port number on which connections are accepted for this service.
49
- <P>
50
- @param txtRecord
51
- The service's primary txt record.
52
- */
53
- void serviceResolved(DNSSDService resolver, int flags, int ifIndex, String fullName, String hostName, int port, Map<String, String> txtRecord);
54
- }
55
-