}
#[repr(C)]
-#[derive(Default, Debug,PartialEq)]
+#[derive(Default, Debug,PartialEq, Eq)]
pub struct AppLayerTxConfig {
/// config: log flags
log_flags: u8,
}
#[repr(C)]
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct AppLayerTxData {
/// config: log flags
pub config: AppLayerTxConfig,
}
#[repr(C)]
-#[derive(Default,Debug,PartialEq,Copy,Clone)]
+#[derive(Default,Debug,PartialEq, Eq,Copy,Clone)]
pub struct AppLayerStateData {
pub file_flags: u16,
}
}
#[repr(C)]
-#[derive(Default,Debug,PartialEq,Copy,Clone)]
+#[derive(Default,Debug,PartialEq, Eq,Copy,Clone)]
pub struct AppLayerResult {
pub status: i32,
pub consumed: u32,
/// LoggerFlags tracks which loggers have already been executed.
#[repr(C)]
-#[derive(Default, Debug,PartialEq)]
+#[derive(Default, Debug,PartialEq, Eq)]
pub struct LoggerFlags {
flags: u32,
}
}
/// Struct to hold parsed asn1 keyword options
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct DetectAsn1Data {
pub bitstring_overflow: bool,
pub double_overflow: bool,
const DIR_TOCLIENT: u8 = 0b0000_1000;
#[repr(C)]
-#[derive(Debug, PartialEq, Clone, Copy)]
+#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub enum Direction {
ToServer = 0x04,
ToClient = 0x08,
}
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct Uuid {
pub time_low: Vec<u8>,
pub time_mid: Vec<u8>,
pub versionminor: u16,
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct DCERPCBindAckResult {
pub ack_result: u16,
pub ack_reason: u16,
| DETECT_BYTEMATH_FLAG_OPER;
#[repr(u8)]
-#[derive(Copy, Clone, Debug, PartialEq)]
+#[derive(Copy, Clone, Debug, PartialEq, Eq)]
// operators: +, -, /, *, <<, >>
pub enum ByteMathOperator {
OperatorNone = 1,
}
#[repr(u8)]
-#[derive(Copy, Clone, Debug, PartialEq)]
+#[derive(Copy, Clone, Debug, PartialEq, Eq)]
// endian <big|little|dce>
pub enum ByteMathEndian {
EndianNone = 0,
pub const DETECT_BYTEMATH_ENDIAN_DEFAULT: ByteMathEndian = ByteMathEndian::BigEndian;
#[repr(u8)]
-#[derive(Copy, Clone, Debug, PartialEq)]
+#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum ByteMathBase {
BaseNone = 0,
BaseOct = 8,
/// Custom rule parse errors.
///
/// Implemented based on the Nom example for implementing custom errors.
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub enum RuleParseError<I> {
InvalidByteMath(String),
use std::str::FromStr;
#[repr(u8)]
-#[derive(Clone, Copy, PartialEq, FromPrimitive, Debug)]
+#[derive(Clone, Copy, PartialEq, Eq, FromPrimitive, Debug)]
pub enum DetectIPRepDataCmd {
IPRepCmdAny = 0,
IPRepCmdBoth = 1,
use std::str::FromStr;
#[repr(u8)]
-#[derive(Clone, Copy, PartialEq, FromPrimitive, Debug)]
+#[derive(Clone, Copy, PartialEq, Eq, FromPrimitive, Debug)]
pub enum DetectStreamSizeDataFlags {
StreamSizeServer = 1,
StreamSizeClient = 2,
use std::ffi::CStr;
-#[derive(PartialEq, Clone, Debug)]
+#[derive(PartialEq, Eq, Clone, Debug)]
#[repr(u8)]
pub enum DetectUintMode {
DetectUintModeEqual,
use std::ffi::CStr;
use std::os::raw::{c_char, c_void};
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct DetectDnsOpcode {
negate: bool,
opcode: u8,
}
-#[derive(Debug, PartialEq, AppLayerEvent)]
+#[derive(Debug, PartialEq, Eq, AppLayerEvent)]
pub enum DNSEvent {
MalformedData,
NotRequest,
ZFlagSet,
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
#[repr(C)]
pub struct DNSHeader {
pub tx_id: u16,
pub rrclass: u16,
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct DNSRDataSOA {
/// Primary name server for this zone
pub mname: Vec<u8>,
pub minimum: u32,
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct DNSRDataSSHFP {
/// Algorithm number
pub algo: u8,
pub fingerprint: Vec<u8>,
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct DNSRDataSRV {
/// Priority
pub priority: u16,
}
/// Represents RData of various formats
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub enum DNSRData {
// RData is an address
A(Vec<u8>),
Unknown(Vec<u8>),
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct DNSAnswerEntry {
pub name: Vec<u8>,
pub rrtype: u16,
pub const HTTP2_DECOMPRESSION_CHUNK_SIZE: usize = 0x1000; // 4096
#[repr(u8)]
-#[derive(Copy, Clone, PartialOrd, PartialEq, Debug)]
+#[derive(Copy, Clone, PartialOrd, PartialEq, Eq, Debug)]
pub enum HTTP2ContentEncoding {
Unknown = 0,
Gzip = 1,
}
#[repr(u8)]
-#[derive(Copy, Clone, PartialOrd, PartialEq)]
+#[derive(Copy, Clone, PartialOrd, PartialEq, Eq)]
pub enum HTTP2ConnectionState {
Http2StateInit = 0,
Http2StateMagicDone = 1,
static mut HTTP2_MAX_STREAMS: usize = 4096; // 0x1000
#[repr(u8)]
-#[derive(Copy, Clone, PartialOrd, PartialEq, Debug)]
+#[derive(Copy, Clone, PartialOrd, PartialEq, Eq, Debug)]
pub enum HTTP2FrameUnhandledReason {
UnknownType = 0,
TooLong = 1,
}
#[repr(u8)]
-#[derive(Copy, Clone, PartialOrd, PartialEq, Debug)]
+#[derive(Copy, Clone, PartialOrd, PartialEq, Eq, Debug)]
pub enum HTTP2TransactionState {
HTTP2StateIdle = 0,
HTTP2StateOpen = 1,
use std::str::FromStr;
#[repr(u8)]
-#[derive(Clone, Copy, PartialEq, FromPrimitive, Debug)]
+#[derive(Clone, Copy, PartialEq, Eq, FromPrimitive, Debug)]
pub enum HTTP2FrameType {
DATA = 0,
HEADERS = 1,
}
}
-#[derive(PartialEq, Debug)]
+#[derive(PartialEq, Eq, Debug)]
pub struct HTTP2FrameHeader {
//we could add detection on (GOAWAY) additional data
pub length: u32,
}
#[repr(u32)]
-#[derive(Clone, Copy, PartialEq, FromPrimitive, Debug)]
+#[derive(Clone, Copy, PartialEq, Eq, FromPrimitive, Debug)]
pub enum HTTP2ErrorCode {
NOERROR = 0,
PROTOCOLERROR = 1,
}
#[repr(u8)]
-#[derive(Copy, Clone, PartialOrd, PartialEq, Debug)]
+#[derive(Copy, Clone, PartialOrd, PartialEq, Eq, Debug)]
pub enum HTTP2HeaderDecodeStatus {
HTTP2HeaderDecodeSuccess = 0,
HTTP2HeaderDecodeSizeUpdate = 1,
}
#[repr(u16)]
-#[derive(Clone, Copy, PartialEq, FromPrimitive, Debug)]
+#[derive(Clone, Copy, PartialEq, Eq, FromPrimitive, Debug)]
pub enum HTTP2SettingsId {
SETTINGSHEADERTABLESIZE = 1,
SETTINGSENABLEPUSH = 2,
use crate::ike::parser::IsakmpHeader;
use ipsec_parser::{IkeExchangeType, IkePayloadType, IkeV2Header};
-#[derive(Clone, Debug, PartialEq)]
+#[derive(Clone, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum IKEV2ConnectionState {
Init,
const INIT_SIZE: usize = 4096;
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub enum JsonError {
InvalidState,
Utf8Error(Utf8Error),
use std::ptr;
use std::str::FromStr;
-#[derive(FromPrimitive, Debug, Copy, Clone, PartialOrd, PartialEq)]
+#[derive(FromPrimitive, Debug, Copy, Clone, PartialOrd, PartialEq, Eq)]
#[allow(non_camel_case_types)]
#[repr(u8)]
pub enum MQTTFlagState {
}
#[repr(u8)]
-#[derive(Clone, Copy, PartialEq, PartialOrd, FromPrimitive, Debug)]
+#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, FromPrimitive, Debug)]
pub enum MQTTTypeCode {
UNASSIGNED = 0,
CONNECT = 1,
use nom7::number::streaming::be_u32;
use nom7::IResult;
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Nfs2Handle<'a> {
pub value: &'a[u8],
}
Ok((i, Nfs2Handle { value }))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Nfs2RequestLookup<'a> {
pub handle: Nfs2Handle<'a>,
pub name_vec: Vec<u8>,
Ok((i, req))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Nfs2RequestRead<'a> {
pub handle: Nfs2Handle<'a>,
pub offset: u32,
Ok((i, reply))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Nfs2Attributes<> {
pub atype: u32,
pub asize: u32,
use nom7::number::streaming::{be_u32, be_u64};
use nom7::IResult;
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct Nfs3Handle<'a> {
pub len: u32,
pub value: &'a [u8],
Ok((i, handle))
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct Nfs3ReplyCreate<'a> {
pub status: u32,
pub handle: Option<Nfs3Handle<'a>>,
Ok((i, reply))
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct Nfs3ReplyLookup<'a> {
pub status: u32,
pub handle: Nfs3Handle<'a>,
Ok((i, reply))
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct Nfs3RequestCreate<'a> {
pub handle: Nfs3Handle<'a>,
pub name_len: u32,
Ok((i, req))
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct Nfs3RequestRemove<'a> {
pub handle: Nfs3Handle<'a>,
pub name_len: u32,
Ok((i, req))
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct Nfs3RequestRmdir<'a> {
pub handle: Nfs3Handle<'a>,
pub name_vec: Vec<u8>,
Ok((i, req))
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct Nfs3RequestMkdir<'a> {
pub handle: Nfs3Handle<'a>,
pub name_vec: Vec<u8>,
Ok((i, req))
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct Nfs3RequestRename<'a> {
pub from_handle: Nfs3Handle<'a>,
pub from_name_vec: Vec<u8>,
Ok((i, req))
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct Nfs3RequestGetAttr<'a> {
pub handle: Nfs3Handle<'a>,
}
Ok((i, Nfs3RequestGetAttr { handle }))
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct Nfs3RequestAccess<'a> {
pub handle: Nfs3Handle<'a>,
pub check_access: u32,
Ok((i, req))
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct Nfs3RequestCommit<'a> {
pub handle: Nfs3Handle<'a>,
}
Ok((i, Nfs3RequestCommit { handle }))
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct Nfs3RequestRead<'a> {
pub handle: Nfs3Handle<'a>,
pub offset: u64,
Ok((i, Nfs3RequestRead { handle, offset }))
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct Nfs3RequestLookup<'a> {
pub handle: Nfs3Handle<'a>,
pub name_vec: Vec<u8>,
Ok((i, req))
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct Nfs3ResponseReaddirplusEntryC<'a> {
pub name_vec: Vec<u8>,
pub handle: Option<Nfs3Handle<'a>>,
Ok((i, resp))
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct Nfs3ResponseReaddirplusEntry<'a> {
pub entry: Option<Nfs3ResponseReaddirplusEntryC<'a>>,
}
Ok((i, Nfs3ResponseReaddirplusEntry { entry }))
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct Nfs3ResponseReaddirplus<'a> {
pub status: u32,
pub data: &'a [u8],
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct Nfs3RequestReaddirplus<'a> {
pub handle: Nfs3Handle<'a>,
pub cookie: u64,
Ok((i, req))
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct Nfs3RequestWrite<'a> {
pub handle: Nfs3Handle<'a>,
pub offset: u64,
// Linux defines NFSD_MAX_OPS_PER_COMPOUND to 16 (tested in Linux 5.15.1).
const NFSD_MAX_OPS_PER_COMPOUND: usize = 64;
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub enum Nfs4RequestContent<'a> {
PutFH(Nfs4Handle<'a>),
GetFH,
DestroyClientID(&'a[u8]),
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Nfs4Attr {
attr_mask: u64,
}
Ok((i, attr))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Nfs4StateId<'a> {
pub seqid: u32,
pub data: &'a[u8],
Ok((i, state))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Nfs4Handle<'a> {
pub len: u32,
pub value: &'a[u8],
Ok((i, data))
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct Nfs4RequestLayoutReturn<'a> {
pub layout_type: u32,
pub return_type: u32,
Ok((i, req))
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct Nfs4RequestGetDevInfo<'a> {
pub device_id: &'a[u8],
pub layout_type: u32,
Ok((i, req))
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct Nfs4RequestCreateSession<'a> {
pub client_id: &'a[u8],
pub seqid: u32,
map(nfs4_parse_handle, Nfs4RequestContent::PutFH)(i)
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Nfs4RequestSetClientId<'a> {
pub client_id: &'a[u8],
pub r_netid: &'a[u8],
Ok((i, Nfs4RequestContent::SetClientIdConfirm))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Nfs4RequestCreate<'a> {
pub ftype4: u32,
pub filename: &'a[u8],
Ok((i, req))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub enum Nfs4OpenRequestContent<'a> {
Exclusive4(&'a[u8]),
Unchecked4(Nfs4Attr),
Ok((i, data))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Nfs4RequestOpen<'a> {
pub open_type: u32,
pub filename: &'a[u8],
Ok((i, Nfs4RequestContent::ReadDir))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Nfs4RequestRename<'a> {
pub oldname: &'a[u8],
pub newname: &'a[u8],
Ok((i, req))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Nfs4RequestLookup<'a> {
pub filename: &'a[u8],
}
map(be_u32, Nfs4RequestContent::SecInfoNoName) (i)
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Nfs4RequestSetAttr<'a> {
pub stateid: Nfs4StateId<'a>,
}
map(nfs4_parse_attrbits, Nfs4RequestContent::GetAttr)(i)
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Nfs4RequestWrite<'a> {
pub stateid: Nfs4StateId<'a>,
pub offset: u64,
Ok((i, req))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Nfs4RequestRead<'a> {
pub stateid: Nfs4StateId<'a>,
pub offset: u64,
Ok((i, Nfs4RequestContent::Close(stateid)))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Nfs4RequestOpenConfirm<'a> {
pub stateid: Nfs4StateId<'a>,
}
Ok((i, Nfs4RequestContent::DestroyClientID(client_id)))
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct Nfs4RequestLayoutGet<'a> {
pub layout_type: u32,
pub length: u64,
Ok((i, req))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Nfs4RequestExchangeId<'a> {
pub client_string: &'a[u8],
pub nii_domain: &'a[u8],
Ok((i, req))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Nfs4RequestSequence<'a> {
pub ssn_id: &'a[u8],
}
Ok((i, cmd_data))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Nfs4RequestCompoundRecord<'a> {
pub commands: Vec<Nfs4RequestContent<'a>>,
}
Ok((i, Nfs4RequestCompoundRecord { commands }))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub enum Nfs4ResponseContent<'a> {
PutFH(u32),
PutRootFH(u32),
Ok((i, Nfs4ResponseContent::LayoutReturn(status)))
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct Nfs4ResponseCreateSession<'a> {
pub ssn_id: &'a[u8],
pub seq_id: u32,
Ok((i, Nfs4ResponseContent::CreateSession( status, create_ssn_data )))
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct Nfs4ResponseExchangeId<'a> {
pub client_id: &'a[u8],
pub eir_minorid: u64,
Ok((i, Nfs4ResponseContent::ExchangeId( status, xchngid_data)))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Nfs4ResponseWrite {
pub count: u32,
pub committed: u32,
Ok((i, Nfs4ResponseContent::Write(status, wd)))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Nfs4ResponseRead<'a> {
pub eof: bool,
pub count: u32,
Ok((i, Nfs4ResponseContent::Read(status, rd)))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Nfs4ResponseOpen<'a> {
pub stateid: Nfs4StateId<'a>,
pub result_flags: u32,
pub delegate: Nfs4ResponseFileDelegation<'a>,
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub enum Nfs4ResponseFileDelegation<'a> {
DelegateRead(Nfs4ResponseOpenDelegateRead<'a>),
DelegateWrite(Nfs4ResponseOpenDelegateWrite<'a>),
DelegateNone(u32),
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct Nfs4ResponseOpenDelegateWrite<'a> {
pub stateid: Nfs4StateId<'a>,
pub who: &'a[u8],
})))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Nfs4ResponseOpenDelegateRead<'a> {
pub stateid: Nfs4StateId<'a>,
}
Ok((i, Nfs4ResponseContent::Open(status, open_data)))
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct Nfs4ResponseGetDevInfo<'a> {
pub layout_type: u32,
pub r_netid: &'a[u8],
/*https://datatracker.ietf.org/doc/html/rfc5661#section-13.1*/
// in case of multiple file handles, return handles in a vector
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct Nfs4ResponseLayoutGet<'a> {
pub stateid: Nfs4StateId<'a>,
pub length: u64,
Ok((i, Nfs4ResponseContent::SecInfoNoName(status)))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Nfs4ResponseReaddirEntry<'a> {
pub name: &'a[u8],
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Nfs4ResponseReaddir<'a> {
pub eof: bool,
pub listing: Vec<Option<Nfs4ResponseReaddirEntry<'a>>>,
Ok((i, Nfs4ResponseContent::Commit(status)))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Nfs4ResponseAccess {
pub supported_types: u32,
pub access_rights: u32,
Ok((i, Nfs4ResponseContent::Access(status, ad)))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Nfs4ResponseSequence<'a> {
pub ssn_id: &'a[u8],
}
Ok((i, cmd_data))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Nfs4ResponseCompoundRecord<'a> {
pub status: u32,
pub commands: Vec<Nfs4ResponseContent<'a>>,
//! Nom parsers for NFS
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct NfsReplyRead<'a> {
pub status: u32,
pub attr_follows: u32,
pub const RPC_MAX_CREDS_SIZE: u32 = 4096; // Linux kernel defines 400.
pub const RPC_MAX_VERIFIER_SIZE: u32 = 4096; // Linux kernel defines 400.
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub enum RpcRequestCreds<'a> {
Unix(RpcRequestCredsUnix<'a>),
GssApi(RpcRequestCredsGssApi<'a>),
Unknown(&'a [u8]),
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct RpcRequestCredsUnix<'a> {
pub stamp: u32,
pub machine_name_len: u32,
Ok((i, creds))
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct RpcRequestCredsGssApi<'a> {
pub version: u32,
pub procedure: u32,
Ok((&[], RpcRequestCreds::Unknown(i)))
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct RpcGssApiIntegrity<'a> {
pub seq_num: u32,
pub data: &'a [u8],
Ok((i, res))
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct RpcPacketHeader {
pub frag_is_last: bool,
pub frag_len: u32,
Ok((i, hdr))
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct RpcReplyPacket<'a> {
pub hdr: RpcPacketHeader,
}
// top of request packet, just to get to procedure
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct RpcRequestPacketPartial {
pub hdr: RpcPacketHeader,
Ok((i, req))
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct RpcPacket<'a> {
pub hdr: RpcPacketHeader,
pub const PGSQL_DUMMY_PROTO_MINOR_SSL: u16 = 5679; //0x162f
pub const _PGSQL_DUMMY_PROTO_MINOR_GSSAPI: u16 = 5680; // 0x1630
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub enum PgsqlParameters {
// startup parameters
User,
}
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct PgsqlParameter {
pub name: PgsqlParameters,
pub value: Vec<u8>,
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct PgsqlStartupParameters {
pub user: PgsqlParameter,
pub database: Option<PgsqlParameter>,
pub optional_params: Option<Vec<PgsqlParameter>>,
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct DummyStartupPacket {
length: u32,
proto_major: u16,
proto_minor: u16,
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct StartupPacket {
pub length: u32,
pub proto_major: u16,
pub params: PgsqlStartupParameters,
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct RegularPacket {
pub identifier: u8,
pub length: u32,
pub payload: Vec<u8>,
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct PgsqlErrorNoticeMessageField {
pub field_type: PgsqlErrorNoticeFieldType,
pub field_value: Vec<u8>,
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct ErrorNoticeMessage {
pub identifier: u8,
pub length: u32,
}
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub enum SSLResponseMessage {
SSLAccepted,
SSLRejected,
}
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct ParameterStatusMessage {
pub identifier: u8,
pub length: u32,
pub param: PgsqlParameter,
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct BackendKeyDataMessage {
pub identifier: u8,
pub length: u32,
pub secret_key: u32,
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct ConsolidatedDataRowPacket {
pub identifier: u8,
pub length: u32,
pub data_size: u64,
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct ReadyForQueryMessage {
pub identifier: u8,
pub length: u32,
pub transaction_status: u8,
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct NotificationResponse {
pub identifier: u8,
pub length: u32,
pub payload: Vec<u8>,
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub enum PgsqlBEMessage {
SSLResponse(SSLResponseMessage),
ErrorResponse(ErrorNoticeMessage),
}
}
-#[derive(Debug, PartialEq, Clone)]
+#[derive(Debug, PartialEq, Eq, Clone)]
pub enum SASLAuthenticationMechanism {
ScramSha256,
ScramSha256Plus,
}
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct TerminationMessage {
pub identifier: u8,
pub length: u32,
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub enum PgsqlFEMessage {
SSLRequest(DummyStartupPacket),
StartupMessage(StartupPacket),
}
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct AuthenticationMessage {
pub identifier: u8,
pub length: u32,
pub payload: Vec<u8>,
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct SASLInitialResponsePacket {
pub identifier: u8,
pub length: u32,
pub sasl_param: Vec<u8>,
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct AuthenticationSASLMechanismMessage {
identifier: u8,
length: u32,
auth_mechanisms: Vec<SASLAuthenticationMechanism>,
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct RowField {
pub field_name: Vec<u8>,
pub table_oid: u32,
pub format_code: u16,
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct RowDescriptionMessage {
pub identifier: u8,
pub length: u32,
pub fields: Vec<RowField>,
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct ColumnFieldValue {
// Can be 0, or -1 as a special NULL column value
pub value_length: i32,
pub value: Vec<u8>,
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub enum PgsqlErrorNoticeFieldType {
SeverityLocalizable,
SeverityNonLocalizable,
static mut PGSQL_MAX_TX: usize = 1024;
#[repr(u8)]
-#[derive(Copy, Clone, PartialOrd, PartialEq, Debug)]
+#[derive(Copy, Clone, PartialOrd, PartialEq, Eq, Debug)]
pub enum PgsqlTransactionState {
Init = 0,
RequestReceived,
}
}
-#[derive(Clone, Copy, Debug, PartialEq)]
+#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PgsqlStateProgress {
IdleState,
SSLRequestReceived,
};
use md5::{Digest, Md5};
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct Cyu {
pub string: String,
pub hash: String,
use std::error::Error;
use std::fmt;
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub enum QuicError {
StreamTagNoMatch(u32),
InvalidPacket,
))
}
-#[derive(Clone, Debug, PartialEq)]
+#[derive(Clone, Debug, PartialEq, Eq)]
pub struct QuicTlsExtension {
pub etype: TlsExtensionType,
pub values: Vec<Vec<u8>>,
}
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub enum QuicType {
Initial,
Retry,
const QUIC_FLAG_NONCE: u8 = 0x4;
const QUIC_FLAG_VERSION: u8 = 0x1;
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct PublicFlags {
pub is_long: bool,
pub raw: u8,
}
/// A QUIC packet's header.
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct QuicHeader {
pub flags: PublicFlags,
pub ty: QuicType,
use nom7::error::{Error, ErrorKind, ParseError};
use nom7::ErrorConvert;
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub enum RdpError {
UnimplementedLengthDeterminant,
NotX224Class0Error,
// ================
/// t.123-spec, section 8
-#[derive(Clone, Debug, PartialEq)]
+#[derive(Clone, Debug, PartialEq, Eq)]
pub enum TpktVersion {
T123 = 0x3,
}
/// t.123-spec, section 8
-#[derive(Clone, Debug, PartialEq)]
+#[derive(Clone, Debug, PartialEq, Eq)]
pub struct T123Tpkt {
pub child: T123TpktChild,
}
/// variants that a t.123 tpkt can hold
-#[derive(Clone, Debug, PartialEq)]
+#[derive(Clone, Debug, PartialEq, Eq)]
pub enum T123TpktChild {
X224ConnectionRequest(X224ConnectionRequest),
X224ConnectionConfirm(X224ConnectionConfirm),
// ================
/// x.224-spec, sections 13.3.3, 13.4.3, 13.7.3
-#[derive(Clone, Debug, PartialEq)]
+#[derive(Clone, Debug, PartialEq, Eq)]
pub enum X224Type {
ConnectionConfirm = 0xd,
ConnectionRequest = 0xe,
/// x.224-spec, section 13.3
// rdp-spec, section 2.2.1.1
-#[derive(Clone, Debug, PartialEq)]
+#[derive(Clone, Debug, PartialEq, Eq)]
pub struct X224ConnectionRequest {
pub cdt: u8,
pub dst_ref: u16,
}
/// rdp-spec, section 2.2.1.1.1
-#[derive(Clone, Debug, PartialEq)]
+#[derive(Clone, Debug, PartialEq, Eq)]
pub struct RdpCookie {
pub mstshash: String,
}
/// rdp-spec, sections 2.2.1.1.1, 2.2.1.2.1, 2.2.1.2.2
-#[derive(Clone, Debug, PartialEq)]
+#[derive(Clone, Debug, PartialEq, Eq)]
pub enum X224ConnectionRequestType {
NegotiationRequest = 0x1,
NegotiationResponse = 0x2,
}
/// rdp-spec, section 2.2.1.1.1
-#[derive(Clone, Debug, PartialEq)]
+#[derive(Clone, Debug, PartialEq, Eq)]
pub struct NegotiationRequest {
pub flags: NegotiationRequestFlags,
pub protocols: ProtocolFlags,
}
/// rdp-spec, section 2.2.1.1.1
-#[derive(Clone, Debug, FromPrimitive, PartialEq)]
+#[derive(Clone, Debug, FromPrimitive, PartialEq, Eq)]
pub enum Protocol {
ProtocolRdp = 0x0,
ProtocolSsl = 0x1,
/// rdp-spec, section 2.2.1.2
/// x.224-spec, section 13.3
-#[derive(Clone, Debug, PartialEq)]
+#[derive(Clone, Debug, PartialEq, Eq)]
pub struct X224ConnectionConfirm {
pub cdt: u8,
pub dst_ref: u16,
}
/// variants of a server negotiation
-#[derive(Clone, Debug, PartialEq)]
+#[derive(Clone, Debug, PartialEq, Eq)]
pub enum NegotiationFromServer {
Response(NegotiationResponse),
Failure(NegotiationFailure),
}
/// rdp-spec, section 2.2.1.1.1
-#[derive(Clone, Debug, PartialEq)]
+#[derive(Clone, Debug, PartialEq, Eq)]
pub struct NegotiationResponse {
pub flags: NegotiationResponseFlags,
pub protocol: Protocol,
}
/// rdp-spec, section 2.2.1.1.1
-#[derive(Clone, Debug, PartialEq)]
+#[derive(Clone, Debug, PartialEq, Eq)]
pub struct NegotiationFailure {
pub code: NegotiationFailureCode,
}
/// rdp-spec, section 2.2.1.2.2
-#[derive(Clone, Debug, FromPrimitive, PartialEq)]
+#[derive(Clone, Debug, FromPrimitive, PartialEq, Eq)]
pub enum NegotiationFailureCode {
SslRequiredByServer = 0x1,
SslNotAllowedByServer = 0x2,
// ================
/// x224-spec, section 13.7
-#[derive(Clone, Debug, PartialEq)]
+#[derive(Clone, Debug, PartialEq, Eq)]
pub struct X223Data {
pub child: X223DataChild,
}
/// variants that an x.223 data message can hold
-#[derive(Clone, Debug, PartialEq)]
+#[derive(Clone, Debug, PartialEq, Eq)]
pub enum X223DataChild {
McsConnectRequest(McsConnectRequest),
McsConnectResponse(McsConnectResponse),
}
/// t.125-spec, section 7, part 2
-#[derive(Clone, Debug, PartialEq)]
+#[derive(Clone, Debug, PartialEq, Eq)]
pub enum T125Type {
T125TypeMcsConnectRequest = 0x65, // 101
T125TypeMcsConnectResponse = 0x66, // 102
}
/// rdp-spec, section 2.2.1.3.2
-#[derive(Clone, Debug, PartialEq)]
+#[derive(Clone, Debug, PartialEq, Eq)]
pub struct McsConnectRequest {
pub children: Vec<McsConnectRequestChild>,
}
/// variants that an mcs connection message can hold
-#[derive(Clone, Debug, PartialEq)]
+#[derive(Clone, Debug, PartialEq, Eq)]
pub enum McsConnectRequestChild {
CsClientCore(CsClientCoreData),
CsNet(CsNet),
}
/// rdp-spec, section 2.2.1.3.1
-#[derive(Clone, Debug, FromPrimitive, PartialEq)]
+#[derive(Clone, Debug, FromPrimitive, PartialEq, Eq)]
pub enum CsType {
Core = 0xc001,
Net = 0xc003,
}
/// rdp-spec, section 2.2.1.3.2
-#[derive(Clone, Debug, PartialEq)]
+#[derive(Clone, Debug, PartialEq, Eq)]
pub struct CsClientCoreData {
pub version: Option<RdpClientVersion>,
pub desktop_width: u16,
}
/// rdp-spec, section 2.2.1.3.2 Client Core Data
-#[derive(Clone, Debug, FromPrimitive, PartialEq)]
+#[derive(Clone, Debug, FromPrimitive, PartialEq, Eq)]
#[allow(non_camel_case_types)]
pub enum RdpClientVersion {
V4 = 0x80001,
}
/// rdp-spec, section 2.2.1.3.2 Client Core Data
-#[derive(Clone, Debug, FromPrimitive, PartialEq)]
+#[derive(Clone, Debug, FromPrimitive, PartialEq, Eq)]
pub enum ColorDepth {
RnsUdColor4Bpp = 0xca00,
RnsUdColor8Bpp = 0xca01,
}
/// rdp-spec, section 2.2.1.3.2 Client Core Data
-#[derive(Clone, Debug, FromPrimitive, PartialEq)]
+#[derive(Clone, Debug, FromPrimitive, PartialEq, Eq)]
pub enum SasSequence {
RnsUdSasDel = 0xaa03,
}
// for keyboard layout, see windows::lcid_to_string
/// rdp-spec, section 2.2.1.3.2 Client Core Data
-#[derive(Clone, Debug, FromPrimitive, PartialEq)]
+#[derive(Clone, Debug, FromPrimitive, PartialEq, Eq)]
pub enum KeyboardType {
KbXt = 0x1,
KbIco = 0x2,
}
/// rdp-spec, section 2.2.1.3.2 Client Core Data
-#[derive(Clone, Debug, FromPrimitive, PartialEq)]
+#[derive(Clone, Debug, FromPrimitive, PartialEq, Eq)]
pub enum PostBeta2ColorDepth {
RnsUdColorNotProvided = 0x0,
RnsUdColor4Bpp = 0xca00,
}
/// rdp-spec, section 2.2.1.3.2 Client Core Data
-#[derive(Clone, Debug, FromPrimitive, PartialEq)]
+#[derive(Clone, Debug, FromPrimitive, PartialEq, Eq)]
pub enum HighColorDepth {
HighColorNotProvided = 0x0,
HighColor4Bpp = 0x4,
}
/// rdp-spec, section 2.2.1.3.2 Client Core Data, `connectionType`
-#[derive(Clone, Debug, FromPrimitive, PartialEq)]
+#[derive(Clone, Debug, FromPrimitive, PartialEq, Eq)]
pub enum ConnectionHint {
ConnectionHintNotProvided = 0x0,
ConnectionHintModem = 0x1,
}
/// rdp-spec, section 2.2.1.3.2 Client Core Data
-#[derive(Clone, Copy, Debug, FromPrimitive, PartialEq)]
+#[derive(Clone, Copy, Debug, FromPrimitive, PartialEq, Eq)]
pub enum DesktopOrientation {
OrientationLandscape = 0,
OrientationPortrait = 90, // 0x5a
}
/// rdp-spec, section 2.2.1.3.4
-#[derive(Clone, Debug, PartialEq)]
+#[derive(Clone, Debug, PartialEq, Eq)]
pub struct CsNet {
pub channels: Vec<String>,
}
/// generic structure
/// cf. rdp-spec, section 2.2.1.3.4
-#[derive(Clone, Debug, PartialEq)]
+#[derive(Clone, Debug, PartialEq, Eq)]
pub struct CsUnknown {
pub typ: u16,
pub data: Vec<u8>,
}
/// rdp-spec, section 2.2.1.4
-#[derive(Clone, Debug, PartialEq)]
+#[derive(Clone, Debug, PartialEq, Eq)]
pub struct McsConnectResponse {}
// ==================
// transactions
//
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct CertificateBlob {
pub data: Vec<u8>,
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub enum RdpTransactionItem {
X224ConnectionRequest(X224ConnectionRequest),
X224ConnectionConfirm(X224ConnectionConfirm),
TlsCertificateChain(Vec<CertificateBlob>),
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct RdpTransaction {
pub id: u64,
pub item: RdpTransactionItem,
// state
//
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct RdpState {
state_data: AppLayerStateData,
next_id: u64,
}
/// Windows operating system type (build and suffix/pack)
-#[derive(Clone, Debug, PartialEq)]
+#[derive(Clone, Debug, PartialEq, Eq)]
pub struct OperatingSystem {
pub build: Build,
pub suffix: Suffix,
}
// <https://en.wikipedia.org/wiki/Windows_NT#Releases>
-#[derive(Clone, Debug, FromPrimitive, PartialEq)]
+#[derive(Clone, Debug, FromPrimitive, PartialEq, Eq)]
#[allow(non_camel_case_types)]
pub enum Build {
Other,
Server2003 = 3790,
}
-#[derive(Clone, Debug, PartialEq)]
+#[derive(Clone, Debug, PartialEq, Eq)]
pub enum Suffix {
Empty,
Rtm,
pub body_len: u16,
}
-#[derive(PartialEq, Debug, Clone)]
+#[derive(PartialEq, Eq, Debug, Clone)]
pub enum Method {
Register,
Custom(String),
Some(s)
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct NtlmsspData {
pub host: Vec<u8>,
pub user: Vec<u8>,
use nom7::sequence::tuple;
use nom7::{Err, IResult};
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct DceRpcResponseRecord<'a> {
pub data: &'a[u8],
}
Ok((i, record))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct DceRpcRequestRecord<'a> {
pub opnum: u16,
pub context_id: u16,
Ok((i, record))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct DceRpcBindIface<'a> {
pub iface: &'a[u8],
pub ver: u16,
Ok((i, res))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct DceRpcBindRecord<'a> {
pub num_ctx_items: u8,
pub ifaces: Vec<DceRpcBindIface<'a>>,
Ok((i, record))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct DceRpcBindAckResult<'a> {
pub ack_result: u16,
pub ack_reason: u16,
Ok((i, res))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct DceRpcBindAckRecord<'a> {
pub num_results: u8,
pub results: Vec<DceRpcBindAckResult<'a>>,
Ok((i, record))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct DceRpcRecord<'a> {
pub version_major: u8,
pub version_minor: u8,
pub const NBSS_MSGTYPE_RETARG_RESPONSE: u8 = 0x84;
pub const NBSS_MSGTYPE_KEEP_ALIVE: u8 = 0x85;
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct NbssRecord<'a> {
pub message_type: u8,
pub length: u32,
use nom7::sequence::tuple;
use nom7::IResult;
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct NTLMSSPVersion {
pub ver_major: u8,
pub ver_minor: u8,
Ok((i, version))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct NTLMSSPAuthRecord<'a> {
pub domain: &'a[u8],
pub user: &'a[u8],
Ok((i, record))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct NTLMSSPRecord<'a> {
pub msg_type: u32,
pub data: &'a[u8],
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct SmbParamBlockAndXHeader {
pub wct: u8,
pub andx_command: u8,
Ok((i, hdr))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Smb1WriteRequestRecord<'a> {
pub offset: u64,
pub len: u32,
Ok((i, record))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Smb1NegotiateProtocolResponseRecord<'a> {
pub dialect_idx: u16,
pub server_guid: &'a[u8],
}
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Smb1NegotiateProtocolRecord<'a> {
pub dialects: Vec<&'a [u8]>,
}
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Smb1ResponseRecordTreeConnectAndX<'a> {
pub service: &'a[u8],
pub nativefs: &'a[u8],
Ok((i, record))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct SmbRecordTreeConnectAndX<'a> {
pub path: Vec<u8>,
pub service: &'a[u8],
Ok((i, record))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct SmbRecordTransRequest<'a> {
pub params: SmbRecordTransRequestParams,
pub pipe: Option<SmbPipeProtocolRecord<'a>>,
pub data: SmbRecordTransRequestData<'a>,
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct SmbPipeProtocolRecord<'a> {
pub function: u16,
pub fid: &'a[u8],
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct SmbRecordTransRequestParams<> {
pub max_data_cnt: u16,
param_cnt: u16,
Ok((i, (params, pipe)))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct SmbRecordTransRequestData<'a> {
pub data: &'a[u8],
}
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct SmbRecordTransResponse<'a> {
pub data_cnt: u16,
pub bcc: u16,
}
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct SmbRecordSetupAndX<'a> {
pub sec_blob: &'a[u8],
}
Ok((i, record))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct SmbResponseRecordSetupAndX<'a> {
pub sec_blob: &'a[u8],
}
}
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct SmbRequestReadAndXRecord<'a> {
pub fid: &'a[u8],
pub size: u64,
Ok((i, record))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct SmbResponseReadAndXRecord<'a> {
pub len: u32,
pub data: &'a[u8],
Ok((i, record))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct SmbRequestRenameRecord {
pub oldname: Vec<u8>,
pub newname: Vec<u8>,
Ok((i, record))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct SmbRequestCreateAndXRecord<> {
pub disposition: u32,
pub create_options: u32,
Ok((i, record))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Trans2RecordParamSetFileInfoDisposition<> {
pub delete: bool,
}
Ok((i, record))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Trans2RecordParamSetFileInfo<'a> {
pub fid: &'a[u8],
pub loi: u16,
Ok((i, record))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Trans2RecordParamSetFileInfoRename<'a> {
pub replace: bool,
pub newname: &'a[u8],
Ok((i, record))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Trans2RecordParamSetPathInfo<> {
pub loi: u16,
pub oldname: Vec<u8>,
Ok((i, record))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Trans2RecordParamSetPathInfoRename<'a> {
pub replace: bool,
pub newname: &'a[u8],
Ok((i, record))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct SmbRequestTrans2Record<'a> {
pub subcmd: u16,
pub setup_blob: &'a[u8],
Ok((i, record))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct SmbResponseCreateAndXRecord<'a> {
pub fid: &'a[u8],
pub create_ts: SMBFiletime,
Ok((i, record))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct SmbRequestCloseRecord<'a> {
pub fid: &'a[u8],
}
Ok((i, record))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct SmbVersion<> {
pub version: u8,
}
Ok((i, version))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct SmbRecord<'a> {
pub command: u8,
pub is_dos_error: bool,
const SMB2_FLAGS_SERVER_TO_REDIR: u32 = 0x0000_0001;
const SMB2_FLAGS_ASYNC_COMMAND: u32 = 0x0000_0002;
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Smb2SecBlobRecord<'a> {
pub data: &'a[u8],
}
Ok((i, Smb2SecBlobRecord { data }))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Smb2RecordDir<> {
pub request: bool,
}
Ok((i, record))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Smb2Record<'a> {
pub direction: u8, // 0 req, 1 res
pub header_len: u16,
Ok((i, record))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Smb2NegotiateProtocolRequestRecord<'a> {
pub dialects_vec: Vec<u16>,
pub client_guid: &'a[u8],
Ok((i, record))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Smb2NegotiateProtocolResponseRecord<'a> {
pub dialect: u16,
pub server_guid: &'a[u8],
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Smb2SessionSetupRequestRecord<'a> {
pub data: &'a[u8],
}
Ok((i, record))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Smb2TreeConnectRequestRecord<'a> {
pub share_name: &'a[u8],
}
Ok((i, record))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Smb2TreeConnectResponseRecord<> {
pub share_type: u8,
}
Ok((i, record))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Smb2CreateRequestRecord<'a> {
pub disposition: u32,
pub create_options: u32,
Ok((i, record))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Smb2IOCtlRequestRecord<'a> {
pub is_pipe: bool,
pub function: u32,
Ok((i, record))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Smb2IOCtlResponseRecord<'a> {
pub is_pipe: bool,
pub guid: &'a[u8],
Ok((i, record))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Smb2CloseRequestRecord<'a> {
pub guid: &'a[u8],
}
Ok((i, record))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Smb2WriteRequestRecord<'a> {
pub wr_len: u32,
pub wr_offset: u64,
Ok((i, record))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Smb2ReadRequestRecord<'a> {
pub rd_len: u32,
pub rd_offset: u64,
Ok((i, record))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Smb2ReadResponseRecord<'a> {
pub len: u32,
pub data: &'a[u8],
Ok((i, record))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Smb2CreateResponseRecord<'a> {
pub guid: &'a[u8],
pub create_ts: SMBFiletime,
Ok((i, record))
}
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Smb2WriteResponseRecord<> {
pub wr_cnt: u32,
}
use nom7::number::streaming::{le_u16, le_u32, le_u64};
use nom7::IResult;
-#[derive(Debug,PartialEq)]
+#[derive(Debug,PartialEq, Eq)]
pub struct Smb3TransformRecord<'a> {
pub session_id: u64,
pub enc_algo: u16,
)(i)
}
-#[derive(PartialEq)]
+#[derive(PartialEq, Eq)]
pub struct SshBanner<'a> {
pub protover: &'a [u8],
pub swver: &'a [u8],
Ok((i, SshBanner { protover, swver }))
}
-#[derive(PartialEq)]
+#[derive(PartialEq, Eq)]
pub struct SshRecordHeader {
pub pkt_len: u32,
padding_len: u8,
))
}
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct SshPacketKeyExchange<'a> {
pub cookie: &'a [u8],
pub kex_algs: &'a [u8],
}
#[repr(u8)]
-#[derive(Copy, Clone, PartialOrd, PartialEq)]
+#[derive(Copy, Clone, PartialOrd, PartialEq, Eq)]
pub enum SSHConnectionState {
SshStateInProgress = 0,
SshStateBannerWaitEol = 1,
const ACK: u8 = 4;
const ERROR: u8 = 5;
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct TFTPTransaction {
pub opcode : u8,
pub filename : String,