Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(5)  |  Call(2)  |  Derive(0)  |  Import(3)
Convert an unsigned integer from network endiant to host endian.

        def ntoh_uint(value):
    """
    Convert an unsigned integer from network endiant to host endian.
    """
    return unpack("I", value))[0]
        


src/s/e/segvault-HEAD/fusil/ptrace/ptrace/syscall/socketcall.py   segvault(Download)
from ptrace.cpu_info import CPU_WORD_SIZE
from ptrace.ctypes_tools import ntoh_ushort, ntoh_uint
from ptrace.syscall.socketcall_constants import SOCKETCALL, SOCKET_FAMILY
from ptrace.syscall.socketcall_struct import sockaddr, sockaddr_in, sockaddr_un
from ctypes import c_int
def formatSockaddrInStruct(argument, name, value):
    if name == "sin_port":
        return ntoh_ushort(value)
    if name == "sin_addr":
        ip = ntoh_uint(value.s_addr)

src/p/y/python-ptrace-0.7/ptrace/syscall/socketcall_struct.py   python-ptrace(Download)
from ctypes import Structure, Union, c_char, c_ushort, c_ubyte, c_uint16, c_uint32
from ptrace.os_tools import RUNNING_BSD, RUNNING_LINUX
from socket import inet_ntoa
from struct import pack
from ptrace.ctypes_tools import ntoh_uint, ntoh_ushort
    def __repr__(self):
        ip = ntoh_uint(self.s_addr)
        return ip_int2str(ip)
 
class in6_addr(Union):

src/p/y/python-ptrace-0.7/ptrace/syscall/socketcall.py   python-ptrace(Download)
from ptrace.cpu_info import CPU_WORD_SIZE
from ptrace.ctypes_tools import ntoh_ushort, ntoh_uint
from ptrace.syscall import SYSCALL_PROTOTYPES
from ptrace.syscall.socketcall_constants import SOCKETCALL, SOCKET_FAMILY
from ptrace.syscall.socketcall_struct import sockaddr, sockaddr_in, sockaddr_in6, sockaddr_un