diff --git a/src/vnet/CMakeLists.txt b/src/vnet/CMakeLists.txt
index ca35d0d..b7a1bbe 100644
--- a/src/vnet/CMakeLists.txt
+++ b/src/vnet/CMakeLists.txt
@@ -607,19 +607,6 @@
 )
 
 ##############################################################################
-# Layer 3 protocol: osi
-##############################################################################
-list(APPEND VNET_SOURCES
-  osi/node.c
-  osi/osi.c
-  osi/pg.c
-)
-
-list(APPEND VNET_HEADERS
-  osi/osi.h
-)
-
-##############################################################################
 # Layer 4 protocol: tcp
 ##############################################################################
 list(APPEND VNET_SOURCES
diff --git a/src/vnet/llc/llc.c b/src/vnet/llc/llc.c
index 4cbf17d..e17eaa6 100644
--- a/src/vnet/llc/llc.c
+++ b/src/vnet/llc/llc.c
@@ -208,7 +208,6 @@
 static clib_error_t *
 llc_init (vlib_main_t * vm)
 {
-  clib_error_t *error;
   llc_main_t *pm = &llc_main;
 
   clib_memset (pm, 0, sizeof (pm[0]));
@@ -221,9 +220,6 @@
   foreach_llc_protocol;
 #undef _
 
-  if ((error = vlib_call_init_function (vm, snap_init)))
-    return error;
-
   return vlib_call_init_function (vm, llc_input_init);
 }
 
diff --git a/src/vnet/llc/node.c b/src/vnet/llc/node.c
index d1ee694..dee0e06 100644
--- a/src/vnet/llc/node.c
+++ b/src/vnet/llc/node.c
@@ -313,10 +313,6 @@
     clib_error_t *error = vlib_call_init_function (vm, llc_input_init);
     if (error)
       clib_error_report (error);
-    /* Otherwise, osi_input_init will wipe out e.g. the snap init */
-    error = vlib_call_init_function (vm, osi_input_init);
-    if (error)
-      clib_error_report (error);
   }
 
   pi = llc_get_protocol_info (lm, protocol);
diff --git a/src/vnet/osi/node.c b/src/vnet/osi/node.c
deleted file mode 100644
index 9edc354..0000000
--- a/src/vnet/osi/node.c
+++ /dev/null
@@ -1,335 +0,0 @@
-/*
- * Copyright (c) 2015 Cisco and/or its affiliates.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at:
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * osi_node.c: osi packet processing
- *
- * Copyright (c) 2010 Eliot Dresselhaus
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- *  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include <vlib/vlib.h>
-#include <vnet/pg/pg.h>
-#include <vnet/osi/osi.h>
-#include <vnet/ppp/ppp.h>
-#include <vnet/hdlc/hdlc.h>
-#include <vnet/llc/llc.h>
-
-#define foreach_osi_input_next			\
-  _ (PUNT, "error-punt")			\
-  _ (DROP, "error-drop")
-
-typedef enum
-{
-#define _(s,n) OSI_INPUT_NEXT_##s,
-  foreach_osi_input_next
-#undef _
-    OSI_INPUT_N_NEXT,
-} osi_input_next_t;
-
-typedef struct
-{
-  u8 packet_data[32];
-} osi_input_trace_t;
-
-static u8 *
-format_osi_input_trace (u8 * s, va_list * va)
-{
-  CLIB_UNUSED (vlib_main_t * vm) = va_arg (*va, vlib_main_t *);
-  CLIB_UNUSED (vlib_node_t * node) = va_arg (*va, vlib_node_t *);
-  osi_input_trace_t *t = va_arg (*va, osi_input_trace_t *);
-
-  s = format (s, "%U", format_osi_header, t->packet_data);
-
-  return s;
-}
-
-static uword
-osi_input (vlib_main_t * vm,
-	   vlib_node_runtime_t * node, vlib_frame_t * from_frame)
-{
-  osi_main_t *lm = &osi_main;
-  u32 n_left_from, next_index, *from, *to_next;
-
-  from = vlib_frame_vector_args (from_frame);
-  n_left_from = from_frame->n_vectors;
-
-  if (node->flags & VLIB_NODE_FLAG_TRACE)
-    vlib_trace_frame_buffers_only (vm, node,
-				   from,
-				   n_left_from,
-				   sizeof (from[0]),
-				   sizeof (osi_input_trace_t));
-
-  next_index = node->cached_next_index;
-
-  while (n_left_from > 0)
-    {
-      u32 n_left_to_next;
-
-      vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
-
-      while (n_left_from >= 4 && n_left_to_next >= 2)
-	{
-	  u32 bi0, bi1;
-	  vlib_buffer_t *b0, *b1;
-	  osi_header_t *h0, *h1;
-	  u8 next0, next1, enqueue_code;
-
-	  /* Prefetch next iteration. */
-	  {
-	    vlib_buffer_t *b2, *b3;
-
-	    b2 = vlib_get_buffer (vm, from[2]);
-	    b3 = vlib_get_buffer (vm, from[3]);
-
-	    vlib_prefetch_buffer_header (b2, LOAD);
-	    vlib_prefetch_buffer_header (b3, LOAD);
-
-	    CLIB_PREFETCH (b2->data, sizeof (h0[0]), LOAD);
-	    CLIB_PREFETCH (b3->data, sizeof (h1[0]), LOAD);
-	  }
-
-	  bi0 = from[0];
-	  bi1 = from[1];
-	  to_next[0] = bi0;
-	  to_next[1] = bi1;
-	  from += 2;
-	  to_next += 2;
-	  n_left_to_next -= 2;
-	  n_left_from -= 2;
-
-	  b0 = vlib_get_buffer (vm, bi0);
-	  b1 = vlib_get_buffer (vm, bi1);
-
-	  h0 = vlib_buffer_get_current (b0);
-	  h1 = vlib_buffer_get_current (b1);
-
-	  next0 = lm->input_next_by_protocol[h0->protocol];
-	  next1 = lm->input_next_by_protocol[h1->protocol];
-
-	  b0->error =
-	    node->errors[next0 ==
-			 OSI_INPUT_NEXT_DROP ? OSI_ERROR_UNKNOWN_PROTOCOL :
-			 OSI_ERROR_NONE];
-	  b1->error =
-	    node->errors[next1 ==
-			 OSI_INPUT_NEXT_DROP ? OSI_ERROR_UNKNOWN_PROTOCOL :
-			 OSI_ERROR_NONE];
-
-	  enqueue_code = (next0 != next_index) + 2 * (next1 != next_index);
-
-	  if (PREDICT_FALSE (enqueue_code != 0))
-	    {
-	      switch (enqueue_code)
-		{
-		case 1:
-		  /* A B A */
-		  to_next[-2] = bi1;
-		  to_next -= 1;
-		  n_left_to_next += 1;
-		  vlib_set_next_frame_buffer (vm, node, next0, bi0);
-		  break;
-
-		case 2:
-		  /* A A B */
-		  to_next -= 1;
-		  n_left_to_next += 1;
-		  vlib_set_next_frame_buffer (vm, node, next1, bi1);
-		  break;
-
-		case 3:
-		  /* A B B or A B C */
-		  to_next -= 2;
-		  n_left_to_next += 2;
-		  vlib_set_next_frame_buffer (vm, node, next0, bi0);
-		  vlib_set_next_frame_buffer (vm, node, next1, bi1);
-		  if (next0 == next1)
-		    {
-		      vlib_put_next_frame (vm, node, next_index,
-					   n_left_to_next);
-		      next_index = next1;
-		      vlib_get_next_frame (vm, node, next_index, to_next,
-					   n_left_to_next);
-		    }
-		}
-	    }
-	}
-
-      while (n_left_from > 0 && n_left_to_next > 0)
-	{
-	  u32 bi0;
-	  vlib_buffer_t *b0;
-	  osi_header_t *h0;
-	  u8 next0;
-
-	  bi0 = from[0];
-	  to_next[0] = bi0;
-	  from += 1;
-	  to_next += 1;
-	  n_left_from -= 1;
-	  n_left_to_next -= 1;
-
-	  b0 = vlib_get_buffer (vm, bi0);
-
-	  h0 = vlib_buffer_get_current (b0);
-
-	  next0 = lm->input_next_by_protocol[h0->protocol];
-
-	  b0->error =
-	    node->errors[next0 ==
-			 OSI_INPUT_NEXT_DROP ? OSI_ERROR_UNKNOWN_PROTOCOL :
-			 OSI_ERROR_NONE];
-
-	  /* Sent packet to wrong next? */
-	  if (PREDICT_FALSE (next0 != next_index))
-	    {
-	      /* Return old frame; remove incorrectly enqueued packet. */
-	      vlib_put_next_frame (vm, node, next_index, n_left_to_next + 1);
-
-	      /* Send to correct next. */
-	      next_index = next0;
-	      vlib_get_next_frame (vm, node, next_index, to_next,
-				   n_left_to_next);
-
-	      to_next[0] = bi0;
-	      to_next += 1;
-	      n_left_to_next -= 1;
-	    }
-	}
-
-      vlib_put_next_frame (vm, node, next_index, n_left_to_next);
-    }
-
-  return from_frame->n_vectors;
-}
-
-static char *osi_error_strings[] = {
-#define _(f,s) s,
-  foreach_osi_error
-#undef _
-};
-
-VLIB_REGISTER_NODE (osi_input_node) = {
-  .function = osi_input,
-  .name = "osi-input",
-  /* Takes a vector of packets. */
-  .vector_size = sizeof (u32),
-
-  .n_errors = OSI_N_ERROR,
-  .error_strings = osi_error_strings,
-
-  .n_next_nodes = OSI_INPUT_N_NEXT,
-  .next_nodes = {
-#define _(s,n) [OSI_INPUT_NEXT_##s] = n,
-    foreach_osi_input_next
-#undef _
-  },
-
-  .format_buffer = format_osi_header_with_length,
-  .format_trace = format_osi_input_trace,
-  .unformat_buffer = unformat_osi_header,
-};
-
-static void
-osi_setup_node (vlib_main_t *vm, u32 node_index)
-{
-  vlib_node_t *n = vlib_get_node (vm, node_index);
-  pg_node_t *pn = pg_get_node (node_index);
-
-  n->format_buffer = format_osi_header_with_length;
-  n->unformat_buffer = unformat_osi_header;
-  pn->unformat_edit = unformat_pg_osi_header;
-}
-
-static clib_error_t *
-osi_input_init (vlib_main_t * vm)
-{
-  clib_error_t *error = 0;
-  osi_main_t *lm = &osi_main;
-
-  if ((error = vlib_call_init_function (vm, osi_init)))
-    return error;
-
-  osi_setup_node (vm, osi_input_node.index);
-
-  {
-    int i;
-    for (i = 0; i < ARRAY_LEN (lm->input_next_by_protocol); i++)
-      lm->input_next_by_protocol[i] = OSI_INPUT_NEXT_DROP;
-  }
-
-  ppp_register_input_protocol (vm, PPP_PROTOCOL_osi, osi_input_node.index);
-  hdlc_register_input_protocol (vm, HDLC_PROTOCOL_osi, osi_input_node.index);
-  llc_register_input_protocol (vm, LLC_PROTOCOL_osi_layer1,
-			       osi_input_node.index);
-  llc_register_input_protocol (vm, LLC_PROTOCOL_osi_layer2,
-			       osi_input_node.index);
-  llc_register_input_protocol (vm, LLC_PROTOCOL_osi_layer3,
-			       osi_input_node.index);
-  llc_register_input_protocol (vm, LLC_PROTOCOL_osi_layer4,
-			       osi_input_node.index);
-  llc_register_input_protocol (vm, LLC_PROTOCOL_osi_layer5,
-			       osi_input_node.index);
-
-  return 0;
-}
-
-VLIB_INIT_FUNCTION (osi_input_init);
-
-void
-osi_register_input_protocol (osi_protocol_t protocol, u32 node_index)
-{
-  osi_main_t *lm = &osi_main;
-  vlib_main_t *vm = lm->vlib_main;
-  osi_protocol_info_t *pi;
-
-  {
-    clib_error_t *error = vlib_call_init_function (vm, osi_input_init);
-    if (error)
-      clib_error_report (error);
-  }
-
-  pi = osi_get_protocol_info (lm, protocol);
-  pi->node_index = node_index;
-  pi->next_index = vlib_node_add_next (vm, osi_input_node.index, node_index);
-
-  lm->input_next_by_protocol[protocol] = pi->next_index;
-}
-
-/*
- * fd.io coding-style-patch-verification: ON
- *
- * Local Variables:
- * eval: (c-set-style "gnu")
- * End:
- */
diff --git a/src/vnet/osi/osi.c b/src/vnet/osi/osi.c
deleted file mode 100644
index 9556481..0000000
--- a/src/vnet/osi/osi.c
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * Copyright (c) 2015 Cisco and/or its affiliates.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at:
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * osi.c: osi support
- *
- * Copyright (c) 2010 Eliot Dresselhaus
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- *  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include <vnet/vnet.h>
-#include <vnet/osi/osi.h>
-
-/* Global main structure. */
-osi_main_t osi_main;
-
-u8 *
-format_osi_protocol (u8 * s, va_list * args)
-{
-  osi_protocol_t p = va_arg (*args, u32);
-  osi_main_t *pm = &osi_main;
-  osi_protocol_info_t *pi = osi_get_protocol_info (pm, p);
-
-  if (pi)
-    s = format (s, "%s", pi->name);
-  else
-    s = format (s, "0x%02x", p);
-
-  return s;
-}
-
-u8 *
-format_osi_header_with_length (u8 * s, va_list * args)
-{
-  osi_main_t *pm = &osi_main;
-  osi_header_t *h = va_arg (*args, osi_header_t *);
-  u32 max_header_bytes = va_arg (*args, u32);
-  osi_protocol_t p = h->protocol;
-  u32 indent, header_bytes;
-
-  header_bytes = sizeof (h[0]);
-  if (max_header_bytes != 0 && header_bytes > max_header_bytes)
-    return format (s, "osi header truncated");
-
-  indent = format_get_indent (s);
-
-  s = format (s, "OSI %U", format_osi_protocol, p);
-
-  if (max_header_bytes != 0 && header_bytes > max_header_bytes)
-    {
-      osi_protocol_info_t *pi = osi_get_protocol_info (pm, p);
-      vlib_node_t *node = vlib_get_node (pm->vlib_main, pi->node_index);
-      if (node->format_buffer)
-	s = format (s, "\n%U%U",
-		    format_white_space, indent,
-		    node->format_buffer, (void *) (h + 1),
-		    max_header_bytes - header_bytes);
-    }
-
-  return s;
-}
-
-u8 *
-format_osi_header (u8 * s, va_list * args)
-{
-  osi_header_t *h = va_arg (*args, osi_header_t *);
-  return format (s, "%U", format_osi_header_with_length, h, 0);
-}
-
-/* Returns osi protocol as an int in host byte order. */
-uword
-unformat_osi_protocol (unformat_input_t * input, va_list * args)
-{
-  u8 *result = va_arg (*args, u8 *);
-  osi_main_t *pm = &osi_main;
-  int p, i;
-
-  /* Numeric type. */
-  if (unformat (input, "0x%x", &p) || unformat (input, "%d", &p))
-    {
-      if (p >= (1 << 8))
-	return 0;
-      *result = p;
-      return 1;
-    }
-
-  /* Named type. */
-  if (unformat_user (input, unformat_vlib_number_by_name,
-		     pm->protocol_info_by_name, &i))
-    {
-      osi_protocol_info_t *pi = vec_elt_at_index (pm->protocol_infos, i);
-      *result = pi->protocol;
-      return 1;
-    }
-
-  return 0;
-}
-
-uword
-unformat_osi_header (unformat_input_t * input, va_list * args)
-{
-  u8 **result = va_arg (*args, u8 **);
-  osi_header_t _h, *h = &_h;
-  u8 p;
-
-  if (!unformat (input, "%U", unformat_osi_protocol, &p))
-    return 0;
-
-  h->protocol = p;
-
-  /* Add header to result. */
-  {
-    void *p;
-    u32 n_bytes = sizeof (h[0]);
-
-    vec_add2 (*result, p, n_bytes);
-    clib_memcpy (p, h, n_bytes);
-  }
-
-  return 1;
-}
-
-static void
-add_protocol (osi_main_t * pm, osi_protocol_t protocol, char *protocol_name)
-{
-  osi_protocol_info_t *pi;
-  u32 i;
-
-  vec_add2 (pm->protocol_infos, pi, 1);
-  i = pi - pm->protocol_infos;
-
-  pi->name = protocol_name;
-  pi->protocol = protocol;
-  pi->next_index = pi->node_index = ~0;
-
-  hash_set (pm->protocol_info_by_protocol, protocol, i);
-  hash_set_mem (pm->protocol_info_by_name, pi->name, i);
-}
-
-static clib_error_t *
-osi_init (vlib_main_t * vm)
-{
-  clib_error_t *error = 0;
-  osi_main_t *pm = &osi_main;
-
-  /* init order dependency: llc_init -> osi_init */
-  if ((error = vlib_call_init_function (vm, llc_init)))
-    return error;
-
-  clib_memset (pm, 0, sizeof (pm[0]));
-  pm->vlib_main = vm;
-
-  pm->protocol_info_by_name = hash_create_string (0, sizeof (uword));
-  pm->protocol_info_by_protocol = hash_create (0, sizeof (uword));
-
-#define _(f,n) add_protocol (pm, OSI_PROTOCOL_##f, #f);
-  foreach_osi_protocol;
-#undef _
-
-  return vlib_call_init_function (vm, osi_input_init);
-}
-
-VLIB_INIT_FUNCTION (osi_init);
-
-
-/*
- * fd.io coding-style-patch-verification: ON
- *
- * Local Variables:
- * eval: (c-set-style "gnu")
- * End:
- */
diff --git a/src/vnet/osi/osi.h b/src/vnet/osi/osi.h
deleted file mode 100644
index fb248ed..0000000
--- a/src/vnet/osi/osi.h
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Copyright (c) 2015 Cisco and/or its affiliates.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at:
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * osi.h: OSI definitions
- *
- * Copyright (c) 2008 Eliot Dresselhaus
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- *  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef included_osi_h
-#define included_osi_h
-
-#include <vnet/vnet.h>
-
-#define foreach_osi_protocol			\
-  _ (null, 0x0)					\
-  _ (x_29, 0x01)				\
-  _ (x_633, 0x03)				\
-  _ (q_931, 0x08)				\
-  _ (q_933, 0x08)				\
-  _ (q_2931, 0x09)				\
-  _ (q_2119, 0x0c)				\
-  _ (snap, 0x80)				\
-  _ (clnp, 0x81)				\
-  _ (esis, 0x82)				\
-  _ (isis, 0x83)				\
-  _ (idrp, 0x85)				\
-  _ (x25_esis, 0x8a)				\
-  _ (iso10030, 0x8c)				\
-  _ (iso11577, 0x8d)				\
-  _ (ip6, 0x8e)					\
-  _ (compressed, 0xb0)				\
-  _ (sndcf, 0xc1)				\
-  _ (ip4, 0xcc)					\
-  _ (ppp, 0xcf)
-
-typedef enum
-{
-#define _(f,n) OSI_PROTOCOL_##f = n,
-  foreach_osi_protocol
-#undef _
-} osi_protocol_t;
-
-typedef struct
-{
-  u8 protocol;
-
-  u8 payload[0];
-} osi_header_t;
-
-typedef struct
-{
-  /* Name (a c string). */
-  char *name;
-
-  /* OSI protocol (SAP type). */
-  osi_protocol_t protocol;
-
-  /* Node which handles this type. */
-  u32 node_index;
-
-  /* Next index for this type. */
-  u32 next_index;
-} osi_protocol_info_t;
-
-#define foreach_osi_error			\
-  _ (NONE, "no error")				\
-  _ (UNKNOWN_PROTOCOL, "unknown osi protocol")
-
-typedef enum
-{
-#define _(f,s) OSI_ERROR_##f,
-  foreach_osi_error
-#undef _
-    OSI_N_ERROR,
-} osi_error_t;
-
-typedef struct
-{
-  vlib_main_t *vlib_main;
-
-  osi_protocol_info_t *protocol_infos;
-
-  /* Hash tables mapping name/protocol to protocol info index. */
-  uword *protocol_info_by_name, *protocol_info_by_protocol;
-
-  /* osi-input next index indexed by protocol. */
-  u8 input_next_by_protocol[256];
-} osi_main_t;
-
-always_inline osi_protocol_info_t *
-osi_get_protocol_info (osi_main_t * m, osi_protocol_t protocol)
-{
-  uword *p = hash_get (m->protocol_info_by_protocol, protocol);
-  return p ? vec_elt_at_index (m->protocol_infos, p[0]) : 0;
-}
-
-extern osi_main_t osi_main;
-
-/* Register given node index to take input for given osi type. */
-void osi_register_input_protocol (osi_protocol_t protocol, u32 node_index);
-
-format_function_t format_osi_protocol;
-format_function_t format_osi_header;
-format_function_t format_osi_header_with_length;
-
-/* Parse osi protocol as 0xXXXX or protocol name. */
-unformat_function_t unformat_osi_protocol;
-
-/* Parse osi header. */
-unformat_function_t unformat_osi_header;
-unformat_function_t unformat_pg_osi_header;
-
-void osi_register_input_protocol (osi_protocol_t protocol, u32 node_index);
-
-format_function_t format_osi_header;
-
-#endif /* included_osi_h */
-
-/*
- * fd.io coding-style-patch-verification: ON
- *
- * Local Variables:
- * eval: (c-set-style "gnu")
- * End:
- */
diff --git a/src/vnet/osi/pg.c b/src/vnet/osi/pg.c
deleted file mode 100644
index c87a869..0000000
--- a/src/vnet/osi/pg.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (c) 2015 Cisco and/or its affiliates.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at:
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * osi_pg.c: packet generator osi interface
- *
- * Copyright (c) 2008 Eliot Dresselhaus
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- *  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include <vlib/vlib.h>
-#include <vnet/pg/pg.h>
-#include <vnet/osi/osi.h>
-
-typedef struct
-{
-  pg_edit_t protocol;
-} pg_osi_header_t;
-
-static inline void
-pg_osi_header_init (pg_osi_header_t * e)
-{
-  pg_edit_init (&e->protocol, osi_header_t, protocol);
-}
-
-uword
-unformat_pg_osi_header (unformat_input_t * input, va_list * args)
-{
-  pg_stream_t *s = va_arg (*args, pg_stream_t *);
-  pg_osi_header_t *h;
-  u32 group_index, error;
-
-  h = pg_create_edit_group (s, sizeof (h[0]), sizeof (osi_header_t),
-			    &group_index);
-  pg_osi_header_init (h);
-
-  error = 1;
-  if (!unformat (input, "%U",
-		 unformat_pg_edit, unformat_osi_protocol, &h->protocol))
-    goto done;
-
-  {
-    osi_main_t *pm = &osi_main;
-    osi_protocol_info_t *pi = 0;
-    pg_node_t *pg_node = 0;
-
-    if (h->protocol.type == PG_EDIT_FIXED)
-      {
-	u8 t = *h->protocol.values[PG_EDIT_LO];
-	pi = osi_get_protocol_info (pm, t);
-	if (pi && pi->node_index != ~0)
-	  pg_node = pg_get_node (pi->node_index);
-      }
-
-    if (pg_node && pg_node->unformat_edit
-	&& unformat_user (input, pg_node->unformat_edit, s))
-      ;
-
-    else if (!unformat_user (input, unformat_pg_payload, s))
-      goto done;
-  }
-
-  error = 0;
-done:
-  if (error)
-    pg_free_edit_group (s);
-  return error == 0;
-}
-
-
-/*
- * fd.io coding-style-patch-verification: ON
- *
- * Local Variables:
- * eval: (c-set-style "gnu")
- * End:
- */
diff --git a/src/vnet/snap/snap.c b/src/vnet/snap/snap.c
index 9bee415..bf59942 100644
--- a/src/vnet/snap/snap.c
+++ b/src/vnet/snap/snap.c
@@ -192,8 +192,9 @@
   return vlib_call_init_function (vm, snap_input_init);
 }
 
-VLIB_INIT_FUNCTION (snap_init);
-
+VLIB_INIT_FUNCTION (snap_init) = {
+  .runs_after = VLIB_INITS ("llc_init"),
+};
 
 /*
  * fd.io coding-style-patch-verification: ON
