First time here? Check out the FAQ!
THIS IS A TEST INSTANCE. Feel free to ask and answer questions, but take care to avoid triggering too many notifications.
0

Dissect request/response of protobuf service method without gRPC

Hi,

We implement a protobuf generic service, the service name and method name can be dissected, and how to get the request/response message type in a Lua dissector? In gRPC, it seems to use grpc_message_type to auto-detected the message type as a syntax of application/grpc,/helloworld.Greeter/SayHello,request, how can I reuse this feature to parse my request and response parts?

Thanks.

wasphin's avatar
1
wasphin
asked 2023-10-12 12:45:07 +0000, updated 2023-10-12 12:45:31 +0000
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

After digging into the protobuf dissector, it supports parsing the pb_msg_type of syntax application/grpc,/service/method,direction, and it works.

local protobuf_dissector = Dissector.get("protobuf")
pinfo.private["pb_msg_type"] = "application/grpc,/" .. service_name .. "/" .. method_name .. ",request"
protobuf_dissector:call(tvb_body, pinfo, tree)

Just note that there must be a space between the method name and paren.

service Greeter {
    rpc SayHello (HelloRequest) returns (HelloResponse);
}
wasphin's avatar
1
wasphin
answered 2023-10-12 15:34:21 +0000, updated 2023-10-12 15:38:16 +0000
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer