syntax = "proto3";

option go_package = "github.com/opencord/voltha-protos/v3/go/common";

package common;

option java_package = "org.opencord.voltha";

// Convey a resource identifier
message ID {
    string id = 1;
}

// Represents a list of IDs
message IDs {
    repeated ID items = 1;
}

enum TestModeKeys {
    api_test=0;
}

message AdminState {
    // Administrative State
    enum Types {

        // The administrative state of the device is unknown
        UNKNOWN = 0;

        // The device is pre-provisioned into Voltha, but not contacted by it
        PREPROVISIONED = 1;

        // The device is enabled for activation and operation
        ENABLED = 2;

        // The device is disabled and shall not perform its intended forwarding
        // functions other than being available for re-activation.
        DISABLED = 3;

        // The device is in the state of image download
        DOWNLOADING_IMAGE = 4;

        // The device is marked to be deleted
        DELETED = 5;

        // The device is marked to be in deleting state
        DELETING = 6;
    }
}

message OperStatus {
    // Operational Status
    enum Types {

        // The status of the device is unknown at this point
        UNKNOWN = 0;

        // The device has been discovered, but not yet activated
        DISCOVERED = 1;

        // The device is being activated (booted, rebooted, upgraded, etc.)
        ACTIVATING = 2;

        // Service impacting tests are being conducted
        TESTING = 3;

        // The device is up and active
        ACTIVE = 4;

        // The device has failed and cannot fulfill its intended role
        FAILED = 5;
    }
}

message ConnectStatus {
    // Connectivity Status
    enum Types {

        // The device connectivity status is unknown
        UNKNOWN = 0;

        // The device cannot be reached by Voltha
        UNREACHABLE = 1;

        // There is live communication between device and Voltha
        REACHABLE = 2;
    }
}

message OperationResp {
    enum OperationReturnCode {
        OPERATION_SUCCESS = 0;
        OPERATION_FAILURE = 1;
        OPERATION_UNSUPPORTED = 2;
    }
    // Return code
    OperationReturnCode code = 1;

    // Additional Info
    string additional_info = 2;
}
message ValueType {
        enum Type {
                EMPTY = 0;
                DISTANCE = 1;
        }
}
message ValueSpecifier {
	string id = 1;
	ValueType.Type value = 2;
}

message ReturnValues {
        uint32  Set = 1;       // Specifies what values are
                               // set/valid in return

        uint32 Unsupported = 2; // Specifies requested values not
                                // supported by the device

        uint32 Error  = 3;      // Specifies requested values not
                                // fetched because of error

        uint32 Distance = 4;    // Value of distance Set includes
                                // DISTANCE

}
