blob: 7ba014b044d4f17fe877a01a65afb0d7ef9baf71 [file] [log] [blame]
package net.floodlightcontroller.bgproute;
import java.net.InetAddress;
import java.net.UnknownHostException;
public class Prefix {
public int masklen;
protected InetAddress address;
Prefix(byte[] addr, int masklen) {
try {
address = InetAddress.getByAddress(addr);
} catch (UnknownHostException e) {
System.out.println("InetAddress exception");
return;
}
this.masklen = masklen;
System.out.println(address.toString() + "/" + masklen);
}
Prefix(String str, int masklen) {
try {
address = InetAddress.getByName(str);
//System.out.println(address.toString());
} catch (UnknownHostException e) {
System.out.println("InetAddress exception");
return;
}
this.masklen = masklen;
}
public byte [] getAddress() {
return address.getAddress();
}
}