DCCL v3
option_extensions.proto
1 
2 import "google/protobuf/descriptor.proto";
3 
4 
5 // Email from liujisi@google.com on 10.02.2012: Feel free to use 1012 for all types of options.
6 //--------------------------------
7 //Project: Dynamic Compact Control Language
8 //Contact: Toby Schneider <tes@mit.edu>
9 //Web site: https://launchpad.net/dccl
10 //Extensions: 1012 (all types)
11 //--------------------------------
12 package dccl;
13 
14 
15 extend .google.protobuf.FieldOptions
16 {
17  optional DCCLFieldOptions field = 1012;
18 }
19 
20 extend .google.protobuf.MessageOptions
21 {
22  optional DCCLMessageOptions msg = 1012;
23 }
24 
25 
26 message DCCLFieldOptions
27 {
28  // what encoder / decoder should we use?
29  optional string codec = 1 [default = "dccl.default2"];
30  // leave this field out of DCCL transmissions (has_field() will be false on receipt)
31  optional bool omit = 2 [default = false];
32  // set true for fields in the header (will *not* be encrypte)d
33  optional bool in_head = 3 [default = false];
34 
35 
36  // double, float
37  optional int32 precision = 4 [default = 0];
38  // int, double, float
39  optional double min = 5 [default = 0];
40  optional double max = 6 [default = 0];
41 
42  // time ("1 day" can encode times 12h before or after the receiver's time)
43  optional uint32 num_days = 7 [default = 1];
44 
45  // static
46  optional string static_value = 8 [default = ""];
47 
48  // string, bytes
49  optional uint32 max_length = 9 [default = 0];
50 
51  // any `repeated` field
52  optional uint32 max_repeat = 10 [default = 1];
53 
54  // enum
55  optional bool packed_enum = 11 [default = true];
56 
57  optional string description = 20;
58 
59  message Units
60  {
61  // units
62  optional string base_dimensions = 1;
63  optional string derived_dimensions = 2;
64  optional string system = 3 [default = "si"];
65  optional bool relative_temperature = 4 [default = false];
66  optional string unit = 5;
67  optional string prefix = 6;
68  }
69  optional Units units = 30;
70 
71  // ccl = 1000
72  // arithmetic = 1001
73  extensions 1000 to max;
74 }
75 
76 
77 message DCCLMessageOptions
78 {
79  optional int32 id = 1;
80  optional uint32 max_bytes = 2;
81 
82  optional string codec = 3 [default = "dccl.default2"];
83 
84  optional string codec_group = 4 [default = "dccl.default2"];
85  optional int32 codec_version = 5 [default = 2];
86 
87  optional string unit_system = 30 [default = "si"];
88 
89 }
90