| // Copyright 2018 The Chromium OS Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| syntax = "proto2"; |
| option optimize_for = LITE_RUNTIME; |
| |
| package shill.mobile_operator_db; |
| |
| message Filter { |
| // A filter can be one of the following types. |
| enum Type { |
| IMSI = 1; |
| ICCID = 2; |
| SID = 3; |
| OPERATOR_NAME = 4; |
| MCCMNC = 5; |
| }; |
| required Type type = 1; |
| // A regular expression specifying the values that are *accepted* by this |
| // filter. The field to be tested is chosen by the |type|. |
| // The regular expression should be specified as an extended POSIX regular |
| // expression. |
| required string regex = 2; |
| } |
| |
| message LocalizedName { |
| required string name = 1; |
| // Language is specified with two letter language codes. See xml:lang. |
| // If missing, language is assumed to be "en". |
| optional string language = 2; |
| } |
| |
| message MobileAPN { |
| required string apn = 1; |
| repeated LocalizedName localized_name = 3; |
| optional string gateway = 4; |
| optional string username = 5; |
| optional string password = 6; |
| repeated string dns = 7; |
| |
| enum Authentication { |
| DEFAULT = 0; |
| PAP = 1; |
| CHAP = 2; |
| } |
| optional Authentication authentication = 8; |
| optional bool is_attach_apn = 9 [default = false]; |
| |
| enum IpType { |
| UNKNOWN = 0; |
| IPV4 = 1; |
| IPV6 = 2; |
| IPV4V6 = 3; |
| } |
| optional IpType ip_type = 10; |
| } |
| |
| message OnlinePortal { |
| enum Method { |
| GET = 1; |
| POST = 2; |
| } |
| // Some OnlinePortals are only valid for a restricted set of SIDs/MCCMNCs etc. |
| // Use this filter to restrict when the OnlinePortal is valid. |
| // The OnlinePortal is assumed to be valid if the filter is not provided. |
| optional Filter olp_filter = 1; |
| required Method method = 2; |
| required string url = 3; |
| optional string post_data = 4; |
| } |
| |
| message Data { |
| // A unique identifier for this M[V]NO. |
| required string uuid = 1; |
| optional string country = 3; |
| // List of localized names for this provider. |
| // If provided, the first is chosen as the default. |
| repeated LocalizedName localized_name = 4; |
| // Indicates that this provider requires roaming and the customer is not |
| // charged additional for roaming. This is particularly useful for some MVNOs. |
| optional bool requires_roaming = 5 [default = false]; |
| repeated OnlinePortal olp = 6; |
| optional int32 mtu = 7; |
| |
| // /////////////////////////////////////////////////////////////////////////// |
| // GSM specific properties [21 - 40] |
| |
| // MCCMNC is the concatenation of MCC and MNC. |
| // MCC is a three digit ITU E.212 Mobile Country Code (e.g. '310' or '409') |
| // and MNC is a two or three digit GSM Mobile Network Code. |
| repeated string mccmnc = 21; |
| repeated MobileAPN mobile_apn = 22; |
| |
| // /////////////////////////////////////////////////////////////////////////// |
| // CDMA specific properties [41-60] |
| |
| repeated string sid = 41; |
| repeated string nid = 42; |
| optional string activation_code = 43; |
| } |
| |
| message MobileVirtualNetworkOperator { |
| repeated Filter mvno_filter = 1; |
| // When nested under an MNO, the data provided in an MVNO is used to augment |
| // the data provided by its MNO. All provided top-level fields in |
| // |MobileVirtualNetworkOperator::data| *replace* the corresponding top-level |
| // fields in |MobileNetworkOperator::data|. No attempt is made to merge lists |
| // etc. |
| required Data data = 2; |
| } |
| |
| message MobileNetworkOperator { |
| required Data data = 1; |
| repeated MobileVirtualNetworkOperator mvno = 2; |
| // The database inevitably contains some duplicate MobileNetworkOperators that |
| // are impossible to distinguish using MCCMNC/name. In such a case, this bool |
| // may be set to pick out one of the duplicates as the intended operator. |
| // Note that if you're using this property, you should DTRT, and find out why |
| // there is an ambiguous entry in the database. |
| // TODO(pprabhu): Add a presubmit-hook to ensure that no more than one of the |
| // duplicates is earmarked. |
| optional bool earmarked = 3; |
| } |
| |
| // Top-level message. |
| // The Database is a single message of type |MobileOperatorDB|. |
| message MobileOperatorDB { |
| repeated MobileNetworkOperator mno = 1; |
| repeated MobileVirtualNetworkOperator mvno = 3; |
| } |