adns-python return codes

Sion Arrowsmith siona at chiark.greenend.org.uk
Tue Sep 7 12:09:27 EDT 2004


Josh Close  <narshe at gmail.com> wrote:
>Does anyone know what the return codes for an mx adns python lookup
>are? I know 0 means a valid domain, and anything else isn't, but there
>are "no nameservers found" and "timeout" and other things that would
>have to be retried again.
>
>I looked through the source and didn't find anything, and looked
>through the gnu adns C source and didn't find anything, but I really
>don't know C at all, so I could have missed something.

I'd guess you want to be looking at adns.h, specifically the typedef'd
enum adns_status (ll. 205--255 in the copy I'm looking at), although
I've not looked at how the Python bindings to adns work. If you're
not familiar with enums, what you need to know is that it's just a
list of symbols defined to be integer values starting with 0 (eg
adns_s_ok is 0) and incrementing by one for each new symbol unless a
symbol is given an explicit value (adns_s_max_* in this case, used to
block out different types of error) -- in which case subsequent
symbols start incrementing from this value (so, eg, adns_s_timeout is
30).

-- 
\S -- siona at chiark.greenend.org.uk -- http://www.chaos.org.uk/~sion/
  ___  |  "Frankly I have no feelings towards penguins one way or the other"
  \X/  |    -- Arthur C. Clarke
   her nu becomeþ se bera eadward ofdun hlæddre heafdes bæce bump bump bump



More information about the Python-list mailing list