#![allow(unknown_lints)]
#![allow(clippy::all)]
#![allow(unused_attributes)]
#![cfg_attr(rustfmt, rustfmt::skip)]
#![allow(dead_code)]
#![allow(missing_docs)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]
#![allow(trivial_casts)]
#![allow(unused_results)]
#![allow(unused_mut)]
const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_7_2;
#[derive(PartialEq,Clone,Default,Debug)]
pub struct SigmaMatch {
pub match_context: ::std::vec::Vec<SigmaMatchContext>,
pub rule_level: ::protobuf::EnumOrUnknown<sigma_rule::Level>,
pub rule_id: ::std::string::String,
pub rule_source: ::std::string::String,
pub rule_title: ::std::string::String,
pub rule_description: ::std::string::String,
pub rule_author: ::std::string::String,
pub special_fields: ::protobuf::SpecialFields,
}
impl<'a> ::std::default::Default for &'a SigmaMatch {
fn default() -> &'a SigmaMatch {
<SigmaMatch as ::protobuf::Message>::default_instance()
}
}
impl SigmaMatch {
pub fn new() -> SigmaMatch {
::std::default::Default::default()
}
fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
let mut fields = ::std::vec::Vec::with_capacity(7);
let mut oneofs = ::std::vec::Vec::with_capacity(0);
fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>(
"match_context",
|m: &SigmaMatch| { &m.match_context },
|m: &mut SigmaMatch| { &mut m.match_context },
));
fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
"rule_level",
|m: &SigmaMatch| { &m.rule_level },
|m: &mut SigmaMatch| { &mut m.rule_level },
));
fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
"rule_id",
|m: &SigmaMatch| { &m.rule_id },
|m: &mut SigmaMatch| { &mut m.rule_id },
));
fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
"rule_source",
|m: &SigmaMatch| { &m.rule_source },
|m: &mut SigmaMatch| { &mut m.rule_source },
));
fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
"rule_title",
|m: &SigmaMatch| { &m.rule_title },
|m: &mut SigmaMatch| { &mut m.rule_title },
));
fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
"rule_description",
|m: &SigmaMatch| { &m.rule_description },
|m: &mut SigmaMatch| { &mut m.rule_description },
));
fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
"rule_author",
|m: &SigmaMatch| { &m.rule_author },
|m: &mut SigmaMatch| { &mut m.rule_author },
));
::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<SigmaMatch>(
"SigmaMatch",
fields,
oneofs,
)
}
}
impl ::protobuf::Message for SigmaMatch {
const NAME: &'static str = "SigmaMatch";
fn is_initialized(&self) -> bool {
true
}
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
while let Some(tag) = is.read_raw_tag_or_eof()? {
match tag {
10 => {
self.match_context.push(is.read_message()?);
},
16 => {
self.rule_level = is.read_enum_or_unknown()?;
},
26 => {
self.rule_id = is.read_string()?;
},
34 => {
self.rule_source = is.read_string()?;
},
42 => {
self.rule_title = is.read_string()?;
},
50 => {
self.rule_description = is.read_string()?;
},
58 => {
self.rule_author = is.read_string()?;
},
tag => {
::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
},
};
}
::std::result::Result::Ok(())
}
#[allow(unused_variables)]
fn compute_size(&self) -> u64 {
let mut my_size = 0;
for value in &self.match_context {
let len = value.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
};
if self.rule_level != ::protobuf::EnumOrUnknown::new(sigma_rule::Level::unknown) {
my_size += ::protobuf::rt::int32_size(2, self.rule_level.value());
}
if !self.rule_id.is_empty() {
my_size += ::protobuf::rt::string_size(3, &self.rule_id);
}
if !self.rule_source.is_empty() {
my_size += ::protobuf::rt::string_size(4, &self.rule_source);
}
if !self.rule_title.is_empty() {
my_size += ::protobuf::rt::string_size(5, &self.rule_title);
}
if !self.rule_description.is_empty() {
my_size += ::protobuf::rt::string_size(6, &self.rule_description);
}
if !self.rule_author.is_empty() {
my_size += ::protobuf::rt::string_size(7, &self.rule_author);
}
my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
self.special_fields.cached_size().set(my_size as u32);
my_size
}
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
for v in &self.match_context {
::protobuf::rt::write_message_field_with_cached_size(1, v, os)?;
};
if self.rule_level != ::protobuf::EnumOrUnknown::new(sigma_rule::Level::unknown) {
os.write_enum(2, ::protobuf::EnumOrUnknown::value(&self.rule_level))?;
}
if !self.rule_id.is_empty() {
os.write_string(3, &self.rule_id)?;
}
if !self.rule_source.is_empty() {
os.write_string(4, &self.rule_source)?;
}
if !self.rule_title.is_empty() {
os.write_string(5, &self.rule_title)?;
}
if !self.rule_description.is_empty() {
os.write_string(6, &self.rule_description)?;
}
if !self.rule_author.is_empty() {
os.write_string(7, &self.rule_author)?;
}
os.write_unknown_fields(self.special_fields.unknown_fields())?;
::std::result::Result::Ok(())
}
fn special_fields(&self) -> &::protobuf::SpecialFields {
&self.special_fields
}
fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
&mut self.special_fields
}
fn new() -> SigmaMatch {
SigmaMatch::new()
}
fn clear(&mut self) {
self.match_context.clear();
self.rule_level = ::protobuf::EnumOrUnknown::new(sigma_rule::Level::unknown);
self.rule_id.clear();
self.rule_source.clear();
self.rule_title.clear();
self.rule_description.clear();
self.rule_author.clear();
self.special_fields.clear();
}
fn default_instance() -> &'static SigmaMatch {
static instance: SigmaMatch = SigmaMatch {
match_context: ::std::vec::Vec::new(),
rule_level: ::protobuf::EnumOrUnknown::from_i32(0),
rule_id: ::std::string::String::new(),
rule_source: ::std::string::String::new(),
rule_title: ::std::string::String::new(),
rule_description: ::std::string::String::new(),
rule_author: ::std::string::String::new(),
special_fields: ::protobuf::SpecialFields::new(),
};
&instance
}
}
impl ::protobuf::MessageFull for SigmaMatch {
fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
descriptor.get(|| file_descriptor().message_by_package_relative_name("SigmaMatch").unwrap()).clone()
}
}
impl ::std::fmt::Display for SigmaMatch {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for SigmaMatch {
type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
}
#[derive(PartialEq,Clone,Default,Debug)]
pub struct SigmaMatchContext {
pub values: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
pub special_fields: ::protobuf::SpecialFields,
}
impl<'a> ::std::default::Default for &'a SigmaMatchContext {
fn default() -> &'a SigmaMatchContext {
<SigmaMatchContext as ::protobuf::Message>::default_instance()
}
}
impl SigmaMatchContext {
pub fn new() -> SigmaMatchContext {
::std::default::Default::default()
}
fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
let mut fields = ::std::vec::Vec::with_capacity(1);
let mut oneofs = ::std::vec::Vec::with_capacity(0);
fields.push(::protobuf::reflect::rt::v2::make_map_simpler_accessor_new::<_, _>(
"values",
|m: &SigmaMatchContext| { &m.values },
|m: &mut SigmaMatchContext| { &mut m.values },
));
::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<SigmaMatchContext>(
"SigmaMatchContext",
fields,
oneofs,
)
}
}
impl ::protobuf::Message for SigmaMatchContext {
const NAME: &'static str = "SigmaMatchContext";
fn is_initialized(&self) -> bool {
true
}
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
while let Some(tag) = is.read_raw_tag_or_eof()? {
match tag {
10 => {
let len = is.read_raw_varint32()?;
let old_limit = is.push_limit(len as u64)?;
let mut key = ::std::default::Default::default();
let mut value = ::std::default::Default::default();
while let Some(tag) = is.read_raw_tag_or_eof()? {
match tag {
10 => key = is.read_string()?,
18 => value = is.read_string()?,
_ => ::protobuf::rt::skip_field_for_tag(tag, is)?,
};
}
is.pop_limit(old_limit);
self.values.insert(key, value);
},
tag => {
::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
},
};
}
::std::result::Result::Ok(())
}
#[allow(unused_variables)]
fn compute_size(&self) -> u64 {
let mut my_size = 0;
for (k, v) in &self.values {
let mut entry_size = 0;
entry_size += ::protobuf::rt::string_size(1, &k);
entry_size += ::protobuf::rt::string_size(2, &v);
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(entry_size) + entry_size
};
my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
self.special_fields.cached_size().set(my_size as u32);
my_size
}
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
for (k, v) in &self.values {
let mut entry_size = 0;
entry_size += ::protobuf::rt::string_size(1, &k);
entry_size += ::protobuf::rt::string_size(2, &v);
os.write_raw_varint32(10)?; os.write_raw_varint32(entry_size as u32)?;
os.write_string(1, &k)?;
os.write_string(2, &v)?;
};
os.write_unknown_fields(self.special_fields.unknown_fields())?;
::std::result::Result::Ok(())
}
fn special_fields(&self) -> &::protobuf::SpecialFields {
&self.special_fields
}
fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
&mut self.special_fields
}
fn new() -> SigmaMatchContext {
SigmaMatchContext::new()
}
fn clear(&mut self) {
self.values.clear();
self.special_fields.clear();
}
fn default_instance() -> &'static SigmaMatchContext {
static instance: ::protobuf::rt::Lazy<SigmaMatchContext> = ::protobuf::rt::Lazy::new();
instance.get(SigmaMatchContext::new)
}
}
impl ::protobuf::MessageFull for SigmaMatchContext {
fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
descriptor.get(|| file_descriptor().message_by_package_relative_name("SigmaMatchContext").unwrap()).clone()
}
}
impl ::std::fmt::Display for SigmaMatchContext {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for SigmaMatchContext {
type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
}
#[derive(PartialEq,Clone,Default,Debug)]
pub struct SigmaRule {
pub rule: ::std::string::String,
pub title: ::std::string::String,
pub log_source: ::protobuf::MessageField<LogSource>,
pub status: ::std::string::String,
pub description: ::std::string::String,
pub references: ::std::vec::Vec<::std::string::String>,
pub fields: ::std::vec::Vec<::std::string::String>,
pub false_positives: ::std::vec::Vec<::std::string::String>,
pub level: ::protobuf::EnumOrUnknown<sigma_rule::Level>,
pub source: ::std::string::String,
pub tags: ::std::vec::Vec<::std::string::String>,
pub detection: ::protobuf::MessageField<Detection>,
pub author: ::std::string::String,
pub source_url: ::std::string::String,
pub special_fields: ::protobuf::SpecialFields,
}
impl<'a> ::std::default::Default for &'a SigmaRule {
fn default() -> &'a SigmaRule {
<SigmaRule as ::protobuf::Message>::default_instance()
}
}
impl SigmaRule {
pub fn new() -> SigmaRule {
::std::default::Default::default()
}
fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
let mut fields = ::std::vec::Vec::with_capacity(14);
let mut oneofs = ::std::vec::Vec::with_capacity(0);
fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
"rule",
|m: &SigmaRule| { &m.rule },
|m: &mut SigmaRule| { &mut m.rule },
));
fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
"title",
|m: &SigmaRule| { &m.title },
|m: &mut SigmaRule| { &mut m.title },
));
fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, LogSource>(
"log_source",
|m: &SigmaRule| { &m.log_source },
|m: &mut SigmaRule| { &mut m.log_source },
));
fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
"status",
|m: &SigmaRule| { &m.status },
|m: &mut SigmaRule| { &mut m.status },
));
fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
"description",
|m: &SigmaRule| { &m.description },
|m: &mut SigmaRule| { &mut m.description },
));
fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>(
"references",
|m: &SigmaRule| { &m.references },
|m: &mut SigmaRule| { &mut m.references },
));
fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>(
"fields",
|m: &SigmaRule| { &m.fields },
|m: &mut SigmaRule| { &mut m.fields },
));
fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>(
"false_positives",
|m: &SigmaRule| { &m.false_positives },
|m: &mut SigmaRule| { &mut m.false_positives },
));
fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
"level",
|m: &SigmaRule| { &m.level },
|m: &mut SigmaRule| { &mut m.level },
));
fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
"source",
|m: &SigmaRule| { &m.source },
|m: &mut SigmaRule| { &mut m.source },
));
fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>(
"tags",
|m: &SigmaRule| { &m.tags },
|m: &mut SigmaRule| { &mut m.tags },
));
fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, Detection>(
"detection",
|m: &SigmaRule| { &m.detection },
|m: &mut SigmaRule| { &mut m.detection },
));
fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
"author",
|m: &SigmaRule| { &m.author },
|m: &mut SigmaRule| { &mut m.author },
));
fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
"source_url",
|m: &SigmaRule| { &m.source_url },
|m: &mut SigmaRule| { &mut m.source_url },
));
::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<SigmaRule>(
"SigmaRule",
fields,
oneofs,
)
}
}
impl ::protobuf::Message for SigmaRule {
const NAME: &'static str = "SigmaRule";
fn is_initialized(&self) -> bool {
true
}
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
while let Some(tag) = is.read_raw_tag_or_eof()? {
match tag {
10 => {
self.rule = is.read_string()?;
},
18 => {
self.title = is.read_string()?;
},
26 => {
::protobuf::rt::read_singular_message_into_field(is, &mut self.log_source)?;
},
34 => {
self.status = is.read_string()?;
},
42 => {
self.description = is.read_string()?;
},
50 => {
self.references.push(is.read_string()?);
},
58 => {
self.fields.push(is.read_string()?);
},
66 => {
self.false_positives.push(is.read_string()?);
},
72 => {
self.level = is.read_enum_or_unknown()?;
},
82 => {
self.source = is.read_string()?;
},
90 => {
self.tags.push(is.read_string()?);
},
98 => {
::protobuf::rt::read_singular_message_into_field(is, &mut self.detection)?;
},
106 => {
self.author = is.read_string()?;
},
114 => {
self.source_url = is.read_string()?;
},
tag => {
::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
},
};
}
::std::result::Result::Ok(())
}
#[allow(unused_variables)]
fn compute_size(&self) -> u64 {
let mut my_size = 0;
if !self.rule.is_empty() {
my_size += ::protobuf::rt::string_size(1, &self.rule);
}
if !self.title.is_empty() {
my_size += ::protobuf::rt::string_size(2, &self.title);
}
if let Some(v) = self.log_source.as_ref() {
let len = v.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
}
if !self.status.is_empty() {
my_size += ::protobuf::rt::string_size(4, &self.status);
}
if !self.description.is_empty() {
my_size += ::protobuf::rt::string_size(5, &self.description);
}
for value in &self.references {
my_size += ::protobuf::rt::string_size(6, &value);
};
for value in &self.fields {
my_size += ::protobuf::rt::string_size(7, &value);
};
for value in &self.false_positives {
my_size += ::protobuf::rt::string_size(8, &value);
};
if self.level != ::protobuf::EnumOrUnknown::new(sigma_rule::Level::unknown) {
my_size += ::protobuf::rt::int32_size(9, self.level.value());
}
if !self.source.is_empty() {
my_size += ::protobuf::rt::string_size(10, &self.source);
}
for value in &self.tags {
my_size += ::protobuf::rt::string_size(11, &value);
};
if let Some(v) = self.detection.as_ref() {
let len = v.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
}
if !self.author.is_empty() {
my_size += ::protobuf::rt::string_size(13, &self.author);
}
if !self.source_url.is_empty() {
my_size += ::protobuf::rt::string_size(14, &self.source_url);
}
my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
self.special_fields.cached_size().set(my_size as u32);
my_size
}
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
if !self.rule.is_empty() {
os.write_string(1, &self.rule)?;
}
if !self.title.is_empty() {
os.write_string(2, &self.title)?;
}
if let Some(v) = self.log_source.as_ref() {
::protobuf::rt::write_message_field_with_cached_size(3, v, os)?;
}
if !self.status.is_empty() {
os.write_string(4, &self.status)?;
}
if !self.description.is_empty() {
os.write_string(5, &self.description)?;
}
for v in &self.references {
os.write_string(6, &v)?;
};
for v in &self.fields {
os.write_string(7, &v)?;
};
for v in &self.false_positives {
os.write_string(8, &v)?;
};
if self.level != ::protobuf::EnumOrUnknown::new(sigma_rule::Level::unknown) {
os.write_enum(9, ::protobuf::EnumOrUnknown::value(&self.level))?;
}
if !self.source.is_empty() {
os.write_string(10, &self.source)?;
}
for v in &self.tags {
os.write_string(11, &v)?;
};
if let Some(v) = self.detection.as_ref() {
::protobuf::rt::write_message_field_with_cached_size(12, v, os)?;
}
if !self.author.is_empty() {
os.write_string(13, &self.author)?;
}
if !self.source_url.is_empty() {
os.write_string(14, &self.source_url)?;
}
os.write_unknown_fields(self.special_fields.unknown_fields())?;
::std::result::Result::Ok(())
}
fn special_fields(&self) -> &::protobuf::SpecialFields {
&self.special_fields
}
fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
&mut self.special_fields
}
fn new() -> SigmaRule {
SigmaRule::new()
}
fn clear(&mut self) {
self.rule.clear();
self.title.clear();
self.log_source.clear();
self.status.clear();
self.description.clear();
self.references.clear();
self.fields.clear();
self.false_positives.clear();
self.level = ::protobuf::EnumOrUnknown::new(sigma_rule::Level::unknown);
self.source.clear();
self.tags.clear();
self.detection.clear();
self.author.clear();
self.source_url.clear();
self.special_fields.clear();
}
fn default_instance() -> &'static SigmaRule {
static instance: SigmaRule = SigmaRule {
rule: ::std::string::String::new(),
title: ::std::string::String::new(),
log_source: ::protobuf::MessageField::none(),
status: ::std::string::String::new(),
description: ::std::string::String::new(),
references: ::std::vec::Vec::new(),
fields: ::std::vec::Vec::new(),
false_positives: ::std::vec::Vec::new(),
level: ::protobuf::EnumOrUnknown::from_i32(0),
source: ::std::string::String::new(),
tags: ::std::vec::Vec::new(),
detection: ::protobuf::MessageField::none(),
author: ::std::string::String::new(),
source_url: ::std::string::String::new(),
special_fields: ::protobuf::SpecialFields::new(),
};
&instance
}
}
impl ::protobuf::MessageFull for SigmaRule {
fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
descriptor.get(|| file_descriptor().message_by_package_relative_name("SigmaRule").unwrap()).clone()
}
}
impl ::std::fmt::Display for SigmaRule {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for SigmaRule {
type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
}
pub mod sigma_rule {
#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)]
pub enum Level {
unknown = 0,
low = 1,
medium = 2,
high = 3,
critical = 4,
}
impl ::protobuf::Enum for Level {
const NAME: &'static str = "Level";
fn value(&self) -> i32 {
*self as i32
}
fn from_i32(value: i32) -> ::std::option::Option<Level> {
match value {
0 => ::std::option::Option::Some(Level::unknown),
1 => ::std::option::Option::Some(Level::low),
2 => ::std::option::Option::Some(Level::medium),
3 => ::std::option::Option::Some(Level::high),
4 => ::std::option::Option::Some(Level::critical),
_ => ::std::option::Option::None
}
}
fn from_str(str: &str) -> ::std::option::Option<Level> {
match str {
"unknown" => ::std::option::Option::Some(Level::unknown),
"low" => ::std::option::Option::Some(Level::low),
"medium" => ::std::option::Option::Some(Level::medium),
"high" => ::std::option::Option::Some(Level::high),
"critical" => ::std::option::Option::Some(Level::critical),
_ => ::std::option::Option::None
}
}
const VALUES: &'static [Level] = &[
Level::unknown,
Level::low,
Level::medium,
Level::high,
Level::critical,
];
}
impl ::protobuf::EnumFull for Level {
fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor {
static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new();
descriptor.get(|| super::file_descriptor().enum_by_package_relative_name("SigmaRule.Level").unwrap()).clone()
}
fn descriptor(&self) -> ::protobuf::reflect::EnumValueDescriptor {
let index = *self as usize;
Self::enum_descriptor().value_by_index(index)
}
}
impl ::std::default::Default for Level {
fn default() -> Self {
Level::unknown
}
}
impl Level {
pub(in super) fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData {
::protobuf::reflect::GeneratedEnumDescriptorData::new::<Level>("SigmaRule.Level")
}
}
}
#[derive(PartialEq,Clone,Default,Debug)]
pub struct LogSource {
pub category: ::std::string::String,
pub product: ::std::string::String,
pub service: ::std::string::String,
pub definition: ::std::string::String,
pub special_fields: ::protobuf::SpecialFields,
}
impl<'a> ::std::default::Default for &'a LogSource {
fn default() -> &'a LogSource {
<LogSource as ::protobuf::Message>::default_instance()
}
}
impl LogSource {
pub fn new() -> LogSource {
::std::default::Default::default()
}
fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
let mut fields = ::std::vec::Vec::with_capacity(4);
let mut oneofs = ::std::vec::Vec::with_capacity(0);
fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
"category",
|m: &LogSource| { &m.category },
|m: &mut LogSource| { &mut m.category },
));
fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
"product",
|m: &LogSource| { &m.product },
|m: &mut LogSource| { &mut m.product },
));
fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
"service",
|m: &LogSource| { &m.service },
|m: &mut LogSource| { &mut m.service },
));
fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
"definition",
|m: &LogSource| { &m.definition },
|m: &mut LogSource| { &mut m.definition },
));
::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<LogSource>(
"LogSource",
fields,
oneofs,
)
}
}
impl ::protobuf::Message for LogSource {
const NAME: &'static str = "LogSource";
fn is_initialized(&self) -> bool {
true
}
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
while let Some(tag) = is.read_raw_tag_or_eof()? {
match tag {
10 => {
self.category = is.read_string()?;
},
18 => {
self.product = is.read_string()?;
},
26 => {
self.service = is.read_string()?;
},
34 => {
self.definition = is.read_string()?;
},
tag => {
::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
},
};
}
::std::result::Result::Ok(())
}
#[allow(unused_variables)]
fn compute_size(&self) -> u64 {
let mut my_size = 0;
if !self.category.is_empty() {
my_size += ::protobuf::rt::string_size(1, &self.category);
}
if !self.product.is_empty() {
my_size += ::protobuf::rt::string_size(2, &self.product);
}
if !self.service.is_empty() {
my_size += ::protobuf::rt::string_size(3, &self.service);
}
if !self.definition.is_empty() {
my_size += ::protobuf::rt::string_size(4, &self.definition);
}
my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
self.special_fields.cached_size().set(my_size as u32);
my_size
}
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
if !self.category.is_empty() {
os.write_string(1, &self.category)?;
}
if !self.product.is_empty() {
os.write_string(2, &self.product)?;
}
if !self.service.is_empty() {
os.write_string(3, &self.service)?;
}
if !self.definition.is_empty() {
os.write_string(4, &self.definition)?;
}
os.write_unknown_fields(self.special_fields.unknown_fields())?;
::std::result::Result::Ok(())
}
fn special_fields(&self) -> &::protobuf::SpecialFields {
&self.special_fields
}
fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
&mut self.special_fields
}
fn new() -> LogSource {
LogSource::new()
}
fn clear(&mut self) {
self.category.clear();
self.product.clear();
self.service.clear();
self.definition.clear();
self.special_fields.clear();
}
fn default_instance() -> &'static LogSource {
static instance: LogSource = LogSource {
category: ::std::string::String::new(),
product: ::std::string::String::new(),
service: ::std::string::String::new(),
definition: ::std::string::String::new(),
special_fields: ::protobuf::SpecialFields::new(),
};
&instance
}
}
impl ::protobuf::MessageFull for LogSource {
fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
descriptor.get(|| file_descriptor().message_by_package_relative_name("LogSource").unwrap()).clone()
}
}
impl ::std::fmt::Display for LogSource {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for LogSource {
type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
}
#[derive(PartialEq,Clone,Default,Debug)]
pub struct Detection {
pub condition: ::std::string::String,
pub details: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
pub special_fields: ::protobuf::SpecialFields,
}
impl<'a> ::std::default::Default for &'a Detection {
fn default() -> &'a Detection {
<Detection as ::protobuf::Message>::default_instance()
}
}
impl Detection {
pub fn new() -> Detection {
::std::default::Default::default()
}
fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
let mut fields = ::std::vec::Vec::with_capacity(2);
let mut oneofs = ::std::vec::Vec::with_capacity(0);
fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
"condition",
|m: &Detection| { &m.condition },
|m: &mut Detection| { &mut m.condition },
));
fields.push(::protobuf::reflect::rt::v2::make_map_simpler_accessor_new::<_, _>(
"details",
|m: &Detection| { &m.details },
|m: &mut Detection| { &mut m.details },
));
::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<Detection>(
"Detection",
fields,
oneofs,
)
}
}
impl ::protobuf::Message for Detection {
const NAME: &'static str = "Detection";
fn is_initialized(&self) -> bool {
true
}
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
while let Some(tag) = is.read_raw_tag_or_eof()? {
match tag {
10 => {
self.condition = is.read_string()?;
},
18 => {
let len = is.read_raw_varint32()?;
let old_limit = is.push_limit(len as u64)?;
let mut key = ::std::default::Default::default();
let mut value = ::std::default::Default::default();
while let Some(tag) = is.read_raw_tag_or_eof()? {
match tag {
10 => key = is.read_string()?,
18 => value = is.read_string()?,
_ => ::protobuf::rt::skip_field_for_tag(tag, is)?,
};
}
is.pop_limit(old_limit);
self.details.insert(key, value);
},
tag => {
::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
},
};
}
::std::result::Result::Ok(())
}
#[allow(unused_variables)]
fn compute_size(&self) -> u64 {
let mut my_size = 0;
if !self.condition.is_empty() {
my_size += ::protobuf::rt::string_size(1, &self.condition);
}
for (k, v) in &self.details {
let mut entry_size = 0;
entry_size += ::protobuf::rt::string_size(1, &k);
entry_size += ::protobuf::rt::string_size(2, &v);
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(entry_size) + entry_size
};
my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
self.special_fields.cached_size().set(my_size as u32);
my_size
}
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
if !self.condition.is_empty() {
os.write_string(1, &self.condition)?;
}
for (k, v) in &self.details {
let mut entry_size = 0;
entry_size += ::protobuf::rt::string_size(1, &k);
entry_size += ::protobuf::rt::string_size(2, &v);
os.write_raw_varint32(18)?; os.write_raw_varint32(entry_size as u32)?;
os.write_string(1, &k)?;
os.write_string(2, &v)?;
};
os.write_unknown_fields(self.special_fields.unknown_fields())?;
::std::result::Result::Ok(())
}
fn special_fields(&self) -> &::protobuf::SpecialFields {
&self.special_fields
}
fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
&mut self.special_fields
}
fn new() -> Detection {
Detection::new()
}
fn clear(&mut self) {
self.condition.clear();
self.details.clear();
self.special_fields.clear();
}
fn default_instance() -> &'static Detection {
static instance: ::protobuf::rt::Lazy<Detection> = ::protobuf::rt::Lazy::new();
instance.get(Detection::new)
}
}
impl ::protobuf::MessageFull for Detection {
fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
descriptor.get(|| file_descriptor().message_by_package_relative_name("Detection").unwrap()).clone()
}
}
impl ::std::fmt::Display for Detection {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for Detection {
type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
}
static file_descriptor_proto_data: &'static [u8] = b"\
\n\x0evt/sigma.proto\x12\x08vt.sigma\x1a\x12vt/filetypes.proto\"\xad\x02\
\n\nSigmaMatch\x12@\n\rmatch_context\x18\x01\x20\x03(\x0b2\x1b.vt.sigma.\
SigmaMatchContextR\x0cmatchContext\x128\n\nrule_level\x18\x02\x20\x01(\
\x0e2\x19.vt.sigma.SigmaRule.LevelR\truleLevel\x12\x17\n\x07rule_id\x18\
\x03\x20\x01(\tR\x06ruleId\x12\x1f\n\x0brule_source\x18\x04\x20\x01(\tR\
\nruleSource\x12\x1d\n\nrule_title\x18\x05\x20\x01(\tR\truleTitle\x12)\n\
\x10rule_description\x18\x06\x20\x01(\tR\x0fruleDescription\x12\x1f\n\
\x0brule_author\x18\x07\x20\x01(\tR\nruleAuthor\"\x8f\x01\n\x11SigmaMatc\
hContext\x12?\n\x06values\x18\x01\x20\x03(\x0b2'.vt.sigma.SigmaMatchCont\
ext.ValuesEntryR\x06values\x1a9\n\x0bValuesEntry\x12\x10\n\x03key\x18\
\x01\x20\x01(\tR\x03key\x12\x14\n\x05value\x18\x02\x20\x01(\tR\x05value:\
\x028\x01\"\x8e\x04\n\tSigmaRule\x12\x12\n\x04rule\x18\x01\x20\x01(\tR\
\x04rule\x12\x14\n\x05title\x18\x02\x20\x01(\tR\x05title\x122\n\nlog_sou\
rce\x18\x03\x20\x01(\x0b2\x13.vt.sigma.LogSourceR\tlogSource\x12\x16\n\
\x06status\x18\x04\x20\x01(\tR\x06status\x12\x20\n\x0bdescription\x18\
\x05\x20\x01(\tR\x0bdescription\x12\x1e\n\nreferences\x18\x06\x20\x03(\t\
R\nreferences\x12\x16\n\x06fields\x18\x07\x20\x03(\tR\x06fields\x12'\n\
\x0ffalse_positives\x18\x08\x20\x03(\tR\x0efalsePositives\x12/\n\x05leve\
l\x18\t\x20\x01(\x0e2\x19.vt.sigma.SigmaRule.LevelR\x05level\x12\x16\n\
\x06source\x18\n\x20\x01(\tR\x06source\x12\x12\n\x04tags\x18\x0b\x20\x03\
(\tR\x04tags\x121\n\tdetection\x18\x0c\x20\x01(\x0b2\x13.vt.sigma.Detect\
ionR\tdetection\x12\x16\n\x06author\x18\r\x20\x01(\tR\x06author\x12\x1d\
\n\nsource_url\x18\x0e\x20\x01(\tR\tsourceUrl\"A\n\x05Level\x12\x0b\n\
\x07unknown\x10\0\x12\x07\n\x03low\x10\x01\x12\n\n\x06medium\x10\x02\x12\
\x08\n\x04high\x10\x03\x12\x0c\n\x08critical\x10\x04\"{\n\tLogSource\x12\
\x1a\n\x08category\x18\x01\x20\x01(\tR\x08category\x12\x18\n\x07product\
\x18\x02\x20\x01(\tR\x07product\x12\x18\n\x07service\x18\x03\x20\x01(\tR\
\x07service\x12\x1e\n\ndefinition\x18\x04\x20\x01(\tR\ndefinition\"\xa1\
\x01\n\tDetection\x12\x1c\n\tcondition\x18\x01\x20\x01(\tR\tcondition\
\x12:\n\x07details\x18\x02\x20\x03(\x0b2\x20.vt.sigma.Detection.DetailsE\
ntryR\x07details\x1a:\n\x0cDetailsEntry\x12\x10\n\x03key\x18\x01\x20\x01\
(\tR\x03key\x12\x14\n\x05value\x18\x02\x20\x01(\tR\x05value:\x028\x01b\
\x06proto3\
";
fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new();
file_descriptor_proto_lazy.get(|| {
::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
})
}
pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor {
static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new();
static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new();
file_descriptor.get(|| {
let generated_file_descriptor = generated_file_descriptor_lazy.get(|| {
let mut deps = ::std::vec::Vec::with_capacity(1);
deps.push(super::filetypes::file_descriptor().clone());
let mut messages = ::std::vec::Vec::with_capacity(5);
messages.push(SigmaMatch::generated_message_descriptor_data());
messages.push(SigmaMatchContext::generated_message_descriptor_data());
messages.push(SigmaRule::generated_message_descriptor_data());
messages.push(LogSource::generated_message_descriptor_data());
messages.push(Detection::generated_message_descriptor_data());
let mut enums = ::std::vec::Vec::with_capacity(1);
enums.push(sigma_rule::Level::generated_enum_descriptor_data());
::protobuf::reflect::GeneratedFileDescriptor::new_generated(
file_descriptor_proto(),
deps,
messages,
enums,
)
});
::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor)
})
}