snap_input: simplify code using existing functions

Change-Id: Ia0cadebab8b800e34e9574601cdebee5ca90cc6a
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
diff --git a/src/vnet/snap/node.c b/src/vnet/snap/node.c
index 884ff32..9baa750 100644
--- a/src/vnet/snap/node.c
+++ b/src/vnet/snap/node.c
@@ -128,8 +128,8 @@
 	  b0 = vlib_get_buffer (vm, bi0);
 	  b1 = vlib_get_buffer (vm, bi1);
 
-	  h0 = (void *) (b0->data + b0->current_data);
-	  h1 = (void *) (b1->data + b1->current_data);
+	  h0 = vlib_buffer_get_current (b0);
+	  h1 = vlib_buffer_get_current (b1);
 
 	  oui0 = snap_header_get_oui (h0);
 	  oui1 = snap_header_get_oui (h1);
@@ -140,11 +140,8 @@
 	  len0 = sizeof (h0[0]) - (is_ethernet0 ? sizeof (h0->protocol) : 0);
 	  len1 = sizeof (h1[0]) - (is_ethernet1 ? sizeof (h1->protocol) : 0);
 
-	  b0->current_data += len0;
-	  b1->current_data += len1;
-
-	  b0->current_length -= len0;
-	  b1->current_length -= len1;
+	  vlib_buffer_advance (b0, len0);
+	  vlib_buffer_advance (b1, len1);
 
 	  pi0 = snap_get_protocol_info (sm, h0);
 	  pi1 = snap_get_protocol_info (sm, h1);
@@ -216,7 +213,7 @@
 
 	  b0 = vlib_get_buffer (vm, bi0);
 
-	  h0 = (void *) (b0->data + b0->current_data);
+	  h0 = vlib_buffer_get_current (b0);
 
 	  oui0 = snap_header_get_oui (h0);
 
@@ -224,9 +221,7 @@
 
 	  len0 = sizeof (h0[0]) - (is_ethernet0 ? sizeof (h0->protocol) : 0);
 
-	  b0->current_data += len0;
-
-	  b0->current_length -= len0;
+	  vlib_buffer_advance (b0, len0);
 
 	  pi0 = snap_get_protocol_info (sm, h0);