[ONOS-3857] BGP update message flow specification components parsing.

Change-Id: I9b58cdf2c47cb736a8119433cbc7911d871a83d1
diff --git a/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/types/NextHop.java b/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/types/NextHop.java
index 806efe5..7e65dc0 100644
--- a/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/types/NextHop.java
+++ b/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/types/NextHop.java
@@ -32,7 +32,7 @@
  */
 public class NextHop implements BgpValueType {
     public static final byte NEXTHOP_TYPE = 3;
-
+    public static final byte FLAGS = (byte) 0x40;
     private boolean isNextHop = false;
     private Ip4Address nextHop;
 
@@ -47,6 +47,14 @@
     }
 
     /**
+     * Constructor to initialize default parameters.
+     *
+     */
+    public NextHop() {
+        this.nextHop = null;
+    }
+
+    /**
      * Returns whether next hop is present.
      *
      * @return whether next hop is present
@@ -103,8 +111,16 @@
 
     @Override
     public int write(ChannelBuffer cb) {
-        //Not required to be implemented now
-        return 0;
+        int iLenStartIndex = cb.writerIndex();
+        cb.writeByte(FLAGS);
+        cb.writeByte(getType());
+        if (!isNextHopSet()) {
+            cb.writeByte(0);
+        } else {
+            cb.writeInt(nextHop.toInt());
+        }
+
+        return cb.writerIndex() - iLenStartIndex;
     }
 
     @Override