1syntax = "proto3";
2// package name placeholder
3
4message SubMessage {
5    string substuff1 = 1;
6    int32 substuff2 = 2;
7    fixed32 substuff3 = 3;
8}
9
10message EmptyMessage {
11
12}
13
14enum HugeEnum {
15    HE_Zero = 0;
16    Negative = -2147483647; /* protoc doesn't accept -2147483648 here */
17    Positive =  2147483647;
18}
19
20message Limits {
21    int32      int32_min  =  1;
22    int32      int32_max  =  2;
23    uint32     uint32_min =  3;
24    uint32     uint32_max =  4;
25    int64      int64_min  =  5;
26    int64      int64_max  =  6;
27    uint64     uint64_min =  7;
28    uint64     uint64_max =  8;
29    HugeEnum   enum_min   =  9;
30    HugeEnum   enum_max   = 10;
31}
32
33enum MyEnum {
34    Zero = 0;
35    First = 1;
36    Second = 2;
37    Truth = 42;
38}
39
40message AllTypes {
41    int32      sng_int32   = 1;
42    int64      sng_int64   = 2;
43    uint32     sng_uint32  = 3;
44    uint64     sng_uint64  = 4;
45    sint32     sng_sint32  = 5;
46    sint64     sng_sint64  = 6;
47    bool       sng_bool    = 7;
48
49    fixed32    sng_fixed32 = 8;
50    sfixed32   sng_sfixed32= 9;
51    float      sng_float   = 10;
52
53    fixed64    sng_fixed64 = 11;
54    sfixed64   sng_sfixed64= 12;
55    double     sng_double  = 13;
56
57    string     sng_string  = 14;
58    bytes      sng_bytes   = 15;
59    SubMessage sng_submsg  = 16;
60    MyEnum     sng_enum    = 17;
61    EmptyMessage sng_emptymsg = 18;
62    bytes      sng_fbytes  = 19;
63
64    repeated int32      rep_int32   = 21 [packed = true];
65    repeated int64      rep_int64   = 22 [packed = true];
66    repeated uint32     rep_uint32  = 23 [packed = true];
67    repeated uint64     rep_uint64  = 24 [packed = true];
68    repeated sint32     rep_sint32  = 25 [packed = true];
69    repeated sint64     rep_sint64  = 26 [packed = true];
70    repeated bool       rep_bool    = 27 [packed = true];
71
72    repeated fixed32    rep_fixed32 = 28 [packed = true];
73    repeated sfixed32   rep_sfixed32= 29 [packed = true];
74    repeated float      rep_float   = 30 [packed = true];
75
76    repeated fixed64    rep_fixed64 = 31 [packed = true];
77    repeated sfixed64   rep_sfixed64= 32 [packed = true];
78    repeated double     rep_double  = 33 [packed = true];
79
80    repeated string     rep_string  = 34;
81    repeated bytes      rep_bytes   = 35;
82    repeated SubMessage rep_submsg  = 36;
83    repeated MyEnum     rep_enum    = 37 [packed = true];
84    repeated EmptyMessage rep_emptymsg = 38;
85    repeated bytes      rep_fbytes  = 39;
86
87    oneof oneof
88    {
89        SubMessage oneof_msg1 = 60;
90        EmptyMessage oneof_msg2 = 61;
91        SubMessage static_msg = 63;
92    }
93
94    // Check that extreme integer values are handled correctly
95    Limits     req_limits = 98;
96
97    // Just to make sure that the size of the fields has been calculated
98    // properly, i.e. otherwise a bug in last field might not be detected.
99    int32      end = 999;
100}
101
102