xref: /aosp_15_r20/external/ot-br-posix/src/proto/feature_flag.proto (revision 4a64e381480ef79f0532b2421e44e6ee336b8e0d)
1syntax = "proto2";
2option optimize_for = LITE_RUNTIME;
3
4package otbr;
5
6enum ProtoLogLevel
7{
8    PROTO_LOG_UNSPECIFIED = 0;  ///< Zero value enum is UNSPECIFIED
9    PROTO_LOG_EMERG       = 1;  ///< System is unusable
10    PROTO_LOG_ALERT       = 2;  ///< Action must be taken immediately
11    PROTO_LOG_CRIT        = 3;  ///< Critical conditions
12    PROTO_LOG_ERR         = 4;  ///< Error conditions
13    PROTO_LOG_WARNING     = 5;  ///< Warning conditions
14    PROTO_LOG_NOTICE      = 6;  ///< Normal but significant condition
15    PROTO_LOG_INFO        = 7;  ///< Informational
16    PROTO_LOG_DEBUG       = 8;  ///< Debug level messages
17}
18
19// Feature flag list message defines the list of feature flags to be used
20// on OpenThread.
21//
22/////////////         Definition Policy Guide            /////////////
23// * Every field is optional with a default value. The default value should
24//   allow the feature to behave safe when the upper layer wants to rollback
25//   or doesn't have the flag value (e.g., due to some network config download
26//   error, API version mismatch, etc.). This makes sure that the system can
27//   always rollback to safe status, even in the edge case.
28// * When a feature finishes the rollup and becomes stable, the clear up process
29//   should update the feature flag default value with the rolluped value.
30
31/////////////  Feature Flag & API Evolving Policy Guide  /////////////
32// * Add a new feature flag: add a new field in the proto.
33// * Remove feature flag: mark the field as deprecated. Do NOT delete the field.
34//   By default, the deprecated field should not impact OpenThread. If feature
35//   owner wants to keep the deprecated flag backward compatible, he need to
36//   clearly specify: what is the behavior if no/portion/all
37//   deprecated_flag & its_new_flags exist.
38// * Rename feature flag: if the feature’s semantics are not changed, it is
39//   allowed to rename the field (the tag should not be changed). If the feature’s
40//   semantics are changed, deprecate the field and add a new one.
41// * Divide the flag into 2 flags: deprecate the old feature field, and add 2
42//   new feature fields. If feature owner wants to keep the deprecated flag backward
43//   compatible, he need to clearly specify: what is the behavior if no/portion/all
44//   deprecated_flag & its_new_flags exist.
45// * API Compatibility:
46//   - If the OTBR API is older than the upper layer API, there are unrecognized
47//     flags during proto parsing and they will be ignored.
48//   - If the OTBR API is newer than the upper layer API, some new flags are
49//     missing during the proto parsing, and these flags' default value will
50//     be used as the feature flag value.
51//   - If OTBR API is newer and deprecates a previously defined flag and upper
52//     layer API is older (not aware of the deprecation) and uses the flag,
53//     the flag takes no effect on OTBR as OTBR API deprecates it.
54message FeatureFlagList {
55  // Whether to enable the NAT64 feature.
56  optional bool enable_nat64 = 1 [default = false];
57  // Whether to enable detailed logging.
58  optional bool enable_detailed_logging = 2 [default = false];
59  // Set specific detailed logging level, default = PROTO_LOG_INFO
60  optional ProtoLogLevel detailed_logging_level = 3 [default = PROTO_LOG_INFO];
61  // Whether to enable the TREL feature.
62  optional bool enable_trel = 4 [default = false];
63  // Whether to enable upstream DNS forwarding.
64  optional bool enable_dns_upstream_query = 5 [default = false];
65  // Whether to enable prefix delegation.
66  optional bool enable_dhcp6_pd = 6 [default = false];
67  // Whether to enable link metrics manager.
68  optional bool enable_link_metrics_manager = 7 [default = false];
69  // Whether to enable the ePSKc feature.
70  optional bool enable_ephemeralkey = 8 [default = false];
71}
72