-
Ruslan Kuprieiev authored
Pavel reported that decimal values for some fields are hard to read, because people used to see hex values in there. Unfortunately, json doesn't support hex representation of integers, so we can only store them as hex strings. Not all field need to be represented as hex strings, so this set introduces a custom field option called "criu" to use in our proto files. One should use [(criu).hex = true] to mark which field should be represented as a hex string. pb2dict module from pycriu package will look into field options and if he finds that criu.hex is set to True, it will convert such field to/from hex string. Though, such behaviour is optional and user can request it by specifying --format hex when calling crit decode("crit encode" in its turn, detects such fields automatically and doesn't require any special cmdline options to be set). We need our proto files to compile with both protoc and protoc-c compilers, which requires creating google/protobuf directory with a symlink to /usr/include/google/protobuf/ descriptor.proto to make protoc-c and generated c files happy. Reported-by:
Pavel Emelyanov <xemul@parallels.com> Signed-off-by:
Ruslan Kuprieiev <kupruser@gmail.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
87da3e34
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
descriptor.proto |