Skip to content

Commit

Permalink
rust: fix app-layer parser flags
Browse files Browse the repository at this point in the history
This especially allows for SSH bypass to work
  • Loading branch information
catenacyber authored and victorjulien committed Jun 4, 2021
1 parent 61fa748 commit fdab22d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 6 additions & 6 deletions rust/src/applayer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,12 +303,12 @@ extern {
}

// Defined in app-layer-parser.h
pub const APP_LAYER_PARSER_EOF_TS : u8 = 0b0101;
pub const APP_LAYER_PARSER_EOF_TC : u8 = 0b0110;
pub const APP_LAYER_PARSER_NO_INSPECTION : u8 = 0b1;
pub const APP_LAYER_PARSER_NO_REASSEMBLY : u8 = 0b10;
pub const APP_LAYER_PARSER_NO_INSPECTION_PAYLOAD : u8 = 0b100;
pub const APP_LAYER_PARSER_BYPASS_READY : u8 = 0b1000;
pub const APP_LAYER_PARSER_EOF_TS : u8 = BIT_U8!(5);
pub const APP_LAYER_PARSER_EOF_TC : u8 = BIT_U8!(6);
pub const APP_LAYER_PARSER_NO_INSPECTION : u8 = BIT_U8!(1);
pub const APP_LAYER_PARSER_NO_REASSEMBLY : u8 = BIT_U8!(2);
pub const APP_LAYER_PARSER_NO_INSPECTION_PAYLOAD : u8 = BIT_U8!(3);
pub const APP_LAYER_PARSER_BYPASS_READY : u8 = BIT_U8!(4);

pub const APP_LAYER_PARSER_OPT_ACCEPT_GAPS: u32 = BIT_U32!(0);
pub const APP_LAYER_PARSER_OPT_UNIDIR_TXS: u32 = BIT_U32!(1);
Expand Down
4 changes: 4 additions & 0 deletions rust/src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ pub static mut ALPROTO_FAILED : AppProto = 0; // updated during init
pub const IPPROTO_TCP : i32 = 6;
pub const IPPROTO_UDP : i32 = 17;

macro_rules!BIT_U8 {
($x:expr) => (1 << $x);
}

macro_rules!BIT_U16 {
($x:expr) => (1 << $x);
}
Expand Down

0 comments on commit fdab22d

Please sign in to comment.