RPKI Engine
1.0
|
Public Member Functions | |
def | __init__ |
def | cleanup |
def | done1 |
def | done2 |
def | go |
def | loop1 |
def | loop2 |
def | lose |
def | socket_cb |
def | socket_eb |
def | socket_timeout |
Public Attributes | |
backoff | |
cb | |
eb | |
iterator | |
nameservers | |
qclass | |
qname | |
qtype | |
request | |
response | |
sockets | |
start | |
timer |
Simplified (no search paths) asynchronous adaptation of dns.resolver.Resolver.query() (q.v.).
def rpki::adns::query::__init__ | ( | self, | |
cb, | |||
eb, | |||
qname, | |||
qtype = dns.rdatatype.A , |
|||
qclass = dns.rdataclass.IN |
|||
) |
def rpki::adns::query::cleanup | ( | self | ) |
def rpki::adns::query::done1 | ( | self | ) |
Done with outer loop. If we got a useful answer, cache it, then pass it back to caller; if we got an error, pass the appropriate exception back to caller.
Definition at line 273 of file adns.py.
References rpki::adns::dispatcher::cb, cb, cleanup(), lose(), nameservers, qclass, qname, qtype, and response.
Referenced by socket_cb().
def rpki::adns::query::done2 | ( | self | ) |
Done with inner loop. If we still haven't got an answer and haven't (yet?) eliminated all of our nameservers, wait a little while before starting the cycle again, unless we've hit the timeout threshold for the whole query.
Definition at line 239 of file adns.py.
References backoff, loop1(), lose(), nameservers, response, and start.
def rpki::adns::query::go | ( | self | ) |
def rpki::adns::query::loop1 | ( | self | ) |
def rpki::adns::query::loop2 | ( | self, | |
iterator, | |||
nameserver | |||
) |
Inner loop. Send query to next nameserver in our list, unless we've hit the overall timeout for this query.
Definition at line 173 of file adns.py.
References lose(), socket_cb(), socket_eb(), socket_timeout(), sockets, and start.
def rpki::adns::query::lose | ( | self, | |
e | |||
) |
Something bad happened. Clean up, then pass error back to caller.
Definition at line 266 of file adns.py.
References cleanup(), rpki::adns::dispatcher::eb, and eb.
Referenced by done1(), done2(), loop2(), and socket_eb().
def rpki::adns::query::socket_cb | ( | self, | |
af, | |||
from_host, | |||
from_port, | |||
wire | |||
) |
Received a packet that might be a DNS message. If it doesn't look like it came from one of our nameservers, just drop it and leave the timer running. Otherwise, try parsing it: if it's an answer, we're done, otherwise handle error appropriately and move on to next nameserver.
Definition at line 213 of file adns.py.
References done1(), iterator, nameservers, request, and response.
Referenced by loop2().
def rpki::adns::query::socket_eb | ( | self, | |
e | |||
) |
UDP socket signaled error. If it really is some kind of socket error, handle as if we've timed out on this nameserver; otherwise, pass error back to caller.
Definition at line 200 of file adns.py.
References iterator, lose(), and response.
Referenced by loop2().
def rpki::adns::query::socket_timeout | ( | self | ) |
Definition at line 122 of file adns.py.
Referenced by rpki::async::sync_wrapper::__call__(), rpki::adns::getaddrinfo::done(), and done1().
Definition at line 122 of file adns.py.
Referenced by rpki::async::sync_wrapper::__call__(), lose(), and rpki::adns::getaddrinfo::lose().
Definition at line 165 of file adns.py.
Referenced by socket_cb(), socket_eb(), and socket_timeout().
Definition at line 142 of file adns.py.
Referenced by done1(), done2(), and socket_cb().
Definition at line 122 of file adns.py.
Referenced by rpki::adns::test_query::done(), done1(), and rpki::adns::test_query::lose().
Definition at line 122 of file adns.py.
Referenced by rpki::adns::test_getaddrinfo::done(), rpki::adns::test_query::done(), done1(), rpki::adns::test_getaddrinfo::lose(), and rpki::adns::test_query::lose().
Definition at line 122 of file adns.py.
Referenced by rpki::adns::test_query::done(), done1(), and rpki::adns::test_query::lose().
Definition at line 142 of file adns.py.
Referenced by socket_cb().
Definition at line 142 of file adns.py.
Referenced by done1(), done2(), socket_cb(), socket_eb(), and socket_timeout().