mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-11-17 03:30:13 -08:00
raddbg_server: checkpoint
This commit is contained in:
1 parent
bf000289db
commit
34a0ff4e80
6 files changed
+424
No files matched your search
@@ -96,3 +96,31 @@ sock_endpoint_from_string(String8 address_and_port)
|
||||
SOCK_Endpoint ep = sock_endpoint_from_string_port(addr, port);
|
||||
return ep;
|
||||
}
|
||||
|
||||
internal String8
|
||||
sock_string_from_endpoint(Arena *arena, SOCK_Endpoint endpoint)
|
||||
{
|
||||
String8 result = {0};
|
||||
switch(endpoint.kind)
|
||||
{
|
||||
default:{}break;
|
||||
case SOCK_EndpointKind_IPv4:
|
||||
{
|
||||
result = str8f(arena, "%i.%i.%i.%i:%i", (int)endpoint.address_u8[0], (int)endpoint.address_u8[1], (int)endpoint.address_u8[2], (int)endpoint.address_u8[3], (int)endpoint.port);
|
||||
}break;
|
||||
case SOCK_EndpointKind_IPv6:
|
||||
{
|
||||
result = str8f(arena, "[%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x]:%i",
|
||||
(int)endpoint.address_u16[0],
|
||||
(int)endpoint.address_u16[1],
|
||||
(int)endpoint.address_u16[2],
|
||||
(int)endpoint.address_u16[3],
|
||||
(int)endpoint.address_u16[4],
|
||||
(int)endpoint.address_u16[5],
|
||||
(int)endpoint.address_u16[6],
|
||||
(int)endpoint.address_u16[7],
|
||||
(int)endpoint.port);
|
||||
}break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
Reference in new issue
Block a user