MCPcopy Create free account
hub / github.com/pion/ice / WithAddressRewriteRules

Function WithAddressRewriteRules

agent_options.go:51–59  ·  view source on GitHub ↗

WithAddressRewriteRules appends the provided address rewrite (1:1) rules to the agent's existing configuration. Each `AddressRewriteRule` can limit the mapping to a specific interface (`Iface`), local address (`Local`), CIDR block (`CIDR`), or subset of network types (`Networks`), allowing fine-grai

(rules ...AddressRewriteRule)

Source from the content-addressed store, hash-verified

49// iface-only, then global) while still keeping rule order meaningful.
50// Overlapping rules in the same scope are logged as warnings.
51func WithAddressRewriteRules(rules ...AddressRewriteRule) AgentOption {
52 return func(agent *Agent) error {
53 if agent.constructed {
54 return ErrAgentOptionNotUpdatable
55 }
56
57 return appendAddressRewriteRules(agent, rules...)
58 }
59}
60
61func warnOnAddressRewriteConflicts(agent *Agent) {
62 if agent == nil || agent.log == nil {

Calls 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…