MCPcopy Create free account
hub / github.com/qilingframework/qiling / __host_socket_level

Function __host_socket_level

qiling/os/posix/syscall/socket.py:117–131  ·  view source on GitHub ↗

Convert emulated socket level value to a host socket level.

(vsock_level: int, arch_type: QL_ARCH)

Source from the content-addressed store, hash-verified

115
116
117def __host_socket_level(vsock_level: int, arch_type: QL_ARCH) -> int:
118 """Convert emulated socket level value to a host socket level.
119 """
120
121 try:
122 vsock_level_name = socket_level_mapping(vsock_level, arch_type)
123 except ValueError:
124 raise NotImplementedError(f'Could not convert emulated socket level {vsock_level} to a socket level name')
125
126 try:
127 hsock_level = getattr(socket, vsock_level_name)
128 except AttributeError:
129 raise NotImplementedError(f'Could not convert emulated socket level name {vsock_level_name} to a host socket level')
130
131 return hsock_level
132
133
134def __host_socket_option(vsock_level: int, vsock_opt: int, arch_type: QL_ARCH, os_type: QL_OS) -> int:

Callers 2

ql_syscall_getsockoptFunction · 0.85
ql_syscall_setsockoptFunction · 0.85

Calls 1

socket_level_mappingFunction · 0.90

Tested by

no test coverage detected