Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultCtrlAddr = ":30256" DefaultDataAddr = ":30056" DefaultTunnelName = "sig" DefaultTunnelRoutingTableID = 11 )
Defaults.
View Source
const ( // FIXME(lukedirtwalker): cleanup traffic policy and use "session.policy" // instead. DefaultSessionPoliciesFile = "/share/conf/traffic.policy" )
Default file paths
Variables ¶
This section is empty.
Functions ¶
func DefaultAddress ¶
DefaultAddress determines the default address. If port is not specified, or is zero, it is set to the default port. If the input is garbage, the output is garbage as well.
Types ¶
type Gateway ¶
type Gateway struct { config.NoDefaulter // ID of the SIG. ID string `toml:"id,omitempty"` // TrafficPolicy is the file path of the traffic policy file. TrafficPolicy string `toml:"traffic_policy_file,omitempty"` // IPRoutingPolicy is the file path of the IP routing policy file. IPRoutingPolicy string `toml:"ip_routing_policy_file,omitempty"` // Control plane address, for prefix discovery. CtrlAddr string `toml:"ctrl_addr,omitempty"` // Data plane address, for frames. DataAddr string `toml:"data_addr,omitempty"` }
Gateway holds the gateway specific configuration.
func (*Gateway) ConfigName ¶
type Loader ¶
type Loader struct { // SessionPoliciesFile is the file name of the session policies. Must be set. SessionPoliciesFile string // RoutingPolicyFile is the file name of the routing policy. Must be set. RoutingPolicyFile string // Publisher is used to publish new loaded configs. Publisher Publisher // Trigger is used to trigger loading. Trigger <-chan struct{} // SessionPolicyParser is used to parse session policies. SessionPolicyParser control.SessionPolicyParser // Logger is used to log errors, if nil nothing is logged. Logger log.Logger // contains filtered or unexported fields }
Loader can be used to load gateway configurations from files. It waits on triggers.
type Publisher ¶
type Publisher interface {
Publish(control.SessionPolicies, *routing.Policy)
}
Publisher publishes new configurations.
type Tunnel ¶
type Tunnel struct { config.NoDefaulter // Name is the name of TUN device to create. Name string `toml:"name,omitempty"` // RoutingTableID is the ID of the routing table used in the gateway. RoutingTableID int `toml:"routing_table_id,omitempty"` // SrcIPv4 is the source address int to put into the routing table. SrcIPv4 net.IP `toml:"src_ipv4,omitempty"` // SrcIPv6 is the source address int to put into the routing table. SrcIPv6 net.IP `toml:"src_ipv6,omitempty"` }
Tunnel holds the tunneling configuration.
func (*Tunnel) ConfigName ¶
Directories ¶
Path | Synopsis |
---|---|
Package mock_config is a generated GoMock package.
|
Package mock_config is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.