PcapStatEx(pcap_stat_ex stat) { this.rxNumPackets = new BigInteger(stat.rx_packets.toString()); this.txNumPackets = new BigInteger(stat.tx_packets.toString()); this.rxNumBytes = new BigInteger(stat.rx_bytes.toString()); this.txNumBytes = new BigInteger(stat.tx_bytes.toString()); this.rxNumPacketsError = new BigInteger(stat.rx_errors.toString()); this.txNumPacketsError = new BigInteger(stat.tx_errors.toString()); this.rxNumPacketsDropped = new BigInteger(stat.rx_dropped.toString()); this.txNumPacketsDropped = new BigInteger(stat.tx_dropped.toString()); this.rxNumMulticastPackets = new BigInteger(stat.multicast.toString()); this.numCollisions = new BigInteger(stat.collisions.toString()); this.rxNumLenghErrors = new BigInteger(stat.rx_length_errors.toString()); this.txNumOverflowErrors = new BigInteger(stat.rx_over_errors.toString()); this.rxNumCrcErrors = new BigInteger(stat.rx_crc_errors.toString()); this.rxNumFrameErrors = new BigInteger(stat.rx_frame_errors.toString()); this.rxNumFifoErrors = new BigInteger(stat.rx_fifo_errors.toString()); this.rxNumMissedErrors = new BigInteger(stat.rx_missed_errors.toString()); this.txNumAbortedErrors = new BigInteger(stat.tx_aborted_errors.toString()); this.txNumCarrierErrors = new BigInteger(stat.tx_carrier_errors.toString()); this.txNumFifoErrors = new BigInteger(stat.tx_fifo_errors.toString()); this.txNumHeartbeatErrors = new BigInteger(stat.tx_heartbeat_errors.toString()); this.txNumWindowErrors = new BigInteger(stat.tx_window_errors.toString()); }
PcapStatEx(pcap_stat_ex stat) { this.rxNumPackets = new BigInteger(stat.rx_packets.toString()); this.txNumPackets = new BigInteger(stat.tx_packets.toString()); this.rxNumBytes = new BigInteger(stat.rx_bytes.toString()); this.txNumBytes = new BigInteger(stat.tx_bytes.toString()); this.rxNumPacketsError = new BigInteger(stat.rx_errors.toString()); this.txNumPacketsError = new BigInteger(stat.tx_errors.toString()); this.rxNumPacketsDropped = new BigInteger(stat.rx_dropped.toString()); this.txNumPacketsDropped = new BigInteger(stat.tx_dropped.toString()); this.rxNumMulticastPackets = new BigInteger(stat.multicast.toString()); this.numCollisions = new BigInteger(stat.collisions.toString()); this.rxNumLenghErrors = new BigInteger(stat.rx_length_errors.toString()); this.txNumOverflowErrors = new BigInteger(stat.rx_over_errors.toString()); this.rxNumCrcErrors = new BigInteger(stat.rx_crc_errors.toString()); this.rxNumFrameErrors = new BigInteger(stat.rx_frame_errors.toString()); this.rxNumFifoErrors = new BigInteger(stat.rx_fifo_errors.toString()); this.rxNumMissedErrors = new BigInteger(stat.rx_missed_errors.toString()); this.txNumAbortedErrors = new BigInteger(stat.tx_aborted_errors.toString()); this.txNumCarrierErrors = new BigInteger(stat.tx_carrier_errors.toString()); this.txNumFifoErrors = new BigInteger(stat.tx_fifo_errors.toString()); this.txNumHeartbeatErrors = new BigInteger(stat.tx_heartbeat_errors.toString()); this.txNumWindowErrors = new BigInteger(stat.tx_window_errors.toString()); }
/** * Gets Ghostscript revision data. * * @return Revision data. */ public static GhostscriptRevision getRevision() { // prepare revision structure and call revision function GhostscriptLibrary.gsapi_revision_s revision = new GhostscriptLibrary.gsapi_revision_s(); GhostscriptLibrary.instance.gsapi_revision(revision, revision.size()); GhostscriptRevision result = new GhostscriptRevision(); result.setProduct(revision.product); result.setCopyright(revision.copyright); result.setNumber(new Float(revision.revision.floatValue() / 100) .toString()); // parse revision date try { SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); result.setRevisionDate(sdf.parse(revision.revisiondate.toString())); } catch (ParseException e) { result.setRevisionDate(null); } return result; }