is it possible to parse an incoming google protocol buffers datagram without any .proto file? I merely now its been serialized using protocol buffers but have no idea about the IDL file.
I'm looking for a way to just iterate through any value by some sort of reflection? Is this possible?
Thank you!
protoc --decode_raw < my_file
You need to take the following things into account when inspecting the output:
- None of the field names are visible, just the tag numbers.
- All varint-fields are shown as integers. This is ok for most types, but sint* will appear in the "zigzagged" format.
- Doubles and floats will be shown as hex.
- Bytes, string fields and submessages all appear the same, i.e. just a bunch of bytes.
If you want to decode the messages programmatically, you can write your own .proto file after you have figured out what the fields mean using the above method.