MCPcopy Index your code
hub / github.com/google/gvisor / SetRouteTable

Method SetRouteTable

pkg/tcpip/stack/stack.go:771–778  ·  view source on GitHub ↗

SetRouteTable assigns the route table to be used by this stack. It specifies which NIC to use for given destination address ranges. This method takes ownership of the table.

(table []tcpip.Route)

Source from the content-addressed store, hash-verified

769//
770// This method takes ownership of the table.
771func (s *Stack) SetRouteTable(table []tcpip.Route) {
772 s.routeMu.Lock()
773 defer s.routeMu.Unlock()
774 s.routeTable.Reset()
775 for _, r := range table {
776 s.addRouteLocked(&r)
777 }
778}
779
780// GetRouteTable returns the route table which is currently in use.
781func (s *Stack) GetRouteTable() []tcpip.Route {

Callers 15

ReplaceConfigMethod · 0.95
newStackWithOptionsFunction · 0.80
TestStateUpdatesFunction · 0.80
TestSndBufFunction · 0.80
TestMulticastLoopFunction · 0.80
TestIPv6PacketInfoFunction · 0.80
NewWithOptionsFunction · 0.80
TestTCPMigrationFunction · 0.80

Calls 4

addRouteLockedMethod · 0.95
LockMethod · 0.65
UnlockMethod · 0.65
ResetMethod · 0.65

Tested by 15

newStackWithOptionsFunction · 0.64
TestStateUpdatesFunction · 0.64
TestSndBufFunction · 0.64
TestMulticastLoopFunction · 0.64
TestIPv6PacketInfoFunction · 0.64
TestTCPMigrationFunction · 0.64
makeStackFunction · 0.64