📄 interfacelistentry.java
字号:
package dsr;import java.net.*;//this class implements an entry for an interface listclass InterfaceListEntry { public String ifIndex; //index number public String name; //name of the interface //RouteTableEntry routeEntry; public InetAddress ipAddress; //ip address of this interface public DatagramSocket localSocket; //socket that might be associated with this interface //default constructor InterfaceListEntry() {} //constructor InterfaceListEntry(InetAddress ip, String n, String index /*RouteTableEntry tempEntry*/, int port) { ipAddress = ip; name=new String(n); ifIndex= new String(index); //routeEntry = new RouteTableEntry(tempEntry); try { localSocket = new DatagramSocket(port, ip); } catch (SocketException e) {} } //copy constructor InterfaceListEntry(InterfaceListEntry rhs) { this.ifIndex = rhs.ifIndex; this.name = rhs.name; this.ipAddress = rhs.ipAddress; this.localSocket = rhs.localSocket; } //toString function to convert the entry in the displayable sting format public String toString() { String value = "\nIP Address is " + ipAddress.toString() + "\nName of the interface is " + name + "\nInterface index is " + ifIndex; /* + "\nsocket info is " + localSocket.getLocalPort();*/ return value; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -