예제 #1
0
 def __getattribute__(self, name):
     _map = BigEndianStructure.__getattribute__(self, '_map')
     value = BigEndianStructure.__getattribute__(self, name)
     if name in _map:
         EnumClass = _map[name]
         if isinstance(value, Array):
             return [EnumClass(x) for x in value]
         else:
             return EnumClass(value)
     else:
         return value
예제 #2
0
파일: tcp.py 프로젝트: superbobry/cxnet
 def __init__(self):
     BigEndianStructure.__init__(self)
     self.protocol = 6
예제 #3
0
파일: ip4.py 프로젝트: superbobry/cxnet
 def __init__(self):
     BigEndianStructure.__init__(self)
     self.version = 4
     self.ttl = 64
     self.id = 0