aboutsummaryrefslogtreecommitdiff
path: root/protobuf-c/example.proto
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2022-09-07 13:50:57 +0200
committerToni Uhlig <matzeton@googlemail.com>2022-09-07 15:09:39 +0200
commit97af3b2fcfa46c6f0d9c010e935e9203b444bcd8 (patch)
tree75f85fe972817237ecded3ddb28821f2246b6373 /protobuf-c/example.proto
parent9a623bfc32a56aa4142fdeacede57b98991edc4f (diff)
Added protobuf-c + example.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'protobuf-c/example.proto')
-rw-r--r--protobuf-c/example.proto31
1 files changed, 31 insertions, 0 deletions
diff --git a/protobuf-c/example.proto b/protobuf-c/example.proto
new file mode 100644
index 0000000..e77f36c
--- /dev/null
+++ b/protobuf-c/example.proto
@@ -0,0 +1,31 @@
+syntax = "proto2";
+
+message SomethingWithUINTs {
+ optional uint32 id = 1;
+ optional uint32 ip_address = 2;
+ optional uint32 port_num = 3;
+}
+
+message SomethingMore {
+ enum Errors {
+ SUCCESS = 200;
+ ERROR_BAD_REQUEST = 400;
+ ERROR_NOT_FOUND = 404;
+ ERROR_SERVER_ERROR = 500;
+ ERROR_SERVICE_UNAVAILABLE = 503;
+ }
+ optional Errors error_code = 1;
+ optional SomethingWithUINTs uints = 2;
+}
+
+message EvenMore {
+ enum SomeEnum {
+ FIRST = 0xFE;
+ SECOND = 0xFF;
+ }
+ required SomeEnum enum_value = 1;
+ repeated SomethingWithUINTs uints = 2;
+ required bytes name=3;
+ required bytes value=4;
+ optional string s=5;
+}