// SPDX-FileCopyrightText: 2020 The Magma Authors.
// SPDX-FileCopyrightText: 2022 Open Networking Foundation <support@opennetworking.org>
//
// SPDX-License-Identifier: BSD-3-Clause

syntax = "proto3";

import "google/protobuf/any.proto";

package magma.orc8r;
option go_package = "magma/orc8r/lib/go/protos";

// --------------------------------------------------------------------------
// GatewayConfigs structure is a container for all Access Gateway's (AG) Cloud
// Managed Configs (CMC). Each and every field of GatewayConfigs represents
// one AG service config
// --------------------------------------------------------------------------
// NOTE: a service config field name (control_proxy, enodebd, etc.) must match
//       the corresponding gateway service's name exactly
message GatewayConfigs {
    map<string, google.protobuf.Any> configs_by_key = 10;

    GatewayConfigsMetadata metadata = 11;
}

// Deterministic hash of a serialized GatewayConfigs proto
message GatewayConfigsDigest {
    // Hexadecimal MD5 hash of the UTF-8-encoded stringified full mconfigs
    string md5_hex_digest = 1;
}

// Metadata about the configs.
message GatewayConfigsMetadata {
    // Unix timestamp of Cloud at the time of config generation.
    uint64 created_at = 11;
    GatewayConfigsDigest digest = 12;
}

// Wraps a gateway config and a stream offset that the config was computed
// from
message OffsetGatewayConfigs {
    GatewayConfigs configs = 1;
    int64 offset = 2;
}

// Stream request passed as extra args to the streaming mconfig streamer policy.
// Contains a single field, the offset of the mconfig currently stored on
// the device.
message MconfigStreamRequest {
    int64 offset = 1;
}
