@@ -3708,6 +3708,38 @@ static void readExtendedQueueDepth(SFSample *sample)
37083708 sf_log_next32 (sample , "queue_depth_bytes" );
37093709}
37103710
3711+ /*_________________----------------------------__________________
3712+ _________________ readExtendedHardwareTrap __________________
3713+ -----------------____________________________------------------
3714+ */
3715+
3716+ static void readExtendedHardwareTrap (SFSample * sample )
3717+ {
3718+ sf_logf (sample , "extendedType" , "hw_trap" );
3719+ char groupName [SFL_MAX_HW_TRAP_LEN + 1 ];
3720+ char trapName [SFL_MAX_HW_TRAP_LEN + 1 ];
3721+ if (getString (sample , groupName , SFL_MAX_HW_TRAP_LEN ) > 0 ) {
3722+ sf_logf (sample , "hw_trap_group" , groupName );
3723+ }
3724+ if (getString (sample , trapName , SFL_MAX_HW_TRAP_LEN ) > 0 ) {
3725+ sf_logf (sample , "hw_trap_name" , trapName );
3726+ }
3727+ }
3728+
3729+ /*_________________----------------------------__________________
3730+ _________________ readExtendedLinuxReason __________________
3731+ -----------------____________________________------------------
3732+ */
3733+
3734+ static void readExtendedLinuxReason (SFSample * sample )
3735+ {
3736+ sf_logf (sample , "extendedType" , "linux_reason" );
3737+ char reason [SFL_MAX_LINUX_REASON_LEN + 1 ];
3738+ if (getString (sample , reason , SFL_MAX_LINUX_REASON_LEN ) > 0 ) {
3739+ sf_logf (sample , "linux_drop_reason" , reason );
3740+ }
3741+ }
3742+
37113743/*_________________---------------------------__________________
37123744 _________________ readFlowSample_v2v4 __________________
37133745 -----------------___________________________------------------
@@ -4089,6 +4121,8 @@ static void readDiscardSample(SFSample *sample)
40894121 case SFLFLOW_HEADER : readFlowSample_header (sample ); break ;
40904122 case SFLFLOW_EX_FUNCTION : readExtendedFunction (sample ); break ;
40914123 case SFLFLOW_EX_EGRESS_Q : readExtendedEgressQueue (sample ); break ;
4124+ case SFLFLOW_EX_HW_TRAP : readExtendedHardwareTrap (sample ); break ;
4125+ case SFLFLOW_EX_LINUX_REASON : readExtendedLinuxReason (sample ); break ;
40924126 default : skipTLVRecord (sample , tag , length , "discard_sample_element" ); break ;
40934127 }
40944128 lengthCheck (sample , "discard_sample_element" , start , length );
0 commit comments