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