masque_ip_client_session (masque v0.7.0)
View SourceClient-side CONNECT-IP session (RFC 9484).
One gen_statem per tunnel, transport-generic: the same module drives both HTTP/3 (quic_h3, QUIC DATAGRAM frames) and HTTP/2 (erlang_h2, RFC 9297 DATAGRAM-type capsules on the stream body) by dispatching on a transport :: h3 | h2 field — following the architecture already used by masque_tcp_client_session.
Owner-side events (the process that called masque:connect/3):
{masque_ip_packet, Sess, Packet}{masque_address_assign, Sess, [ip_assignment()]}{masque_address_request, Sess, [ip_prefix_request()]}{masque_route_advertisement, Sess, [ip_route()]}{masque_ip_error, Sess, Reason}{masque_closed, Sess, Reason}
Summary
Functions
Send a ROUTE_ADVERTISEMENT capsule.
Send an ADDRESS_ASSIGN capsule. Nonzero Request IDs must match an outstanding peer ADDRESS_REQUEST (tracked in the session's pending set); ID 0 is unprompted and always accepted.
Block for the next inbound IP packet when in queue mode.
Send an ADDRESS_REQUEST capsule asking the server to assign addresses matching the given prefixes. Returns the list of allocated Request IDs (strictly nonzero).
Send a full IP packet through the tunnel.
Functions
-spec advertise_routes(pid(), [masque_ip_capsule:route_entry()]) -> ok | {error, term()}.
Send a ROUTE_ADVERTISEMENT capsule.
-spec assign_addresses(pid(), [masque_ip_capsule:address_entry()]) -> ok | {error, term()}.
Send an ADDRESS_ASSIGN capsule. Nonzero Request IDs must match an outstanding peer ADDRESS_REQUEST (tracked in the session's pending set); ID 0 is unprompted and always accepted.
Block for the next inbound IP packet when in queue mode.
-spec request_addresses(pid(), [{4 | 6, inet:ip_address(), non_neg_integer()}]) -> {ok, [pos_integer()]} | {error, term()}.
Send an ADDRESS_REQUEST capsule asking the server to assign addresses matching the given prefixes. Returns the list of allocated Request IDs (strictly nonzero).
Send a full IP packet through the tunnel.