SetNICAddress sets the hardware address which is identified by the nic ID.
(id tcpip.NICID, addr tcpip.LinkAddress)
| 1125 | |
| 1126 | // SetNICAddress sets the hardware address which is identified by the nic ID. |
| 1127 | func (s *Stack) SetNICAddress(id tcpip.NICID, addr tcpip.LinkAddress) tcpip.Error { |
| 1128 | s.mu.Lock() |
| 1129 | defer s.mu.Unlock() |
| 1130 | |
| 1131 | nic, ok := s.nics[id] |
| 1132 | if !ok { |
| 1133 | return &tcpip.ErrUnknownNICID{} |
| 1134 | } |
| 1135 | nic.NetworkLinkEndpoint.SetLinkAddress(addr) |
| 1136 | return nil |
| 1137 | } |
| 1138 | |
| 1139 | // SetNICName sets a NIC's name. |
| 1140 | func (s *Stack) SetNICName(id tcpip.NICID, name string) tcpip.Error { |
no test coverage detected