syntax = "proto3";

message Route {
    bytes route_id = 1;
    int64 timestamp = 2;
    string saddr = 3;
    string daddr = 4;
}

message Message {
    enum Kind {
        HANDSHAKE = 0;
        GOSSIP = 1;
        SYN = 2;
        ACK = 3;

        PUB = 4;
        SUB = 5;
        REQ = 6;
        RES = 7;
    }

    message Routing {
        bytes src_id = 1;
        bytes dst_id = 2;
        repeated Route routes = 3;
    }

    bytes id = 1;
    repeated Kind kind = 2;
    Routing routing = 3;

    string topic = 4;
    bytes payload = 5;
}
