link start!

This commit is contained in:
cherubin
2026-03-17 13:31:18 -07:00
commit 08abe87cfb
5910 changed files with 386288 additions and 0 deletions
@@ -0,0 +1,97 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.sys.BComponent
* javax.baja.sys.Property
* javax.baja.sys.Sys
* javax.baja.sys.Type
*/
package com.tridium.platform.tcpip;
import javax.baja.sys.BComponent;
import javax.baja.sys.Property;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class BPingArgs
extends BComponent {
public static final Property destHost = BPingArgs.newProperty((int)0, (String)"", null);
public static final Property timeout = BPingArgs.newProperty((int)0, (int)5, null);
public static final Type TYPE;
boolean isIpv6;
static /* synthetic */ Class class$com$tridium$platform$tcpip$BPingArgs;
public String getDestHost() {
return this.getString(destHost);
}
public void setDestHost(String string) {
this.setString(destHost, string, null);
}
public int getTimeout() {
return this.getInt(timeout);
}
public void setTimeout(int n) {
this.setInt(timeout, n, null);
}
public Type getType() {
return TYPE;
}
static /* synthetic */ Class class(String string, boolean bl) {
try {
Class<?> clazz = Class.forName(string);
if (!bl) {
clazz = clazz.getComponentType();
}
return clazz;
}
catch (ClassNotFoundException classNotFoundException) {
throw new NoClassDefFoundError(classNotFoundException.getMessage());
}
}
private final /* synthetic */ void this() {
this.isIpv6 = false;
}
public BPingArgs() {
this(false);
}
public BPingArgs(boolean bl) {
this.this();
if (bl) {
this.setDestHost("::1");
} else {
this.setDestHost("127.0.0.1");
}
}
public BPingArgs(String string) {
this.this();
this.setDestHost(string);
}
public BPingArgs(String string, int n) {
this.this();
this.setDestHost(string);
this.setTimeout(n);
}
static {
Class clazz = class$com$tridium$platform$tcpip$BPingArgs;
if (clazz == null) {
clazz = class$com$tridium$platform$tcpip$BPingArgs = BPingArgs.class("[Lcom.tridium.platform.tcpip.BPingArgs;", false);
}
TYPE = Sys.loadType((Class)clazz);
}
}
@@ -0,0 +1,362 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.sys.BComponent
* javax.baja.sys.BComponentEvent
* javax.baja.sys.BIcon
* javax.baja.sys.BValue
* javax.baja.sys.BVector
* javax.baja.sys.Property
* javax.baja.sys.Subscriber
* javax.baja.sys.Sys
* javax.baja.sys.Type
*/
package com.tridium.platform.tcpip;
import com.tridium.platform.tcpip.BTcpIpHostSettings;
import javax.baja.sys.BComponent;
import javax.baja.sys.BComponentEvent;
import javax.baja.sys.BIcon;
import javax.baja.sys.BValue;
import javax.baja.sys.BVector;
import javax.baja.sys.Property;
import javax.baja.sys.Subscriber;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class BTcpIpAdapterSettings
extends BComponent {
public static final Property adapterId = BTcpIpAdapterSettings.newProperty((int)3, (String)"", null);
public static final Property isAdapterEnabled = BTcpIpAdapterSettings.newProperty((int)3, (boolean)true, null);
public static final Property canDisableAdapter = BTcpIpAdapterSettings.newProperty((int)3, (boolean)false, null);
public static final Property description = BTcpIpAdapterSettings.newProperty((int)3, (String)"", null);
public static final Property mediaAccessControlAddress = BTcpIpAdapterSettings.newProperty((int)3, (String)"", null);
public static final Property isDhcpEnabled = BTcpIpAdapterSettings.newProperty((int)3, (boolean)true, null);
public static final Property canUseDhcp = BTcpIpAdapterSettings.newProperty((int)3, (boolean)true, null);
public static final Property defaultGateway = BTcpIpAdapterSettings.newProperty((int)3, (String)"", null);
public static final Property dnsHosts = BTcpIpAdapterSettings.newProperty((int)3, (BValue)new BVector(), null);
public static final Property maxDnsHosts = BTcpIpAdapterSettings.newProperty((int)6, (int)2, null);
public static final Property domain = BTcpIpAdapterSettings.newProperty((int)3, (String)"", null);
public static final Property ipAddress = BTcpIpAdapterSettings.newProperty((int)3, (String)"", null);
public static final Property subnetMask = BTcpIpAdapterSettings.newProperty((int)3, (String)"", null);
public static final Property dhcpHost = BTcpIpAdapterSettings.newProperty((int)3, (String)"n/a", null);
public static final Property dhcpLeaseGranted = BTcpIpAdapterSettings.newProperty((int)3, (String)"n/a", null);
public static final Property dhcpLeaseExpires = BTcpIpAdapterSettings.newProperty((int)3, (String)"n/a", null);
public static final Property isIpv6DhcpEnabled = BTcpIpAdapterSettings.newProperty((int)3, (boolean)true, null);
public static final Property canUseIpv6Dhcp = BTcpIpAdapterSettings.newProperty((int)3, (boolean)true, null);
public static final Property isIpv6Supported = BTcpIpAdapterSettings.newProperty((int)3, (boolean)false, null);
public static final Property isIpv6Enabled = BTcpIpAdapterSettings.newProperty((int)3, (boolean)false, null);
public static final Property canDisableIpv6 = BTcpIpAdapterSettings.newProperty((int)3, (boolean)false, null);
public static final Property ipv6Address = BTcpIpAdapterSettings.newProperty((int)3, (String)"", null);
public static final Property ipv6SubnetPrefixLength = BTcpIpAdapterSettings.newProperty((int)3, (int)0, null);
public static final Property ipv6DefaultGateway = BTcpIpAdapterSettings.newProperty((int)3, (String)"", null);
public static final Property ipv6DefaultDevice = BTcpIpAdapterSettings.newProperty((int)3, (String)"", null);
public static final Property ipv6DnsHosts = BTcpIpAdapterSettings.newProperty((int)3, (BValue)new BVector(), null);
public static final Property ipv6DhcpHost = BTcpIpAdapterSettings.newProperty((int)3, (String)"n/a", null);
public static final Property ipv6DhcpLeaseGranted = BTcpIpAdapterSettings.newProperty((int)3, (String)"n/a", null);
public static final Property ipv6DhcpLeaseExpires = BTcpIpAdapterSettings.newProperty((int)3, (String)"n/a", null);
public static final Type TYPE;
private static final BIcon icon;
private Subscriber subscriber;
static /* synthetic */ Class class$com$tridium$platform$tcpip$BTcpIpAdapterSettings;
public String getAdapterId() {
return this.getString(adapterId);
}
public void setAdapterId(String string) {
this.setString(adapterId, string, null);
}
public boolean getIsAdapterEnabled() {
return this.getBoolean(isAdapterEnabled);
}
public void setIsAdapterEnabled(boolean bl) {
this.setBoolean(isAdapterEnabled, bl, null);
}
public boolean getCanDisableAdapter() {
return this.getBoolean(canDisableAdapter);
}
public void setCanDisableAdapter(boolean bl) {
this.setBoolean(canDisableAdapter, bl, null);
}
public String getDescription() {
return this.getString(description);
}
public void setDescription(String string) {
this.setString(description, string, null);
}
public String getMediaAccessControlAddress() {
return this.getString(mediaAccessControlAddress);
}
public void setMediaAccessControlAddress(String string) {
this.setString(mediaAccessControlAddress, string, null);
}
public boolean getIsDhcpEnabled() {
return this.getBoolean(isDhcpEnabled);
}
public void setIsDhcpEnabled(boolean bl) {
this.setBoolean(isDhcpEnabled, bl, null);
}
public boolean getCanUseDhcp() {
return this.getBoolean(canUseDhcp);
}
public void setCanUseDhcp(boolean bl) {
this.setBoolean(canUseDhcp, bl, null);
}
public String getDefaultGateway() {
return this.getString(defaultGateway);
}
public void setDefaultGateway(String string) {
this.setString(defaultGateway, string, null);
}
public BVector getDnsHosts() {
return (BVector)this.get(dnsHosts);
}
public void setDnsHosts(BVector bVector) {
this.set(dnsHosts, (BValue)bVector, null);
}
public int getMaxDnsHosts() {
return this.getInt(maxDnsHosts);
}
public void setMaxDnsHosts(int n) {
this.setInt(maxDnsHosts, n, null);
}
public String getDomain() {
return this.getString(domain);
}
public void setDomain(String string) {
this.setString(domain, string, null);
}
public String getIpAddress() {
return this.getString(ipAddress);
}
public void setIpAddress(String string) {
this.setString(ipAddress, string, null);
}
public String getSubnetMask() {
return this.getString(subnetMask);
}
public void setSubnetMask(String string) {
this.setString(subnetMask, string, null);
}
public String getDhcpHost() {
return this.getString(dhcpHost);
}
public void setDhcpHost(String string) {
this.setString(dhcpHost, string, null);
}
public String getDhcpLeaseGranted() {
return this.getString(dhcpLeaseGranted);
}
public void setDhcpLeaseGranted(String string) {
this.setString(dhcpLeaseGranted, string, null);
}
public String getDhcpLeaseExpires() {
return this.getString(dhcpLeaseExpires);
}
public void setDhcpLeaseExpires(String string) {
this.setString(dhcpLeaseExpires, string, null);
}
public boolean getIsIpv6DhcpEnabled() {
return this.getBoolean(isIpv6DhcpEnabled);
}
public void setIsIpv6DhcpEnabled(boolean bl) {
this.setBoolean(isIpv6DhcpEnabled, bl, null);
}
public boolean getCanUseIpv6Dhcp() {
return this.getBoolean(canUseIpv6Dhcp);
}
public void setCanUseIpv6Dhcp(boolean bl) {
this.setBoolean(canUseIpv6Dhcp, bl, null);
}
public boolean getIsIpv6Supported() {
return this.getBoolean(isIpv6Supported);
}
public void setIsIpv6Supported(boolean bl) {
this.setBoolean(isIpv6Supported, bl, null);
}
public boolean getIsIpv6Enabled() {
return this.getBoolean(isIpv6Enabled);
}
public void setIsIpv6Enabled(boolean bl) {
this.setBoolean(isIpv6Enabled, bl, null);
}
public boolean getCanDisableIpv6() {
return this.getBoolean(canDisableIpv6);
}
public void setCanDisableIpv6(boolean bl) {
this.setBoolean(canDisableIpv6, bl, null);
}
public String getIpv6Address() {
return this.getString(ipv6Address);
}
public void setIpv6Address(String string) {
this.setString(ipv6Address, string, null);
}
public int getIpv6SubnetPrefixLength() {
return this.getInt(ipv6SubnetPrefixLength);
}
public void setIpv6SubnetPrefixLength(int n) {
this.setInt(ipv6SubnetPrefixLength, n, null);
}
public String getIpv6DefaultGateway() {
return this.getString(ipv6DefaultGateway);
}
public void setIpv6DefaultGateway(String string) {
this.setString(ipv6DefaultGateway, string, null);
}
public String getIpv6DefaultDevice() {
return this.getString(ipv6DefaultDevice);
}
public void setIpv6DefaultDevice(String string) {
this.setString(ipv6DefaultDevice, string, null);
}
public BVector getIpv6DnsHosts() {
return (BVector)this.get(ipv6DnsHosts);
}
public void setIpv6DnsHosts(BVector bVector) {
this.set(ipv6DnsHosts, (BValue)bVector, null);
}
public String getIpv6DhcpHost() {
return this.getString(ipv6DhcpHost);
}
public void setIpv6DhcpHost(String string) {
this.setString(ipv6DhcpHost, string, null);
}
public String getIpv6DhcpLeaseGranted() {
return this.getString(ipv6DhcpLeaseGranted);
}
public void setIpv6DhcpLeaseGranted(String string) {
this.setString(ipv6DhcpLeaseGranted, string, null);
}
public String getIpv6DhcpLeaseExpires() {
return this.getString(ipv6DhcpLeaseExpires);
}
public void setIpv6DhcpLeaseExpires(String string) {
this.setString(ipv6DhcpLeaseExpires, string, null);
}
public Type getType() {
return TYPE;
}
public BTcpIpHostSettings getHostSettings() {
return (BTcpIpHostSettings)this.getParent().getParent();
}
public boolean getUsesAdapterLevelSettings() {
return this.getHostSettings().getUsesAdapterLevelSettings();
}
public void subscribed() {
this.subscriber.subscribe((BComponent)this.getHostSettings());
}
public void unsubscribed() {
this.subscriber.unsubscribe((BComponent)this.getHostSettings());
}
public BIcon getIcon() {
return icon;
}
static /* synthetic */ Class class(String string, boolean bl) {
try {
Class<?> clazz = Class.forName(string);
if (!bl) {
clazz = clazz.getComponentType();
}
return clazz;
}
catch (ClassNotFoundException classNotFoundException) {
throw new NoClassDefFoundError(classNotFoundException.getMessage());
}
}
private final /* synthetic */ void this() {
this.subscriber = new Subscriber(){
public final void event(BComponentEvent bComponentEvent) {
}
};
}
public BTcpIpAdapterSettings() {
this.this();
}
public BTcpIpAdapterSettings(String string) {
this.this();
this.setAdapterId(string);
}
static {
Class clazz = class$com$tridium$platform$tcpip$BTcpIpAdapterSettings;
if (clazz == null) {
clazz = class$com$tridium$platform$tcpip$BTcpIpAdapterSettings = BTcpIpAdapterSettings.class("[Lcom.tridium.platform.tcpip.BTcpIpAdapterSettings;", false);
}
TYPE = Sys.loadType((Class)clazz);
icon = BIcon.std((String)"deviceNetwork.png");
}
}
@@ -0,0 +1,238 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.data.BIDataValue
* javax.baja.sys.BBoolean
* javax.baja.sys.BComplex
* javax.baja.sys.BComponent
* javax.baja.sys.BComponentEvent
* javax.baja.sys.BFacets
* javax.baja.sys.BValue
* javax.baja.sys.BVector
* javax.baja.sys.Property
* javax.baja.sys.Subscriber
* javax.baja.sys.Sys
* javax.baja.sys.Type
*/
package com.tridium.platform.tcpip;
import com.tridium.platform.BPlatformService;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import javax.baja.data.BIDataValue;
import javax.baja.sys.BBoolean;
import javax.baja.sys.BComplex;
import javax.baja.sys.BComponent;
import javax.baja.sys.BComponentEvent;
import javax.baja.sys.BFacets;
import javax.baja.sys.BValue;
import javax.baja.sys.BVector;
import javax.baja.sys.Property;
import javax.baja.sys.Subscriber;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class BTcpIpHostSettings
extends BComponent {
public static final Property hostName = BTcpIpHostSettings.newProperty((int)3, (String)"", null);
public static final Property adapters = BTcpIpHostSettings.newProperty((int)3, (BValue)new BVector(), null);
public static final Property niagaraUsesIpv6 = BTcpIpHostSettings.newProperty((int)3, (boolean)false, null);
public static final Property hostFileContents = BTcpIpHostSettings.newProperty((int)3, (String)"", (BFacets)BFacets.make((String)"multiLine", (BIDataValue)BBoolean.TRUE));
public static final Property usesAdapterLevelSettings = BTcpIpHostSettings.newProperty((int)3, (boolean)true, null);
public static final Property isIPv6Readonly = BTcpIpHostSettings.newProperty((int)3, (boolean)true, null);
public static final Property isReadonly = BTcpIpHostSettings.newProperty((int)3, (boolean)false, null);
public static final Property defaultGateway = BTcpIpHostSettings.newProperty((int)3, (String)"", null);
public static final Property dnsHosts = BTcpIpHostSettings.newProperty((int)3, (BValue)new BVector(), null);
public static final Property maxDnsHosts = BTcpIpHostSettings.newProperty((int)6, (int)2, null);
public static final Property domain = BTcpIpHostSettings.newProperty((int)3, (String)"", null);
public static final Property ipv6DefaultGateway = BTcpIpHostSettings.newProperty((int)3, (String)"", null);
public static final Property ipv6DefaultDevice = BTcpIpHostSettings.newProperty((int)3, (String)"", null);
public static final Property ipv6DnsHosts = BTcpIpHostSettings.newProperty((int)3, (BValue)new BVector(), null);
public static final Type TYPE;
private Subscriber subscriber;
static /* synthetic */ Class class$com$tridium$platform$tcpip$BTcpIpHostSettings;
public String getHostName() {
return this.getString(hostName);
}
public void setHostName(String string) {
this.setString(hostName, string, null);
}
public BVector getAdapters() {
return (BVector)this.get(adapters);
}
public void setAdapters(BVector bVector) {
this.set(adapters, (BValue)bVector, null);
}
public boolean getNiagaraUsesIpv6() {
return this.getBoolean(niagaraUsesIpv6);
}
public void setNiagaraUsesIpv6(boolean bl) {
this.setBoolean(niagaraUsesIpv6, bl, null);
}
public String getHostFileContents() {
return this.getString(hostFileContents);
}
public void setHostFileContents(String string) {
this.setString(hostFileContents, string, null);
}
public boolean getUsesAdapterLevelSettings() {
return this.getBoolean(usesAdapterLevelSettings);
}
public void setUsesAdapterLevelSettings(boolean bl) {
this.setBoolean(usesAdapterLevelSettings, bl, null);
}
public boolean getIsIPv6Readonly() {
return this.getBoolean(isIPv6Readonly);
}
public void setIsIPv6Readonly(boolean bl) {
this.setBoolean(isIPv6Readonly, bl, null);
}
public boolean getIsReadonly() {
return this.getBoolean(isReadonly);
}
public void setIsReadonly(boolean bl) {
this.setBoolean(isReadonly, bl, null);
}
public String getDefaultGateway() {
return this.getString(defaultGateway);
}
public void setDefaultGateway(String string) {
this.setString(defaultGateway, string, null);
}
public BVector getDnsHosts() {
return (BVector)this.get(dnsHosts);
}
public void setDnsHosts(BVector bVector) {
this.set(dnsHosts, (BValue)bVector, null);
}
public int getMaxDnsHosts() {
return this.getInt(maxDnsHosts);
}
public void setMaxDnsHosts(int n) {
this.setInt(maxDnsHosts, n, null);
}
public String getDomain() {
return this.getString(domain);
}
public void setDomain(String string) {
this.setString(domain, string, null);
}
public String getIpv6DefaultGateway() {
return this.getString(ipv6DefaultGateway);
}
public void setIpv6DefaultGateway(String string) {
this.setString(ipv6DefaultGateway, string, null);
}
public String getIpv6DefaultDevice() {
return this.getString(ipv6DefaultDevice);
}
public void setIpv6DefaultDevice(String string) {
this.setString(ipv6DefaultDevice, string, null);
}
public BVector getIpv6DnsHosts() {
return (BVector)this.get(ipv6DnsHosts);
}
public void setIpv6DnsHosts(BVector bVector) {
this.set(ipv6DnsHosts, (BValue)bVector, null);
}
public Type getType() {
return TYPE;
}
public void started() throws Exception {
this.setNiagaraUsesIpv6(Boolean.getBoolean("niagara.ipv6Enabled"));
}
public void loadHostFileContents(InputStream inputStream) throws IOException {
int n;
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
byte[] byArray = new byte[8192];
while ((n = inputStream.read(byArray, 0, 8192)) > 0) {
byteArrayOutputStream.write(byArray, 0, n);
}
this.setHostFileContents(byteArrayOutputStream.toString());
inputStream.close();
}
public void subscribed() {
BComplex bComplex = this.getParent();
if (bComplex != null && bComplex instanceof BPlatformService) {
this.subscriber.subscribe((BComponent)((BPlatformService)bComplex));
}
}
public void unsubscribed() {
BComplex bComplex = this.getParent();
if (bComplex != null && bComplex instanceof BPlatformService) {
this.subscriber.unsubscribe((BComponent)((BPlatformService)bComplex));
}
}
static /* synthetic */ Class class(String string, boolean bl) {
try {
Class<?> clazz = Class.forName(string);
if (!bl) {
clazz = clazz.getComponentType();
}
return clazz;
}
catch (ClassNotFoundException classNotFoundException) {
throw new NoClassDefFoundError(classNotFoundException.getMessage());
}
}
private final /* synthetic */ void this() {
this.subscriber = new Subscriber(){
public final void event(BComponentEvent bComponentEvent) {
}
};
}
public BTcpIpHostSettings() {
this.this();
}
static {
Class clazz = class$com$tridium$platform$tcpip$BTcpIpHostSettings;
if (clazz == null) {
clazz = class$com$tridium$platform$tcpip$BTcpIpHostSettings = BTcpIpHostSettings.class("[Lcom.tridium.platform.tcpip.BTcpIpHostSettings;", false);
}
TYPE = Sys.loadType((Class)clazz);
}
}
@@ -0,0 +1,272 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* com.tridium.sys.NreLib
* javax.baja.nre.util.ByteBuffer
* javax.baja.sys.Action
* javax.baja.sys.BIcon
* javax.baja.sys.BInteger
* javax.baja.sys.BValue
* javax.baja.sys.BajaRuntimeException
* javax.baja.sys.Context
* javax.baja.sys.Property
* javax.baja.sys.Sys
* javax.baja.sys.Type
* javax.baja.util.Lexicon
* javax.baja.xml.XElem
* javax.baja.xml.XParser
* javax.baja.xml.XWriter
*/
package com.tridium.platform.tcpip;
import com.tridium.platform.BOperatingSystemEnum;
import com.tridium.platform.BPlatformService;
import com.tridium.platform.BSystemPlatformService;
import com.tridium.platform.tcpip.BPingArgs;
import com.tridium.platform.tcpip.BTcpIpAdapterSettings;
import com.tridium.platform.tcpip.BTcpIpHostSettings;
import com.tridium.platform.tcpip.TcpUtil;
import com.tridium.sys.NreLib;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import javax.baja.nre.util.ByteBuffer;
import javax.baja.sys.Action;
import javax.baja.sys.BIcon;
import javax.baja.sys.BInteger;
import javax.baja.sys.BValue;
import javax.baja.sys.BajaRuntimeException;
import javax.baja.sys.Context;
import javax.baja.sys.Property;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
import javax.baja.util.Lexicon;
import javax.baja.xml.XElem;
import javax.baja.xml.XParser;
import javax.baja.xml.XWriter;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class BTcpIpPlatformService
extends BPlatformService {
public static final Property settings = BTcpIpPlatformService.newProperty((int)3, (BValue)new BTcpIpHostSettings(), null);
public static final Action ping = BTcpIpPlatformService.newAction((int)4, (BValue)new BPingArgs(), null);
public static final Action ping6 = BTcpIpPlatformService.newAction((int)4, (BValue)new BPingArgs(true), null);
public static final Type TYPE;
private static final BIcon icon;
static /* synthetic */ Class class$com$tridium$platform$tcpip$BTcpIpPlatformService;
static /* synthetic */ Class class$com$tridium$platform$tcpip$BTcpIpAdapterSettings;
public BTcpIpHostSettings getSettings() {
return (BTcpIpHostSettings)this.get(settings);
}
public void setSettings(BTcpIpHostSettings bTcpIpHostSettings) {
this.set(settings, (BValue)bTcpIpHostSettings, null);
}
public BInteger ping(BPingArgs bPingArgs) {
return (BInteger)this.invoke(ping, (BValue)bPingArgs, null);
}
public BInteger ping6(BPingArgs bPingArgs) {
return (BInteger)this.invoke(ping6, (BValue)bPingArgs, null);
}
public Type getType() {
return TYPE;
}
public boolean isValidPlatform() {
return true;
}
public int getSlotFlags() {
return 0;
}
/*
* Unable to fully structure code
*/
public void doSavePlatformServiceProperties() throws Exception {
block10: {
if (!this.isRunning()) {
return;
}
if (!this.loadSystemPlatformServiceLibrary() && this.getSettings().getIsReadonly()) {
return;
}
super.doSavePlatformServiceProperties();
var1_1 = false;
var2_2 = this.getSettings().getAdapters().getProperties();
if (true) ** GOTO lbl13
do {
if (((BTcpIpAdapterSettings)var2_2.get()).getIsIpv6Supported()) {
var1_1 = true;
break;
}
lbl13:
// 3 sources
if ((v0 = BTcpIpPlatformService.class$com$tridium$platform$tcpip$BTcpIpAdapterSettings) != null) continue;
v0 = BTcpIpPlatformService.class("[Lcom.tridium.platform.tcpip.BTcpIpAdapterSettings;", false);
} while (var2_2.next(v0));
if (var1_1 && System.getProperty("java.vm.vendor", "null").equalsIgnoreCase("IBM Corporation") && this.getSettings().getNiagaraUsesIpv6()) {
throw new BajaRuntimeException(Lexicon.make((String)"platform").getText("TcpIpHostSettings.cannotUseIPv6"));
}
NreLib.setSystemProperty((String)"niagara.ipv6Enabled", (String)String.valueOf(this.getSettings().getNiagaraUsesIpv6()));
if (this.getSettings().getHostName().length() > 15 && BOperatingSystemEnum.isOS(BOperatingSystemEnum.windows)) {
throw new BajaRuntimeException(Lexicon.make((String)"platform").getText("TcpIpHostSettings.invalidHostName"));
}
if (!BOperatingSystemEnum.isOS(BOperatingSystemEnum.qnx)) break block10;
var2_3 = 0;
var3_4 = this.getSettings().getAdapters().getProperties();
if (true) ** GOTO lbl29
do {
if ((var4_5 = (BTcpIpAdapterSettings)var3_4.get()).getIsDhcpEnabled()) {
++var2_3;
}
lbl29:
// 4 sources
if ((v1 = BTcpIpPlatformService.class$com$tridium$platform$tcpip$BTcpIpAdapterSettings) != null) continue;
v1 = BTcpIpPlatformService.class("[Lcom.tridium.platform.tcpip.BTcpIpAdapterSettings;", false);
} while (var3_4.next(v1));
if (var2_3 > 1) {
throw new BajaRuntimeException(Lexicon.make((String)"platform").getText("TcpIpHostSettings.multipleDhcpAdapters"));
}
}
var2_2 = TcpUtil.getHostSettingsXml(this.getSettings());
var3_4 = new ByteBuffer();
var4_5 = new XWriter(var3_4.getOutputStream());
var2_2.write((XWriter)var4_5);
var4_5.flush();
var4_5.close();
BTcpIpPlatformService.setHostSettingsXML0(new String(var3_4.toByteArray()));
if (!BOperatingSystemEnum.isOS(BOperatingSystemEnum.linux)) {
var5_6 = new BufferedOutputStream(new FileOutputStream(new File(BTcpIpPlatformService.getHostFileName0())));
var5_6.write(this.getSettings().getHostFileContents().getBytes());
var5_6.close();
}
BTcpIpPlatformService.saveSettings0();
}
public void loadPlatformServiceProperties() {
super.loadPlatformServiceProperties();
this.refreshProperties();
}
public void doPoll(Context context) {
if (!this.isRunning()) {
return;
}
super.doPoll(context);
this.refreshProperties();
}
private final boolean loadSystemPlatformServiceLibrary() {
BSystemPlatformService bSystemPlatformService;
BSystemPlatformService bSystemPlatformService2 = bSystemPlatformService = Sys.getStation() == null ? null : (BSystemPlatformService)Sys.getService((Type)BSystemPlatformService.TYPE);
return bSystemPlatformService != null && bSystemPlatformService.getPlatformLibrary() != null;
}
protected synchronized void refreshProperties() {
if (!this.loadSystemPlatformServiceLibrary()) {
return;
}
try {
XElem xElem = XParser.make((String)BTcpIpPlatformService.getHostSettingsXML0()).parse();
if (xElem.attrIndex("niagaraUsesIpv6") == -1) {
xElem.addAttr("niagaraUsesIpv6", System.getProperty("niagara.ipv6Enabled", "false"));
}
TcpUtil.updateFields(this.getSettings(), xElem);
}
catch (RuntimeException runtimeException) {
throw runtimeException;
}
catch (Exception exception) {
throw new BajaRuntimeException((Throwable)exception);
}
try {
this.getSettings().loadHostFileContents(new FileInputStream(new File(BTcpIpPlatformService.getHostFileName0())));
}
catch (FileNotFoundException fileNotFoundException) {
this.getSettings().setHostFileContents("");
}
catch (RuntimeException runtimeException) {
throw runtimeException;
}
catch (Exception exception) {
throw new BajaRuntimeException((Throwable)exception);
}
}
public BInteger doPing(BPingArgs bPingArgs) {
if (!this.loadSystemPlatformServiceLibrary()) {
return BInteger.make((int)-1);
}
return BInteger.make((int)BTcpIpPlatformService.ping0(bPingArgs.getDestHost(), bPingArgs.getTimeout()));
}
public BInteger doPing6(BPingArgs bPingArgs) {
if (!this.loadSystemPlatformServiceLibrary()) {
return BInteger.make((int)-1);
}
return BInteger.make((int)BTcpIpPlatformService.ping60(bPingArgs.getDestHost(), bPingArgs.getTimeout()));
}
public Type[] getServiceTypes() {
return new Type[]{TYPE};
}
public boolean hasNavChildren() {
return false;
}
public BIcon getIcon() {
return icon;
}
private static final synchronized native int ping0(String var0, int var1);
private static final synchronized native int ping60(String var0, int var1);
private static final native String getHostSettingsXML0();
private static final native int setHostSettingsXML0(String var0);
private static final native void saveSettings0();
private static final native String getHostFileName0();
static /* synthetic */ Class class(String string, boolean bl) {
try {
Class<?> clazz = Class.forName(string);
if (!bl) {
clazz = clazz.getComponentType();
}
return clazz;
}
catch (ClassNotFoundException classNotFoundException) {
throw new NoClassDefFoundError(classNotFoundException.getMessage());
}
}
public BTcpIpPlatformService() {
this.setPlatformServiceDescription(this.getLexicon().getText("TcpIpPlatformService.description"));
}
static {
Class clazz = class$com$tridium$platform$tcpip$BTcpIpPlatformService;
if (clazz == null) {
clazz = class$com$tridium$platform$tcpip$BTcpIpPlatformService = BTcpIpPlatformService.class("[Lcom.tridium.platform.tcpip.BTcpIpPlatformService;", false);
}
TYPE = Sys.loadType((Class)clazz);
icon = BIcon.std((String)"deviceNetwork.png");
}
}
@@ -0,0 +1,281 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.naming.SlotPath
* javax.baja.sys.BString
* javax.baja.sys.BValue
* javax.baja.sys.BVector
* javax.baja.sys.Sys
* javax.baja.sys.Type
*/
package com.tridium.platform.tcpip;
import com.tridium.platform.tcpip.BTcpIpAdapterSettings;
import com.tridium.platform.tcpip.BTcpIpHostSettings;
import com.tridium.platform.tcpip.BTcpIpPlatformService;
import javax.baja.naming.SlotPath;
import javax.baja.platform.tcpip.TcpIpManager;
import javax.baja.sys.BString;
import javax.baja.sys.BValue;
import javax.baja.sys.BVector;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class PlatformTcpIpManager
implements TcpIpManager {
private static final String dhcpEnabledMsg = "Can not set value because DHCP is enabled";
private static final String serverArrayTooLargeMsg = "Server array exceeds maximum size";
static /* synthetic */ Class class$javax$baja$sys$BString;
static /* synthetic */ Class class$com$tridium$platform$tcpip$BTcpIpAdapterSettings;
public static PlatformTcpIpManager make() {
return new PlatformTcpIpManager();
}
public String[] getAdapterIds() {
BTcpIpAdapterSettings[] bTcpIpAdapterSettingsArray = this.getAllTcpIpAdapterSettings();
int n = bTcpIpAdapterSettingsArray.length;
String[] stringArray = new String[n];
int n2 = 0;
while (n2 < n) {
stringArray[n2] = bTcpIpAdapterSettingsArray[n2].getAdapterId();
++n2;
}
return stringArray;
}
public String getDefaultGateway(String string) {
BTcpIpHostSettings bTcpIpHostSettings = this.getTcpIpHostSettings();
if (bTcpIpHostSettings.getUsesAdapterLevelSettings()) {
return this.getTcpIpAdapterSettings(bTcpIpHostSettings, string).getDefaultGateway();
}
return bTcpIpHostSettings.getDefaultGateway();
}
public void setDefaultGateway(String string, String string2) {
BTcpIpHostSettings bTcpIpHostSettings = this.getTcpIpHostSettings();
if (bTcpIpHostSettings.getUsesAdapterLevelSettings()) {
BTcpIpAdapterSettings bTcpIpAdapterSettings = this.getTcpIpAdapterSettings(bTcpIpHostSettings, string);
if (this.usingDhcp(bTcpIpAdapterSettings)) {
throw new IllegalStateException(dhcpEnabledMsg);
}
bTcpIpAdapterSettings.setDefaultGateway(string2);
} else {
if (this.usingDhcp()) {
throw new IllegalStateException(dhcpEnabledMsg);
}
bTcpIpHostSettings.setDefaultGateway(string2);
}
}
public boolean isDhcpEnabled(String string) {
return this.getTcpIpAdapterSettings(string).getIsDhcpEnabled();
}
public void enableDhcp(String string, boolean bl) {
this.getTcpIpAdapterSettings(string).setIsDhcpEnabled(bl);
}
public int getDnsServerLimit(String string) {
BTcpIpHostSettings bTcpIpHostSettings = this.getTcpIpHostSettings();
if (bTcpIpHostSettings.getUsesAdapterLevelSettings()) {
return this.getTcpIpAdapterSettings(bTcpIpHostSettings, string).getMaxDnsHosts();
}
return bTcpIpHostSettings.getMaxDnsHosts();
}
public String[] getDnsServers(String string) {
BVector bVector = null;
BTcpIpHostSettings bTcpIpHostSettings = this.getTcpIpHostSettings();
bVector = bTcpIpHostSettings.getUsesAdapterLevelSettings() ? this.getTcpIpAdapterSettings(bTcpIpHostSettings, string).getDnsHosts() : bTcpIpHostSettings.getDnsHosts();
Class clazz = class$javax$baja$sys$BString;
if (clazz == null) {
clazz = class$javax$baja$sys$BString = PlatformTcpIpManager.class("[Ljavax.baja.sys.BString;", false);
}
BString[] bStringArray = (BString[])bVector.getChildren(clazz);
int n = bStringArray.length;
String[] stringArray = new String[n];
int n2 = 0;
while (n2 < n) {
stringArray[n2] = bStringArray[n2].toString();
++n2;
}
return stringArray;
}
public void setDnsServers(String string, String[] stringArray) {
BVector bVector = this.buildHostsVector(stringArray);
if (bVector.getSlotCount() > this.getDnsServerLimit(string)) {
throw new IllegalArgumentException(serverArrayTooLargeMsg);
}
BTcpIpHostSettings bTcpIpHostSettings = this.getTcpIpHostSettings();
if (bTcpIpHostSettings.getUsesAdapterLevelSettings()) {
BTcpIpAdapterSettings bTcpIpAdapterSettings = this.getTcpIpAdapterSettings(bTcpIpHostSettings, string);
if (this.usingDhcp(bTcpIpAdapterSettings)) {
throw new IllegalStateException(dhcpEnabledMsg);
}
bTcpIpAdapterSettings.setDnsHosts(bVector);
} else {
if (this.usingDhcp()) {
throw new IllegalStateException(dhcpEnabledMsg);
}
bTcpIpHostSettings.setDnsHosts(bVector);
}
}
public String getDomain(String string) {
BTcpIpHostSettings bTcpIpHostSettings = this.getTcpIpHostSettings();
if (bTcpIpHostSettings.getUsesAdapterLevelSettings()) {
return this.getTcpIpAdapterSettings(bTcpIpHostSettings, string).getDomain();
}
return bTcpIpHostSettings.getDomain();
}
public void setDomain(String string, String string2) {
BTcpIpHostSettings bTcpIpHostSettings = this.getTcpIpHostSettings();
if (bTcpIpHostSettings.getUsesAdapterLevelSettings()) {
BTcpIpAdapterSettings bTcpIpAdapterSettings = this.getTcpIpAdapterSettings(bTcpIpHostSettings, string);
if (this.usingDhcp(bTcpIpAdapterSettings)) {
throw new IllegalStateException(dhcpEnabledMsg);
}
bTcpIpAdapterSettings.setDomain(string2);
} else {
if (this.usingDhcp()) {
throw new IllegalStateException(dhcpEnabledMsg);
}
bTcpIpHostSettings.setDomain(string2);
}
}
public String getHostName() {
return this.getTcpIpHostSettings().getHostName();
}
public void setHostName(String string) {
this.getTcpIpHostSettings().setHostName(string);
}
public String getIpAddress(String string) {
return this.getTcpIpAdapterSettings(string).getIpAddress();
}
public void setIpAddress(String string, String string2) {
BTcpIpAdapterSettings bTcpIpAdapterSettings = this.getTcpIpAdapterSettings(string);
if (this.usingDhcp(bTcpIpAdapterSettings)) {
throw new IllegalStateException(dhcpEnabledMsg);
}
bTcpIpAdapterSettings.setIpAddress(string2);
}
public String getSubnetMask(String string) {
return this.getTcpIpAdapterSettings(string).getSubnetMask();
}
public void setSubnetMask(String string, String string2) {
BTcpIpAdapterSettings bTcpIpAdapterSettings = this.getTcpIpAdapterSettings(string);
if (this.usingDhcp(bTcpIpAdapterSettings)) {
throw new IllegalStateException(dhcpEnabledMsg);
}
bTcpIpAdapterSettings.setSubnetMask(string2);
}
public String getMediaAccessControlAddress(String string) {
return this.getTcpIpAdapterSettings(string).getMediaAccessControlAddress();
}
public void saveProperties() {
this.getTcpIpService().savePlatformServiceProperties();
}
private final BVector buildHostsVector(String[] stringArray) {
BVector bVector = new BVector();
int n = 0;
while (n < stringArray.length) {
String string = stringArray[n];
bVector.add(SlotPath.escape((String)string), (BValue)BString.make((String)string));
++n;
}
return bVector;
}
private final BTcpIpHostSettings getTcpIpHostSettings() {
return this.getTcpIpService().getSettings();
}
private final BTcpIpAdapterSettings getTcpIpAdapterSettings(BTcpIpHostSettings bTcpIpHostSettings, String string) {
BVector bVector = bTcpIpHostSettings.getAdapters();
Class clazz = class$com$tridium$platform$tcpip$BTcpIpAdapterSettings;
if (clazz == null) {
clazz = class$com$tridium$platform$tcpip$BTcpIpAdapterSettings = PlatformTcpIpManager.class("[Lcom.tridium.platform.tcpip.BTcpIpAdapterSettings;", false);
}
BTcpIpAdapterSettings[] bTcpIpAdapterSettingsArray = (BTcpIpAdapterSettings[])bVector.getChildren(clazz);
return this.resolveAdapter(bTcpIpAdapterSettingsArray, string);
}
private final BTcpIpAdapterSettings getTcpIpAdapterSettings(String string) {
BTcpIpAdapterSettings[] bTcpIpAdapterSettingsArray = this.getAllTcpIpAdapterSettings();
return this.resolveAdapter(bTcpIpAdapterSettingsArray, string);
}
private final BTcpIpAdapterSettings resolveAdapter(BTcpIpAdapterSettings[] bTcpIpAdapterSettingsArray, String string) {
int n = 0;
while (n < bTcpIpAdapterSettingsArray.length) {
if (bTcpIpAdapterSettingsArray[n].getAdapterId().equals(string)) {
return bTcpIpAdapterSettingsArray[n];
}
++n;
}
return bTcpIpAdapterSettingsArray[0];
}
private final BTcpIpAdapterSettings[] getAllTcpIpAdapterSettings() {
BVector bVector = this.getTcpIpHostSettings().getAdapters();
Class clazz = class$com$tridium$platform$tcpip$BTcpIpAdapterSettings;
if (clazz == null) {
clazz = class$com$tridium$platform$tcpip$BTcpIpAdapterSettings = PlatformTcpIpManager.class("[Lcom.tridium.platform.tcpip.BTcpIpAdapterSettings;", false);
}
return (BTcpIpAdapterSettings[])bVector.getChildren(clazz);
}
private final BTcpIpPlatformService getTcpIpService() {
return (BTcpIpPlatformService)Sys.getService((Type)BTcpIpPlatformService.TYPE);
}
private final void loadPlatformProperties() {
this.getTcpIpService().poll();
}
private final boolean usingDhcp() {
return this.usingDhcp(this.getTcpIpAdapterSettings(null));
}
private final boolean usingDhcp(BTcpIpAdapterSettings bTcpIpAdapterSettings) {
boolean bl = false;
if (bTcpIpAdapterSettings.getCanUseDhcp() && bTcpIpAdapterSettings.getIsDhcpEnabled()) {
bl = true;
}
return bl;
}
static /* synthetic */ Class class(String string, boolean bl) {
try {
Class<?> clazz = Class.forName(string);
if (!bl) {
clazz = clazz.getComponentType();
}
return clazz;
}
catch (ClassNotFoundException classNotFoundException) {
throw new NoClassDefFoundError(classNotFoundException.getMessage());
}
}
private PlatformTcpIpManager() {
this.loadPlatformProperties();
}
}
@@ -0,0 +1,741 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* com.tridium.net.HttpUtil
* javax.baja.data.BIDataValue
* javax.baja.file.BIFile
* javax.baja.file.FilePath
* javax.baja.naming.SlotPath
* javax.baja.sys.BFacets
* javax.baja.sys.BString
* javax.baja.sys.BValue
* javax.baja.sys.BajaRuntimeException
* javax.baja.sys.Context
* javax.baja.sys.LocalizableRuntimeException
* javax.baja.sys.Property
* javax.baja.sys.SlotCursor
* javax.baja.util.Lexicon
* javax.baja.xml.XContent
* javax.baja.xml.XElem
* javax.baja.xml.XException
* javax.baja.xml.XParser
*/
package com.tridium.platform.tcpip;
import com.tridium.net.HttpUtil;
import com.tridium.platform.daemon.BDaemonSession;
import com.tridium.platform.daemon.DaemonFileUtil;
import com.tridium.platform.daemon.file.BCacheAccessPolicy;
import com.tridium.platform.daemon.message.ByteArrayFileTransferElement;
import com.tridium.platform.daemon.message.DaemonMessage;
import com.tridium.platform.daemon.message.FileTransferMessage;
import com.tridium.platform.daemon.message.GetFileMessage;
import com.tridium.platform.daemon.message.XmlResponseMessage;
import com.tridium.platform.tcpip.BTcpIpAdapterSettings;
import com.tridium.platform.tcpip.BTcpIpHostSettings;
import java.io.InputStream;
import java.util.HashMap;
import java.util.HashSet;
import javax.baja.data.BIDataValue;
import javax.baja.file.BIFile;
import javax.baja.file.FilePath;
import javax.baja.naming.SlotPath;
import javax.baja.sys.BFacets;
import javax.baja.sys.BString;
import javax.baja.sys.BValue;
import javax.baja.sys.BajaRuntimeException;
import javax.baja.sys.Context;
import javax.baja.sys.LocalizableRuntimeException;
import javax.baja.sys.Property;
import javax.baja.sys.SlotCursor;
import javax.baja.util.Lexicon;
import javax.baja.xml.XContent;
import javax.baja.xml.XElem;
import javax.baja.xml.XException;
import javax.baja.xml.XParser;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class TcpUtil {
static /* synthetic */ Class class$com$tridium$platform$tcpip$BTcpIpAdapterSettings;
static /* synthetic */ Class class$javax$baja$sys$BString;
public static void loadFromSession(BTcpIpHostSettings bTcpIpHostSettings, BDaemonSession bDaemonSession) throws Exception {
InputStream inputStream = bDaemonSession.getInputStream(new DaemonMessage(){
public final String getMessageString() {
return "tcpip";
}
});
TcpUtil.updateFields(bTcpIpHostSettings, XParser.make((InputStream)inputStream).parse());
BIFile bIFile = bDaemonSession.getFileSpace().findFile(new FilePath("/"), BCacheAccessPolicy.cacheOnly);
FilePath filePath = bIFile == null ? new FilePath("!etc/hosts") : new FilePath("/etc/hosts");
InputStream inputStream2 = bDaemonSession.getInputStream(new GetFileMessage(filePath, bDaemonSession.getFileSpace()));
if (inputStream2 != null) {
bTcpIpHostSettings.loadHostFileContents(inputStream2);
}
}
/*
* Unable to fully structure code
*/
public static XElem getHostSettingsXml(BTcpIpHostSettings var0) {
block7: {
var2_1 = new XElem("tcpIpSettings");
var3_2 = false;
var2_1.addAttr("hostname", var0.getHostName());
var2_1.addAttr("isReadonly", String.valueOf(var0.getIsReadonly()));
var2_1.addAttr("usesAdapterLevelSettings", String.valueOf(var0.getUsesAdapterLevelSettings()));
var4_3 = null;
var5_4 = var0.getAdapters().getProperties();
if (true) ** GOTO lbl16
do {
if ((var4_3 = (BTcpIpAdapterSettings)var5_4.get()).getIsIpv6Supported()) {
var3_2 = true;
break;
}
lbl16:
// 3 sources
if ((v0 = TcpUtil.class$com$tridium$platform$tcpip$BTcpIpAdapterSettings) != null) continue;
v0 = TcpUtil.class("[Lcom.tridium.platform.tcpip.BTcpIpAdapterSettings;", false);
} while (var5_4.next(v0));
if (var3_2) {
var2_1.addAttr("niagaraUsesIpv6", String.valueOf(var0.getNiagaraUsesIpv6()));
var2_1.addAttr("isIPv6Readonly", String.valueOf(var0.getIsIPv6Readonly()));
} else {
var2_1.addAttr("niagaraUsesIpv6", "false");
var2_1.addAttr("isIPv6Readonly", "true");
}
if (var0.getUsesAdapterLevelSettings()) break block7;
var2_1.addAttr("domain", var0.getDomain());
var2_1.addAttr("defaultGateway", var0.getDefaultGateway());
var5_4 = new XElem("dnsHosts");
var5_4.addAttr("limit", String.valueOf(var0.getMaxDnsHosts()));
var6_5 = var0.getDnsHosts().getProperties();
if (true) ** GOTO lbl45
do {
var1_6 = new XElem("dnsHost");
var1_6.addAttr("ipAddress", var6_5.get().toString());
var5_4.addContent((XContent)var1_6);
lbl45:
// 2 sources
if ((v1 = TcpUtil.class$javax$baja$sys$BString) != null) continue;
v1 = TcpUtil.class("[Ljavax.baja.sys.BString;", false);
} while (var6_5.next(v1));
var2_1.addContent((XContent)var5_4);
if (!var3_2) break block7;
var2_1.addAttr("ipv6DefaultGateway", var0.getIpv6DefaultGateway());
var6_5 = new XElem("ipv6DnsHosts");
var6_5.addAttr("limit", String.valueOf(var0.getMaxDnsHosts()));
var7_7 = var0.getIpv6DnsHosts().getProperties();
if (true) ** GOTO lbl64
do {
var1_6 = new XElem("ipv6DnsHost");
var1_6.addAttr("ipv6Address", var7_7.get().toString());
var6_5.addContent((XContent)var1_6);
lbl64:
// 2 sources
if ((v2 = TcpUtil.class$javax$baja$sys$BString) != null) continue;
v2 = TcpUtil.class("[Ljavax.baja.sys.BString;", false);
} while (var7_7.next(v2));
var2_1.addContent((XContent)var6_5);
}
var5_4 = new XElem("adapters");
var6_5 = var0.getAdapters().getProperties();
if (true) ** GOTO lbl76
do {
var5_4.addContent((XContent)TcpUtil.getAdapterSettingsXml((BTcpIpAdapterSettings)var6_5.get(), var0.getUsesAdapterLevelSettings()));
lbl76:
// 2 sources
if ((v3 = TcpUtil.class$com$tridium$platform$tcpip$BTcpIpAdapterSettings) != null) continue;
v3 = TcpUtil.class("[Lcom.tridium.platform.tcpip.BTcpIpAdapterSettings;", false);
} while (var6_5.next(v3));
var2_1.addContent((XContent)var5_4);
return var2_1;
}
public static void updateFields(BTcpIpHostSettings bTcpIpHostSettings, XElem xElem) {
Object object;
Object object2;
String string;
block23: {
string = null;
try {
string = xElem.get("hostname");
if (string == null || string.trim().length() == 0) {
string = "localhost";
}
}
catch (XException xException) {
string = xElem.get("hostName", "localhost");
if (string != null && string.trim().length() != 0) break block23;
string = "localhost";
}
}
bTcpIpHostSettings.setHostName(string);
bTcpIpHostSettings.setIsReadonly(xElem.getb("isReadonly", false));
bTcpIpHostSettings.setUsesAdapterLevelSettings(xElem.getb("usesAdapterLevelSettings", true));
boolean bl = false;
XElem[] xElemArray = xElem.elem("adapters").elems("adapter");
int n = 0;
while (n < xElemArray.length) {
if (xElemArray[n].getb("ipv6Supported", false)) {
bl = true;
break;
}
++n;
}
if (bl) {
bTcpIpHostSettings.setNiagaraUsesIpv6(xElem.getb("niagaraUsesIpv6", false));
bTcpIpHostSettings.setIsIPv6Readonly(xElem.getb("isIPv6Readonly", true));
} else {
bTcpIpHostSettings.setNiagaraUsesIpv6(false);
bTcpIpHostSettings.setIsIPv6Readonly(true);
}
if (!bTcpIpHostSettings.getUsesAdapterLevelSettings()) {
bTcpIpHostSettings.setDefaultGateway(xElem.get("defaultGateway"));
bTcpIpHostSettings.setDomain(xElem.get("domain"));
String string2 = null;
object2 = xElem.elem("dnsHosts");
XElem[] xElemArray2 = object2.elems("dnsHost");
bTcpIpHostSettings.setMaxDnsHosts(object2.geti("limit", 2));
object = new HashSet();
int n2 = 0;
while (n2 < xElemArray2.length) {
string2 = SlotPath.escape((String)xElemArray2[n2].get("ipAddress"));
((HashSet)object).add(string2);
if (bTcpIpHostSettings.getDnsHosts().getSlot(string2) == null) {
bTcpIpHostSettings.getDnsHosts().add(string2, (BValue)BString.make((String)xElemArray2[n2].get("ipAddress")), 1, (Context)BFacets.make((String)"fieldEditor", (BIDataValue)BString.make((String)"platform:IpHostFE")));
}
++n2;
}
Property[] propertyArray = bTcpIpHostSettings.getDnsHosts().getPropertiesArray();
int n3 = 0;
while (n3 < propertyArray.length) {
if (!((HashSet)object).contains(propertyArray[n3].getName())) {
bTcpIpHostSettings.getDnsHosts().remove(propertyArray[n3].getName());
}
++n3;
}
if (bl) {
bTcpIpHostSettings.setIpv6DefaultGateway(xElem.get("ipv6DefaultGateway", ""));
XElem xElem2 = xElem.elem("ipv6DnsHosts");
if (xElem2 == null) {
bTcpIpHostSettings.getIpv6DnsHosts().removeAll();
} else {
XElem[] xElemArray3 = xElem2.elems("ipv6DnsHost");
HashSet<String> hashSet = new HashSet<String>();
int n4 = 0;
while (n4 < xElemArray3.length) {
string2 = SlotPath.escape((String)xElemArray3[n4].get("ipv6Address"));
hashSet.add(string2);
if (bTcpIpHostSettings.getIpv6DnsHosts().getSlot(string2) == null) {
bTcpIpHostSettings.getIpv6DnsHosts().add(string2, (BValue)BString.make((String)xElemArray3[n4].get("ipv6Address")), 1, (Context)BFacets.make((String)"fieldEditor", (BIDataValue)BString.make((String)"platform:IpHostFE")));
}
++n4;
}
Property[] propertyArray2 = bTcpIpHostSettings.getIpv6DnsHosts().getPropertiesArray();
int n5 = 0;
while (n5 < propertyArray2.length) {
if (!hashSet.contains(propertyArray2[n5].getName())) {
bTcpIpHostSettings.getIpv6DnsHosts().remove(propertyArray2[n5].getName());
}
++n5;
}
}
}
}
HashSet<String> hashSet = new HashSet<String>();
object2 = null;
xElemArray = xElem.elem("adapters").elems("adapter");
int n6 = 0;
while (n6 < xElemArray.length) {
object = SlotPath.escape((String)xElemArray[n6].get("id"));
hashSet.add((String)object);
object2 = (BTcpIpAdapterSettings)bTcpIpHostSettings.getAdapters().get((String)object);
if (object2 == null) {
object2 = new BTcpIpAdapterSettings();
bTcpIpHostSettings.getAdapters().add((String)object, (BValue)object2);
}
TcpUtil.updateFields((BTcpIpAdapterSettings)((Object)object2), xElemArray[n6]);
++n6;
}
Property[] propertyArray = bTcpIpHostSettings.getAdapters().getPropertiesArray();
int n7 = 0;
while (n7 < propertyArray.length) {
if (!hashSet.contains(propertyArray[n7].getName())) {
bTcpIpHostSettings.getAdapters().remove(propertyArray[n7].getName());
}
++n7;
}
}
/*
* Unable to fully structure code
*/
public static XElem getAdapterSettingsXml(BTcpIpAdapterSettings var0, boolean var1_1) {
block10: {
var2_2 = new XElem("adapter");
var2_2.addAttr("id", var0.getAdapterId());
var2_2.addAttr("enabled", String.valueOf(var0.getIsAdapterEnabled()));
var2_2.addAttr("canDisable", String.valueOf(var0.getCanDisableAdapter()));
var2_2.addAttr("desc", var0.getDescription());
var2_2.addAttr("macAddress", var0.getMediaAccessControlAddress());
var2_2.addAttr("ipAddress", var0.getIpAddress());
var2_2.addAttr("subnetMask", var0.getSubnetMask());
var2_2.addAttr("canUseDhcp", String.valueOf(var0.getCanUseDhcp()));
if (var1_1) {
var2_2.addAttr("defaultGateway", var0.getDefaultGateway());
var2_2.addAttr("domain", var0.getDomain());
}
var2_2.addAttr("ipv6Supported", String.valueOf(var0.getIsIpv6Supported()));
if (var0.getIsIpv6Supported()) {
var2_2.addAttr("canDisableIpv6", String.valueOf(var0.getCanDisableIpv6()));
var2_2.addAttr("ipv6Enabled", String.valueOf(var0.getIsIpv6Enabled()));
var2_2.addAttr("canUseIpv6Dhcp", String.valueOf(var0.getCanUseIpv6Dhcp()));
if (var0.getIsIpv6Enabled()) {
var2_2.addAttr("ipv6Address", var0.getIpv6Address());
var2_2.addAttr("ipv6SubnetPrefixLength", String.valueOf(var0.getIpv6SubnetPrefixLength()));
if (var1_1) {
var2_2.addAttr("ipv6DefaultGateway", var0.getIpv6DefaultGateway());
}
}
}
if (var0.getCanUseDhcp()) {
var2_2.addAttr("dhcpEnabled", String.valueOf(var0.getIsDhcpEnabled()));
if (var0.getIsDhcpEnabled()) {
var2_2.addAttr("dhcpHost", var0.getDhcpHost());
var2_2.addAttr("dhcpLeaseGranted", var0.getDhcpLeaseGranted());
var2_2.addAttr("dhcpLeaseExpires", var0.getDhcpLeaseExpires());
}
}
if (var0.getIsIpv6Enabled() && var0.getCanUseIpv6Dhcp()) {
var2_2.addAttr("ipv6DhcpEnabled", String.valueOf(var0.getIsIpv6DhcpEnabled()));
if (var0.getIsIpv6DhcpEnabled()) {
var2_2.addAttr("ipv6DhcpHost", var0.getIpv6DhcpHost());
var2_2.addAttr("ipv6DhcpLeaseGranted", var0.getIpv6DhcpLeaseGranted());
var2_2.addAttr("ipv6DhcpLeaseExpires", var0.getIpv6DhcpLeaseExpires());
}
}
if (!var1_1) break block10;
var3_3 = new XElem("dnsHosts");
var3_3.addAttr("limit", String.valueOf(var0.getMaxDnsHosts()));
var4_4 = var0.getDnsHosts().getProperties();
if (true) ** GOTO lbl72
do {
var5_5 = new XElem("dnsHost");
var5_5.addAttr("ipAddress", var4_4.get().toString());
var3_3.addContent((XContent)var5_5);
lbl72:
// 2 sources
if ((v0 = TcpUtil.class$javax$baja$sys$BString) != null) continue;
v0 = TcpUtil.class("[Ljavax.baja.sys.BString;", false);
} while (var4_4.next(v0));
var2_2.addContent((XContent)var3_3);
if (!var0.getIsIpv6Enabled()) break block10;
var4_4 = new XElem("ipv6DnsHosts");
var4_4.addAttr("limit", String.valueOf(var0.getMaxDnsHosts()));
var5_5 = var0.getIpv6DnsHosts().getProperties();
if (true) ** GOTO lbl89
do {
var6_6 = new XElem("ipv6DnsHost");
var6_6.addAttr("ipv6Address", var5_5.get().toString());
var4_4.addContent((XContent)var6_6);
lbl89:
// 2 sources
if ((v1 = TcpUtil.class$javax$baja$sys$BString) != null) continue;
v1 = TcpUtil.class("[Ljavax.baja.sys.BString;", false);
} while (var5_5.next(v1));
var2_2.addContent((XContent)var4_4);
}
return var2_2;
}
public static void updateFields(BTcpIpAdapterSettings bTcpIpAdapterSettings, XElem xElem) {
int n;
Property[] propertyArray;
Object object;
XElem xElem2;
bTcpIpAdapterSettings.setAdapterId(xElem.get("id"));
bTcpIpAdapterSettings.setIsAdapterEnabled(xElem.getb("enabled", true));
bTcpIpAdapterSettings.setCanDisableAdapter(xElem.getb("canDisable", false));
bTcpIpAdapterSettings.setDescription(xElem.get("desc"));
bTcpIpAdapterSettings.setMediaAccessControlAddress(xElem.get("macAddress", "Unavailable"));
bTcpIpAdapterSettings.setIpAddress(xElem.get("ipAddress"));
bTcpIpAdapterSettings.setSubnetMask(xElem.get("subnetMask"));
boolean bl = xElem.getb("canUseDhcp", true);
boolean bl2 = xElem.getb("ipv6Supported", false);
boolean bl3 = false;
if (bl2 && xElem.getb("ipv6Enabled", false)) {
bl3 = true;
}
boolean bl4 = bl3;
boolean bl5 = false;
if (bl2 && xElem.getb("canDisableIpv6", false)) {
bl5 = true;
}
boolean bl6 = bl5;
boolean bl7 = xElem.getb("canUseIpv6Dhcp", false);
bTcpIpAdapterSettings.setCanUseDhcp(bl);
bTcpIpAdapterSettings.setIsIpv6Supported(bl2);
bTcpIpAdapterSettings.setIsIpv6Enabled(bl4);
bTcpIpAdapterSettings.setCanDisableIpv6(bl6);
bTcpIpAdapterSettings.setCanUseIpv6Dhcp(bl7);
if (xElem.get("domain", null) != null) {
bTcpIpAdapterSettings.setDomain(xElem.get("domain"));
}
if (xElem.get("defaultGateway", null) != null) {
bTcpIpAdapterSettings.setDefaultGateway(xElem.get("defaultGateway"));
}
if (bl4) {
if (xElem.get("ipv6Address", null) != null) {
bTcpIpAdapterSettings.setIpv6Address(xElem.get("ipv6Address"));
}
if (xElem.get("ipv6DefaultGateway", null) != null) {
bTcpIpAdapterSettings.setIpv6DefaultGateway(xElem.get("ipv6DefaultGateway"));
}
if (xElem.get("ipv6SubnetPrefixLength", null) != null) {
bTcpIpAdapterSettings.setIpv6SubnetPrefixLength(xElem.geti("ipv6SubnetPrefixLength"));
}
}
boolean bl8 = false;
if (bl && xElem.getb("dhcpEnabled", false)) {
bl8 = true;
}
bTcpIpAdapterSettings.setIsDhcpEnabled(bl8);
boolean bl9 = false;
if (bl7 && xElem.getb("ipv6DhcpEnabled", false)) {
bl9 = true;
}
bTcpIpAdapterSettings.setIsIpv6DhcpEnabled(bl9);
if (bTcpIpAdapterSettings.getIsDhcpEnabled()) {
bTcpIpAdapterSettings.setDhcpHost(xElem.get("dhcpHost", "n/a"));
bTcpIpAdapterSettings.setDhcpLeaseGranted(xElem.get("dhcpLeaseGranted", "n/a"));
bTcpIpAdapterSettings.setDhcpLeaseExpires(xElem.get("dhcpLeaseExpires", "n/a"));
} else {
bTcpIpAdapterSettings.setDhcpHost("n/a");
bTcpIpAdapterSettings.setDhcpLeaseGranted("n/a");
bTcpIpAdapterSettings.setDhcpLeaseExpires("n/a");
}
if (bl4) {
if (bTcpIpAdapterSettings.getIsIpv6DhcpEnabled()) {
bTcpIpAdapterSettings.setIpv6DhcpHost(xElem.get("ipv6DhcpHost", "n/a"));
bTcpIpAdapterSettings.setIpv6DhcpLeaseGranted(xElem.get("ipv6DhcpLeaseGranted", "n/a"));
bTcpIpAdapterSettings.setIpv6DhcpLeaseExpires(xElem.get("ipv6DhcpLeaseExpires", "n/a"));
} else {
bTcpIpAdapterSettings.setIpv6DhcpHost("n/a");
bTcpIpAdapterSettings.setIpv6DhcpLeaseGranted("n/a");
bTcpIpAdapterSettings.setIpv6DhcpLeaseExpires("n/a");
}
}
String string = null;
XElem xElem3 = xElem.elem("dnsHosts");
if (xElem3 != null) {
xElem2 = xElem3.elems("dnsHost");
bTcpIpAdapterSettings.setMaxDnsHosts(xElem3.geti("limit", 2));
object = new HashSet();
int n2 = 0;
while (n2 < ((XElem)xElem2).length) {
string = SlotPath.escape((String)xElem2[n2].get("ipAddress"));
((HashSet)object).add(string);
if (bTcpIpAdapterSettings.getDnsHosts().getSlot(string) == null) {
bTcpIpAdapterSettings.getDnsHosts().add(string, (BValue)BString.make((String)xElem2[n2].get("ipAddress")), 1, (Context)BFacets.make((String)"fieldEditor", (BIDataValue)BString.make((String)"platform:IpHostFE")));
}
++n2;
}
propertyArray = bTcpIpAdapterSettings.getDnsHosts().getPropertiesArray();
n = 0;
while (n < propertyArray.length) {
if (!((HashSet)object).contains(propertyArray[n].getName())) {
bTcpIpAdapterSettings.getDnsHosts().remove(propertyArray[n].getName());
}
++n;
}
}
if (bl4 && (xElem2 = xElem.elem("ipv6DnsHosts")) != null) {
object = xElem2.elems("ipv6DnsHost");
propertyArray = new HashSet();
n = 0;
while (n < ((XElem[])object).length) {
string = SlotPath.escape((String)object[n].get("ipv6Address"));
propertyArray.add(string);
if (bTcpIpAdapterSettings.getIpv6DnsHosts().getSlot(string) == null) {
bTcpIpAdapterSettings.getIpv6DnsHosts().add(string, (BValue)BString.make((String)object[n].get("ipv6Address")), 1, (Context)BFacets.make((String)"fieldEditor", (BIDataValue)BString.make((String)"platform:IpHostFE")));
}
++n;
}
Property[] propertyArray2 = bTcpIpAdapterSettings.getIpv6DnsHosts().getPropertiesArray();
int n3 = 0;
while (n3 < propertyArray2.length) {
if (!propertyArray.contains(propertyArray2[n3].getName())) {
bTcpIpAdapterSettings.getIpv6DnsHosts().remove(propertyArray2[n3].getName());
}
++n3;
}
}
}
public static BTcpIpHostSettings updateAdapterNames(BTcpIpHostSettings bTcpIpHostSettings, BTcpIpHostSettings bTcpIpHostSettings2, BTcpIpHostSettings bTcpIpHostSettings3) throws Exception {
BTcpIpAdapterSettings bTcpIpAdapterSettings;
String string;
if (!bTcpIpHostSettings3.getUsesAdapterLevelSettings()) {
return bTcpIpHostSettings3;
}
BTcpIpHostSettings bTcpIpHostSettings4 = (BTcpIpHostSettings)bTcpIpHostSettings3.newCopy();
HashMap<String, String> hashMap = new HashMap<String, String>();
SlotCursor slotCursor = bTcpIpHostSettings.getAdapters().getProperties();
while (slotCursor.next()) {
string = SlotPath.unescape((String)slotCursor.property().getName());
if (string.charAt(0) != '{') {
return bTcpIpHostSettings4;
}
bTcpIpAdapterSettings = (BTcpIpAdapterSettings)slotCursor.get();
if (hashMap.put(bTcpIpAdapterSettings.getIpAddress(), string) == null) continue;
throw new LocalizableRuntimeException("platform", "CannotSaveTcpChangesError.duplicateIpAddress", new Object[]{bTcpIpAdapterSettings.getIpAddress()});
}
slotCursor = bTcpIpHostSettings2.getAdapters().getProperties();
while (slotCursor.next()) {
string = SlotPath.unescape((String)slotCursor.property().getName());
bTcpIpAdapterSettings = (BTcpIpAdapterSettings)slotCursor.get();
String string2 = (String)hashMap.get(bTcpIpAdapterSettings.getIpAddress());
if (string2 == null) {
throw new LocalizableRuntimeException("platform", "CannotSaveTcpChangesError.cannotTranslateAdapterAddress", new Object[]{bTcpIpAdapterSettings.getIpAddress()});
}
BTcpIpAdapterSettings bTcpIpAdapterSettings2 = (BTcpIpAdapterSettings)bTcpIpHostSettings4.getAdapters().get(SlotPath.escape((String)string2));
bTcpIpHostSettings4.getAdapters().rename(bTcpIpAdapterSettings2.getPropertyInParent(), SlotPath.escape((String)string));
bTcpIpAdapterSettings2.setAdapterId(string);
hashMap.remove(bTcpIpAdapterSettings.getIpAddress());
}
if (hashMap.size() > 0) {
throw new LocalizableRuntimeException("platform", "CannotSaveTcpChangesError.cannotTranslateAdapterAddress", new Object[]{hashMap.keySet().iterator().next()});
}
return bTcpIpHostSettings4;
}
public static BTcpIpHostSettings updateAdapterNames(BTcpIpHostSettings bTcpIpHostSettings, BDaemonSession bDaemonSession, BTcpIpHostSettings bTcpIpHostSettings2) throws Exception {
if (!bTcpIpHostSettings2.getUsesAdapterLevelSettings()) {
return bTcpIpHostSettings2;
}
BTcpIpHostSettings bTcpIpHostSettings3 = new BTcpIpHostSettings();
TcpUtil.loadFromSession(bTcpIpHostSettings3, bDaemonSession);
return TcpUtil.updateAdapterNames(bTcpIpHostSettings, bTcpIpHostSettings3, bTcpIpHostSettings2);
}
/*
* Unable to fully structure code
* Could not resolve type clashes
*/
public static void saveToSession(BTcpIpHostSettings var0, BDaemonSession var1_1, boolean var2_2) throws Exception {
block8: {
if (var0 == null) {
return;
}
var3_3 = var1_1.getHostProperties();
if (var3_3.getOsName().startsWith("win") && var0.getHostName().length() > 15) {
throw new BajaRuntimeException(Lexicon.make((String)"platform").getText("TcpIpHostSettings.invalidHostName"));
}
if (var3_3.getVmVendor().equalsIgnoreCase("IBM Corporation") && var0.getNiagaraUsesIpv6()) {
throw new BajaRuntimeException(Lexicon.make((String)"platform").getText("TcpIpHostSettings.cannotUseIPv6"));
}
if (!var3_3.getOsName().startsWith("qnx")) break block8;
var4_4 = 0;
var5_6 /* !! */ = var0.getAdapters().getProperties();
if (true) ** GOTO lbl15
do {
if ((var6_7 = (BTcpIpAdapterSettings)var5_6 /* !! */ .get()).getIsDhcpEnabled()) {
++var4_4;
}
lbl15:
// 4 sources
if ((v0 = TcpUtil.class$com$tridium$platform$tcpip$BTcpIpAdapterSettings) != null) continue;
v0 = TcpUtil.class("[Lcom.tridium.platform.tcpip.BTcpIpAdapterSettings;", false);
} while (var5_6 /* !! */ .next(v0));
if (var4_4 > 1) {
throw new BajaRuntimeException(Lexicon.make((String)"platform").getText("TcpIpHostSettings.multipleDhcpAdapters"));
}
}
var1_1.sendMessage(new UpdateTcpIpHostMessage(var0));
var4_5 = var0.getAdapters().loadSlots().getProperties();
while (var4_5.next()) {
var5_6 /* !! */ = (BTcpIpAdapterSettings)var4_5.get();
var1_1.sendMessage(new UpdateTcpIpAdapterMessage((BTcpIpAdapterSettings)var5_6 /* !! */ ));
}
if (!var3_3.getOsName().toLowerCase().startsWith("linux") && var2_2) {
var4_5 = var1_1.getFileSpace().findFile(new FilePath("/"), BCacheAccessPolicy.cacheOnly);
var5_6 /* !! */ = var4_5 == null ? new FilePath("!etc/hosts") : new FilePath("/etc/hosts");
var6_7 = new FileTransferMessage(var1_1.getFileSpace());
var6_7.addElement(new ByteArrayFileTransferElement((FilePath)var5_6 /* !! */ , var0.getHostFileContents().getBytes(), var1_1.getFileSpace()));
DaemonFileUtil.transfer(var1_1, (FileTransferMessage)var6_7, null);
}
}
static /* synthetic */ Class class(String string, boolean bl) {
try {
Class<?> clazz = Class.forName(string);
if (!bl) {
clazz = clazz.getComponentType();
}
return clazz;
}
catch (ClassNotFoundException classNotFoundException) {
throw new NoClassDefFoundError(classNotFoundException.getMessage());
}
}
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
private static class UpdateTcpIpHostMessage
extends XmlResponseMessage {
private StringBuffer path = new StringBuffer("tcpip?update=true");
static /* synthetic */ Class class$com$tridium$platform$tcpip$BTcpIpAdapterSettings;
public String getMessageString() {
return this.path.toString();
}
static /* synthetic */ Class class(String string, boolean bl) {
try {
Class<?> clazz = Class.forName(string);
if (!bl) {
clazz = clazz.getComponentType();
}
return clazz;
}
catch (ClassNotFoundException classNotFoundException) {
throw new NoClassDefFoundError(classNotFoundException.getMessage());
}
}
/*
* Unable to fully structure code
*/
public UpdateTcpIpHostMessage(BTcpIpHostSettings var1_1) {
super();
this.path.append("&hostname=").append(HttpUtil.encodeUrl((String)var1_1.getHostName()));
var2_2 = false;
var4_3 = var1_1.getAdapters().getProperties();
if (true) ** GOTO lbl12
do {
if ((var3_4 = (BTcpIpAdapterSettings)var4_3.get()).getIsIpv6Enabled()) {
var2_2 = true;
break;
}
lbl12:
// 3 sources
if ((v0 = UpdateTcpIpHostMessage.class$com$tridium$platform$tcpip$BTcpIpAdapterSettings) != null) continue;
v0 = UpdateTcpIpHostMessage.class("[Lcom.tridium.platform.tcpip.BTcpIpAdapterSettings;", false);
} while (var4_3.next(v0));
if (var2_2) {
this.path.append("&niagaraUsesIpv6=").append(var1_1.getNiagaraUsesIpv6());
} else {
this.path.append("&niagaraUsesIpv6=false");
}
if (!var1_1.getUsesAdapterLevelSettings()) {
this.path.append("&domain=").append(HttpUtil.encodeUrl((String)var1_1.getDomain()));
this.path.append("&defaultGateway=").append(HttpUtil.encodeUrl((String)var1_1.getDefaultGateway().toString()));
var4_3 = new StringBuffer();
var5_5 = var1_1.getDnsHosts().loadSlots().getProperties();
while (var5_5.next()) {
if (var4_3.length() > 0) {
var4_3.append("%2C");
}
var4_3.append(HttpUtil.encodeUrl((String)var5_5.get().toString()));
}
this.path.append("&dnsHosts=").append(var4_3.toString());
if (var2_2) {
this.path.append("&ipv6DefaultGateway=").append(HttpUtil.encodeUrl((String)var1_1.getIpv6DefaultGateway()));
var5_5 = new StringBuffer();
var6_6 = var1_1.getIpv6DnsHosts().loadSlots().getProperties();
while (var6_6.next()) {
if (var5_5.length() > 0) {
var5_5.append("%2C");
}
var5_5.append(HttpUtil.encodeUrl((String)var6_6.get().toString()));
}
this.path.append("&ipv6DnsHosts=").append(var5_5.toString());
} else {
this.path.append("&ipv6DefaultGateway=");
this.path.append("&ipv6DnsHosts=");
}
}
}
}
private static class UpdateTcpIpAdapterMessage
extends XmlResponseMessage {
private StringBuffer path = new StringBuffer("tcpip?update=true");
public String getMessageString() {
String string = this.path.toString();
return string;
}
public UpdateTcpIpAdapterMessage(BTcpIpAdapterSettings bTcpIpAdapterSettings) {
SlotCursor slotCursor;
StringBuffer stringBuffer;
this.path.append("&adapterId=").append(HttpUtil.encodeUrl((String)bTcpIpAdapterSettings.getAdapterId()));
this.path.append("&enabled=").append(String.valueOf(bTcpIpAdapterSettings.getIsAdapterEnabled()));
if (bTcpIpAdapterSettings.getCanUseDhcp()) {
this.path.append("&dhcpEnabled=").append(String.valueOf(bTcpIpAdapterSettings.getIsDhcpEnabled()));
}
if (bTcpIpAdapterSettings.getIsIpv6Supported()) {
if (bTcpIpAdapterSettings.getCanDisableIpv6()) {
this.path.append("&ipv6Enabled=").append(String.valueOf(bTcpIpAdapterSettings.getIsIpv6Enabled()));
}
if (bTcpIpAdapterSettings.getCanUseIpv6Dhcp()) {
StringBuffer stringBuffer2 = this.path.append("&ipv6DhcpEnabled=");
boolean bl = false;
if (bTcpIpAdapterSettings.getIsIpv6Enabled() && bTcpIpAdapterSettings.getIsIpv6DhcpEnabled()) {
bl = true;
}
stringBuffer2.append(String.valueOf(bl));
}
}
if (!bTcpIpAdapterSettings.getIsDhcpEnabled()) {
this.path.append("&ipAddress=").append(HttpUtil.encodeUrl((String)bTcpIpAdapterSettings.getIpAddress().toString()));
this.path.append("&subnetMask=").append(HttpUtil.encodeUrl((String)bTcpIpAdapterSettings.getSubnetMask().toString()));
if (bTcpIpAdapterSettings.getUsesAdapterLevelSettings()) {
this.path.append("&defaultGateway=").append(HttpUtil.encodeUrl((String)bTcpIpAdapterSettings.getDefaultGateway().toString()));
this.path.append("&domain=").append(HttpUtil.encodeUrl((String)bTcpIpAdapterSettings.getDomain()));
stringBuffer = new StringBuffer();
slotCursor = bTcpIpAdapterSettings.getDnsHosts().loadSlots().getProperties();
while (slotCursor.next()) {
if (stringBuffer.length() > 0) {
stringBuffer.append("%2C");
}
stringBuffer.append(HttpUtil.encodeUrl((String)slotCursor.get().toString()));
}
this.path.append("&dnsHosts=").append(stringBuffer.toString());
}
}
if (bTcpIpAdapterSettings.getIsIpv6Enabled() && !bTcpIpAdapterSettings.getIsIpv6DhcpEnabled()) {
this.path.append("&ipv6Address=").append(HttpUtil.encodeUrl((String)bTcpIpAdapterSettings.getIpv6Address().toString()));
this.path.append("&ipv6SubnetPrefixLength=").append(String.valueOf(bTcpIpAdapterSettings.getIpv6SubnetPrefixLength()));
if (bTcpIpAdapterSettings.getUsesAdapterLevelSettings()) {
this.path.append("&ipv6DefaultGateway=").append(HttpUtil.encodeUrl((String)bTcpIpAdapterSettings.getIpv6DefaultGateway().toString()));
stringBuffer = new StringBuffer();
slotCursor = bTcpIpAdapterSettings.getIpv6DnsHosts().loadSlots().getProperties();
while (slotCursor.next()) {
if (stringBuffer.length() > 0) {
stringBuffer.append("%2C");
}
stringBuffer.append(HttpUtil.encodeUrl((String)slotCursor.get().toString()));
}
this.path.append("&ipv6DnsHosts=").append(stringBuffer.toString());
}
}
}
}
}