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)
| 480 | // option is not supported by the protocol implementation or the provided value |
| 481 | // is incorrect. |
| 482 | func (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 |