/[tcldrop]/tcldrop/modules/dns/dns.tcl
ViewVC logotype

Diff of /tcldrop/modules/dns/dns.tcl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by fireegl, Wed May 21 04:26:23 2003 UTC revision 1.3 by fireegl, Sat May 24 19:56:16 2003 UTC
# Line 23  Line 23 
23  # Or can be found on IRC (EFNet or FreeNode) as FireEgl.  # Or can be found on IRC (EFNet or FreeNode) as FireEgl.
24    
25  #  #
26  #  #       dns module for Tcldrop.  (OPTIONAL)
27    #       Depends on: none.
28    #
29    #       Provides the dnslookup command.
30    #
31    
32    namespace eval ::tcldrop::dns {
33            variable version {0.1}
34            package provide tcldrop-dns $version
35            variable rcsid {$Id$}
36            # Export all the commands that should be available to 3rd-party scripters:
37            namespace export dnslookup
38    }
39    
40    # Note, the dns package in tcllib only supports TCP based dns lookups.
41    #       This is because Tcl doesn't yet have UDP support.
42    
43  # Require the dns package that's in tcllib:  # Require the dns package that's in tcllib:
44  if {[catch { package require dns }]} {  if {[catch { package require dns }]} {
# Line 31  if {[catch { package require dns }]} { Line 46  if {[catch { package require dns }]} {
46          return 0          return 0
47  }  }
48    
49  # Note, the dns package in tcllib only supports tcp based dns lookups.  #  dnslookup <ip-address/hostname> <proc> [[arg1] [arg2] ... [argN]]
50    #    Description: This issues an asynchronous dns lookup request. The
51  # FixMe: Provide the Eggdrop based commands needed to interface with the dns package.  #      command will block if dns module is not loaded; otherwise it will
52    #      either return immediately or immediately call the specified proc
53    #      (e.g. if the lookup is already cached).
54    #
55    #      As soon as the request completes, the specified proc will be called
56    #      as follows:
57    #
58    #       <proc> <ipaddress> <hostname> <status> [[arg1] [arg2] ... [argN]]
59    #
60    #      status is 1 if the lookup was successful and 0 if it wasn't. All
61    #      additional parameters (called arg1, arg2 and argN above) get
62    #      appended to the proc's other parameters.
63    #    Returns: nothing
64    #    Module: core
65    proc ::tcldrop::dns::dnslookup {address proc args} {
66            # Note, the dns package in tcllib doesn't have a callback option!  GHAY!
67            #
68            # Also note that the use of vwait anywhere in Tcldrop is forbidden.
69            # While Tcldrop running standalone works perfectly happy with it,
70            # vwait will NOT work under Eggdrop (and possibly other applications)
71            # because it blocks the entire application.
72    }

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26