summaryrefslogtreecommitdiff
path: root/src/net/ip.py
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2014-05-12 17:24:51 -0700
committerBen Longbons <b.r.longbons@gmail.com>2014-05-12 17:28:25 -0700
commitc87b1dc338eadc68accac02563a487d7d8e1c9a0 (patch)
tree4333dca2f664bd7170a7ff984abc8a2d1a643fb2 /src/net/ip.py
parent0659ef14f64e2c5d71601060717a761aded8381f (diff)
downloadtmwa-c87b1dc338eadc68accac02563a487d7d8e1c9a0.tar.gz
tmwa-c87b1dc338eadc68accac02563a487d7d8e1c9a0.tar.bz2
tmwa-c87b1dc338eadc68accac02563a487d7d8e1c9a0.tar.xz
tmwa-c87b1dc338eadc68accac02563a487d7d8e1c9a0.zip
Split net/ from mmo/
Diffstat (limited to 'src/net/ip.py')
-rw-r--r--src/net/ip.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/net/ip.py b/src/net/ip.py
new file mode 100644
index 0000000..e6a8183
--- /dev/null
+++ b/src/net/ip.py
@@ -0,0 +1,14 @@
+class IP4Address(object):
+ ''' print an IP4Address
+ '''
+ __slots__ = ('_value')
+ name = 'IP4Address'
+ enabled = True
+
+ def __init__(self, value):
+ self._value = value
+
+ def to_string(self):
+ addr = self._value['_addr']
+ addr = tuple(int(addr[i]) for i in range(4))
+ return '%d.%d.%d.%d' % addr