Commit 5debeae6 authored by Scott Vokes's avatar Scott Vokes
Browse files

Dead code elimination.

parent b36b7851
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -336,7 +336,7 @@ static acl_of_file_res unpack_scopes(KineticProto_Command_Security_ACL *acl,
                enum json_type perm_type = json_object_get_type(val);
                if (perm_type == json_type_string) {
                    scope->permission[0] = permission_of_str(json_object_get_string(val));
                    if (scope->permission[0] == PERM_INVALID) {
                    if (scope->permission[0] == KINETIC_PROTO_COMMAND_SECURITY_ACL_PERMISSION_INVALID_PERMISSION) {
                        return ACL_ERROR_INVALID_FIELD;
                    } else {
                        scope->n_permission++;
+0 −43
Original line number Diff line number Diff line
@@ -18,21 +18,6 @@ struct hmac_key {
    uint8_t key[];
};

typedef enum {
    PERM_INVALID = -1, // place holder for backward compatibility
    PERM_READ = 0, // can read key/values
    PERM_WRITE = 1, // can write key/values
    PERM_DELETE = 2, // can delete key/values
    PERM_RANGE = 3, // can do a range
    PERM_SETUP = 4, // can set up a device
    PERM_P2POP = 5, // can do a peer to peer operation
    // [apparently 6 was deprecated]
    PERM_GETLOG = 7, // can get log
    PERM_SECURITY = 8, // can set up the security permission of the device
} permission_t;

#define ACL_MAX_PERMISSIONS 8

struct ACL {
    size_t ACL_ceil;
    size_t ACL_count;
@@ -50,32 +35,4 @@ typedef enum {
    ACL_ERROR_INVALID_FIELD = -6,
} acl_of_file_res;

#if 0
struct  _KineticProto_Command_Security_ACL {
    ProtobufCMessage base;
    protobuf_c_boolean has_identity;
    int64_t identity;
    protobuf_c_boolean has_key;
    ProtobufCBinaryData key;
    protobuf_c_boolean has_hmacAlgorithm;
    KineticProto_Command_Security_ACL_HMACAlgorithm hmacAlgorithm;
    size_t n_scope;
    KineticProto_Command_Security_ACL_Scope** scope;
    protobuf_c_boolean has_maxPriority;
    KineticProto_Command_Priority maxPriority;
};

struct  _KineticProto_Command_Security_ACL_Scope {
    ProtobufCMessage base;
    protobuf_c_boolean has_offset;
    int64_t offset;
    protobuf_c_boolean has_value;
    ProtobufCBinaryData value;
    size_t n_permission;
    KineticProto_Command_Security_ACL_Permission* permission;
    protobuf_c_boolean has_TlsRequired;
    protobuf_c_boolean TlsRequired;
};
#endif

#endif