View Source VintageNet.Route.IPRoute (vintage_net v0.13.3)

This module knows how to invoke the ip command to modify the Linux routing tables

Link to this section Summary

Functions

Add a source IP address -> routing table rule

Clear one local route generically

Clear one default route out of the main table for any interface

Clear one default route that goes to the specified interface

Clear out one rule

Clear all routes on all interfaces

Clear all rules that select the specified table or tables

Link to this section Functions

Link to this function

add_default_route(ifname, route, metric, table_index)

View Source
@spec add_default_route(
  VintageNet.ifname(),
  :inet.ip_address(),
  VintageNet.Route.metric(),
  VintageNet.Route.table_index()
) :: :ok | {:error, any()}

Add a default route

Link to this function

add_local_route(ifname, ip, subnet_bits, metric, table_index)

View Source

Add a local route

Link to this function

add_rule(ip_address, table_index)

View Source
@spec add_rule(:inet.ip_address(), VintageNet.Route.table_index()) ::
  :ok | {:error, any()}

Add a source IP address -> routing table rule

Link to this function

clear_a_local_route(ifname)

View Source
@spec clear_a_local_route(VintageNet.ifname()) :: :ok | {:error, any()}

Clear one local route generically

Link to this function

clear_a_local_route(ifname, ip, subnet_bits, metric, table_index)

View Source

Clear one local route

@spec clear_a_route() :: :ok | {:error, any()}

Clear one default route out of the main table for any interface

Link to this function

clear_a_route(ifname, table_index \\ :main)

View Source
@spec clear_a_route(VintageNet.ifname(), VintageNet.Route.table_index()) ::
  :ok | {:error, any()}

Clear one default route that goes to the specified interface

Link to this function

clear_a_rule(table_index)

View Source
@spec clear_a_rule(VintageNet.Route.table_index()) :: :ok | {:error, any()}

Clear out one rule

@spec clear_all_routes() :: :ok

Clear all routes on all interfaces

Link to this function

clear_all_rules(table_index)

View Source
@spec clear_all_rules(VintageNet.Route.table_index() | Enumerable.t()) :: :ok

Clear all rules that select the specified table or tables