Bug 978709 - 1/6: remove nsINetworkInterface::broadcast. r=hsinyi

This commit is contained in:
Vicamo Yang 2014-03-29 15:18:09 +08:00
Родитель 3be965812e
Коммит d5eb9240f6
9 изменённых файлов: 2 добавлений и 32 удалений

Просмотреть файл

@ -363,7 +363,6 @@ NetworkManager.prototype = {
name: i.name,
ip: i.ip,
prefixLength: i.prefixLength,
broadcast: i.broadcast,
gateway: i.gateway,
dns1: i.dns1,
dns2: i.dns2,

Просмотреть файл

@ -2147,13 +2147,9 @@ RadioInterface.prototype = {
case "datacallstatechange":
message.ip = null;
message.prefixLength = 0;
message.broadcast = null;
if (message.ipaddr) {
message.ip = message.ipaddr.split("/")[0];
message.prefixLength = parseInt(message.ipaddr.split("/")[1], 10);
let ip_value = netHelpers.stringToIP(message.ip);
let mask_value = netHelpers.makeMask(message.prefixLength);
message.broadcast = netHelpers.ipToString((ip_value & mask_value) + ~mask_value);
}
connHandler.handleDataCallState(message);
break;
@ -4432,8 +4428,6 @@ RILNetworkInterface.prototype = {
prefixLength: 0,
broadcast: null,
dns1: null,
dns2: null,
@ -4552,7 +4546,6 @@ RILNetworkInterface.prototype = {
this.name = datacall.ifname;
this.ip = datacall.ip;
this.prefixLength = datacall.prefixLength;
this.broadcast = datacall.broadcast;
this.gateway = datacall.gw;
if (datacall.dns) {
this.dns1 = datacall.dns[0];

Просмотреть файл

@ -9,7 +9,7 @@ interface nsIWifiTetheringCallback;
/**
* Information about networks that is exposed to network manager API consumers.
*/
[scriptable, uuid(0e5e8fca-0f46-416c-8bee-b3fea4bbdfd3)]
[scriptable, uuid(23eb5e3d-ed15-41e0-93c9-b9b3c022b1ac)]
interface nsINetworkInterface : nsISupports
{
const long NETWORK_STATE_UNKNOWN = -1;
@ -55,11 +55,6 @@ interface nsINetworkInterface : nsISupports
*/
readonly attribute unsigned long prefixLength;
/**
* Broadcast
*/
readonly attribute DOMString broadcast;
/**
* Default gateway
*/

Просмотреть файл

@ -21,7 +21,7 @@ interface nsIRilNetworkInterface : nsINetworkInterface
readonly attribute long mmsPort; // -1 if not set.
};
[scriptable, uuid(83dd3394-5de0-4485-a0b9-c1ed537507a3)]
[scriptable, uuid(44322269-ac2a-4641-aaf9-b5ccee0d429e)]
interface nsIRILDataCallInfo : nsISupports
{
/**
@ -34,7 +34,6 @@ interface nsIRILDataCallInfo : nsISupports
readonly attribute AString ifname;
readonly attribute AString ip;
readonly attribute unsigned long prefixLength;
readonly attribute AString broadcast;
readonly attribute AString gw;
readonly attribute jsval dns;
};

Просмотреть файл

@ -43,7 +43,6 @@ dictionary WifiResultOptions
DOMString ipaddr_str = ""; // The following are for the result of
// dhcp_do_request.
DOMString gateway_str = "";
DOMString broadcast_str = "";
DOMString dns1_str = "";
DOMString dns2_str = "";
DOMString mask_str = "";

Просмотреть файл

@ -93,7 +93,6 @@ const DEFAULT_P2P_DEVICE_TYPE = "10-0050F204-5"; // For wpa_supplicant.
const GO_NETWORK_INTERFACE = {
ip: "192.168.2.1",
maskLength: 24,
broadcast: "192.168.2.255",
gateway: "192.168.2.1",
dns1: "0.0.0.0",
dns2: "0.0.0.0",
@ -494,7 +493,6 @@ function P2pStateMachine(aP2pCommand, aNetUtil) {
name: P2P_INTERFACE_NAME,
ip: null,
prefixLength: 0,
broadcast: null,
dns1: null,
dns2: null,
gateway: null,
@ -1412,7 +1410,6 @@ function P2pStateMachine(aP2pCommand, aNetUtil) {
_p2pNetworkInterface.state = Ci.nsINetworkInterface.NETWORK_STATE_CONNECTED;
_p2pNetworkInterface.ip = dhcpData.info.ipaddr_str;
_p2pNetworkInterface.prefixLength = maskLength;
_p2pNetworkInterface.broadcast = dhcpData.info.broadcast_str;
_p2pNetworkInterface.dns1 = dhcpData.info.dns1_str;
_p2pNetworkInterface.dns2 = dhcpData.info.dns2_str;
_p2pNetworkInterface.gateway = dhcpData.info.gateway_str;
@ -1429,7 +1426,6 @@ function P2pStateMachine(aP2pCommand, aNetUtil) {
_p2pNetworkInterface.state = Ci.nsINetworkInterface.NETWORK_STATE_DISCONNECTED;
_p2pNetworkInterface.ip = null;
_p2pNetworkInterface.prefixLength = 0;
_p2pNetworkInterface.broadcast = null;
_p2pNetworkInterface.dns1 = null;
_p2pNetworkInterface.dns2 = null;
_p2pNetworkInterface.gateway = null;

Просмотреть файл

@ -94,7 +94,6 @@ public:
COPY_FIELD(mValue)
COPY_FIELD(mIpaddr_str)
COPY_FIELD(mGateway_str)
COPY_FIELD(mBroadcast_str)
COPY_FIELD(mDns1_str)
COPY_FIELD(mDns2_str)
COPY_FIELD(mMask_str)

Просмотреть файл

@ -411,11 +411,6 @@ bool WpaSupplicant::ExecuteCommand(CommandOptions aOptions,
if (inet_ntop(AF_INET, &aResult.mMask, inet_str, sizeof(inet_str))) {
aResult.mMask_str = NS_ConvertUTF8toUTF16(inet_str);
}
uint32_t broadcast = (aResult.mIpaddr & aResult.mMask) + ~aResult.mMask;
if (inet_ntop(AF_INET, &broadcast, inet_str, sizeof(inet_str))) {
aResult.mBroadcast_str = NS_ConvertUTF8toUTF16(inet_str);
}
} else {
NS_WARNING("WpaSupplicant::ExecuteCommand : Unknown command");
printf_stderr("WpaSupplicant::ExecuteCommand : Unknown command: %s",

Просмотреть файл

@ -896,7 +896,6 @@ var WifiManager = (function() {
WifiNetworkInterface.state = Ci.nsINetworkInterface.NETWORK_STATE_DISCONNECTED;
WifiNetworkInterface.ip = null;
WifiNetworkInterface.netmask = null;
WifiNetworkInterface.broadcast = null;
WifiNetworkInterface.gateway = null;
WifiNetworkInterface.dns1 = null;
WifiNetworkInterface.dns2 = null;
@ -1523,8 +1522,6 @@ let WifiNetworkInterface = {
prefixLength: 0,
broadcast: null,
dns1: null,
dns2: null,
@ -1933,7 +1930,6 @@ function WifiWorker() {
Ci.nsINetworkInterface.NETWORK_STATE_DISCONNECTED;
WifiNetworkInterface.ip = null;
WifiNetworkInterface.prefixLength = 0;
WifiNetworkInterface.broadcast = null;
WifiNetworkInterface.gateway = null;
WifiNetworkInterface.dns1 = null;
WifiNetworkInterface.dns2 = null;
@ -1972,7 +1968,6 @@ function WifiWorker() {
Ci.nsINetworkInterface.NETWORK_STATE_CONNECTED;
WifiNetworkInterface.ip = this.info.ipaddr_str;
WifiNetworkInterface.prefixLength = maskLength;
WifiNetworkInterface.broadcast = this.info.broadcast_str;
WifiNetworkInterface.gateway = this.info.gateway_str;
WifiNetworkInterface.dns1 = this.info.dns1_str;
WifiNetworkInterface.dns2 = this.info.dns2_str;