1syntax = "proto3"; 2 3package envoy.api.v2.core; 4 5import "udpa/annotations/migrate.proto"; 6import "udpa/annotations/status.proto"; 7import "validate/validate.proto"; 8 9option java_package = "io.envoyproxy.envoy.api.v2.core"; 10option java_outer_classname = "SocketOptionProto"; 11option java_multiple_files = true; 12option go_package = "github.com/envoyproxy/go-control-plane/envoy/api/v2/core"; 13option (udpa.annotations.file_migrate).move_to_package = "envoy.config.core.v3"; 14option (udpa.annotations.file_status).package_version_status = FROZEN; 15 16// [#protodoc-title: Socket Option ] 17 18// Generic socket option message. This would be used to set socket options that 19// might not exist in upstream kernels or precompiled Envoy binaries. 20// [#next-free-field: 7] 21message SocketOption { 22 enum SocketState { 23 // Socket options are applied after socket creation but before binding the socket to a port 24 STATE_PREBIND = 0; 25 26 // Socket options are applied after binding the socket to a port but before calling listen() 27 STATE_BOUND = 1; 28 29 // Socket options are applied after calling listen() 30 STATE_LISTENING = 2; 31 } 32 33 // An optional name to give this socket option for debugging, etc. 34 // Uniqueness is not required and no special meaning is assumed. 35 string description = 1; 36 37 // Corresponding to the level value passed to setsockopt, such as IPPROTO_TCP 38 int64 level = 2; 39 40 // The numeric name as passed to setsockopt 41 int64 name = 3; 42 43 oneof value { 44 option (validate.required) = true; 45 46 // Because many sockopts take an int value. 47 int64 int_value = 4; 48 49 // Otherwise it's a byte buffer. 50 bytes buf_value = 5; 51 } 52 53 // The state in which the option will be applied. When used in BindConfig 54 // STATE_PREBIND is currently the only valid value. 55 SocketState state = 6 [(validate.rules).enum = {defined_only: true}]; 56} 57