class SolarisNetworkIF extends AbstractNetworkIF {

    private static final Logger LOG = LoggerFactory.getLogger(SolarisNetworkIF.class);

    private long bytesRecv;
    private long bytesSent;
    private long packetsRecv;
    private long packetsSent;
    private long inErrors;
    private long outErrors;
    private long inDrops;
    private long collisions;
    private long speed;
    private long timeStamp;

    public SolarisNetworkIF(NetworkInterface netint) throws InstantiationException {
        super(netint);
        updateAttributes();
    }

    /**
     * Gets all network interfaces on this machine
     *
     * @param includeLocalInterfaces include local interfaces in the result
     * @return A list of {@link NetworkIF} objects representing the interfaces
     */
    public static List<NetworkIF> getNetworks(boolean includeLocalInterfaces) {
        List<NetworkIF> ifList = new ArrayList<>();
        for (NetworkInterface ni : getNetworkInterfaces(includeLocalInterfaces)) {
            try {
                ifList.add(new SolarisNetworkIF(ni));
            } catch (InstantiationException e) {
                LOG.debug("Network Interface Instantiation failed: {}", e.getMessage());
            }
        }
        return ifList;
    }

    @Override
    public long getBytesRecv() {
        return this.bytesRecv;
    }

    @Override
    public long getBytesSent() {
        return this.bytesSent;
    }

    @Override
    public long getPacketsRecv() {
        return this.packetsRecv;
    }

    @Override
    public long getPacketsSent() {
        return this.packetsSent;
    }

    @Override
    public long getInErrors() {
        return this.inErrors;
    }

    @Override
    public long getOutErrors() {
        return this.outErrors;
    }

    @Override
    public long getInDrops() {
        return this.inDrops;
    }

    @Override
    public long getCollisions() {
        return this.collisions;
    }

    @Override
    public long getSpeed() {
        return this.speed;
    }

    @Override
    public long getTimeStamp() {
        return this.timeStamp;
    }

    @Override
    public boolean updateAttributes() {
        // Initialize to a sane default value
        this.timeStamp = System.currentTimeMillis();
        if (HAS_KSTAT2) {
            // Use Kstat2 implementation
            return updateAttributes2();
        }
        try (KstatChain kc = KstatUtil.openChain()) {
            Kstat ksp = kc.lookup("link", -1, getName());
            if (ksp == null) { // Solaris 10 compatibility
                ksp = kc.lookup(null, -1, getName());
            }
            if (ksp != null && kc.read(ksp)) {
                this.bytesSent = KstatUtil.dataLookupLong(ksp, "obytes64");
                this.bytesRecv = KstatUtil.dataLookupLong(ksp, "rbytes64");
                this.packetsSent = KstatUtil.dataLookupLong(ksp, "opackets64");
                this.packetsRecv = KstatUtil.dataLookupLong(ksp, "ipackets64");
                this.outErrors = KstatUtil.dataLookupLong(ksp, "oerrors");
                this.inErrors = KstatUtil.dataLookupLong(ksp, "ierrors");
                this.collisions = KstatUtil.dataLookupLong(ksp, "collisions");
                this.inDrops = KstatUtil.dataLookupLong(ksp, "dl_idrops");
                this.speed = KstatUtil.dataLookupLong(ksp, "ifspeed");
                // Snap time in ns; convert to ms
                this.timeStamp = ksp.ks_snaptime / 1_000_000L;
                return true;
            }
        }
        return false;
    }

    private boolean updateAttributes2() {<FILL_FUNCTION_BODY>}
}

        Object[] results = KstatUtil.queryKstat2("kstat:/net/link/" + getName() + "/0", "obytes64", "rbytes64",
                "opackets64", "ipackets64", "oerrors", "ierrors", "collisions", "dl_idrops", "ifspeed", "snaptime");
        if (results[results.length - 1] == null) {
            return false;
        }
        this.bytesSent = results[0] == null ? 0L : (long) results[0];
        this.bytesRecv = results[1] == null ? 0L : (long) results[1];
        this.packetsSent = results[2] == null ? 0L : (long) results[2];
        this.packetsRecv = results[3] == null ? 0L : (long) results[3];
        this.outErrors = results[4] == null ? 0L : (long) results[4];
        this.collisions = results[5] == null ? 0L : (long) results[5];
        this.inDrops = results[6] == null ? 0L : (long) results[6];
        this.speed = results[7] == null ? 0L : (long) results[7];
        // Snap time in ns; convert to ms
        this.timeStamp = (long) results[8] / 1_000_000L;
        return true;
    
<methods>public java.lang.String getDisplayName() ,public java.lang.String[] getIPv4addr() ,public java.lang.String[] getIPv6addr() ,public int getIndex() ,public long getMTU() ,public java.lang.String getMacaddr() ,public java.lang.String getName() ,public java.lang.Short[] getPrefixLengths() ,public java.lang.Short[] getSubnetMasks() ,public boolean isKnownVmMacAddr() ,public java.net.NetworkInterface queryNetworkInterface() ,public java.lang.String toString() <variables>private static final org.slf4j.Logger LOG,private static final java.lang.String OSHI_VM_MAC_ADDR_PROPERTIES,private java.lang.String displayName,private int index,private java.lang.String[] ipv4,private java.lang.String[] ipv6,private java.lang.String mac,private long mtu,private java.lang.String name,private java.net.NetworkInterface networkInterface,private java.lang.Short[] prefixLengths,private java.lang.Short[] subnetMasks,private final Supplier<java.util.Properties> vmMacAddrProps