syntax = "proto2";

package KismetExternal;

option optimize_for = LITE_RUNTIME;

// Overall command structure used for all Kismet helper binaries;  Each command
// is an arbitrary string (command type), with a unique sequence number which is
// used in responses to the command.
//
// The payload of the command (content) is arbitrary, however Kismet uses 
// Google Protobuf for all embedded commands, and it strongly recommended that
// other implementations do as well.
// 
// This command is wrapped inside the kismet network structure which defines
// total length, embeds a checksum, and so on.

message Command {
    required string command = 1; // Command type
    required uint32 seqno = 2; // Unique command sequence number
    required bytes content = 3;
}

// User-readable message (Helper->Kismet)
message MsgbusMessage {
    // Match the Kismet messagebus types
    enum MessageType {
        DEBUG = 1;
        INFO = 2;
        ERROR = 4;
        ALERT = 8;
        FATAL = 16;
    }

    required MessageType msgtype = 1;
    required string msgtext = 2;
}


// Request other end send a PONG (bidirectional)
message Ping {

}

// Respond to PING (bidirectional)
message Pong {
    required uint32 ping_seqno = 1; // PING sequence that reached out to us
}

// Shut down the connection (bidirectional)
message ExternalShutdown {
    required string reason = 1;
}

// Register helper; this helps us identify what we're talking to if we need to
// dispatch the helpers / multiplex over a single TCP socket for remote systems
// (Helper->Kismet)
message SystemRegister {
    required string subsystem = 1;
}

