1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
|
// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROMEOS_COMPONENTS_ONC_ONC_SIGNATURE_H_
#define CHROMEOS_COMPONENTS_ONC_ONC_SIGNATURE_H_
#include <string>
#include "base/component_export.h"
#include "base/memory/raw_ptr_exclusion.h"
#include "base/values.h"
namespace chromeos {
namespace onc {
// Generates a default value for a field.
// This is used so that static global base::Values can be avoided (which would
// have a non-trivial destructor and are thus prohibited).
using DefaultValueSetterFunc = base::Value (*)();
struct OncValueSignature;
struct OncFieldSignature {
const char* onc_field_name;
// This field is not a raw_ptr<> because it only ever points to statically-
// allocated memory that is never freed, so it can't possibly dangle.
RAW_PTR_EXCLUSION const OncValueSignature* value_signature;
// If this is non-null, it will be called if the field doesn't have a value
// after shill->onc translation and the returned value will be assigned to the
// field.
DefaultValueSetterFunc default_value_setter = nullptr;
};
struct COMPONENT_EXPORT(CHROMEOS_ONC) OncValueSignature {
base::Value::Type onc_type;
// These fields are not raw_ptr<>s because they only ever point to statically-
// allocated memory that is never freed, so they can't possibly dangle.
RAW_PTR_EXCLUSION const OncFieldSignature* fields;
RAW_PTR_EXCLUSION const OncValueSignature* onc_array_entry_signature;
RAW_PTR_EXCLUSION const OncValueSignature* base_signature;
};
COMPONENT_EXPORT(CHROMEOS_ONC)
const OncFieldSignature* GetFieldSignature(const OncValueSignature& signature,
const std::string& onc_field_name);
COMPONENT_EXPORT(CHROMEOS_ONC)
bool FieldIsCredential(const OncValueSignature& signature,
const std::string& onc_field_name);
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kRecommendedSignature;
COMPONENT_EXPORT(CHROMEOS_ONC) extern const OncValueSignature kEAPSignature;
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kIssuerSubjectPatternSignature;
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kCertificatePatternSignature;
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kIPsecSignature;
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kL2TPSignature;
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kXAUTHSignature;
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kOpenVPNSignature;
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kWireGuardSignature;
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kWireGuardPeerSignature;
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kWireGuardPeerListSignature;
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kThirdPartyVPNSignature;
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kARCVPNSignature;
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kVerifyX509Signature;
COMPONENT_EXPORT(CHROMEOS_ONC) extern const OncValueSignature kVPNSignature;
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kEthernetSignature;
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kTetherSignature;
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kTetherWithStateSignature;
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kIPConfigSignature;
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kSavedIPConfigSignature;
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kStaticIPConfigSignature;
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kProxyLocationSignature;
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kProxyManualSignature;
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kProxySettingsSignature;
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kWiFiSignature;
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kCertificateSignature;
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kScopeSignature;
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kNetworkConfigurationSignature;
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kGlobalNetworkConfigurationSignature;
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kCertificateListSignature;
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kAdminApnListSignature;
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kNetworkConfigurationListSignature;
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kToplevelConfigurationSignature;
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kEAPSubjectAlternativeNameMatchListSignature;
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kEAPSubjectAlternativeNameMatchSignature;
// Derived "ONC with State" signatures.
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kNetworkWithStateSignature;
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kWiFiWithStateSignature;
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kCellularSignature;
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kCellularWithStateSignature;
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kCellularPaymentPortalSignature;
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kCellularProviderSignature;
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kCellularApnSignature;
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kCellularFoundNetworkSignature;
COMPONENT_EXPORT(CHROMEOS_ONC)
extern const OncValueSignature kSIMLockStatusSignature;
} // namespace onc
} // namespace chromeos
#endif // CHROMEOS_COMPONENTS_ONC_ONC_SIGNATURE_H_
|