Imported Upstream version 1.6.0
SVN-Git Migration
8 years ago
Binary diff not shown
0 | ||
1 | 2007-11-25 Bob Halley <halley@dnspython.org | |
2 | ||
3 | * dns/query.py (_wait_for): if select() raises an exception due to | |
4 | EINTR, we should just select() again. | |
5 | ||
6 | 2007-06-13 Bob Halley <halley@dnspython.org> | |
7 | ||
8 | * dns/inet.py: Added is_multicast(). | |
9 | ||
10 | * dns/query.py (udp): If the queried address is a multicast address, then | |
11 | don't check that the address of the response is the same as the address | |
12 | queried. | |
13 | ||
14 | 2007-05-24 Bob Halley <halley@dnspython.org> | |
15 | ||
16 | * dns/rdtypes/IN/NAPTR.py: NAPTR comparisons didn't compare the | |
17 | preference field due to a typo. | |
18 | ||
19 | 2007-02-07 Bob Halley <halley@dnspython.org> | |
20 | ||
21 | * dns/resolver.py: Integrate code submitted by Paul Marks to | |
22 | determine whether a Windows NIC is enabled. The way dnspython | |
23 | used to do this does not work on Windows Vista. | |
24 | ||
25 | 2006-12-10 Bob Halley <halley@dnspython.org> | |
26 | ||
27 | * (Version 1.5.0 released) | |
28 | ||
0 | 29 | 2006-11-03 Bob Halley <halley@dnspython.org> |
1 | 30 | |
2 | 31 | * dns/rdtypes/IN/DHCID.py: Added support for the DHCID RR type. |
0 | 0 | Metadata-Version: 1.1 |
1 | 1 | Name: dnspython |
2 | Version: 1.5.0 | |
2 | Version: 1.6.0 | |
3 | 3 | Summary: DNS toolkit |
4 | 4 | Home-page: http://www.dnspython.org |
5 | 5 | Author: Bob Halley |
6 | 6 | Author-email: halley@dnspython.org |
7 | 7 | License: BSD-like |
8 | Download-URL: http://www.dnspython.org/kits/dnspython-1.5.0.tar.gz | |
8 | Download-URL: http://www.dnspython.org/kits/1.6.0/dnspython-1.6.0.tar.gz | |
9 | 9 | Description: dnspython is a DNS toolkit for Python. It supports almost all |
10 | 10 | record types. It can be used for queries, zone transfers, and dynamic |
11 | 11 | updates. It supports TSIG authenticated messages and EDNS0. |
21 | 21 | |
22 | 22 | ABOUT THIS RELEASE |
23 | 23 | |
24 | This is dnspython 1.5.0. | |
24 | This is dnspython 1.6.0. | |
25 | ||
26 | New since 1.5.0: | |
27 | Added dns.inet.is_multicast(). | |
28 | ||
29 | Bugs fixed since 1.5.0: | |
30 | ||
31 | If select() raises an exception due to EINTR, we should just | |
32 | select() again. | |
33 | ||
34 | If the queried address is a multicast address, then don't | |
35 | check that the address of the response is the same as the | |
36 | address queried. | |
37 | ||
38 | NAPTR comparisons didn't compare the preference field due to a | |
39 | typo. | |
40 | ||
41 | Testing of whether a Windows NIC is enabled now works on Vista | |
42 | thanks to code contributed by Paul Marks. | |
25 | 43 | |
26 | 44 | New since 1.4.0: |
27 | 45 |
Binary diff not shown
Binary diff not shown
Binary diff not shown
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2005 Nominum, Inc. | |
0 | # Copyright (C) 2006, 2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2001-2005 Nominum, Inc. | |
0 | # Copyright (C) 2001-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
87 | 87 | return AF_INET6 |
88 | 88 | except: |
89 | 89 | raise ValueError |
90 | ||
91 | def is_multicast(text): | |
92 | """Is the textual-form network address a multicast address? | |
93 | ||
94 | @param text: the textual address | |
95 | @raises ValueError: the address family cannot be determined from the input. | |
96 | @rtype: bool | |
97 | """ | |
98 | try: | |
99 | first = ord(dns.ipv4.inet_aton(text)[0]) | |
100 | return (first >= 224 and first <= 239) | |
101 | except: | |
102 | try: | |
103 | first = ord(dns.ipv6.inet_aton(text)[0]) | |
104 | return (first == 255) | |
105 | except: | |
106 | raise ValueError | |
107 |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2001-2005 Nominum, Inc. | |
0 | # Copyright (C) 2001-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2001-2005 Nominum, Inc. | |
0 | # Copyright (C) 2001-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2001-2005 Nominum, Inc. | |
0 | # Copyright (C) 2001-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2001-2005 Nominum, Inc. | |
0 | # Copyright (C) 2001-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
43 | 43 | return None |
44 | 44 | else: |
45 | 45 | return time.time() + timeout |
46 | ||
46 | ||
47 | 47 | def _wait_for(ir, iw, ix, expiration): |
48 | if expiration is None: | |
49 | timeout = None | |
50 | else: | |
51 | timeout = expiration - time.time() | |
52 | if timeout <= 0.0: | |
48 | done = False | |
49 | while not done: | |
50 | if expiration is None: | |
51 | timeout = None | |
52 | else: | |
53 | timeout = expiration - time.time() | |
54 | if timeout <= 0.0: | |
55 | raise dns.exception.Timeout | |
56 | try: | |
57 | if timeout is None: | |
58 | (r, w, x) = select.select(ir, iw, ix) | |
59 | else: | |
60 | (r, w, x) = select.select(ir, iw, ix, timeout) | |
61 | except select.error, e: | |
62 | if e.args[0] != errno.EINTR: | |
63 | raise e | |
64 | done = True | |
65 | if len(r) == 0 and len(w) == 0 and len(x) == 0: | |
53 | 66 | raise dns.exception.Timeout |
54 | if timeout is None: | |
55 | (r, w, x) = select.select(ir, iw, ix) | |
56 | else: | |
57 | (r, w, x) = select.select(ir, iw, ix, timeout) | |
58 | if len(r) == 0 and len(w) == 0 and len(x) == 0: | |
59 | raise dns.exception.Timeout | |
60 | ||
67 | ||
61 | 68 | def _wait_for_readable(s, expiration): |
62 | 69 | _wait_for([s], [], [s], expiration) |
63 | ||
70 | ||
64 | 71 | def _wait_for_writable(s, expiration): |
65 | 72 | _wait_for([], [s], [s], expiration) |
66 | 73 | |
90 | 97 | @param ignore_unexpected: If True, ignore responses from unexpected |
91 | 98 | sources. The default is False. |
92 | 99 | @type ignore_unexpected: bool""" |
93 | ||
100 | ||
94 | 101 | wire = q.to_wire() |
95 | 102 | if af is None: |
96 | 103 | try: |
116 | 123 | while 1: |
117 | 124 | _wait_for_readable(s, expiration) |
118 | 125 | (wire, from_address) = s.recvfrom(65535) |
119 | if from_address == destination: | |
126 | if from_address == destination or \ | |
127 | (dns.inet.is_multicast(where) and \ | |
128 | from_address[1] == destination[1]): | |
120 | 129 | break |
121 | 130 | if not ignore_unexpected: |
122 | 131 | raise UnexpectedSource, \ |
188 | 197 | @param source_port: The port from which to send the message. |
189 | 198 | The default is 0. |
190 | 199 | @type source_port: int""" |
191 | ||
200 | ||
192 | 201 | wire = q.to_wire() |
193 | 202 | if af is None: |
194 | 203 | try: |
0 | # Copyright (C) 2001-2005 Nominum, Inc. | |
0 | # Copyright (C) 2001-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2001-2005 Nominum, Inc. | |
0 | # Copyright (C) 2001-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2001-2005 Nominum, Inc. | |
0 | # Copyright (C) 2001-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2001-2005 Nominum, Inc. | |
0 | # Copyright (C) 2001-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2001-2005 Nominum, Inc. | |
0 | # Copyright (C) 2001-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2004, 2005 Nominum, Inc. | |
0 | # Copyright (C) 2004-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2004, 2005 Nominum, Inc. | |
0 | # Copyright (C) 2004-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2004, 2005 Nominum, Inc. | |
0 | # Copyright (C) 2004-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2006 Nominum, Inc. | |
0 | # Copyright (C) 2006, 2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2005 Nominum, Inc. | |
0 | # Copyright (C) 2005-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2006 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
Binary diff not shown
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2006 Nominum, Inc. | |
0 | # Copyright (C) 2006, 2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2006 Nominum, Inc. | |
0 | # Copyright (C) 2006, 2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
118 | 118 | |
119 | 119 | def _cmp(self, other): |
120 | 120 | sp = struct.pack("!HH", self.order, self.preference) |
121 | op = struct.pack("!HH", other.order, self.preference) | |
121 | op = struct.pack("!HH", other.order, other.preference) | |
122 | 122 | v = cmp(sp, op) |
123 | 123 | if v == 0: |
124 | 124 | v = cmp(self.flags, other.flags) |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2004, 2005 Nominum, Inc. | |
0 | # Copyright (C) 2004-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2004, 2005 Nominum, Inc. | |
0 | # Copyright (C) 2004-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2006, 2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2001-2005 Nominum, Inc. | |
0 | # Copyright (C) 2001-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
452 | 452 | guid = _winreg.EnumKey(interfaces, i) |
453 | 453 | i += 1 |
454 | 454 | key = _winreg.OpenKey(interfaces, guid) |
455 | if not self._win32_is_nic_enabled(lm, guid, key): | |
456 | continue | |
455 | 457 | try: |
456 | # enabled interfaces seem to have a non-empty | |
457 | # NTEContextList | |
458 | try: | |
459 | (nte, ttype) = _winreg.QueryValueEx(key, | |
460 | 'NTEContextList') | |
461 | except WindowsError: | |
462 | nte = None | |
463 | if nte: | |
464 | self._config_win32_fromkey(key) | |
458 | self._config_win32_fromkey(key) | |
465 | 459 | finally: |
466 | 460 | key.Close() |
467 | 461 | except EnvironmentError: |
470 | 464 | interfaces.Close() |
471 | 465 | finally: |
472 | 466 | lm.Close() |
467 | ||
468 | def _win32_is_nic_enabled(self, lm, guid, interface_key): | |
469 | # Look in the Windows Registry to determine whether the network | |
470 | # interface corresponding to the given guid is enabled. | |
471 | # | |
472 | # (Code contributed by Paul Marks, thanks!) | |
473 | # | |
474 | try: | |
475 | # This hard-coded location seems to be consistent, at least | |
476 | # from Windows 2000 through Vista. | |
477 | connection_key = _winreg.OpenKey( | |
478 | lm, | |
479 | r'SYSTEM\CurrentControlSet\Control\Network' | |
480 | r'\{4D36E972-E325-11CE-BFC1-08002BE10318}' | |
481 | r'\%s\Connection' % guid) | |
482 | ||
483 | try: | |
484 | # The PnpInstanceID points to a key inside Enum | |
485 | (pnp_id, ttype) = _winreg.QueryValueEx( | |
486 | connection_key, 'PnpInstanceID') | |
487 | ||
488 | if ttype != _winreg.REG_SZ: | |
489 | raise ValueError | |
490 | ||
491 | device_key = _winreg.OpenKey( | |
492 | lm, r'SYSTEM\CurrentControlSet\Enum\%s' % pnp_id) | |
493 | ||
494 | try: | |
495 | # Get ConfigFlags for this device | |
496 | (flags, ttype) = _winreg.QueryValueEx( | |
497 | device_key, 'ConfigFlags') | |
498 | ||
499 | if ttype != _winreg.REG_DWORD: | |
500 | raise ValueError | |
501 | ||
502 | # Based on experimentation, bit 0x1 indicates that the | |
503 | # device is disabled. | |
504 | return not (flags & 0x1) | |
505 | ||
506 | finally: | |
507 | device_key.Close() | |
508 | finally: | |
509 | connection_key.Close() | |
510 | except (EnvironmentError, ValueError): | |
511 | # Pre-vista, enabled interfaces seem to have a non-empty | |
512 | # NTEContextList; this was how dnspython detected enabled | |
513 | # nics before the code above was contributed. We've retained | |
514 | # the old method since we don't know if the code above works | |
515 | # on Windows 95/98/ME. | |
516 | try: | |
517 | (nte, ttype) = _winreg.QueryValueEx(interface_key, | |
518 | 'NTEContextList') | |
519 | return nte is not None | |
520 | except WindowsError: | |
521 | return False | |
473 | 522 | |
474 | 523 | def _compute_timeout(self, start): |
475 | 524 | now = time.time() |
0 | # Copyright (C) 2005 Nominum, Inc. | |
0 | # Copyright (C) 2006, 2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003, 2004 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2001-2005 Nominum, Inc. | |
0 | # Copyright (C) 2001-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
15 | 15 | """dnspython release version information.""" |
16 | 16 | |
17 | 17 | MAJOR = 1 |
18 | MINOR = 5 | |
18 | MINOR = 6 | |
19 | 19 | MICRO = 0 |
20 | 20 | RELEASELEVEL = 0x0f |
21 | 21 | SERIAL = 0 |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
24 | 24 | import dns.rdataclass |
25 | 25 | import dns.rdatatype |
26 | 26 | import dns.rdata |
27 | import dns.rrset | |
27 | 28 | import dns.tokenizer |
28 | 29 | import dns.ttl |
29 | 30 |
0 | 0 | #!/usr/bin/env python |
1 | 1 | # |
2 | # Copyright (C) 2003-2006 Nominum, Inc. | |
2 | # Copyright (C) 2003-2007 Nominum, Inc. | |
3 | 3 | # |
4 | 4 | # Permission to use, copy, modify, and distribute this software and its |
5 | 5 | # documentation for any purpose with or without fee is hereby granted, |
17 | 17 | import sys |
18 | 18 | from distutils.core import setup |
19 | 19 | |
20 | version = '1.5.0' | |
20 | version = '1.6.0' | |
21 | 21 | |
22 | 22 | kwargs = { |
23 | 23 | 'name' : 'dnspython', |
41 | 41 | |
42 | 42 | if sys.hexversion >= 0x02020300: |
43 | 43 | kwargs['download_url'] = \ |
44 | 'http://www.dnspython.org/kits/dnspython-%s.tar.gz' % version | |
44 | 'http://www.dnspython.org/kits/%s/dnspython-%s.tar.gz' % (version, | |
45 | version) | |
45 | 46 | kwargs['classifiers'] = [ |
46 | 47 | "Development Status :: 5 - Production/Stable", |
47 | 48 | "Intended Audience :: Developers", |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2005 Nominum, Inc. | |
0 | # Copyright (C) 2006, 2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003, 2004 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |
0 | # Copyright (C) 2003-2005 Nominum, Inc. | |
0 | # Copyright (C) 2003-2007 Nominum, Inc. | |
1 | 1 | # |
2 | 2 | # Permission to use, copy, modify, and distribute this software and its |
3 | 3 | # documentation for any purpose with or without fee is hereby granted, |