In general, the "standard" way to tell between different incoming message types in protobuf is to define a union type that would contain these different messages and also a field to determine which of them is present. See official docs on this here.
Example for your case:
message A
{
// ...
}
message B
{
// ...
}
message C
{
enum Type { A = 1; B = 2; }
required Type type = 1;
optional A a = 2;
optional B b = 3;
}