@@ -453,10 +453,10 @@ static inline void flowHash_resize(flowHash_t *flowHash) {
453
453
* 1 - value was inserted.
454
454
* returns the index into the stat record array of new or existing value
455
455
*/
456
- static inline int flowHash_add (flowHash_t * flowHash , const hashValue_t * value , int * insert ) {
456
+ static inline int flowHash_add (flowHash_t * flowHash , const hashValue_t value , int * insert ) {
457
457
if (flowHash -> count == flowHash -> load_factor ) flowHash_resize (flowHash );
458
458
459
- uint32_t hash = value -> hash ;
459
+ uint32_t hash = value . hash ;
460
460
// cell address
461
461
uint32_t cell = ___fib_hash (hash , flowHash -> shift );
462
462
@@ -465,7 +465,7 @@ static inline int flowHash_add(flowHash_t *flowHash, const hashValue_t *value, i
465
465
if (is_free (flowHash -> flags , cell )) {
466
466
int index = flowHash -> count ++ ;
467
467
flowHash -> flags [cell ] = flag ;
468
- flowHash -> cells [cell ] = * value ;
468
+ flowHash -> cells [cell ] = value ;
469
469
flowHash -> cells [cell ].index = index ;
470
470
* insert = 1 ;
471
471
return index ;
@@ -481,13 +481,13 @@ static inline int flowHash_add(flowHash_t *flowHash, const hashValue_t *value, i
481
481
// free cell found
482
482
int index = flowHash -> count ++ ;
483
483
flowHash -> flags [cell ] = flag ;
484
- flowHash -> cells [cell ] = * value ;
484
+ flowHash -> cells [cell ] = value ;
485
485
flowHash -> cells [cell ].index = index ;
486
486
* insert = 1 ;
487
487
return index ;
488
488
} else {
489
489
// cell with matching flag
490
- if (valCompare (flowHash -> cells [cell ], * value )) {
490
+ if (valCompare (flowHash -> cells [cell ], value )) {
491
491
// existing value found
492
492
* insert = 0 ;
493
493
return flowHash -> cells [cell ].index ;
@@ -505,8 +505,8 @@ static inline int flowHash_add(flowHash_t *flowHash, const hashValue_t *value, i
505
505
* index into the stat record array if found
506
506
* -1 if value does not exists
507
507
*/
508
- static inline int flowHash_get (flowHash_t * flowHash , hashValue_t * value ) {
509
- uint32_t hash = value -> hash ;
508
+ static inline int flowHash_get (flowHash_t * flowHash , const hashValue_t value ) {
509
+ uint32_t hash = value . hash ;
510
510
// cell address
511
511
uint32_t cell = ___fib_hash (hash , flowHash -> shift );
512
512
@@ -521,7 +521,7 @@ static inline int flowHash_get(flowHash_t *flowHash, hashValue_t *value) {
521
521
if (++ cell == flowHash -> capacity ) cell = 0 ;
522
522
523
523
if (is_free (flowHash -> flags , cell )) return -1 ;
524
- if (valCompare (flowHash -> cells [cell ], * value )) return flowHash -> cells [cell ].index ;
524
+ if (valCompare (flowHash -> cells [cell ], value )) return flowHash -> cells [cell ].index ;
525
525
526
526
// collision - flag matches but compare does not - loop
527
527
if (++ cell == flowHash -> capacity ) cell = 0 ;
@@ -1309,7 +1309,7 @@ static void AddBidirFlow(recordHandle_t *recordHandle) {
1309
1309
// generate 32bit hash from hash value
1310
1310
hashValue .hash = SuperFastHash (* keymem , keyLen );
1311
1311
1312
- int index = flowHash_get (flowHash , & hashValue );
1312
+ int index = flowHash_get (flowHash , hashValue );
1313
1313
if (index >= 0 ) {
1314
1314
// flow record found - update all fields
1315
1315
flowHash -> records [index ].inBytes += inBytes ;
@@ -1329,7 +1329,7 @@ static void AddBidirFlow(recordHandle_t *recordHandle) {
1329
1329
} else if (genericFlow -> proto != IPPROTO_TCP && genericFlow -> proto != IPPROTO_UDP ) {
1330
1330
// no flow record found and no TCP/UDP bidir flows. Insert flow record into hash
1331
1331
int insert ;
1332
- index = flowHash_add (flowHash , & hashValue , & insert );
1332
+ index = flowHash_add (flowHash , hashValue , & insert );
1333
1333
flowHash -> records [index ].inBytes = inBytes ;
1334
1334
flowHash -> records [index ].inPackets = inPackets ;
1335
1335
flowHash -> records [index ].outBytes = outBytes ;
@@ -1359,7 +1359,7 @@ static void AddBidirFlow(recordHandle_t *recordHandle) {
1359
1359
New_HashKey (* keymem , recordHandle , 1 );
1360
1360
hashValue .hash = SuperFastHash (* keymem , keyLen );
1361
1361
1362
- index = flowHash_get (flowHash , & hashValue );
1362
+ index = flowHash_get (flowHash , hashValue );
1363
1363
if (index >= 0 ) {
1364
1364
// we found a corresponding reverse flow - so update all fields in reverse direction
1365
1365
flowHash -> records [index ].outBytes += inBytes ;
@@ -1383,7 +1383,7 @@ static void AddBidirFlow(recordHandle_t *recordHandle) {
1383
1383
hashValue .hash = SuperFastHash (* keymem , keyLen );
1384
1384
1385
1385
int insert ;
1386
- index = flowHash_add (flowHash , & hashValue , & insert );
1386
+ index = flowHash_add (flowHash , hashValue , & insert );
1387
1387
flowHash -> records [index ].inBytes = inBytes ;
1388
1388
flowHash -> records [index ].inPackets = inPackets ;
1389
1389
flowHash -> records [index ].outBytes = outBytes ;
@@ -1467,7 +1467,7 @@ void AddFlowCache(recordHandle_t *recordHandle) {
1467
1467
hashValue .hash = SuperFastHash (* keymem , keyLen );
1468
1468
1469
1469
int insert ;
1470
- int index = flowHash_add (flowHash , & hashValue , & insert );
1470
+ int index = flowHash_add (flowHash , hashValue , & insert );
1471
1471
if (insert == 0 ) {
1472
1472
// flow record found - update all fields
1473
1473
flowHash -> records [index ].inBytes += inBytes ;
0 commit comments