PageRenderTime 42ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/src/net/java/sip/communicator/impl/protocol/zeroconf/jmdns/DNSConstants.java

https://gitlab.com/yorty.ruiz/jitsi
Java | 160 lines | 100 code | 11 blank | 49 comment | 0 complexity | f35f01915f8e8be918a2ab4731ff7d3c MD5 | raw file
  1. /*
  2. * Jitsi, the OpenSource Java VoIP and Instant Messaging client.
  3. *
  4. * Copyright 2003-2005 Arthur van Hoff, Rick Blair
  5. *
  6. * Licensed under the Apache License, Version 2.0 (the "License");
  7. * you may not use this file except in compliance with the License.
  8. * You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. package net.java.sip.communicator.impl.protocol.zeroconf.jmdns;
  19. /**
  20. * DNS constants.
  21. *
  22. * @version %I%, %G%
  23. * @author Arthur van Hoff, Jeff Sonstein,
  24. * Werner Randelshofer, Pierre Frisch, Rick Blair
  25. */
  26. public final class DNSConstants
  27. {
  28. // changed to final class - jeffs
  29. final static String MDNS_GROUP = "224.0.0.251";
  30. final static String MDNS_GROUP_IPV6 = "FF02::FB";
  31. final static int MDNS_PORT = 5353;
  32. final static int DNS_PORT = 53;
  33. // default one hour TTL
  34. final static int DNS_TTL = 60 * 60;
  35. // two hour TTL (draft-cheshire-dnsext-multicastdns.txt ch 13)
  36. // final static int DNS_TTL = 120 * 60;
  37. final static int MAX_MSG_TYPICAL = 1460;
  38. final static int MAX_MSG_ABSOLUTE = 8972;
  39. final static int FLAGS_QR_MASK = 0x8000; // Query response mask
  40. final static int FLAGS_QR_QUERY = 0x0000; // Query
  41. final static int FLAGS_QR_RESPONSE = 0x8000;// Response
  42. public final static int FLAGS_AA = 0x0400; // Authorative answer
  43. final static int FLAGS_TC = 0x0200; // Truncated
  44. final static int FLAGS_RD = 0x0100; // Recursion desired
  45. public final static int FLAGS_RA = 0x8000; // Recursion available
  46. final static int FLAGS_Z = 0x0040; // Zero
  47. final static int FLAGS_AD = 0x0020; // Authentic data
  48. final static int FLAGS_CD = 0x0010; // Checking disabled
  49. // Final Static Internet
  50. public final static int CLASS_IN = 1;
  51. // CSNET
  52. final static int CLASS_CS = 2;
  53. // CHAOS
  54. final static int CLASS_CH = 3;
  55. // Hesiod
  56. final static int CLASS_HS = 4;
  57. // Used in DNS UPDATE [RFC 2136]
  58. final static int CLASS_NONE = 254;
  59. // Not a DNS class, but a DNS query class, meaning "all classes"
  60. final static int CLASS_ANY = 255;
  61. // Multicast DNS uses the bottom 15 bits to identify the record class...
  62. final static int CLASS_MASK = 0x7FFF;
  63. // ... and the top bit indicates that all other cached records are now invalid
  64. public final static int CLASS_UNIQUE = 0x8000;
  65. final static int TYPE_IGNORE = 0; // This is a hack to stop further processing
  66. public final static int TYPE_A = 1; // Address
  67. final static int TYPE_NS = 2; // Name Server
  68. final static int TYPE_MD = 3; // Mail Destination
  69. final static int TYPE_MF = 4; // Mail Forwarder
  70. final static int TYPE_CNAME = 5; // Canonical Name
  71. final static int TYPE_SOA = 6; // Start of Authority
  72. final static int TYPE_MB = 7; // Mailbox
  73. final static int TYPE_MG = 8; // Mail Group
  74. final static int TYPE_MR = 9; // Mail Rename
  75. final static int TYPE_NULL = 10; // NULL RR
  76. final static int TYPE_WKS = 11; // Well-known-service
  77. final static int TYPE_PTR = 12; // Domain Name pofinal static inter
  78. final static int TYPE_HINFO = 13; // Host information
  79. final static int TYPE_MINFO = 14; // Mailbox information
  80. final static int TYPE_MX = 15; // Mail exchanger
  81. public final static int TYPE_TXT = 16;// Arbitrary text string
  82. final static int TYPE_RP = 17; // for Responsible Person [RFC1183]
  83. final static int TYPE_AFSDB = 18; // for AFS Data Base location [RFC1183]
  84. final static int TYPE_X25 = 19; // for X.25 PSDN address [RFC1183]
  85. final static int TYPE_ISDN = 20; // for ISDN address [RFC1183]
  86. final static int TYPE_RT = 21; // for Route Through [RFC1183]
  87. final static int TYPE_NSAP = 22; // for NSAP address, NSAP style A record [RFC1706]
  88. final static int TYPE_NSAP_PTR = 23;//
  89. final static int TYPE_SIG = 24; // for security signature [RFC2931]
  90. final static int TYPE_KEY = 25; // for security key [RFC2535]
  91. final static int TYPE_PX = 26; // X.400 mail mapping information [RFC2163]
  92. final static int TYPE_GPOS = 27; // Geographical Position [RFC1712]
  93. final static int TYPE_AAAA = 28; // IP6 Address [Thomson]
  94. final static int TYPE_LOC = 29; // Location Information [Vixie]
  95. final static int TYPE_NXT = 30; // Next Domain - OBSOLETE [RFC2535, RFC3755]
  96. final static int TYPE_EID = 31; // Endpoint Identifier [Patton]
  97. final static int TYPE_NIMLOC = 32; // Nimrod Locator [Patton]
  98. public final static int TYPE_SRV = 33;// Server Selection [RFC2782]
  99. final static int TYPE_ATMA = 34; // ATM Address [Dobrowski]
  100. final static int TYPE_NAPTR = 35; // Naming Authority Pointer [RFC2168, RFC2915]
  101. final static int TYPE_KX = 36; // Key Exchanger [RFC2230]
  102. final static int TYPE_CERT = 37; // CERT [RFC2538]
  103. final static int TYPE_A6 = 38; // A6 [RFC2874]
  104. final static int TYPE_DNAME = 39; // DNAME [RFC2672]
  105. final static int TYPE_SINK = 40; // SINK [Eastlake]
  106. final static int TYPE_OPT = 41; // OPT [RFC2671]
  107. final static int TYPE_APL = 42; // APL [RFC3123]
  108. final static int TYPE_DS = 43; // Delegation Signer [RFC3658]
  109. final static int TYPE_SSHFP = 44; // SSH Key Fingerprint [RFC-ietf-secsh-dns-05.txt]
  110. final static int TYPE_RRSIG = 46; // RRSIG [RFC3755]
  111. final static int TYPE_NSEC = 47; // NSEC [RFC3755]
  112. final static int TYPE_DNSKEY = 48; // DNSKEY [RFC3755]
  113. final static int TYPE_UINFO = 100; // [IANA-Reserved]
  114. final static int TYPE_UID = 101; // [IANA-Reserved]
  115. final static int TYPE_GID = 102; // [IANA-Reserved]
  116. final static int TYPE_UNSPEC = 103; // [IANA-Reserved]
  117. final static int TYPE_TKEY = 249; // Transaction Key [RFC2930]
  118. final static int TYPE_TSIG = 250; // Transaction Signature [RFC2845]
  119. final static int TYPE_IXFR = 251; // Incremental transfer [RFC1995]
  120. final static int TYPE_AXFR = 252; // Transfer of an entire zone [RFC1035]
  121. final static int TYPE_MAILA = 253; // Mailbox-related records (MB, MG or MR) [RFC1035]
  122. final static int TYPE_MAILB = 254; // Mail agent RRs (Obsolete - see MX) [RFC1035]
  123. final static int TYPE_ANY = 255; // Request for all records [RFC1035]
  124. //Time Intervals for various functions
  125. //milliseconds before send shared query
  126. final static int SHARED_QUERY_TIME = 20;
  127. //milliseconds between query loops.
  128. final static int QUERY_WAIT_INTERVAL = 225;
  129. //milliseconds between probe loops.
  130. final static int PROBE_WAIT_INTERVAL = 250;
  131. //minimal wait interval for response.
  132. final static int RESPONSE_MIN_WAIT_INTERVAL = 20;
  133. //maximal wait interval for response
  134. final static int RESPONSE_MAX_WAIT_INTERVAL = 115;
  135. //milliseconds to wait after conflict.
  136. final static int PROBE_CONFLICT_INTERVAL = 1000;
  137. //After x tries go 1 time a sec. on probes.
  138. final static int PROBE_THROTTLE_COUNT = 10;
  139. //We only increment the throttle count, if
  140. // the previous increment is inside this interval.
  141. final static int PROBE_THROTTLE_COUNT_INTERVAL = 5000;
  142. //milliseconds between Announce loops.
  143. final static int ANNOUNCE_WAIT_INTERVAL = 1000;
  144. //milliseconds between cache cleanups.
  145. final static int RECORD_REAPER_INTERVAL = 10000;
  146. final static int KNOWN_ANSWER_TTL = 120;
  147. // 50% of the TTL in milliseconds
  148. final static int ANNOUNCED_RENEWAL_TTL_INTERVAL = DNS_TTL * 500;
  149. }