Socket Option

core.SocketOption

[core.SocketOption proto]

Generic socket option message. This would be used to set socket options that might not exist in upstream kernels or precompiled Envoy binaries.

  1. {
  2. "description": "...",
  3. "level": "...",
  4. "name": "...",
  5. "int_value": "...",
  6. "buf_value": "...",
  7. "state": "..."
  8. }

description

(string) An optional name to give this socket option for debugging, etc. Uniqueness is not required and no special meaning is assumed.

level

(int64) Corresponding to the level value passed to setsockopt, such as IPPROTO_TCP

name

(int64) The numeric name as passed to setsockopt

int_value

(int64) Because many sockopts take an int value.

Precisely one of int_value, buf_value must be set.

buf_value

(bytes) Otherwise it’s a byte buffer.

Precisely one of int_value, buf_value must be set.

state

(core.SocketOption.SocketState) The state in which the option will be applied. When used in BindConfig STATE_PREBIND is currently the only valid value.

Enum core.SocketOption.SocketState

[core.SocketOption.SocketState proto]

STATE_PREBIND

(DEFAULT) ⁣Socket options are applied after socket creation but before binding the socket to a port

STATE_BOUND

⁣Socket options are applied after binding the socket to a port but before calling listen()

STATE_LISTENING

⁣Socket options are applied after calling listen()