Files
trailofbits-buttercup/common/protos/msg.proto
T
Boyan MILANOV 966c184129 Make build_type a proper enum (#346)
* Make build type an int enum

* Lint

* Fix protobuf

* Fix protobuf for linux

* Remove old  enum and use the  class from protobuf message

* Lint

* Fix tests

* Print build type name instead of int value in logs

* Try fix enum instanciation in scheduler

* Correctly get protobuf enum name for BuildType values using EnumTypeWrapper methods

* Fix import

---------

Co-authored-by: Boyan MILANOV <boyanmilanov@coder-boyanmilanov-aixcc-boyan.c.production-1-405717.internal>
2025-04-07 11:54:42 +03:00

129 lines
2.4 KiB
Protocol Buffer

syntax = "proto3";
package msgpb2;
// Task-related messages
message Task {
enum TaskType {
TASK_TYPE_FULL = 0;
TASK_TYPE_DELTA = 1;
}
string message_id = 1;
int64 message_time = 2;
string task_id = 3;
TaskType task_type = 4;
repeated SourceDetail sources = 5;
int64 deadline = 6;
bool cancelled = 7;
string project_name = 8;
string focus = 9;
map<string, string> metadata = 10; // String to string map for traceability data
}
enum BuildType {
FUZZER = 0;
COVERAGE = 1;
TRACER_NO_DIFF = 2;
}
message SourceDetail {
enum SourceType {
SOURCE_TYPE_REPO = 0;
SOURCE_TYPE_FUZZ_TOOLING = 1;
SOURCE_TYPE_DIFF = 2;
}
string sha256 = 1;
SourceType source_type = 2;
string url = 3;
}
message TaskDownload {
Task task = 1;
}
message TaskReady {
Task task = 1;
}
message TaskDelete {
oneof delete_option {
string task_id = 1;
bool all = 3;
}
float received_at = 2;
}
// Fuzzer-related messages
message BuildRequest {
string engine = 1;
string sanitizer = 2;
string task_dir = 3;
string task_id = 4;
BuildType build_type = 5;
bool apply_diff = 6;
}
message BuildOutput {
string engine = 1;
string sanitizer = 2;
string task_dir = 3;
string task_id = 4;
BuildType build_type = 5;
bool apply_diff = 6;
}
message WeightedHarness {
float weight = 1;
string package_name = 2;
string harness_name = 3;
string task_id = 4;
}
message Crash {
BuildOutput target = 1;
string harness_name = 2;
string crash_input_path = 3;
string stacktrace = 4;
}
message TracedCrash {
Crash crash = 1;
string tracer_stacktrace = 2;
}
message ConfirmedVulnerability {
TracedCrash crash = 1;
string vuln_id = 2;
}
message Patch {
string task_id = 1;
string vulnerability_id = 2;
string patch = 3;
}
message IndexRequest {
BuildType build_type = 1;
string package_name = 2;
string sanitizer = 3;
string task_dir = 4;
string task_id = 5;
}
message IndexOutput {
BuildType build_type = 1;
string package_name = 2;
string sanitizer = 3;
string task_dir = 4;
string task_id = 5;
}
message FunctionCoverage {
string function_name = 1;
repeated string function_paths = 2;
int32 total_lines = 3;
int32 covered_lines = 4;
}