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 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124
|
// Copyright 2015 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// The <code>chrome.networkingPrivate</code> API is used for configuring
// network connections (Cellular, Ethernet, VPN or WiFi). This private
// API is only valid if called from a browser or app associated with the
// primary user. See the Open Network Configuration (ONC) documentation for
// descriptions of properties:
// <a href="https://source.chromium.org/chromium/chromium/src/+/HEAD:components/onc/docs/onc_spec.md">
// src/components/onc/docs/onc_spec.html</a>, or the
// <a href="http://www.chromium.org/chromium-os/chromiumos-design-docs/open-network-configuration">
// Open Network Configuration</a> page at chromium.org.
// <br><br>
// NOTE: Most dictionary properties and enum values use UpperCamelCase to match
// the ONC spec instead of the JavaScript lowerCamelCase convention.
// <br><br>
// "State" properties describe just the ONC properties returned by
// $(ref:networkingPrivate.getState) and $(ref:networkingPrivate.getNetworks).
// <br><br>
// "Config" properties describe just the ONC properties that can be configured
// through this API. NOTE: Not all configuration properties are exposed at this
// time, only those currently required by the Chrome Settings UI.
// TODO(stevenjb): Provide all configuration properties and types,
// crbug.com/380937.
// <br><br>
// TODO(stevenjb/pneubeck): Merge the ONC documentation with this document and
// use it as the ONC specification.
namespace networkingPrivate {
enum ActivationStateType {
Activated, Activating, NotActivated, PartiallyActivated
};
enum CaptivePortalStatus {
Unknown, Offline, Online, Portal, ProxyAuthRequired
};
enum ConnectionStateType {
Connected, Connecting, NotConnected
};
enum DeviceStateType {
// Device is available but not initialized.
Uninitialized,
// Device is initialized but not enabled.
Disabled,
// Enabled state has been requested but has not completed.
Enabling,
// Device is enabled.
Enabled,
// Device is prohibited.
Prohibited
};
enum IPConfigType {
DHCP, Static
};
enum NetworkType {
All, Cellular, Ethernet, Tether, VPN, Wireless, WiFi
};
enum ProxySettingsType {
Direct, Manual, PAC, WPAD
};
enum ApnType {
Default, Attach, Tether
};
enum ApnSource {
Modem, Modb, Ui, Admin
};
// Managed property types. These types all share a common structure:
// Active: For properties that are translated from the configuration
// manager (e.g. Shill), the 'active' value currently in use by the
// configuration manager.
// Effective: The effective source for the property: UserPolicy, DevicePolicy,
// UserSetting or SharedSetting.
// UserPolicy: The value provided by the user policy.
// DevicePolicy: The value provided by the device policy.
// UserSetting: The value set by the logged in user. Only provided if
// UserEditable is true (i.e. no policy affects the property or the
// policy provided value is recommened only).
// SharedSetting: The value set for all users of the device. Only provided if
// DeviceEditiable is true (i.e. no policy affects the property or the
// policy provided value is recommened only).
// UserEditable: True if a UserPolicy exists and allows the property to be
// edited (i.e. is a recommended value). Defaults to False.
// DeviceEditable: True if a DevicePolicy exists and allows the property to be
// edited (i.e. is a recommended value). Defaults to False.
dictionary ManagedBoolean {
boolean? Active;
DOMString? Effective;
boolean? UserPolicy;
boolean? DevicePolicy;
boolean? UserSetting;
boolean? SharedSetting;
boolean? UserEditable;
boolean? DeviceEditable;
};
dictionary ManagedLong {
long? Active;
DOMString? Effective;
long? UserPolicy;
long? DevicePolicy;
long? UserSetting;
long? SharedSetting;
boolean? UserEditable;
boolean? DeviceEditable;
};
dictionary ManagedDOMString {
DOMString? Active;
DOMString? Effective;
DOMString? UserPolicy;
DOMString? DevicePolicy;
DOMString? UserSetting;
DOMString? SharedSetting;
boolean? UserEditable;
boolean? DeviceEditable;
};
dictionary ManagedDOMStringList {
DOMString[]? Active;
DOMString? Effective;
DOMString[]? UserPolicy;
DOMString[]? DevicePolicy;
DOMString[]? UserSetting;
DOMString[]? SharedSetting;
boolean? UserEditable;
boolean? DeviceEditable;
};
dictionary ManagedIPConfigType {
IPConfigType? Active;
DOMString? Effective;
IPConfigType? UserPolicy;
IPConfigType? DevicePolicy;
IPConfigType? UserSetting;
IPConfigType? SharedSetting;
boolean? UserEditable;
boolean? DeviceEditable;
};
dictionary ManagedProxySettingsType {
ProxySettingsType? Active;
DOMString? Effective;
ProxySettingsType? UserPolicy;
ProxySettingsType? DevicePolicy;
ProxySettingsType? UserSetting;
ProxySettingsType? SharedSetting;
boolean? UserEditable;
boolean? DeviceEditable;
};
// Sub-dictionary types.
dictionary APNProperties {
DOMString AccessPointName;
DOMString? Authentication;
DOMString? Language;
DOMString? LocalizedName;
DOMString? Name;
DOMString? Password;
DOMString? Username;
ApnType[]? ApnTypes;
ApnSource? Source;
};
dictionary ManagedAPNProperties {
ManagedDOMString AccessPointName;
ManagedDOMString? Authentication;
ManagedDOMString? Language;
ManagedDOMString? LocalizedName;
ManagedDOMString? Name;
ManagedDOMString? Password;
ManagedDOMString? Username;
};
dictionary ManagedAPNList {
APNProperties[]? Active;
DOMString? Effective;
APNProperties[]? UserPolicy;
APNProperties[]? DevicePolicy;
APNProperties[]? UserSetting;
APNProperties[]? SharedSetting;
boolean? UserEditable;
boolean? DeviceEditable;
};
dictionary CellularProviderProperties {
DOMString Name;
DOMString Code;
DOMString? Country;
};
dictionary CellularSimState {
// Whether or not a PIN should be required.
boolean requirePin;
// The current PIN (required for any change, even when the SIM is unlocked).
DOMString currentPin;
// If provided, change the PIN to |newPin|. |requirePin| must be true.
DOMString? newPin;
};
dictionary IssuerSubjectPattern {
DOMString? CommonName;
DOMString? Locality;
DOMString? Organization;
DOMString? OrganizationalUnit;
};
dictionary ManagedIssuerSubjectPattern {
ManagedDOMString? CommonName;
ManagedDOMString? Locality;
ManagedDOMString? Organization;
ManagedDOMString? OrganizationalUnit;
};
dictionary CertificatePattern {
DOMString[]? EnrollmentURI;
IssuerSubjectPattern? Issuer;
DOMString[]? IssuerCAPEMs;
DOMString[]? IssuerCARef;
IssuerSubjectPattern? Subject;
};
dictionary ManagedCertificatePattern {
ManagedDOMStringList? EnrollmentURI;
ManagedIssuerSubjectPattern? Issuer;
ManagedDOMStringList? IssuerCARef;
ManagedIssuerSubjectPattern? Subject;
};
dictionary EAPProperties {
DOMString? AnonymousIdentity;
CertificatePattern? ClientCertPattern;
DOMString? ClientCertPKCS11Id;
DOMString? ClientCertProvisioningProfileId;
DOMString? ClientCertRef;
DOMString? ClientCertType;
DOMString? Identity;
DOMString? Inner;
// The outer EAP type. Required by ONC, but may not be provided when
// translating from Shill.
DOMString? Outer;
DOMString? Password;
boolean? SaveCredentials;
DOMString[]? ServerCAPEMs;
DOMString[]? ServerCARefs;
DOMString? SubjectMatch;
DOMString? TLSVersionMax;
boolean? UseProactiveKeyCaching;
boolean? UseSystemCAs;
};
dictionary ManagedEAPProperties {
ManagedDOMString? AnonymousIdentity;
ManagedCertificatePattern? ClientCertPattern;
ManagedDOMString? ClientCertPKCS11Id;
ManagedDOMString? ClientCertProvisioningProfileId;
ManagedDOMString? ClientCertRef;
ManagedDOMString? ClientCertType;
ManagedDOMString? Identity;
ManagedDOMString? Inner;
// The outer EAP type. Required by ONC, but may not be provided when
// translating from Shill.
ManagedDOMString? Outer;
ManagedDOMString? Password;
ManagedBoolean? SaveCredentials;
ManagedDOMStringList? ServerCAPEMs;
ManagedDOMStringList? ServerCARefs;
ManagedDOMString? SubjectMatch;
ManagedDOMString? TLSVersionMax;
ManagedBoolean? UseProactiveKeyCaching;
ManagedBoolean? UseSystemCAs;
};
dictionary FoundNetworkProperties {
DOMString Status;
DOMString NetworkId;
DOMString Technology;
DOMString? ShortName;
DOMString? LongName;
};
dictionary IPConfigProperties {
DOMString? Gateway;
DOMString? IPAddress;
DOMString[]? ExcludedRoutes;
DOMString[]? IncludedRoutes;
DOMString[]? NameServers;
DOMString[]? SearchDomains;
long? RoutingPrefix;
DOMString? Type;
DOMString? WebProxyAutoDiscoveryUrl;
};
dictionary ManagedIPConfigProperties {
ManagedDOMString? Gateway;
ManagedDOMString? IPAddress;
ManagedDOMStringList? NameServers;
ManagedLong? RoutingPrefix;
ManagedDOMString? Type;
ManagedDOMString? WebProxyAutoDiscoveryUrl;
};
dictionary XAUTHProperties {
DOMString? Password;
boolean? SaveCredentials;
DOMString? Username;
};
dictionary ManagedXAUTHProperties {
ManagedDOMString? Password;
ManagedBoolean? SaveCredentials;
ManagedDOMString? Username;
};
dictionary IPSecProperties {
DOMString AuthenticationType;
CertificatePattern? ClientCertPattern;
DOMString? ClientCertPKCS11Id;
DOMString? ClientCertProvisioningProfileId;
DOMString? ClientCertRef;
DOMString? ClientCertType;
EAPProperties? EAP;
DOMString? Group;
long? IKEVersion;
DOMString? LocalIdentity;
DOMString? PSK;
DOMString? RemoteIdentity;
boolean? SaveCredentials;
DOMString[]? ServerCAPEMs;
DOMString[]? ServerCARefs;
XAUTHProperties? XAUTH;
};
dictionary ManagedIPSecProperties {
ManagedDOMString AuthenticationType;
ManagedCertificatePattern? ClientCertPattern;
ManagedDOMString? ClientCertPKCS11Id;
ManagedDOMString? ClientCertProvisioningProfileId;
ManagedDOMString? ClientCertRef;
ManagedDOMString? ClientCertType;
ManagedEAPProperties? EAP;
ManagedDOMString? Group;
ManagedLong? IKEVersion;
ManagedDOMString? PSK;
ManagedBoolean? SaveCredentials;
ManagedDOMStringList? ServerCAPEMs;
ManagedDOMStringList? ServerCARefs;
ManagedXAUTHProperties? XAUTH;
};
dictionary L2TPProperties {
boolean? LcpEchoDisabled;
DOMString? Password;
boolean? SaveCredentials;
DOMString? Username;
};
dictionary ManagedL2TPProperties {
ManagedBoolean? LcpEchoDisabled;
ManagedDOMString? Password;
ManagedBoolean? SaveCredentials;
ManagedDOMString? Username;
};
dictionary PaymentPortal {
DOMString Method;
DOMString? PostData;
DOMString? Url;
};
dictionary ProxyLocation {
DOMString Host;
long Port;
};
dictionary ManagedProxyLocation {
ManagedDOMString Host;
ManagedLong Port;
};
dictionary ManualProxySettings {
ProxyLocation? HTTPProxy;
ProxyLocation? SecureHTTPProxy;
ProxyLocation? FTPProxy;
ProxyLocation? SOCKS;
};
dictionary ManagedManualProxySettings {
ManagedProxyLocation? HTTPProxy;
ManagedProxyLocation? SecureHTTPProxy;
ManagedProxyLocation? FTPProxy;
ManagedProxyLocation? SOCKS;
};
dictionary ProxySettings {
ProxySettingsType Type;
ManualProxySettings? Manual;
DOMString[]? ExcludeDomains;
DOMString? PAC;
};
dictionary ManagedProxySettings {
ManagedProxySettingsType Type;
ManagedManualProxySettings? Manual;
ManagedDOMStringList? ExcludeDomains;
ManagedDOMString? PAC;
};
dictionary VerifyX509 {
DOMString? Name;
DOMString? Type;
};
dictionary ManagedVerifyX509 {
ManagedDOMString? Name;
ManagedDOMString? Type;
};
dictionary OpenVPNProperties {
DOMString? Auth;
DOMString? AuthRetry;
boolean? AuthNoCache;
DOMString? Cipher;
DOMString? ClientCertPKCS11Id;
CertificatePattern? ClientCertPattern;
DOMString? ClientCertProvisioningProfileId;
DOMString? ClientCertRef;
DOMString? ClientCertType;
DOMString? CompLZO;
boolean? CompNoAdapt;
DOMString[]? ExtraHosts;
boolean? IgnoreDefaultRoute;
DOMString? KeyDirection;
DOMString? NsCertType;
DOMString? OTP;
DOMString? Password;
long? Port;
DOMString? Proto;
boolean? PushPeerInfo;
DOMString? RemoteCertEKU;
DOMString[]? RemoteCertKU;
DOMString? RemoteCertTLS;
long? RenegSec;
boolean? SaveCredentials;
DOMString[]? ServerCAPEMs;
DOMString[]? ServerCARefs;
DOMString? ServerCertRef;
long? ServerPollTimeout;
long? Shaper;
DOMString? StaticChallenge;
DOMString? TLSAuthContents;
DOMString? TLSRemote;
DOMString? TLSVersionMin;
DOMString? UserAuthenticationType;
DOMString? Username;
DOMString? Verb;
DOMString? VerifyHash;
VerifyX509? VerifyX509;
};
dictionary ManagedOpenVPNProperties {
ManagedDOMString? Auth;
ManagedDOMString? AuthRetry;
ManagedBoolean? AuthNoCache;
ManagedDOMString? Cipher;
ManagedDOMString? ClientCertPKCS11Id;
ManagedCertificatePattern? ClientCertPattern;
ManagedDOMString? ClientCertProvisioningProfileId;
ManagedDOMString? ClientCertRef;
ManagedDOMString? ClientCertType;
ManagedDOMString? CompLZO;
ManagedBoolean? CompNoAdapt;
ManagedDOMStringList? ExtraHosts;
ManagedBoolean? IgnoreDefaultRoute;
ManagedDOMString? KeyDirection;
ManagedDOMString? NsCertType;
ManagedDOMString? OTP;
ManagedDOMString? Password;
ManagedLong? Port;
ManagedDOMString? Proto;
ManagedBoolean? PushPeerInfo;
ManagedDOMString? RemoteCertEKU;
ManagedDOMStringList? RemoteCertKU;
ManagedDOMString? RemoteCertTLS;
ManagedLong? RenegSec;
ManagedBoolean? SaveCredentials;
ManagedDOMStringList? ServerCAPEMs;
ManagedDOMStringList? ServerCARefs;
ManagedDOMString? ServerCertRef;
ManagedLong? ServerPollTimeout;
ManagedLong? Shaper;
ManagedDOMString? StaticChallenge;
ManagedDOMString? TLSAuthContents;
ManagedDOMString? TLSRemote;
ManagedDOMString? TLSVersionMin;
ManagedDOMString? UserAuthenticationType;
ManagedDOMString? Username;
ManagedDOMString? Verb;
ManagedDOMString? VerifyHash;
ManagedVerifyX509? VerifyX509;
};
dictionary SIMLockStatus {
DOMString LockType; // sim-pin, sim-puk, or ''
boolean LockEnabled;
long? RetriesLeft;
};
dictionary ThirdPartyVPNProperties {
DOMString ExtensionID;
DOMString? ProviderName;
};
dictionary ManagedThirdPartyVPNProperties {
ManagedDOMString ExtensionID;
DOMString? ProviderName;
};
// Network type dictionary types.
dictionary CellularProperties {
boolean? AutoConnect;
APNProperties? APN;
APNProperties[]? APNList;
DOMString? ActivationType;
ActivationStateType? ActivationState;
boolean? AllowRoaming;
DOMString? ESN;
DOMString? Family;
DOMString? FirmwareRevision;
FoundNetworkProperties[]? FoundNetworks;
DOMString? HardwareRevision;
CellularProviderProperties? HomeProvider;
DOMString? ICCID;
DOMString? IMEI;
APNProperties? LastGoodAPN;
DOMString? Manufacturer;
DOMString? MDN;
DOMString? MEID;
DOMString? MIN;
DOMString? ModelID;
DOMString? NetworkTechnology;
PaymentPortal? PaymentPortal;
DOMString? RoamingState;
boolean? Scanning;
CellularProviderProperties? ServingOperator;
SIMLockStatus? SIMLockStatus;
boolean? SIMPresent;
long? SignalStrength;
boolean? SupportNetworkScan;
};
dictionary ManagedCellularProperties {
ManagedBoolean? AutoConnect;
ManagedAPNProperties? APN;
ManagedAPNList? APNList;
DOMString? ActivationType;
ActivationStateType? ActivationState;
boolean? AllowRoaming;
DOMString? ESN;
DOMString? Family;
DOMString? FirmwareRevision;
FoundNetworkProperties[]? FoundNetworks;
DOMString? HardwareRevision;
CellularProviderProperties? HomeProvider;
DOMString? ICCID;
DOMString? IMEI;
APNProperties? LastGoodAPN;
DOMString? Manufacturer;
DOMString? MDN;
DOMString? MEID;
DOMString? MIN;
DOMString? ModelID;
DOMString? NetworkTechnology;
PaymentPortal? PaymentPortal;
DOMString? RoamingState;
boolean? Scanning;
CellularProviderProperties? ServingOperator;
SIMLockStatus? SIMLockStatus;
boolean? SIMPresent;
long? SignalStrength;
boolean? SupportNetworkScan;
};
dictionary CellularStateProperties {
ActivationStateType? ActivationState;
DOMString? EID;
DOMString? ICCID;
DOMString? NetworkTechnology;
DOMString? RoamingState;
boolean? Scanning;
boolean? SIMPresent;
long? SignalStrength;
};
dictionary EAPStateProperties {
DOMString? Outer;
};
dictionary EthernetProperties {
boolean? AutoConnect;
DOMString? Authentication;
EAPProperties? EAP;
};
dictionary ManagedEthernetProperties {
ManagedBoolean? AutoConnect;
ManagedDOMString? Authentication;
ManagedEAPProperties? EAP;
};
dictionary EthernetStateProperties {
DOMString Authentication;
};
dictionary TetherProperties {
long? BatteryPercentage;
DOMString? Carrier;
boolean HasConnectedToHost;
long? SignalStrength;
};
dictionary VPNProperties {
boolean? AutoConnect;
DOMString? Host;
IPSecProperties? IPsec;
L2TPProperties? L2TP;
OpenVPNProperties? OpenVPN;
ThirdPartyVPNProperties? ThirdPartyVPN;
// The VPN type. This cannot be an enum because of 'L2TP-IPSec'.
// This is optional for NetworkConfigProperties which is passed to
// setProperties which may be used to set only specific properties.
DOMString? Type;
};
dictionary ManagedVPNProperties {
ManagedBoolean? AutoConnect;
ManagedDOMString? Host;
ManagedIPSecProperties? IPsec;
ManagedL2TPProperties? L2TP;
ManagedOpenVPNProperties? OpenVPN;
ManagedThirdPartyVPNProperties? ThirdPartyVPN;
ManagedDOMString? Type;
};
dictionary VPNStateProperties {
DOMString Type;
IPSecProperties? IPsec;
ThirdPartyVPNProperties? ThirdPartyVPN;
};
dictionary WiFiProperties {
boolean? AllowGatewayARPPolling;
boolean? AutoConnect;
DOMString? BSSID;
EAPProperties? EAP;
long? Frequency;
long[]? FrequencyList;
DOMString? HexSSID;
boolean? HiddenSSID;
DOMString? Passphrase;
DOMString? SSID;
DOMString? Security;
long? SignalStrength;
};
dictionary ManagedWiFiProperties {
ManagedBoolean? AllowGatewayARPPolling;
ManagedBoolean? AutoConnect;
DOMString? BSSID;
ManagedEAPProperties? EAP;
long? Frequency;
long[]? FrequencyList;
ManagedDOMString? HexSSID;
ManagedBoolean? HiddenSSID;
ManagedDOMString? Passphrase;
ManagedDOMString? SSID;
ManagedDOMString Security;
long? SignalStrength;
};
dictionary WiFiStateProperties {
DOMString? BSSID;
EAPStateProperties? EAP;
long? Frequency;
DOMString? HexSSID;
DOMString Security;
long? SignalStrength;
DOMString? SSID;
};
dictionary NetworkConfigProperties {
CellularProperties? Cellular;
EthernetProperties? Ethernet;
DOMString? GUID;
IPConfigType? IPAddressConfigType;
DOMString? Name;
IPConfigType? NameServersConfigType;
long? Priority;
ProxySettings? ProxySettings;
IPConfigProperties? StaticIPConfig;
NetworkType? Type;
VPNProperties? VPN;
WiFiProperties? WiFi;
};
dictionary NetworkProperties {
CellularProperties? Cellular;
boolean? Connectable;
ConnectionStateType? ConnectionState;
DOMString? ErrorState;
EthernetProperties? Ethernet;
DOMString GUID;
IPConfigType? IPAddressConfigType;
IPConfigProperties[]? IPConfigs;
DOMString? MacAddress;
boolean? Metered;
DOMString? Name;
IPConfigType? NameServersConfigType;
long? Priority;
ProxySettings? ProxySettings;
boolean? RestrictedConnectivity;
IPConfigProperties? StaticIPConfig;
IPConfigProperties? SavedIPConfig;
// Indicates whether and how the network is configured.
// 'Source' can be Device, DevicePolicy, User, UserPolicy or None.
// 'None' conflicts with extension code generation so we must use a string
// for 'Source' instead of a SourceType enum.
DOMString? Source;
TetherProperties? Tether;
double? TrafficCounterResetTime;
NetworkType Type;
VPNProperties? VPN;
WiFiProperties? WiFi;
};
dictionary ManagedProperties {
ManagedCellularProperties? Cellular;
boolean? Connectable;
ConnectionStateType? ConnectionState;
DOMString? ErrorState;
ManagedEthernetProperties? Ethernet;
DOMString GUID;
ManagedIPConfigType? IPAddressConfigType;
IPConfigProperties[]? IPConfigs;
DOMString? MacAddress;
ManagedBoolean? Metered;
ManagedDOMString? Name;
ManagedIPConfigType? NameServersConfigType;
ManagedLong? Priority;
ManagedProxySettings? ProxySettings;
boolean? RestrictedConnectivity;
ManagedIPConfigProperties? StaticIPConfig;
IPConfigProperties? SavedIPConfig;
// See $(ref:NetworkProperties.Source).
DOMString? Source;
TetherProperties? Tether;
double? TrafficCounterResetTime;
NetworkType Type;
ManagedVPNProperties? VPN;
ManagedWiFiProperties? WiFi;
};
dictionary NetworkStateProperties {
CellularStateProperties? Cellular;
boolean? Connectable;
ConnectionStateType? ConnectionState;
EthernetStateProperties? Ethernet;
DOMString? ErrorState;
DOMString GUID;
DOMString? Name;
long? Priority;
// See $(ref:NetworkProperties.Source).
DOMString? Source;
TetherProperties? Tether;
NetworkType Type;
VPNStateProperties? VPN;
WiFiStateProperties? WiFi;
};
dictionary DeviceStateProperties {
// Set if the device is enabled. True if the device is currently scanning.
boolean? Scanning;
// The SIM lock status if Type = Cellular and SIMPresent = True.
SIMLockStatus? SIMLockStatus;
// Set to the SIM present state if the device type is Cellular.
boolean? SIMPresent;
// The current state of the device.
DeviceStateType State;
// The network type associated with the device (Cellular, Ethernet or WiFi).
NetworkType Type;
// Whether or not any managed networks are available/visible.
boolean? ManagedNetworkAvailable;
};
dictionary NetworkFilter {
// The type of networks to return.
NetworkType networkType;
// If true, only include visible (physically connected or in-range)
// networks. Defaults to 'false'.
boolean? visible;
// If true, only include configured (saved) networks. Defaults to 'false'.
boolean? configured;
// Maximum number of networks to return. Defaults to 1000 if unspecified.
// Use 0 for no limit.
long? limit;
};
dictionary GlobalPolicy {
// If true, only policy networks may auto connect. Defaults to false.
boolean? AllowOnlyPolicyNetworksToAutoconnect;
// If true, only policy networks may be connected to and no new networks may
// be added or configured. Defaults to false.
boolean? AllowOnlyPolicyNetworksToConnect;
// If true and a managed network is available in the visible network list,
// only policy networks may be connected to and no new networks may be added
// or configured. Defaults to false.
boolean? AllowOnlyPolicyNetworksToConnectIfAvailable;
// List of blocked networks. Connections to blocked networks are
// prohibited. Networks can be allowed again by specifying an explicit
// network configuration. Defaults to an empty list.
DOMString[]? BlockedHexSSIDs;
};
dictionary Certificate {
// Unique hash for the certificate.
DOMString hash;
// Certificate issuer common name.
DOMString issuedBy;
// Certificate name or nickname.
DOMString issuedTo;
// PEM for server CA certificates.
DOMString? pem;
// PKCS#11 id for user certificates.
DOMString? PKCS11Id;
// Whether or not the certificate is hardware backed.
boolean hardwareBacked;
// Whether or not the certificate is device wide.
boolean deviceWide;
};
dictionary CertificateLists {
// List of avaliable server CA certificates.
Certificate[] serverCaCertificates;
// List of available user certificates.
Certificate[] userCertificates;
};
callback VoidCallback = void();
callback BooleanCallback = void(boolean result);
callback StringCallback = void(DOMString result);
// TODO(stevenjb): Use NetworkProperties for |result| once defined.
callback GetPropertiesCallback = void(NetworkProperties result);
// TODO(stevenjb): Use ManagedNetworkProperties for |result| once defined.
callback GetManagedPropertiesCallback = void(ManagedProperties result);
callback GetStatePropertiesCallback = void(NetworkStateProperties result);
callback GetNetworksCallback = void(NetworkStateProperties[] result);
callback GetDeviceStatesCallback = void(DeviceStateProperties[] result);
callback GetEnabledNetworkTypesCallback = void(NetworkType[] result);
callback CaptivePortalStatusCallback = void(CaptivePortalStatus result);
callback GetGlobalPolicyCallback = void(GlobalPolicy result);
callback GetCertificateListsCallback = void(CertificateLists result);
// These functions all report failures either via $(ref:runtime.lastError)
// when using callbacks or passed to the rejection handler when using
// promises.
interface Functions {
// Gets all the properties of the network with id networkGuid. Includes all
// properties of the network (read-only and read/write values).
// |networkGuid|: The GUID of the network to get properties for.
// |callback|: Called with the network properties when received.
static void getProperties(
DOMString networkGuid,
GetPropertiesCallback callback);
// Gets the merged properties of the network with id networkGuid from the
// sources: User settings, shared settings, user policy, device policy and
// the currently active settings.
// |networkGuid|: The GUID of the network to get properties for.
// |callback|: Called with the managed network properties when received.
static void getManagedProperties(
DOMString networkGuid,
GetManagedPropertiesCallback callback);
// Gets the cached read-only properties of the network with id networkGuid.
// This is meant to be a higher performance function than
// $(ref:getProperties), which requires a round trip to query the networking
// subsystem. The following properties are returned for all networks: GUID,
// Type, Name, WiFi.Security. Additional properties are provided for visible
// networks: ConnectionState, ErrorState, WiFi.SignalStrength,
// Cellular.NetworkTechnology, Cellular.ActivationState,
// Cellular.RoamingState.
// |networkGuid|: The GUID of the network to get properties for.
// |callback|: Called immediately with the network state properties.
static void getState(
DOMString networkGuid,
GetStatePropertiesCallback callback);
// Sets the properties of the network with id |networkGuid|. This is only
// valid for configured networks (Source != None). Unconfigured visible
// networks should use createNetwork instead.
// |networkGuid|: The GUID of the network to set properties for.
// |properties|: The properties to set.
// |callback|: Called when the operation has completed.
static void setProperties(
DOMString networkGuid,
NetworkConfigProperties properties,
optional VoidCallback callback);
// Creates a new network configuration from properties. If a matching
// configured network already exists, this will fail. Otherwise returns the
// guid of the new network.
// |shared|: If true, share this network configuration with other users.
// |properties|: The properties to configure the new network with.
// |callback|: Called with the GUID for the new network configuration once
// the network has been created.
static void createNetwork(
boolean shared,
NetworkConfigProperties properties,
optional StringCallback callback);
// Forgets a network configuration by clearing any configured properties for
// the network with GUID 'networkGuid'. This may also include any other
// networks with matching identifiers (e.g. WiFi SSID and Security). If no
// such configuration exists, an error will be set and the operation will
// fail.
// |networkGuid|: The GUID of the network to forget.
// |callback|: Called when the operation has completed.
static void forgetNetwork(
DOMString networkGuid,
optional VoidCallback callback);
// Returns a list of network objects with the same properties provided by
// $(ref:networkingPrivate.getState). A filter is provided to specify the
// type of networks returned and to limit the number of networks. Networks
// are ordered by the system based on their priority, with connected or
// connecting networks listed first.
// |filter|: Describes which networks to return.
// |callback|: Called with a dictionary of networks and their state
// properties when received.
static void getNetworks(
NetworkFilter filter,
GetNetworksCallback callback);
// Deprecated. Please use $(ref:networkingPrivate.getNetworks) with
// filter.visible = true instead.
[deprecated="Use getNetworks."] static void getVisibleNetworks(
NetworkType networkType,
GetNetworksCallback callback);
// Deprecated. Please use $(ref:networkingPrivate.getDeviceStates) instead.
[deprecated="Use getDeviceStates."] static void getEnabledNetworkTypes(
GetEnabledNetworkTypesCallback callback);
// Returns a list of $(ref:networkingPrivate.DeviceStateProperties) objects.
// |callback|: Called with a list of devices and their state.
static void getDeviceStates(
GetDeviceStatesCallback callback);
// Enables any devices matching the specified network type. Note, the type
// might represent multiple network types (e.g. 'Wireless').
// |networkType|: The type of network to enable.
static void enableNetworkType(NetworkType networkType);
// Disables any devices matching the specified network type. See note for
// $(ref:networkingPrivate.enableNetworkType).
// |networkType|: The type of network to disable.
static void disableNetworkType(NetworkType networkType);
// Requests that the networking subsystem scan for new networks and
// update the list returned by $(ref:getVisibleNetworks). This is only a
// request: the network subsystem can choose to ignore it. If the list
// is updated, then the $(ref:onNetworkListChanged) event will be fired.
// |networkType|: If provided, requests a scan specific to the type.
// For Cellular a mobile network scan will be requested if supported.
static void requestNetworkScan(optional NetworkType networkType);
// Starts a connection to the network with networkGuid.
// |networkGuid|: The GUID of the network to connect to.
// |callback|: Called when the connect request has been sent. Note: the
// connection may not have completed. Observe $(ref:onNetworksChanged)
// to be notified when a network state changes. If the connect request
// immediately failed (e.g. the network is unconfigured),
// $(ref:runtime.lastError) will be set with a failure reason.
static void startConnect(
DOMString networkGuid,
optional VoidCallback callback);
// Starts a disconnect from the network with networkGuid.
// |networkGuid|: The GUID of the network to disconnect from.
// |callback|: Called when the disconnect request has been sent. See note
// for $(ref:startConnect).
static void startDisconnect(
DOMString networkGuid,
optional VoidCallback callback);
// Starts activation of the Cellular network with networkGuid. If called
// for a network that is already activated, or for a network with a carrier
// that can not be directly activated, this will show the account details
// page for the carrier if possible.
// |networkGuid|: The GUID of the Cellular network to activate.
// |carrier|: Optional name of carrier to activate.
// |callback|: Called when the activation request has been sent. See note
// for $(ref:startConnect).
static void startActivate(
DOMString networkGuid,
optional DOMString carrier,
optional VoidCallback callback);
// Returns captive portal status for the network matching 'networkGuid'.
// |networkGuid|: The GUID of the network to get captive portal status for.
// |callback|: A callback function that returns the results of the query for
// network captive portal status.
static void getCaptivePortalStatus(
DOMString networkGuid,
CaptivePortalStatusCallback callback);
// Unlocks a Cellular SIM card.
// * If the SIM is PIN locked, |pin| will be used to unlock the SIM and
// the |puk| argument will be ignored if provided.
// * If the SIM is PUK locked, |puk| and |pin| must be provided. If the
// operation succeeds (|puk| is valid), the PIN will be set to |pin|.
// (If |pin| is empty or invalid the operation will fail).
// |networkGuid|: The GUID of the cellular network to unlock.
// If empty, the default cellular device will be used.
// |pin|: The current SIM PIN, or the new PIN if PUK is provided.
// |puk|: The operator provided PUK for unblocking a blocked SIM.
// |callback|: Called when the operation has completed.
static void unlockCellularSim(
DOMString networkGuid,
DOMString pin,
optional DOMString puk,
optional VoidCallback callback);
// Sets whether or not SIM locking is enabled (i.e a PIN will be required
// when the device is powered) and changes the PIN if a new PIN is
// specified. If the new PIN is provided but not valid (e.g. too short)
// the operation will fail. This will not lock the SIM; that is handled
// automatically by the device. NOTE: If the SIM is locked, it must first be
// unlocked with unlockCellularSim() before this can be called (otherwise it
// will fail and $(ref:runtime.lastError) will be set to Error.SimLocked).
// |networkGuid|: The GUID of the cellular network to set the SIM state of.
// If empty, the default cellular device will be used.
// |simState|: The SIM state to set.
// |callback|: Called when the operation has completed.
static void setCellularSimState(
DOMString networkGuid,
CellularSimState simState,
optional VoidCallback callback);
// Selects which Cellular Mobile Network to use. |networkId| must be the
// NetworkId property of a member of Cellular.FoundNetworks from the
// network properties for the specified Cellular network.
// |networkGuid|: The GUID of the cellular network to select the network
// for. If empty, the default cellular device will be used.
// |networkId|: The networkId to select.
// |callback|: Called when the operation has completed.
static void selectCellularMobileNetwork(
DOMString networkGuid,
DOMString networkId,
optional VoidCallback callback);
// Gets the global policy properties. These properties are not expected to
// change during a session.
static void getGlobalPolicy(
GetGlobalPolicyCallback callback);
// Gets the lists of certificates available for network configuration.
static void getCertificateLists(
GetCertificateListsCallback callback);
};
interface Events {
// Fired when the properties change on any of the networks. Sends a list of
// GUIDs for networks whose properties have changed.
static void onNetworksChanged(DOMString[] changes);
// Fired when the list of networks has changed. Sends a complete list of
// GUIDs for all the current networks.
static void onNetworkListChanged(DOMString[] changes);
// Fired when the list of devices has changed or any device state properties
// have changed.
static void onDeviceStateListChanged();
// Fired when a portal detection for a network completes. Sends the guid of
// the network and the corresponding captive portal status.
static void onPortalDetectionCompleted(DOMString networkGuid,
CaptivePortalStatus status);
// Fired when any certificate list has changed.
static void onCertificateListsChanged();
};
};
|