add an invalid protection level to the enum
This commit is contained in:
@@ -81,7 +81,7 @@ name_to_level(const char *name)
|
||||
for(i = 0; i < sizeof(level_names) / sizeof(level_names[0]); i++)
|
||||
if(!strncasecmp(level_names[i].name, name, strlen(name)))
|
||||
return level_names[i].level;
|
||||
return (enum protection_level)-1;
|
||||
return prot_invalid;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -683,7 +683,7 @@ set_command_prot(enum protection_level level)
|
||||
ret = command("CCC");
|
||||
if(ret != COMPLETE) {
|
||||
printf("Failed to clear command channel.\n");
|
||||
return -1;
|
||||
return prot_invalid;
|
||||
}
|
||||
}
|
||||
command_prot = level;
|
||||
|
@@ -37,10 +37,11 @@
|
||||
#define __security_h__
|
||||
|
||||
enum protection_level {
|
||||
prot_clear,
|
||||
prot_safe,
|
||||
prot_confidential,
|
||||
prot_private
|
||||
prot_invalid = -1,
|
||||
prot_clear = 0,
|
||||
prot_safe = 1,
|
||||
prot_confidential = 2,
|
||||
prot_private = 3
|
||||
};
|
||||
|
||||
struct sec_client_mech {
|
||||
|
Reference in New Issue
Block a user