⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 floodidqueueentry.java

📁 DSr project for the java applications
💻 JAVA
字号:
package dsr;import java.io.*;import java.util.*;import java.net.*;//this class implements the entry of a FloodIDQueueclass FloodIDQueueEntry {  InetAddress srcIP;      //source IP address. from where the packet was originated  InetAddress dstIP;      //destination IP address, where the packet is headed to  int floodID;            //flood ID of that particular packet  long lifetime;          //the amount fo time this entry is valid  static int tmpID=0;     //static int to generate a unique flood ID  //default constructor  public FloodIDQueueEntry() {}  //constructor  public FloodIDQueueEntry(InetAddress srcIP, InetAddress dstIP, long lifetime) {    floodID = ++tmpID;    this.srcIP = srcIP;    this.dstIP = dstIP;    this.lifetime = lifetime;  }  //copy constructor  public FloodIDQueueEntry (FloodIDQueueEntry rhs) {       srcIP = rhs.srcIP;       dstIP = rhs.dstIP;       floodID = rhs.floodID;       lifetime = rhs.lifetime;  }  //toString method for printing the entries in a string format  public String toString(){    final String EOLN = java.lang.System.getProperty("line.separator");    String value = "flood ID: " + floodID + EOLN +                   "lifetime: " + lifetime + EOLN +                   "Source IP Address: " + srcIP.toString() + EOLN +                   "Destination IP Address: " + dstIP.toString() + EOLN;    return value;  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -