proj: Add struct addrinfo and INTERCEPT_VERBOSE
This commit is contained in:
@@ -17,7 +17,9 @@ StructSockAddr = TypedDict('StructSockAddr', {'sa_family': Constant, 'sa_data':
|
||||
'sun_path': NotRequired[bytes],
|
||||
'sin_addr': NotRequired[bytes], 'sin_port': NotRequired[int],
|
||||
'sin6_addr': NotRequired[bytes], 'sin6_port': NotRequired[int], 'sin6_scope_id': NotRequired[int]})
|
||||
StructAddrInfo = TypedDict('StructAddrInfo', {})
|
||||
StructAddrInfo = TypedDict('StructAddrInfo', {'ai_flags': Flags, 'ai_family': Constant, 'ai_socktype': Constant, 'ai_protocol': int, 'ai_addrlen': int,
|
||||
'ai_addr': PointerTo[StructSockAddr],
|
||||
'ai_canonname': PointerTo[bytes], 'ai_next': Pointer})
|
||||
StructMsgHdr = TypedDict('StructMsgHdr', {})
|
||||
|
||||
|
||||
@@ -481,10 +483,10 @@ class Handler(StreamRequestHandler):
|
||||
def after_connect(self, sockfd: int, address: PointerTo[StructSockAddr], address_len: int,
|
||||
ret_value: int, errno: str = None) -> None:
|
||||
raise NotImplementedError()
|
||||
def before_getaddrinfo(self, node: PointerTo[bytes], service: PointerTo[bytes], hints: PointerTo[StructAddrInfo], res_ptr: Pointer) -> str:
|
||||
def before_getaddrinfo(self, node: PointerTo[bytes], service: PointerTo[bytes], hints: PointerTo[list[StructAddrInfo]], res_ptr: Pointer) -> str:
|
||||
raise NotImplementedError()
|
||||
def after_getaddrinfo(self, node: PointerTo[bytes], service: PointerTo[bytes], hints: PointerTo[StructAddrInfo], res_ptr: Pointer,
|
||||
ret_value: int, errno: str = None, res: Pointer = None) -> None:
|
||||
def after_getaddrinfo(self, node: PointerTo[bytes], service: PointerTo[bytes], hints: PointerTo[list[StructAddrInfo]], res_ptr: Pointer,
|
||||
ret_value: int, errno: str = None, res: PointerTo[list[StructAddrInfo]] = None) -> None:
|
||||
raise NotImplementedError()
|
||||
def before_freeaddrinfo(self, res: Pointer) -> str:
|
||||
raise NotImplementedError()
|
||||
|
||||
@@ -24,6 +24,7 @@ def main() -> None:
|
||||
subprocess.run(extra, env={
|
||||
'LD_PRELOAD': os.getcwd() + '/../../intercept/intercept.so',
|
||||
'INTERCEPT': 'unix:' + socket_name,
|
||||
'INTERCEPT_VERBOSE': '1',
|
||||
'INTERCEPT_FUNCTIONS': '*',
|
||||
'INTERCEPT_LIBRARIES': '*,-/lib*,-/usr/lib*',
|
||||
})
|
||||
|
||||
@@ -24,6 +24,7 @@ def main() -> None:
|
||||
subprocess.run(extra, env={
|
||||
'LD_PRELOAD': os.getcwd() + '/../../intercept/intercept.so',
|
||||
'INTERCEPT': 'unix:' + socket_name,
|
||||
'INTERCEPT_VERBOSE': '1',
|
||||
'INTERCEPT_FUNCTIONS': ','.join(['malloc', 'calloc', 'realloc', 'reallocarray', 'free', 'getaddrinfo', 'freeaddrinfo']),
|
||||
'INTERCEPT_LIBRARIES': '*,-/lib*,-/usr/lib*',
|
||||
})
|
||||
|
||||
@@ -35,6 +35,7 @@ def main() -> None:
|
||||
subprocess.run(extra, stdin=stdin, env={
|
||||
'LD_PRELOAD': os.getcwd() + '/../../intercept/intercept.so',
|
||||
'INTERCEPT': 'unix:' + socket_name,
|
||||
'INTERCEPT_VERBOSE': '1',
|
||||
'INTERCEPT_FUNCTIONS': '*',
|
||||
'INTERCEPT_LIBRARIES': '*,-/lib*,-/usr/lib*',
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user