~ubuntu-branches/debian/experimental/kopete/experimental

« back to all changes in this revision

Viewing changes to protocols/jabber/libiris/src/jdns/README.md

  • Committer: Package Import Robot
  • Author(s): Maximiliano Curia
  • Date: 2015-02-24 11:32:57 UTC
  • mfrom: (1.1.41 vivid)
  • Revision ID: package-import@ubuntu.com-20150224113257-gnupg4v7lzz18ij0
Tags: 4:14.12.2-1
* New upstream release (14.12.2).
* Bump Standards-Version to 3.9.6, no changes needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
### JDNS
 
2
 
 
3
Date: October 1st, 2005
 
4
Author: Justin Karneges <justin@affinix.com>
 
5
 
 
6
JDNS is a simple DNS implementation that can perform normal DNS queries
 
7
of any record type (notably SRV), as well as Multicast DNS queries and
 
8
advertising.  Multicast support is based on Jeremie Miller's "mdnsd"
 
9
implementation.
 
10
 
 
11
For maximum flexibility, JDNS is written in C with no direct dependencies,
 
12
and is licensed under the MIT license.  Your application must supply
 
13
functionality to JDNS, such as UDP sending/receiving, via callbacks.
 
14
 
 
15
For Qt users there is a wrapper available called QJDns.  jdns.pri can
 
16
be used to include everything into a qmake project.  jdns.pro will build
 
17
the sample Qt-based commandline tool 'jdns'.
 
18
 
 
19
#### Features:
 
20
* DNS client "stub" resolver
 
21
* Can fetch any record type, but provides handy decoding for many
 
22
    known types: A, AAAA, SRV, MX, TXT, etc.
 
23
* Performs retries, caching/expiration, and CNAME following
 
24
* Algorithm logic adapted from Q3Dns
 
25
* Multicast queries
 
26
* Multicast advertising
 
27
 
 
28
#### Why?
 
29
* Trolltech is phasing out the Qt DNS implementation, which in Qt 4 has
 
30
  been relegated to the Qt3Support module.  A replacement was desired.
 
31
 
 
32
* While there are many DNS libraries available, at the time of this
 
33
  writing it was (and still may be) hard to find one that satisfies
 
34
  three essential conditions: cross-platform friendliness (and this
 
35
  includes Windows 9x!), the ability to integrate into existing
 
36
  eventloops, sensible licensing (ie, not GPL).
 
37
 
 
38
#### How to use:
 
39
* Prepare callbacks and call jdns_session_new()
 
40
* Call jdns_init_unicast() or jdns_init_multicast(), depending on
 
41
  if you want regular or multicast DNS.  If you want both kinds, you
 
42
  can always make two sessions.
 
43
* Make queries and have fun
 
44
* Call jdns_step() at the right times to advance JDNS processing
 
45
 
 
46
#### What is left to you:
 
47
* The callback functions, obviously.
 
48
* Querying for several "qualified" names.  Here is what Q3Dns does:
 
49
    Query for name as provided
 
50
    Query for name + '.domain' (for every domain the computer is in)
 
51
* Detecting for '.local' in a name to be queried, and using that
 
52
  to decide whether to query via Multicast or normal DNS.
 
53
* Recognition of IP addresses.  If you want an IP address to resolve
 
54
  to itself, then do that yourself.  Passing an IP address as a DNS
 
55
  name to JDNS won't work (especially since it wouldn't make any
 
56
  sense in some contexts, like SRV).
 
57
* Recognition of known hosts.  If you want this, compare inputs against
 
58
  jdns_system_dnsparams().
 
59
* For zeroconf/Bonjour, keep in mind that JDNS only provides Multicast
 
60
  DNS capability.  DNS-SD and any higher layers would be your job.
 
61
 
 
62
Using a custom DNS implementation has the drawback that it is difficult
 
63
to take advantage of platform-specific features (for example, an OS-wide
 
64
DNS cache or LDAP integration).
 
65
 
 
66
An application strategy for normal DNS should probably be:
 
67
* If an A or AAAA record is desired, use a native lookup.
 
68
* Else, if the platform has advanced DNS features already (ie,
 
69
  res_query), use those.
 
70
* Else, use JDNS.
 
71
 
 
72
However, it may not be a bad idea at first to use JDNS for all occasions,
 
73
so that it can be debugged.
 
74
 
 
75
For Multicast DNS, awareness of the platform is doubly important.  There
 
76
should only be one Multicast DNS "Responder" per computer, and using JDNS
 
77
at the same time could result in a conflict.
 
78
 
 
79
An application strategy for Multicast DNS should be:
 
80
* If the platform has a Multicast DNS daemon installed already, use
 
81
  it somehow.
 
82
* Else, use JDNS.
 
83
 
 
84
Have fun!
 
85