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)
| 769 | // |
| 770 | // This method takes ownership of the table. |
| 771 | func (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. |
| 781 | func (s *Stack) GetRouteTable() []tcpip.Route { |