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

Method GetRouteTable

pkg/tcpip/stack/stack.go:781–789  ·  view source on GitHub ↗

GetRouteTable returns the route table which is currently in use.

()

Source from the content-addressed store, hash-verified

779
780// GetRouteTable returns the route table which is currently in use.
781func (s *Stack) GetRouteTable() []tcpip.Route {
782 s.routeMu.RLock()
783 defer s.routeMu.RUnlock()
784 table := make([]tcpip.Route, 0)
785 for r := s.routeTable.Front(); r != nil; r = r.Next() {
786 table = append(table, *r)
787 }
788 return table
789}
790
791// AddRoute appends a route to the route table.
792func (s *Stack) AddRoute(route tcpip.Route) {

Callers 6

AddInterfaceAddrMethod · 0.80
RouteTableMethod · 0.80
NewRouteMethod · 0.80
TestAddRouteFunction · 0.80
TestRemoveRoutesFunction · 0.80
ReplaceConfigMethod · 0.80

Calls 4

NextMethod · 0.65
RLockMethod · 0.45
RUnlockMethod · 0.45
FrontMethod · 0.45

Tested by 2

TestAddRouteFunction · 0.64
TestRemoveRoutesFunction · 0.64