MCPcopy Create free account
hub / github.com/google/gvisor / SetNetworkProtocolOption

Method SetNetworkProtocolOption

pkg/tcpip/stack/stack.go:482–488  ·  view source on GitHub ↗

SetNetworkProtocolOption allows configuring individual protocol level options. This method returns an error if the protocol is not supported or option is not supported by the protocol implementation or the provided value is incorrect.

(network tcpip.NetworkProtocolNumber, option tcpip.SettableNetworkProtocolOption)

Source from the content-addressed store, hash-verified

480// option is not supported by the protocol implementation or the provided value
481// is incorrect.
482func (s *Stack) SetNetworkProtocolOption(network tcpip.NetworkProtocolNumber, option tcpip.SettableNetworkProtocolOption) tcpip.Error {
483 netProto, ok := s.networkProtocols[network]
484 if !ok {
485 return &tcpip.ErrUnknownProtocol{}
486 }
487 return netProto.SetOption(option)
488}
489
490// NetworkProtocolOption allows retrieving individual protocol level option
491// values. This method returns an error if the protocol is not supported or

Callers 2

TestNetworkOptionFunction · 0.80

Calls 1

SetOptionMethod · 0.65

Tested by 1

TestNetworkOptionFunction · 0.64