File tree Expand file tree Collapse file tree 1 file changed +8
-15
lines changed Expand file tree Collapse file tree 1 file changed +8
-15
lines changed Original file line number Diff line number Diff line change @@ -103,25 +103,18 @@ static uint64_t ENIPGetTxCnt(void *alstate)
103
103
return ((ENIPState * )alstate )-> transaction_max ;
104
104
}
105
105
106
- static int ENIPStateGetEventInfo (const char * event_name , int * event_id , AppLayerEventType * event_type )
106
+ static int ENIPStateGetEventInfo (
107
+ const char * event_name , uint8_t * event_id , AppLayerEventType * event_type )
107
108
{
108
- * event_id = SCMapEnumNameToValue (event_name , enip_decoder_event_table );
109
-
110
- if (* event_id == -1 ) {
111
- SCLogError ("event \"%s\" not present in "
112
- "enip's enum map table." ,
113
- event_name );
114
- /* yes this is fatal */
115
- return -1 ;
109
+ if (SCAppLayerGetEventIdByName (event_name , enip_decoder_event_table , event_id )) {
110
+ * event_type = APP_LAYER_EVENT_TYPE_TRANSACTION ;
111
+ return 0 ;
116
112
}
117
-
118
- * event_type = APP_LAYER_EVENT_TYPE_TRANSACTION ;
119
-
120
- return 0 ;
113
+ return -1 ;
121
114
}
122
115
123
- static int ENIPStateGetEventInfoById (int event_id , const char * * event_name ,
124
- AppLayerEventType * event_type )
116
+ static int ENIPStateGetEventInfoById (
117
+ uint8_t event_id , const char * * event_name , AppLayerEventType * event_type )
125
118
{
126
119
* event_name = SCMapEnumValueToName (event_id , enip_decoder_event_table );
127
120
if (* event_name == NULL ) {
You can’t perform that action at this time.
0 commit comments