Ask Your Question
0

Dissect request/response of protobuf service method without gRPC

asked 2023-10-12 12:45:07 +0000

wasphin gravatar image

updated 2023-10-12 12:45:31 +0000

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-10-12 15:34:21 +0000

wasphin gravatar image

updated 2023-10-12 15:38:16 +0000

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);
}
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2023-10-12 12:45:07 +0000

Seen: 201 times

Last updated: Oct 12 '23