~ubuntu-branches/ubuntu/utopic/suricata/utopic

« back to all changes in this revision

Viewing changes to src/util-validate.h

  • Committer: Package Import Robot
  • Author(s): Pierre Chifflier
  • Date: 2012-07-22 22:27:36 UTC
  • mfrom: (1.1.13)
  • Revision ID: package-import@ubuntu.com-20120722222736-s2bcw3ruzenagjam
Tags: 1.3-1
* Imported Upstream version 1.3
* Add build-dependency on libnss3-dev and libnspr4-dev
* Bump Standards Version to 3.9.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
 
34
34
#ifdef DEBUG_VALIDATION
35
35
 
 
36
/** \brief test if a flow is locked.
 
37
 *
 
38
 * If trylock returns 0 it got a lock. Which means
 
39
 * the flow was previously unlocked.
 
40
 */
 
41
#define DEBUG_ASSERT_FLOW_LOCKED(f) do {            \
 
42
    if ((f) != NULL) {                              \
 
43
        int r = SCMutexTrylock(&(f)->m);            \
 
44
        if (r == 0) {                               \
 
45
            BUG_ON(1);                              \
 
46
        }                                           \
 
47
    }                                               \
 
48
} while(0)
 
49
 
36
50
/** \brief validate the integrity of the flow
37
51
 *
38
52
 *  BUG_ON's on problems
82
96
 
83
97
#else /* DEBUG_VALIDATE */
84
98
 
 
99
#define DEBUG_ASSERT_FLOW_LOCKED(f)
85
100
#define DEBUG_VALIDATE_FLOW(f)
86
101
#define DEBUG_VALIDATE_PACKET(p)
87
102