masque_ip_proxy_handler (masque v0.7.0)

View Source

Default CONNECT-IP proxy handler (RFC 9484).

Responsibilities:

  • Allocate addresses from the configured address_pool in response to ADDRESS_REQUEST capsules (round-robin).
  • Emit the initial ROUTE_ADVERTISEMENT combining the configured static routes with any resolved_addresses populated by the listener's DNS step.
  • BCP-38 source-address filtering on inbound packets (via masque_ip:is_public/1).
  • Hand each accepted IP packet to the user-supplied forward_fun (default: drop).

Phase 2 replaces this handler with masque_ip_tun_proxy_handler which owns a TUN device instead of a forwarder-fun.

Summary

Functions

Bump the drop counter and invoke lifecycle_fun if configured in handler opts. Public so a TUN/router consumer that runs its own data path can drive the same telemetry without re-implementing it.

Functions

accept(Req)

emit_drop(Reason, Detail)

-spec emit_drop(atom(), map()) -> ok.

Bump the drop counter and invoke lifecycle_fun if configured in handler opts. Public so a TUN/router consumer that runs its own data path can drive the same telemetry without re-implementing it.

emit_drop(Reason, Detail, Opts)

-spec emit_drop(atom(), map(), map()) -> ok.

handle_address_assign(Entries, S)

handle_address_request(Requests, State)

handle_ip_packet(Packet, State)

handle_route_advertisement(Entries, S)

init(Req, Opts)

terminate(Reason, State)