summaryrefslogtreecommitdiff
path: root/dns/ipv4.py
diff options
context:
space:
mode:
authorBob Halley <halley@dnspython.org>2012-04-08 14:22:42 +0100
committerBob Halley <halley@dnspython.org>2012-04-08 14:22:42 +0100
commitefc5e26851a43ffc74a4edf67bc8a94ae801e119 (patch)
tree3f70bcaedab0ad493baf654c22ad44673b1527ea /dns/ipv4.py
parentea13fd9c21194a54055326bf6f5219d1e983641f (diff)
downloaddnspython-efc5e26851a43ffc74a4edf67bc8a94ae801e119.tar.gz
doco fixes
Diffstat (limited to 'dns/ipv4.py')
-rw-r--r--dns/ipv4.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/dns/ipv4.py b/dns/ipv4.py
index e117966..85ab48f 100644
--- a/dns/ipv4.py
+++ b/dns/ipv4.py
@@ -20,12 +20,24 @@ import struct
import dns.exception
def inet_ntoa(address):
+ """Convert an IPv4 address in network form to text form.
+
+ @param address: The IPv4 address
+ @type address: string
+ @returns: string
+ """
if len(address) != 4:
raise dns.exception.SyntaxError
return '%u.%u.%u.%u' % (ord(address[0]), ord(address[1]),
ord(address[2]), ord(address[3]))
def inet_aton(text):
+ """Convert an IPv4 address in text form to network form.
+
+ @param text: The IPv4 address
+ @type text: string
+ @returns: string
+ """
parts = text.split('.')
if len(parts) != 4:
raise dns.exception.SyntaxError