Example #1
0
def formatSockaddrInStruct(argument, name, value):
    if name == "sin_port":
        return ntoh_ushort(value)
    if name == "sin_addr":
        ip = ntoh_uint(value.s_addr)
        return ip_int2str(ip)
    return None
Example #2
0
def formatSockaddrInStruct(argument, name, value):
    if name == "sin_port":
        return ntoh_ushort(value)
    if name == "sin_addr":
        ip = ntoh_uint(value.s_addr)
        return ip_int2str(ip)
    return None
 def formatStructValue(self, struct, name, value):
     if struct.startswith("sockaddr") and name.endswith("family"):
         return SOCKET_FAMILY.get(value, value)
     if struct == "sockaddr_in":
         if name == "sin_port":
             return ntoh_ushort(value)
         if name == "sin_addr":
             ip = ntoh_uint(value.s_addr)
             return IP(ip)
     return None
Example #4
0
 def __repr__(self):
     ip = ntoh_uint(self.s_addr)
     return ip_int2str(ip)
 def __repr__(self):
     ip = ntoh_uint(self.s_addr)
     return ip_int2str(ip)