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

Method AddProtocolAddress

pkg/tcpip/stack/stack.go:1313–1323  ·  view source on GitHub ↗

AddProtocolAddress adds an address to the specified NIC, possibly with extra properties.

(id tcpip.NICID, protocolAddress tcpip.ProtocolAddress, properties AddressProperties)

Source from the content-addressed store, hash-verified

1311// AddProtocolAddress adds an address to the specified NIC, possibly with extra
1312// properties.
1313func (s *Stack) AddProtocolAddress(id tcpip.NICID, protocolAddress tcpip.ProtocolAddress, properties AddressProperties) tcpip.Error {
1314 s.mu.RLock()
1315 defer s.mu.RUnlock()
1316
1317 nic, ok := s.nics[id]
1318 if !ok {
1319 return &tcpip.ErrUnknownNICID{}
1320 }
1321
1322 return nic.addAddress(protocolAddress, properties)
1323}
1324
1325// RemoveAddress removes an existing network-layer address from the specified
1326// NIC.

Callers 15

AddInterfaceAddrMethod · 0.80
newStackWithOptionsFunction · 0.80
TestStateUpdatesFunction · 0.80
TestSndBufFunction · 0.80
TestMulticastLoopFunction · 0.80
TestIPv6PacketInfoFunction · 0.80
TestBindNICIDFunction · 0.80
addNICWithDefaultRouteFunction · 0.80
NewWithOptionsFunction · 0.80

Calls 3

addAddressMethod · 0.80
RLockMethod · 0.45
RUnlockMethod · 0.45

Tested by 15

newStackWithOptionsFunction · 0.64
TestStateUpdatesFunction · 0.64
TestSndBufFunction · 0.64
TestMulticastLoopFunction · 0.64
TestIPv6PacketInfoFunction · 0.64
TestBindNICIDFunction · 0.64
addNICWithDefaultRouteFunction · 0.64
TestTCPMigrationFunction · 0.64