diff options
| author | Bob Halley <halley@dnspython.org> | 2012-04-08 14:22:42 +0100 |
|---|---|---|
| committer | Bob Halley <halley@dnspython.org> | 2012-04-08 14:22:42 +0100 |
| commit | efc5e26851a43ffc74a4edf67bc8a94ae801e119 (patch) | |
| tree | 3f70bcaedab0ad493baf654c22ad44673b1527ea /dns/ipv4.py | |
| parent | ea13fd9c21194a54055326bf6f5219d1e983641f (diff) | |
| download | dnspython-efc5e26851a43ffc74a4edf67bc8a94ae801e119.tar.gz | |
doco fixes
Diffstat (limited to 'dns/ipv4.py')
| -rw-r--r-- | dns/ipv4.py | 12 |
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 |
