diff options
Diffstat (limited to 'source4/torture/smb2/util.c')
-rw-r--r-- | source4/torture/smb2/util.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/source4/torture/smb2/util.c b/source4/torture/smb2/util.c index 5be96b3167..85cf0f7fba 100644 --- a/source4/torture/smb2/util.c +++ b/source4/torture/smb2/util.c @@ -544,3 +544,24 @@ uint32_t smb2_util_share_access(const char *sharemode) return val; } +uint32_t smb2_util_oplock_level(const char *op) +{ + uint32_t val = SMB2_OPLOCK_LEVEL_NONE; + int i; + + for (i = 0; i < strlen(op); i++) { + switch (op[i]) { + case 's': + return SMB2_OPLOCK_LEVEL_II; + case 'x': + return SMB2_OPLOCK_LEVEL_EXCLUSIVE; + case 'b': + return SMB2_OPLOCK_LEVEL_BATCH; + default: + continue; + } + } + + return val; +} + |