THIS IS A TEST INSTANCE. Feel free to ask and answer questions, but take care to avoid triggering too many notifications.

Revision history  [back]

lua example for protobuf dissector which has protobuf encoded within protobuf

Hi,

Am looking for working example for below case where data is serialized as bytes to another protobuf.

In below example streamDataArgs msg includes "data" as bytes and that is serialized with encodeData.proto. This is a very simple case and I would like to know if there is simpler way to get the working lua example for this.

I found https://ask.wireshark.org/question/21121/decode-protobuf-within-a-protobuf-in-lua-plugin/ but that neither had the protofile nor the full lua script example to check.

serviceA.proto

syntax = "proto3";

package export_data;

service streamDataOut { 
    rpc streamData(stream streamDataArgs) returns(stream streamDataArgs) {}; 
}

message streamDataArgs { 
    int64 Id = 1; 
    bytes data = 2; // serialized with encodeDataInfo message from encodeData.proto 
}

encodeData.proto

syntax = "proto3";

package encoded_data;

message encodeDataInfo { 
    string name = 1; // set to macData.proto
    bytes val = 2;     // serialized with macDataInfo from macData.proto
}

macData.proto

syntax = "proto3";

package mac_data;

message macDataInfo { 
    string mac_addr = 1; // set to mac address
    uint64 time = 2;        // set to epoch time in ms
}

pcap file

https://www.dropbox.com/scl/fi/nayzxf0al7v2pd4fojcgc/proto_data.pcap?rlkey=1p9tne61gsxglejsb226cvy8f&dl=0

lua example for protobuf dissector which has protobuf encoded within protobuf

Hi,

Am looking for working example for below case where data is serialized as bytes to another protobuf.

In below example streamDataArgs msg includes "data" as bytes and that is serialized with encodeData.proto. This is a very simple case and I would like to know if there is simpler way to get the working lua example for this.

I found https://ask.wireshark.org/question/21121/decode-protobuf-within-a-protobuf-in-lua-plugin/ but that neither had the protofile nor the full lua script example to check.

serviceA.proto

syntax = "proto3";

package export_data;

service streamDataOut { 
    rpc streamData(stream streamDataArgs) returns(stream streamDataArgs) {}; 
}

message streamDataArgs { 
    int64 Id = 1; 
    bytes data = 2; // serialized with encodeDataInfo message from encodeData.proto 
}

encodeData.proto

syntax = "proto3";

package encoded_data;

message encodeDataInfo { 
    string name = 1; // set to macData.proto
    bytes val = 2;     // serialized with macDataInfo from macData.proto
}

macData.proto

syntax = "proto3";

package mac_data;

message macDataInfo { 
    string mac_addr = 1; // set to mac address
    uint64 time = 2;        // set to epoch time in ms
}

pcap file

https://www.dropbox.com/scl/fi/nayzxf0al7v2pd4fojcgc/proto_data.pcap?rlkey=1p9tne61gsxglejsb226cvy8f&dl=0

lua example for protobuf dissector which has protobuf encoded encode within protobuf

Hi,

Am looking for working example for below case where data is serialized as bytes to another protobuf.

In below example streamDataArgs msg includes "data" as bytes and that is serialized with encodeData.proto. This is a very simple case and I would like to know if there is simpler way to get the working lua example for this.

I found https://ask.wireshark.org/question/21121/decode-protobuf-within-a-protobuf-in-lua-plugin/ but that neither had the protofile nor the full lua script example to check.

serviceA.proto

serviceA.proto:

syntax = "proto3"; "proto3";

package export_data; export_data;

service streamDataOut { { rpc streamData(stream streamDataArgs) returns(stream streamDataArgs) {}; } {}; }

message streamDataArgs { { int64 Id = 1; 1; bytes data = 2; // serialized with encodeDataInfo message from encodeData.proto }

encodeData.proto

encodeData.proto
}

encodeData.proto:

syntax = "proto3"; "proto3";

package encoded_data; = "encoded_data";

message encodeDataInfo { { string name = 1; // set to macData.proto bytes 1; string val = 2; // serialized with macDataInfo from macData.proto }

macData.proto

syntax = "proto3";

package mac_data;

message macDataInfo { 
    string mac_addr = 1; // set to mac address
    uint64 time = 2;        // set to epoch time in ms
}
2; }

lua example for protobuf dissector which has protobuf encode within protobufprotobuf encode

Hi,

Am looking for working example for below case where data is serialized as bytes to another protobuf.

In below example streamDataArgs msg includes "data" as bytes and that is serialized with encodeData.proto. This is a very simple case and I would like to know if there is simpler way to get the working lua example for this.

I found https://ask.wireshark.org/question/21121/decode-protobuf-within-a-protobuf-in-lua-plugin/ but that neither had the protofile nor the full lua script example to check.

serviceA.proto:

syntax = "proto3";

package export_data;

service streamDataOut { rpc streamData(stream streamDataArgs) returns(stream streamDataArgs) {}; }

message streamDataArgs { int64 Id = 1; bytes data = 2; // serialized with encodeDataInfo message from encodeData.proto }

encodeData.proto:

syntax = "proto3";

package = "encoded_data";

message encodeDataInfo { string name = 1; string val = 2; }

lua example for protobuf dissector which has protobuf encode within protobuf encode

Hi,

Am looking for working example for below case where data is serialized as bytes to another protobuf.

In below example streamDataArgs msg includes "data" as bytes and that is serialized with encodeData.proto. This is a very simple case and I would like to know if there is simpler way to get the working lua example for this.

I found https://ask.wireshark.org/question/21121/decode-protobuf-within-a-protobuf-in-lua-plugin/ but that neither had the protofile nor the full lua script example to check.

serviceA.proto:

syntax = "proto3";

package export_data;

service streamDataOut { rpc streamData(stream streamDataArgs) returns(stream streamDataArgs) {}; }

message streamDataArgs { int64 Id = 1; bytes data = 2; // serialized with encodeDataInfo message from encodeData.proto }

encodeData.proto:

syntax = "proto3";

package = "encoded_data";

message encodeDataInfo { string name = 1; string val = 2; }

lua example for protobuf dissector which has protobuf encode within protobuf encode

Hi,

Am looking for working example for below case where data is serialized as bytes to another protobuf.

In below example streamDataArgs msg includes "data" as bytes and that is serialized with encodeData.proto. This is a very simple case and I would like to know if there is simpler way to get the working lua example for this.

I found https://ask.wireshark.org/question/21121/decode-protobuf-within-a-protobuf-in-lua-plugin/ but that neither had the protofile nor the full lua script example to check.

serviceA.proto:

syntax = "proto3";

package export_data;

service streamDataOut { rpc streamData(stream streamDataArgs) returns(stream streamDataArgs) {}; }

message streamDataArgs { int64 Id = 1; bytes data = 2; // serialized with encodeDataInfo message from encodeData.proto }

encodeData.proto:

syntax = "proto3";

package = "encoded_data";

message encodeDataInfo { string name = 1; string val = 2; }