Files
praxisandClaude Fable 5.2 c2194c59d4 Protocol core: packet translation between source and native
127 files, from working commit b1a079a.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-19 01:32:47 +02:00

31 lines
1.2 KiB
C++

#pragma once
#include "gateway/protocol.hpp"
namespace gateway {
// Explicit opt-in numeric transport destination. No DNS/defaults/redirects.
// Publicly immutable; construction rejects noncanonical or non-unicast IPv4.
class NumericIPv4Endpoint {
const std::array<uint8_t,4> address_;
const uint16_t port_;
public:
NumericIPv4Endpoint(const std::string& address,uint16_t port);
const std::array<uint8_t,4>& address() const {return address_;}
uint16_t port() const {return port_;}
std::string host() const;
};
struct LegacyRealm {
uint32_t type;
uint8_t flags,characters,category,wire_id;
std::string name,address;
float population;
bool offline() const {return (flags&2)!=0;}
};
// Actual Tortoise AuthSocket::LoadRealmlist 1.x layout. wire_id is the
// server's trailing byte (currently0), not its database realm ID.
std::vector<LegacyRealm> turtle_realm_list(std::span<const uint8_t> body);
struct LocalRealmEndpoint {uint16_t port;};
LocalRealmEndpoint local_realm_endpoint(const LegacyRealm& realm);
// Separate explicit-profile parser. Hostname advertisements are unsupported,
// never resolved or silently rewritten to the authentication host.
NumericIPv4Endpoint numeric_realm_endpoint(const LegacyRealm& realm);
}