#222
diff --git a/src/main/java/net/floodlightcontroller/bgproute/Rib.java b/src/main/java/net/floodlightcontroller/bgproute/Rib.java
new file mode 100644
index 0000000..71868ff
--- /dev/null
+++ b/src/main/java/net/floodlightcontroller/bgproute/Rib.java
@@ -0,0 +1,45 @@
+package net.floodlightcontroller.bgproute;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+
+public class Rib {
+ protected InetAddress routerId;
+ protected InetAddress nextHop;
+ protected int masklen;
+// protected int distance;
+
+ Rib(InetAddress router_id, InetAddress nexthop, int masklen) {
+ this.routerId = router_id;
+ this.nextHop = nexthop;
+ this.masklen = masklen;
+// this.distance = distance;
+ }
+
+ Rib(String router_id, String nexthop, int masklen) {
+ try {
+ this.routerId = InetAddress.getByName(router_id);
+ } catch (UnknownHostException e) {
+ System.out.println("InetAddress exception");
+ }
+ try {
+ this.nextHop = InetAddress.getByName(nexthop);
+ } catch (UnknownHostException e) {
+ System.out.println("InetAddress exception");
+ }
+ this.masklen = masklen;
+ }
+
+ public InetAddress getNextHop() {
+ return nextHop;
+ }
+
+ public int getMasklen(){
+ return masklen;
+ }
+
+ public boolean equals(Rib r) {
+
+ return this.routerId == r.routerId && this.nextHop == r.nextHop && this.masklen == r.masklen;
+ }
+}