Added field getters to class ICMP 58/2358/2
authorNoam Mor <noam.mor@contextream.com>
Mon, 4 Nov 2013 14:22:33 +0000 (16:22 +0200)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 4 Nov 2013 17:51:23 +0000 (17:51 +0000)
Change-Id: I436082be38ae00a1825b2cf83a607786f69cfb72
Signed-off-by: Noam Mor <noam.mor@contextream.com>
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/packet/ICMP.java

index b2a1cfe8c2824b8bfab8a4b737d949e9d67df446..35ae71d0019ed2b0b1d4893c7e47901be6e906ea 100644 (file)
@@ -79,6 +79,15 @@ public class ICMP extends Packet {
         return this;
     }
 
         return this;
     }
 
+    /**
+     * Returns the type field of the current ICMP packet
+     *
+     * @return The type code of the current ICMP packet
+     */
+    public byte getType() {
+        return BitBufferHelper.getByte(fieldValues.get(TYPE));
+    }
+
     /**
      * Sets the ICMP code (type subtype) for the current ICMP object instance
      *
     /**
      * Sets the ICMP code (type subtype) for the current ICMP object instance
      *
@@ -92,6 +101,15 @@ public class ICMP extends Packet {
         return this;
     }
 
         return this;
     }
 
+    /**
+     * Gets the ICMP code (type subtype) for the current ICMP object instance
+     *
+     * @return The ICMP message type subtype
+     */
+    public byte getCode() {
+        return BitBufferHelper.getByte(fieldValues.get(CODE));
+    }
+
     /**
      * Sets the ICMP checksum  for the current ICMP object instance
      * @param short - checksum
     /**
      * Sets the ICMP checksum  for the current ICMP object instance
      * @param short - checksum
@@ -104,7 +122,7 @@ public class ICMP extends Packet {
     }
 
     /**
     }
 
     /**
-     * Sets the ICMP identifier  for the current ICMP object instance
+     * Sets the ICMP identifier for the current ICMP object instance
      * @param short - identifier
      * @return ICMP
      */
      * @param short - identifier
      * @return ICMP
      */
@@ -114,6 +132,16 @@ public class ICMP extends Packet {
         return this;
     }
 
         return this;
     }
 
+    /**
+     * Gets the ICMP identifier of the current ICMP object instance
+     *
+     * @return short - identifier
+     */
+
+    public short getIdentifier() {
+        return BitBufferHelper.getShort(fieldValues.get(IDENTIFIER));
+    }
+
     /**
      * Sets the ICMP sequence number for the current ICMP object instance
      * @param short - seqNumber
     /**
      * Sets the ICMP sequence number for the current ICMP object instance
      * @param short - seqNumber
@@ -125,6 +153,16 @@ public class ICMP extends Packet {
         return this;
     }
 
         return this;
     }
 
+    /**
+     * Gets the ICMP sequence number of the current ICMP object instance
+     *
+     * @return short - seqNumber
+     */
+
+    public short getSequenceNumber() {
+        return BitBufferHelper.getShort(fieldValues.get(SEQNUMBER));
+    }
+
     /**
      * Gets the header size in bits
      * @return The ICMP header size in bits
     /**
      * Gets the header size in bits
      * @return The ICMP header size in bits