// utility extensions for tweaking the behavior of protogen syntax = "proto3"; import "google/protobuf/descriptor.proto"; package protobuf_net; option csharp_namespace = "ProtoBuf.Reflection"; extend .google.protobuf.FileOptions { ProtogenFileOptions fileopt = 1037 [(.protobuf_net.fieldopt).name = "Options"]; } extend .google.protobuf.MessageOptions { ProtogenMessageOptions msgopt = 1037 [(.protobuf_net.fieldopt).name = "Options"]; } extend .google.protobuf.FieldOptions { ProtogenFieldOptions fieldopt = 1037 [(.protobuf_net.fieldopt).name = "Options"]; } extend .google.protobuf.EnumOptions { ProtogenEnumOptions enumopt = 1037 [(.protobuf_net.fieldopt).name = "Options"]; } extend .google.protobuf.EnumValueOptions { ProtogenEnumValueOptions enumvalopt = 1037 [(.protobuf_net.fieldopt).name = "Options"]; } extend .google.protobuf.ServiceOptions { ProtogenServiceOptions serviceopt = 1037 [(.protobuf_net.fieldopt).name = "Options"]; } extend .google.protobuf.MethodOptions { ProtogenMethodOptions methodopt = 1037 [(.protobuf_net.fieldopt).name = "Options"]; } extend .google.protobuf.OneofOptions { ProtogenOneofOptions oneofopt = 1037 [(.protobuf_net.fieldopt).name = "Options"]; } enum Access { option (.protobuf_net.enumopt) = { access: PUBLIC }; INHERIT = 0; PUBLIC = 1; PRIVATE = 2; INTERNAL = 3; } message ProtogenFileOptions { string namespace = 1; Access access = 2; string extensions = 3 [(.protobuf_net.fieldopt).name = "ExtensionTypeName"]; string csharp_langver = 4 [(.protobuf_net.fieldopt).name = "CSharpLanguageVersion"]; // language specific version specifier, for example "3.0" or "3" for C# 3 bool requiredDefaults = 5 [(.protobuf_net.fieldopt).name = "EmitRequiredDefaults"]; // intialize required values with their default values bool oneofEnum = 6 [(.protobuf_net.fieldopt).name = "EmitOneOfEnum"]; // emit enums for oneof elements string vb_langver = 7 [(.protobuf_net.fieldopt).name = "VisualBasicLanguageVersion"]; // language specific version specifier, for example "11" for VB 11 } message ProtogenMessageOptions { string name = 1; Access access = 2; string extensions = 3 [(.protobuf_net.fieldopt).name = "ExtensionTypeName"]; string namespace = 4; // optional namespace, otherwise the order is: ProtogenFileOptions.namespace, global csharp_namespace, package } message ProtogenFieldOptions { string name = 1; Access access = 2; bool asRef = 3 [(.protobuf_net.fieldopt).name = "AsReference"]; bool dynamicType = 4 [(.protobuf_net.fieldopt).name = "DynamicType"]; } message ProtogenEnumOptions { string name = 1; Access access = 2; string namespace = 3; // optional namespace, otherwise the order is: ProtogenFileOptions.namespace, global csharp_namespace, package } message ProtogenEnumValueOptions { string name = 1; } message ProtogenServiceOptions { string name = 1; Access access = 2; } message ProtogenMethodOptions { string name = 1; } message ProtogenOneofOptions { string name = 1; bool isSubType = 2 [(.protobuf_net.fieldopt).name = "IsSubType"]; } option (.protobuf_net.fileopt) = { access: PUBLIC // mostly a test };