• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef ETH_EAP_PROFILE_H
17 #define ETH_EAP_PROFILE_H
18 
19 #include <string>
20 #include <vector>
21 
22 #include "parcel.h"
23 
24 namespace OHOS {
25 namespace NetManagerStandard {
26 
27 typedef enum {
28     EAP_NONE       = 0,
29     EAP_PEAP       = 1,
30     EAP_TLS        = 2,
31     EAP_TTLS       = 3,
32     EAP_PWD        = 4,
33     EAP_SIM        = 5,
34     EAP_AKA        = 6,
35     EAP_AKA_PRIME  = 7,
36     EAP_UNAUTH_TLS = 8
37 } EapMethod;
38 
39 typedef enum {
40     PHASE2_NONE      = 0,
41     PHASE2_PAP       = 1,  // only EAP-TTLS support this mode
42     PHASE2_MSCHAP    = 2,  // only EAP-TTLS support this mode
43     PHASE2_MSCHAPV2  = 3,  // only EAP-PEAP/EAP-TTLS support this mode
44     PHASE2_GTC       = 4,  // only EAP-PEAP/EAP-TTLS support this mode
45     PHASE2_SIM       = 5,  // only EAP-PEAP support this mode
46     PHASE2_AKA       = 6,  // only EAP-PEAP support this mode
47     PHASE2_AKA_PRIME = 7   // only EAP-PEAP support this mode
48 } Phase2Method;
49 
50 struct EthEapProfile : public Parcelable {
51     EapMethod eapMethod;            /* EAP authentication mode:PEAP/TLS/TTLS/PWD/SIM/AKA/AKA' */
52     Phase2Method phase2Method;      /* Second stage authentication method */
53     std::string identity;           /* Identity information */
54     std::string anonymousIdentity;  /* Anonymous identity information */
55     std::string password;           /* EAP mode password */
56     std::string caCertAliases;      /* CA certificate alias */
57     std::string caPath;             /* CA certificate path */
58     std::string clientCertAliases;  /* Client certificate alias */
59     std::vector<uint8_t> certEntry; /* CA certificate entry */
60     std::string certPassword;       /* Certificate password */
61     std::string altSubjectMatch;    /* Alternative topic matching */
62     std::string domainSuffixMatch;  /* Domain suffix matching */
63     std::string realm;              /* The field of passport credentials */
64     std::string plmn;               /* Public Land Mobile Network of the provider of Passpoint credential */
65     int32_t eapSubId;               /* Sub ID of SIM card */
66 
67     virtual bool Marshalling(Parcel& parcel) const override;
68     static EthEapProfile* Unmarshalling(Parcel &parcel);
69 };
70 } // namespace NetManagerStandard
71 } // namespace OHOS
72 #endif // ETH_EAP_PROFILE_H