// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License.  You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.

syntax = "proto2";

package brpc.rdma;

option cc_generic_services = false;

// RDMA handshake v3 message.
// Carried in the body of every "RDM3" handshake packet:
//
//   [ "RDM3" 4B ][ pb_size 4B ][ RdmaHello protobuf bytes ]
message RdmaHello {
    // ---- v2-parity base fields (required) ----
    // Listed first and in the same logical order as the v2 binary
    // HelloMessage (minus hello_ver / impl_ver, which are subsumed by
    // the wrapper magic "RDM3"). Keeping the same ordering simplifies
    // side-by-side reasoning when debugging mixed v2/v3 traffic.
    //
    // Marked `required` because the handshake cannot proceed without
    // any of these; ParseFromArray() will reject a missing field at
    // the protobuf layer, so we don't need an extra has_xxx() check
    // in RdmaHelloValid() for presence.
    required uint32 block_size = 1;
    required uint32 sq_size    = 2;
    required uint32 rq_size    = 3;
    required uint32 lid        = 4;
    // Must be exactly 16 bytes (sizeof(ibv_gid)).
    required bytes  gid        = 5;
    required uint32 qp_num     = 6;
}
