text: /* Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University */
  /* Copyright (c) 2011, 2012 Open Networking Foundation */
  /* Copyright (c) 2012, 2013 Big Switch Networks, Inc. */
  /* See the file LICENSE.loci which should have been included in the source distribution */
  #ifdef __GNUC__
  
  #ifdef __linux__
  /* glibc */
  #include <features.h>
  #else
  /* NetBSD etc */
  #include <sys/cdefs.h>
  #ifdef __GNUC_PREREQ__
  #define __GNUC_PREREQ __GNUC_PREREQ__
  #endif
  #endif
  
  #ifndef __GNUC_PREREQ
  /* fallback */
  #define __GNUC_PREREQ(maj, min) 0
  #endif
  
  #if __GNUC_PREREQ(4,6)
  #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
  #endif
  
  #endif
  
  #include "loci_log.h"
  #include "loci_int.h"
  
  void
  of_bsn_tlv_force_link_up_push_wire_types(of_object_t *obj)
  {
      unsigned char *buf = OF_OBJECT_BUFFER_INDEX(obj, 0);
      switch (obj->version) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          *(uint16_t *)(buf + 0) = U16_HTON(0x97); /* type */
          break;
      default:
          UNREACHABLE();
      }
  }
  
  
  
  /**
   * \defgroup of_bsn_tlv_force_link_up of_bsn_tlv_force_link_up
   */
  
  /**
   * Create a new of_bsn_tlv_force_link_up object
   *
   * @param version The wire version to use for the object
   * @return Pointer to the newly create object or NULL on error
   *
   * Initializes the new object with it's default fixed length associating
   * a new underlying wire buffer.
   *
   * \ingroup of_bsn_tlv_force_link_up
   */
  
  of_object_t *
  of_bsn_tlv_force_link_up_new(of_version_t version)
  {
      of_object_t *obj;
      int bytes;
  
      bytes = of_object_fixed_len[version][OF_BSN_TLV_FORCE_LINK_UP];
  
      if ((obj = of_object_new(bytes)) == NULL) {
          return NULL;
      }
  
      of_bsn_tlv_force_link_up_init(obj, version, bytes, 0);
      of_bsn_tlv_force_link_up_push_wire_types(obj);
      of_tlv16_wire_length_set(obj, obj->length);
  
      return obj;
  }
  
  /**
   * Initialize an object of type of_bsn_tlv_force_link_up.
   *
   * @param obj Pointer to the object to initialize
   * @param version The wire version to use for the object
   * @param bytes How many bytes in the object
   * @param clean_wire Boolean: If true, clear the wire object control struct
   *
   * If bytes < 0, then the default fixed length is used for the object
   *
   * This is a "coerce" function that sets up the pointers for the
   * accessors properly.
   *
   * If anything other than 0 is passed in for the buffer size, the underlying
   * wire buffer will have 'grow' called.
   */
  
  void
  of_bsn_tlv_force_link_up_init(of_object_t *obj,
      of_version_t version, int bytes, int clean_wire)
  {
      LOCI_ASSERT(of_object_fixed_len[version][OF_BSN_TLV_FORCE_LINK_UP] >= 0);
      if (clean_wire) {
          MEMSET(obj, 0, sizeof(*obj));
      }
      if (bytes < 0) {
          bytes = of_object_fixed_len[version][OF_BSN_TLV_FORCE_LINK_UP];
      }
      obj->version = version;
      obj->length = bytes;
      obj->object_id = OF_BSN_TLV_FORCE_LINK_UP;
  
      /* Grow the wire buffer */
      if (obj->wbuf != NULL) {
          int tot_bytes;
  
          tot_bytes = bytes + obj->obj_offset;
          of_wire_buffer_grow(obj->wbuf, tot_bytes);
      }
  }
  /* Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University */
  /* Copyright (c) 2011, 2012 Open Networking Foundation */
  /* Copyright (c) 2012, 2013 Big Switch Networks, Inc. */
  /* See the file LICENSE.loci which should have been included in the source distribution */
  #ifdef __GNUC__
  
  #ifdef __linux__
  /* glibc */
  #include <features.h>
  #else
  /* NetBSD etc */
  #include <sys/cdefs.h>
  #ifdef __GNUC_PREREQ__
  #define __GNUC_PREREQ __GNUC_PREREQ__
  #endif
  #endif
  
  #ifndef __GNUC_PREREQ
  /* fallback */
  #define __GNUC_PREREQ(maj, min) 0
  #endif
  
  #if __GNUC_PREREQ(4,6)
  #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
  #endif
  
  #endif
  
  #include "loci_log.h"
  #include "loci_int.h"
  
  void
  of_bsn_tlv_forward_error_correction_push_wire_types(of_object_t *obj)
  {
      unsigned char *buf = OF_OBJECT_BUFFER_INDEX(obj, 0);
      switch (obj->version) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          *(uint16_t *)(buf + 0) = U16_HTON(0x95); /* type */
          break;
      default:
          UNREACHABLE();
      }
  }
  
  
  
  /**
   * \defgroup of_bsn_tlv_forward_error_correction of_bsn_tlv_forward_error_correction
   */
  
  /**
   * Create a new of_bsn_tlv_forward_error_correction object
   *
   * @param version The wire version to use for the object
   * @return Pointer to the newly create object or NULL on error
   *
   * Initializes the new object with it's default fixed length associating
   * a new underlying wire buffer.
   *
   * \ingroup of_bsn_tlv_forward_error_correction
   */
  
  of_object_t *
  of_bsn_tlv_forward_error_correction_new(of_version_t version)
  {
      of_object_t *obj;
      int bytes;
  
      bytes = of_object_fixed_len[version][OF_BSN_TLV_FORWARD_ERROR_CORRECTION];
  
      if ((obj = of_object_new(bytes)) == NULL) {
          return NULL;
      }
  
      of_bsn_tlv_forward_error_correction_init(obj, version, bytes, 0);
      of_bsn_tlv_forward_error_correction_push_wire_types(obj);
      of_tlv16_wire_length_set(obj, obj->length);
  
      return obj;
  }
  
  /**
   * Initialize an object of type of_bsn_tlv_forward_error_correction.
   *
   * @param obj Pointer to the object to initialize
   * @param version The wire version to use for the object
   * @param bytes How many bytes in the object
   * @param clean_wire Boolean: If true, clear the wire object control struct
   *
   * If bytes < 0, then the default fixed length is used for the object
   *
   * This is a "coerce" function that sets up the pointers for the
   * accessors properly.
   *
   * If anything other than 0 is passed in for the buffer size, the underlying
   * wire buffer will have 'grow' called.
   */
  
  void
  of_bsn_tlv_forward_error_correction_init(of_object_t *obj,
      of_version_t version, int bytes, int clean_wire)
  {
      LOCI_ASSERT(of_object_fixed_len[version][OF_BSN_TLV_FORWARD_ERROR_CORRECTION] >= 0);
      if (clean_wire) {
          MEMSET(obj, 0, sizeof(*obj));
      }
      if (bytes < 0) {
          bytes = of_object_fixed_len[version][OF_BSN_TLV_FORWARD_ERROR_CORRECTION];
      }
      obj->version = version;
      obj->length = bytes;
      obj->object_id = OF_BSN_TLV_FORWARD_ERROR_CORRECTION;
  
      /* Grow the wire buffer */
      if (obj->wbuf != NULL) {
          int tot_bytes;
  
          tot_bytes = bytes + obj->obj_offset;
          of_wire_buffer_grow(obj->wbuf, tot_bytes);
      }
  }
  
  /**
   * Get value from an object of type of_bsn_tlv_forward_error_correction.
   * @param obj Pointer to an object of type of_bsn_tlv_forward_error_correction.
   * @param value Pointer to the child object of type
   * uint8_t to be filled out.
   *
   */
  void
  of_bsn_tlv_forward_error_correction_value_get(
      of_bsn_tlv_forward_error_correction_t *obj,
      uint8_t *value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_FORWARD_ERROR_CORRECTION);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u8_get(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  
  /**
   * Set value in an object of type of_bsn_tlv_forward_error_correction.
   * @param obj Pointer to an object of type of_bsn_tlv_forward_error_correction.
   * @param value The value to write into the object
   */
  void
  of_bsn_tlv_forward_error_correction_value_set(
      of_bsn_tlv_forward_error_correction_t *obj,
      uint8_t value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_FORWARD_ERROR_CORRECTION);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u8_set(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  /* Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University */
  /* Copyright (c) 2011, 2012 Open Networking Foundation */
  /* Copyright (c) 2012, 2013 Big Switch Networks, Inc. */
  /* See the file LICENSE.loci which should have been included in the source distribution */
  #ifdef __GNUC__
  
  #ifdef __linux__
  /* glibc */
  #include <features.h>
  #else
  /* NetBSD etc */
  #include <sys/cdefs.h>
  #ifdef __GNUC_PREREQ__
  #define __GNUC_PREREQ __GNUC_PREREQ__
  #endif
  #endif
  
  #ifndef __GNUC_PREREQ
  /* fallback */
  #define __GNUC_PREREQ(maj, min) 0
  #endif
  
  #if __GNUC_PREREQ(4,6)
  #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
  #endif
  
  #endif
  
  #include "loci_log.h"
  #include "loci_int.h"
  
  void
  of_bsn_tlv_free_count_push_wire_types(of_object_t *obj)
  {
      unsigned char *buf = OF_OBJECT_BUFFER_INDEX(obj, 0);
      switch (obj->version) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          *(uint16_t *)(buf + 0) = U16_HTON(0xd7); /* type */
          break;
      default:
          UNREACHABLE();
      }
  }
  
  
  
  /**
   * \defgroup of_bsn_tlv_free_count of_bsn_tlv_free_count
   */
  
  /**
   * Create a new of_bsn_tlv_free_count object
   *
   * @param version The wire version to use for the object
   * @return Pointer to the newly create object or NULL on error
   *
   * Initializes the new object with it's default fixed length associating
   * a new underlying wire buffer.
   *
   * \ingroup of_bsn_tlv_free_count
   */
  
  of_object_t *
  of_bsn_tlv_free_count_new(of_version_t version)
  {
      of_object_t *obj;
      int bytes;
  
      bytes = of_object_fixed_len[version][OF_BSN_TLV_FREE_COUNT];
  
      if ((obj = of_object_new(bytes)) == NULL) {
          return NULL;
      }
  
      of_bsn_tlv_free_count_init(obj, version, bytes, 0);
      of_bsn_tlv_free_count_push_wire_types(obj);
      of_tlv16_wire_length_set(obj, obj->length);
  
      return obj;
  }
  
  /**
   * Initialize an object of type of_bsn_tlv_free_count.
   *
   * @param obj Pointer to the object to initialize
   * @param version The wire version to use for the object
   * @param bytes How many bytes in the object
   * @param clean_wire Boolean: If true, clear the wire object control struct
   *
   * If bytes < 0, then the default fixed length is used for the object
   *
   * This is a "coerce" function that sets up the pointers for the
   * accessors properly.
   *
   * If anything other than 0 is passed in for the buffer size, the underlying
   * wire buffer will have 'grow' called.
   */
  
  void
  of_bsn_tlv_free_count_init(of_object_t *obj,
      of_version_t version, int bytes, int clean_wire)
  {
      LOCI_ASSERT(of_object_fixed_len[version][OF_BSN_TLV_FREE_COUNT] >= 0);
      if (clean_wire) {
          MEMSET(obj, 0, sizeof(*obj));
      }
      if (bytes < 0) {
          bytes = of_object_fixed_len[version][OF_BSN_TLV_FREE_COUNT];
      }
      obj->version = version;
      obj->length = bytes;
      obj->object_id = OF_BSN_TLV_FREE_COUNT;
  
      /* Grow the wire buffer */
      if (obj->wbuf != NULL) {
          int tot_bytes;
  
          tot_bytes = bytes + obj->obj_offset;
          of_wire_buffer_grow(obj->wbuf, tot_bytes);
      }
  }
  
  /**
   * Get value from an object of type of_bsn_tlv_free_count.
   * @param obj Pointer to an object of type of_bsn_tlv_free_count.
   * @param value Pointer to the child object of type
   * uint32_t to be filled out.
   *
   */
  void
  of_bsn_tlv_free_count_value_get(
      of_bsn_tlv_free_count_t *obj,
      uint32_t *value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_FREE_COUNT);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u32_get(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  
  /**
   * Set value in an object of type of_bsn_tlv_free_count.
   * @param obj Pointer to an object of type of_bsn_tlv_free_count.
   * @param value The value to write into the object
   */
  void
  of_bsn_tlv_free_count_value_set(
      of_bsn_tlv_free_count_t *obj,
      uint32_t value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_FREE_COUNT);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u32_set(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  /* Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University */
  /* Copyright (c) 2011, 2012 Open Networking Foundation */
  /* Copyright (c) 2012, 2013 Big Switch Networks, Inc. */
  /* See the file LICENSE.loci which should have been included in the source distribution */
  #ifdef __GNUC__
  
  #ifdef __linux__
  /* glibc */
  #include <features.h>
  #else
  /* NetBSD etc */
  #include <sys/cdefs.h>
  #ifdef __GNUC_PREREQ__
  #define __GNUC_PREREQ __GNUC_PREREQ__
  #endif
  #endif
  
  #ifndef __GNUC_PREREQ
  /* fallback */
  #define __GNUC_PREREQ(maj, min) 0
  #endif
  
  #if __GNUC_PREREQ(4,6)
  #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
  #endif
  
  #endif
  
  #include "loci_log.h"
  #include "loci_int.h"
  
  void
  of_bsn_tlv_generation_id_push_wire_types(of_object_t *obj)
  {
      unsigned char *buf = OF_OBJECT_BUFFER_INDEX(obj, 0);
      switch (obj->version) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          *(uint16_t *)(buf + 0) = U16_HTON(0x50); /* type */
          break;
      default:
          UNREACHABLE();
      }
  }
  
  
  
  /**
   * \defgroup of_bsn_tlv_generation_id of_bsn_tlv_generation_id
   */
  
  /**
   * Create a new of_bsn_tlv_generation_id object
   *
   * @param version The wire version to use for the object
   * @return Pointer to the newly create object or NULL on error
   *
   * Initializes the new object with it's default fixed length associating
   * a new underlying wire buffer.
   *
   * \ingroup of_bsn_tlv_generation_id
   */
  
  of_object_t *
  of_bsn_tlv_generation_id_new(of_version_t version)
  {
      of_object_t *obj;
      int bytes;
  
      bytes = of_object_fixed_len[version][OF_BSN_TLV_GENERATION_ID];
  
      if ((obj = of_object_new(bytes)) == NULL) {
          return NULL;
      }
  
      of_bsn_tlv_generation_id_init(obj, version, bytes, 0);
      of_bsn_tlv_generation_id_push_wire_types(obj);
      of_tlv16_wire_length_set(obj, obj->length);
  
      return obj;
  }
  
  /**
   * Initialize an object of type of_bsn_tlv_generation_id.
   *
   * @param obj Pointer to the object to initialize
   * @param version The wire version to use for the object
   * @param bytes How many bytes in the object
   * @param clean_wire Boolean: If true, clear the wire object control struct
   *
   * If bytes < 0, then the default fixed length is used for the object
   *
   * This is a "coerce" function that sets up the pointers for the
   * accessors properly.
   *
   * If anything other than 0 is passed in for the buffer size, the underlying
   * wire buffer will have 'grow' called.
   */
  
  void
  of_bsn_tlv_generation_id_init(of_object_t *obj,
      of_version_t version, int bytes, int clean_wire)
  {
      LOCI_ASSERT(of_object_fixed_len[version][OF_BSN_TLV_GENERATION_ID] >= 0);
      if (clean_wire) {
          MEMSET(obj, 0, sizeof(*obj));
      }
      if (bytes < 0) {
          bytes = of_object_fixed_len[version][OF_BSN_TLV_GENERATION_ID];
      }
      obj->version = version;
      obj->length = bytes;
      obj->object_id = OF_BSN_TLV_GENERATION_ID;
  
      /* Grow the wire buffer */
      if (obj->wbuf != NULL) {
          int tot_bytes;
  
          tot_bytes = bytes + obj->obj_offset;
          of_wire_buffer_grow(obj->wbuf, tot_bytes);
      }
  }
  
  /**
   * Get value from an object of type of_bsn_tlv_generation_id.
   * @param obj Pointer to an object of type of_bsn_tlv_generation_id.
   * @param value Pointer to the child object of type
   * uint64_t to be filled out.
   *
   */
  void
  of_bsn_tlv_generation_id_value_get(
      of_bsn_tlv_generation_id_t *obj,
      uint64_t *value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_GENERATION_ID);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u64_get(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  
  /**
   * Set value in an object of type of_bsn_tlv_generation_id.
   * @param obj Pointer to an object of type of_bsn_tlv_generation_id.
   * @param value The value to write into the object
   */
  void
  of_bsn_tlv_generation_id_value_set(
      of_bsn_tlv_generation_id_t *obj,
      uint64_t value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_GENERATION_ID);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u64_set(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  /* Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University */
  /* Copyright (c) 2011, 2012 Open Networking Foundation */
  /* Copyright (c) 2012, 2013 Big Switch Networks, Inc. */
  /* See the file LICENSE.loci which should have been included in the source distribution */
  #ifdef __GNUC__
  
  #ifdef __linux__
  /* glibc */
  #include <features.h>
  #else
  /* NetBSD etc */
  #include <sys/cdefs.h>
  #ifdef __GNUC_PREREQ__
  #define __GNUC_PREREQ __GNUC_PREREQ__
  #endif
  #endif
  
  #ifndef __GNUC_PREREQ
  /* fallback */
  #define __GNUC_PREREQ(maj, min) 0
  #endif
  
  #if __GNUC_PREREQ(4,6)
  #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
  #endif
  
  #endif
  
  #include "loci_log.h"
  #include "loci_int.h"
  
  void
  of_bsn_tlv_hash_algorithm_push_wire_types(of_object_t *obj)
  {
      unsigned char *buf = OF_OBJECT_BUFFER_INDEX(obj, 0);
      switch (obj->version) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          *(uint16_t *)(buf + 0) = U16_HTON(0x91); /* type */
          break;
      default:
          UNREACHABLE();
      }
  }
  
  
  
  /**
   * \defgroup of_bsn_tlv_hash_algorithm of_bsn_tlv_hash_algorithm
   */
  
  /**
   * Create a new of_bsn_tlv_hash_algorithm object
   *
   * @param version The wire version to use for the object
   * @return Pointer to the newly create object or NULL on error
   *
   * Initializes the new object with it's default fixed length associating
   * a new underlying wire buffer.
   *
   * \ingroup of_bsn_tlv_hash_algorithm
   */
  
  of_object_t *
  of_bsn_tlv_hash_algorithm_new(of_version_t version)
  {
      of_object_t *obj;
      int bytes;
  
      bytes = of_object_fixed_len[version][OF_BSN_TLV_HASH_ALGORITHM];
  
      if ((obj = of_object_new(bytes)) == NULL) {
          return NULL;
      }
  
      of_bsn_tlv_hash_algorithm_init(obj, version, bytes, 0);
      of_bsn_tlv_hash_algorithm_push_wire_types(obj);
      of_tlv16_wire_length_set(obj, obj->length);
  
      return obj;
  }
  
  /**
   * Initialize an object of type of_bsn_tlv_hash_algorithm.
   *
   * @param obj Pointer to the object to initialize
   * @param version The wire version to use for the object
   * @param bytes How many bytes in the object
   * @param clean_wire Boolean: If true, clear the wire object control struct
   *
   * If bytes < 0, then the default fixed length is used for the object
   *
   * This is a "coerce" function that sets up the pointers for the
   * accessors properly.
   *
   * If anything other than 0 is passed in for the buffer size, the underlying
   * wire buffer will have 'grow' called.
   */
  
  void
  of_bsn_tlv_hash_algorithm_init(of_object_t *obj,
      of_version_t version, int bytes, int clean_wire)
  {
      LOCI_ASSERT(of_object_fixed_len[version][OF_BSN_TLV_HASH_ALGORITHM] >= 0);
      if (clean_wire) {
          MEMSET(obj, 0, sizeof(*obj));
      }
      if (bytes < 0) {
          bytes = of_object_fixed_len[version][OF_BSN_TLV_HASH_ALGORITHM];
      }
      obj->version = version;
      obj->length = bytes;
      obj->object_id = OF_BSN_TLV_HASH_ALGORITHM;
  
      /* Grow the wire buffer */
      if (obj->wbuf != NULL) {
          int tot_bytes;
  
          tot_bytes = bytes + obj->obj_offset;
          of_wire_buffer_grow(obj->wbuf, tot_bytes);
      }
  }
  
  /**
   * Get value from an object of type of_bsn_tlv_hash_algorithm.
   * @param obj Pointer to an object of type of_bsn_tlv_hash_algorithm.
   * @param value Pointer to the child object of type
   * uint16_t to be filled out.
   *
   */
  void
  of_bsn_tlv_hash_algorithm_value_get(
      of_bsn_tlv_hash_algorithm_t *obj,
      uint16_t *value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_HASH_ALGORITHM);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u16_get(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  
  /**
   * Set value in an object of type of_bsn_tlv_hash_algorithm.
   * @param obj Pointer to an object of type of_bsn_tlv_hash_algorithm.
   * @param value The value to write into the object
   */
  void
  of_bsn_tlv_hash_algorithm_value_set(
      of_bsn_tlv_hash_algorithm_t *obj,
      uint16_t value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_HASH_ALGORITHM);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u16_set(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  /* Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University */
  /* Copyright (c) 2011, 2012 Open Networking Foundation */
  /* Copyright (c) 2012, 2013 Big Switch Networks, Inc. */
  /* See the file LICENSE.loci which should have been included in the source distribution */
  #ifdef __GNUC__
  
  #ifdef __linux__
  /* glibc */
  #include <features.h>
  #else
  /* NetBSD etc */
  #include <sys/cdefs.h>
  #ifdef __GNUC_PREREQ__
  #define __GNUC_PREREQ __GNUC_PREREQ__
  #endif
  #endif
  
  #ifndef __GNUC_PREREQ
  /* fallback */
  #define __GNUC_PREREQ(maj, min) 0
  #endif
  
  #if __GNUC_PREREQ(4,6)
  #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
  #endif
  
  #endif
  
  #include "loci_log.h"
  #include "loci_int.h"
  
  void
  of_bsn_tlv_hash_gtp_header_match_push_wire_types(of_object_t *obj)
  {
      unsigned char *buf = OF_OBJECT_BUFFER_INDEX(obj, 0);
      switch (obj->version) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          *(uint16_t *)(buf + 0) = U16_HTON(0x68); /* type */
          break;
      default:
          UNREACHABLE();
      }
  }
  
  
  
  /**
   * \defgroup of_bsn_tlv_hash_gtp_header_match of_bsn_tlv_hash_gtp_header_match
   */
  
  /**
   * Create a new of_bsn_tlv_hash_gtp_header_match object
   *
   * @param version The wire version to use for the object
   * @return Pointer to the newly create object or NULL on error
   *
   * Initializes the new object with it's default fixed length associating
   * a new underlying wire buffer.
   *
   * \ingroup of_bsn_tlv_hash_gtp_header_match
   */
  
  of_object_t *
  of_bsn_tlv_hash_gtp_header_match_new(of_version_t version)
  {
      of_object_t *obj;
      int bytes;
  
      bytes = of_object_fixed_len[version][OF_BSN_TLV_HASH_GTP_HEADER_MATCH];
  
      if ((obj = of_object_new(bytes)) == NULL) {
          return NULL;
      }
  
      of_bsn_tlv_hash_gtp_header_match_init(obj, version, bytes, 0);
      of_bsn_tlv_hash_gtp_header_match_push_wire_types(obj);
      of_tlv16_wire_length_set(obj, obj->length);
  
      return obj;
  }
  
  /**
   * Initialize an object of type of_bsn_tlv_hash_gtp_header_match.
   *
   * @param obj Pointer to the object to initialize
   * @param version The wire version to use for the object
   * @param bytes How many bytes in the object
   * @param clean_wire Boolean: If true, clear the wire object control struct
   *
   * If bytes < 0, then the default fixed length is used for the object
   *
   * This is a "coerce" function that sets up the pointers for the
   * accessors properly.
   *
   * If anything other than 0 is passed in for the buffer size, the underlying
   * wire buffer will have 'grow' called.
   */
  
  void
  of_bsn_tlv_hash_gtp_header_match_init(of_object_t *obj,
      of_version_t version, int bytes, int clean_wire)
  {
      LOCI_ASSERT(of_object_fixed_len[version][OF_BSN_TLV_HASH_GTP_HEADER_MATCH] >= 0);
      if (clean_wire) {
          MEMSET(obj, 0, sizeof(*obj));
      }
      if (bytes < 0) {
          bytes = of_object_fixed_len[version][OF_BSN_TLV_HASH_GTP_HEADER_MATCH];
      }
      obj->version = version;
      obj->length = bytes;
      obj->object_id = OF_BSN_TLV_HASH_GTP_HEADER_MATCH;
  
      /* Grow the wire buffer */
      if (obj->wbuf != NULL) {
          int tot_bytes;
  
          tot_bytes = bytes + obj->obj_offset;
          of_wire_buffer_grow(obj->wbuf, tot_bytes);
      }
  }
  
  /**
   * Get first_header_byte from an object of type of_bsn_tlv_hash_gtp_header_match.
   * @param obj Pointer to an object of type of_bsn_tlv_hash_gtp_header_match.
   * @param first_header_byte Pointer to the child object of type
   * uint8_t to be filled out.
   *
   */
  void
  of_bsn_tlv_hash_gtp_header_match_first_header_byte_get(
      of_bsn_tlv_hash_gtp_header_match_t *obj,
      uint8_t *first_header_byte)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_HASH_GTP_HEADER_MATCH);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u8_get(wbuf, abs_offset, first_header_byte);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  
  /**
   * Set first_header_byte in an object of type of_bsn_tlv_hash_gtp_header_match.
   * @param obj Pointer to an object of type of_bsn_tlv_hash_gtp_header_match.
   * @param first_header_byte The value to write into the object
   */
  void
  of_bsn_tlv_hash_gtp_header_match_first_header_byte_set(
      of_bsn_tlv_hash_gtp_header_match_t *obj,
      uint8_t first_header_byte)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_HASH_GTP_HEADER_MATCH);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u8_set(wbuf, abs_offset, first_header_byte);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  
  /**
   * Get first_header_mask from an object of type of_bsn_tlv_hash_gtp_header_match.
   * @param obj Pointer to an object of type of_bsn_tlv_hash_gtp_header_match.
   * @param first_header_mask Pointer to the child object of type
   * uint8_t to be filled out.
   *
   */
  void
  of_bsn_tlv_hash_gtp_header_match_first_header_mask_get(
      of_bsn_tlv_hash_gtp_header_match_t *obj,
      uint8_t *first_header_mask)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_HASH_GTP_HEADER_MATCH);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 5;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u8_get(wbuf, abs_offset, first_header_mask);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  
  /**
   * Set first_header_mask in an object of type of_bsn_tlv_hash_gtp_header_match.
   * @param obj Pointer to an object of type of_bsn_tlv_hash_gtp_header_match.
   * @param first_header_mask The value to write into the object
   */
  void
  of_bsn_tlv_hash_gtp_header_match_first_header_mask_set(
      of_bsn_tlv_hash_gtp_header_match_t *obj,
      uint8_t first_header_mask)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_HASH_GTP_HEADER_MATCH);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 5;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u8_set(wbuf, abs_offset, first_header_mask);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  /* Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University */
  /* Copyright (c) 2011, 2012 Open Networking Foundation */
  /* Copyright (c) 2012, 2013 Big Switch Networks, Inc. */
  /* See the file LICENSE.loci which should have been included in the source distribution */
  #ifdef __GNUC__
  
  #ifdef __linux__
  /* glibc */
  #include <features.h>
  #else
  /* NetBSD etc */
  #include <sys/cdefs.h>
  #ifdef __GNUC_PREREQ__
  #define __GNUC_PREREQ __GNUC_PREREQ__
  #endif
  #endif
  
  #ifndef __GNUC_PREREQ
  /* fallback */
  #define __GNUC_PREREQ(maj, min) 0
  #endif
  
  #if __GNUC_PREREQ(4,6)
  #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
  #endif
  
  #endif
  
  #include "loci_log.h"
  #include "loci_int.h"
  
  void
  of_bsn_tlv_hash_gtp_port_match_push_wire_types(of_object_t *obj)
  {
      unsigned char *buf = OF_OBJECT_BUFFER_INDEX(obj, 0);
      switch (obj->version) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          *(uint16_t *)(buf + 0) = U16_HTON(0x69); /* type */
          break;
      default:
          UNREACHABLE();
      }
  }
  
  
  
  /**
   * \defgroup of_bsn_tlv_hash_gtp_port_match of_bsn_tlv_hash_gtp_port_match
   */
  
  /**
   * Create a new of_bsn_tlv_hash_gtp_port_match object
   *
   * @param version The wire version to use for the object
   * @return Pointer to the newly create object or NULL on error
   *
   * Initializes the new object with it's default fixed length associating
   * a new underlying wire buffer.
   *
   * \ingroup of_bsn_tlv_hash_gtp_port_match
   */
  
  of_object_t *
  of_bsn_tlv_hash_gtp_port_match_new(of_version_t version)
  {
      of_object_t *obj;
      int bytes;
  
      bytes = of_object_fixed_len[version][OF_BSN_TLV_HASH_GTP_PORT_MATCH];
  
      if ((obj = of_object_new(bytes)) == NULL) {
          return NULL;
      }
  
      of_bsn_tlv_hash_gtp_port_match_init(obj, version, bytes, 0);
      of_bsn_tlv_hash_gtp_port_match_push_wire_types(obj);
      of_tlv16_wire_length_set(obj, obj->length);
  
      return obj;
  }
  
  /**
   * Initialize an object of type of_bsn_tlv_hash_gtp_port_match.
   *
   * @param obj Pointer to the object to initialize
   * @param version The wire version to use for the object
   * @param bytes How many bytes in the object
   * @param clean_wire Boolean: If true, clear the wire object control struct
   *
   * If bytes < 0, then the default fixed length is used for the object
   *
   * This is a "coerce" function that sets up the pointers for the
   * accessors properly.
   *
   * If anything other than 0 is passed in for the buffer size, the underlying
   * wire buffer will have 'grow' called.
   */
  
  void
  of_bsn_tlv_hash_gtp_port_match_init(of_object_t *obj,
      of_version_t version, int bytes, int clean_wire)
  {
      LOCI_ASSERT(of_object_fixed_len[version][OF_BSN_TLV_HASH_GTP_PORT_MATCH] >= 0);
      if (clean_wire) {
          MEMSET(obj, 0, sizeof(*obj));
      }
      if (bytes < 0) {
          bytes = of_object_fixed_len[version][OF_BSN_TLV_HASH_GTP_PORT_MATCH];
      }
      obj->version = version;
      obj->length = bytes;
      obj->object_id = OF_BSN_TLV_HASH_GTP_PORT_MATCH;
  
      /* Grow the wire buffer */
      if (obj->wbuf != NULL) {
          int tot_bytes;
  
          tot_bytes = bytes + obj->obj_offset;
          of_wire_buffer_grow(obj->wbuf, tot_bytes);
      }
  }
  
  /**
   * Get match from an object of type of_bsn_tlv_hash_gtp_port_match.
   * @param obj Pointer to an object of type of_bsn_tlv_hash_gtp_port_match.
   * @param match Pointer to the child object of type
   * uint8_t to be filled out.
   *
   */
  void
  of_bsn_tlv_hash_gtp_port_match_match_get(
      of_bsn_tlv_hash_gtp_port_match_t *obj,
      uint8_t *match)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_HASH_GTP_PORT_MATCH);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u8_get(wbuf, abs_offset, match);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  
  /**
   * Set match in an object of type of_bsn_tlv_hash_gtp_port_match.
   * @param obj Pointer to an object of type of_bsn_tlv_hash_gtp_port_match.
   * @param match The value to write into the object
   */
  void
  of_bsn_tlv_hash_gtp_port_match_match_set(
      of_bsn_tlv_hash_gtp_port_match_t *obj,
      uint8_t match)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_HASH_GTP_PORT_MATCH);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u8_set(wbuf, abs_offset, match);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  
  /**
   * Get src_port from an object of type of_bsn_tlv_hash_gtp_port_match.
   * @param obj Pointer to an object of type of_bsn_tlv_hash_gtp_port_match.
   * @param src_port Pointer to the child object of type
   * uint16_t to be filled out.
   *
   */
  void
  of_bsn_tlv_hash_gtp_port_match_src_port_get(
      of_bsn_tlv_hash_gtp_port_match_t *obj,
      uint16_t *src_port)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_HASH_GTP_PORT_MATCH);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 5;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u16_get(wbuf, abs_offset, src_port);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  
  /**
   * Set src_port in an object of type of_bsn_tlv_hash_gtp_port_match.
   * @param obj Pointer to an object of type of_bsn_tlv_hash_gtp_port_match.
   * @param src_port The value to write into the object
   */
  void
  of_bsn_tlv_hash_gtp_port_match_src_port_set(
      of_bsn_tlv_hash_gtp_port_match_t *obj,
      uint16_t src_port)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_HASH_GTP_PORT_MATCH);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 5;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u16_set(wbuf, abs_offset, src_port);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  
  /**
   * Get dst_port from an object of type of_bsn_tlv_hash_gtp_port_match.
   * @param obj Pointer to an object of type of_bsn_tlv_hash_gtp_port_match.
   * @param dst_port Pointer to the child object of type
   * uint16_t to be filled out.
   *
   */
  void
  of_bsn_tlv_hash_gtp_port_match_dst_port_get(
      of_bsn_tlv_hash_gtp_port_match_t *obj,
      uint16_t *dst_port)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_HASH_GTP_PORT_MATCH);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 7;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u16_get(wbuf, abs_offset, dst_port);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  
  /**
   * Set dst_port in an object of type of_bsn_tlv_hash_gtp_port_match.
   * @param obj Pointer to an object of type of_bsn_tlv_hash_gtp_port_match.
   * @param dst_port The value to write into the object
   */
  void
  of_bsn_tlv_hash_gtp_port_match_dst_port_set(
      of_bsn_tlv_hash_gtp_port_match_t *obj,
      uint16_t dst_port)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_HASH_GTP_PORT_MATCH);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 7;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u16_set(wbuf, abs_offset, dst_port);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  /* Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University */
  /* Copyright (c) 2011, 2012 Open Networking Foundation */
  /* Copyright (c) 2012, 2013 Big Switch Networks, Inc. */
  /* See the file LICENSE.loci which should have been included in the source distribution */
  #ifdef __GNUC__
  
  #ifdef __linux__
  /* glibc */
  #include <features.h>
  #else
  /* NetBSD etc */
  #include <sys/cdefs.h>
  #ifdef __GNUC_PREREQ__
  #define __GNUC_PREREQ __GNUC_PREREQ__
  #endif
  #endif
  
  #ifndef __GNUC_PREREQ
  /* fallback */
  #define __GNUC_PREREQ(maj, min) 0
  #endif
  
  #if __GNUC_PREREQ(4,6)
  #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
  #endif
  
  #endif
  
  #include "loci_log.h"
  #include "loci_int.h"
  
  void
  of_bsn_tlv_hash_packet_field_push_wire_types(of_object_t *obj)
  {
      unsigned char *buf = OF_OBJECT_BUFFER_INDEX(obj, 0);
      switch (obj->version) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          *(uint16_t *)(buf + 0) = U16_HTON(0x67); /* type */
          break;
      default:
          UNREACHABLE();
      }
  }
  
  
  
  /**
   * \defgroup of_bsn_tlv_hash_packet_field of_bsn_tlv_hash_packet_field
   */
  
  /**
   * Create a new of_bsn_tlv_hash_packet_field object
   *
   * @param version The wire version to use for the object
   * @return Pointer to the newly create object or NULL on error
   *
   * Initializes the new object with it's default fixed length associating
   * a new underlying wire buffer.
   *
   * \ingroup of_bsn_tlv_hash_packet_field
   */
  
  of_object_t *
  of_bsn_tlv_hash_packet_field_new(of_version_t version)
  {
      of_object_t *obj;
      int bytes;
  
      bytes = of_object_fixed_len[version][OF_BSN_TLV_HASH_PACKET_FIELD];
  
      if ((obj = of_object_new(bytes)) == NULL) {
          return NULL;
      }
  
      of_bsn_tlv_hash_packet_field_init(obj, version, bytes, 0);
      of_bsn_tlv_hash_packet_field_push_wire_types(obj);
      of_tlv16_wire_length_set(obj, obj->length);
  
      return obj;
  }
  
  /**
   * Initialize an object of type of_bsn_tlv_hash_packet_field.
   *
   * @param obj Pointer to the object to initialize
   * @param version The wire version to use for the object
   * @param bytes How many bytes in the object
   * @param clean_wire Boolean: If true, clear the wire object control struct
   *
   * If bytes < 0, then the default fixed length is used for the object
   *
   * This is a "coerce" function that sets up the pointers for the
   * accessors properly.
   *
   * If anything other than 0 is passed in for the buffer size, the underlying
   * wire buffer will have 'grow' called.
   */
  
  void
  of_bsn_tlv_hash_packet_field_init(of_object_t *obj,
      of_version_t version, int bytes, int clean_wire)
  {
      LOCI_ASSERT(of_object_fixed_len[version][OF_BSN_TLV_HASH_PACKET_FIELD] >= 0);
      if (clean_wire) {
          MEMSET(obj, 0, sizeof(*obj));
      }
      if (bytes < 0) {
          bytes = of_object_fixed_len[version][OF_BSN_TLV_HASH_PACKET_FIELD];
      }
      obj->version = version;
      obj->length = bytes;
      obj->object_id = OF_BSN_TLV_HASH_PACKET_FIELD;
  
      /* Grow the wire buffer */
      if (obj->wbuf != NULL) {
          int tot_bytes;
  
          tot_bytes = bytes + obj->obj_offset;
          of_wire_buffer_grow(obj->wbuf, tot_bytes);
      }
  }
  
  /**
   * Get value from an object of type of_bsn_tlv_hash_packet_field.
   * @param obj Pointer to an object of type of_bsn_tlv_hash_packet_field.
   * @param value Pointer to the child object of type
   * uint64_t to be filled out.
   *
   */
  void
  of_bsn_tlv_hash_packet_field_value_get(
      of_bsn_tlv_hash_packet_field_t *obj,
      uint64_t *value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_HASH_PACKET_FIELD);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u64_get(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  
  /**
   * Set value in an object of type of_bsn_tlv_hash_packet_field.
   * @param obj Pointer to an object of type of_bsn_tlv_hash_packet_field.
   * @param value The value to write into the object
   */
  void
  of_bsn_tlv_hash_packet_field_value_set(
      of_bsn_tlv_hash_packet_field_t *obj,
      uint64_t value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_HASH_PACKET_FIELD);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u64_set(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  /* Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University */
  /* Copyright (c) 2011, 2012 Open Networking Foundation */
  /* Copyright (c) 2012, 2013 Big Switch Networks, Inc. */
  /* See the file LICENSE.loci which should have been included in the source distribution */
  #ifdef __GNUC__
  
  #ifdef __linux__
  /* glibc */
  #include <features.h>
  #else
  /* NetBSD etc */
  #include <sys/cdefs.h>
  #ifdef __GNUC_PREREQ__
  #define __GNUC_PREREQ __GNUC_PREREQ__
  #endif
  #endif
  
  #ifndef __GNUC_PREREQ
  /* fallback */
  #define __GNUC_PREREQ(maj, min) 0
  #endif
  
  #if __GNUC_PREREQ(4,6)
  #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
  #endif
  
  #endif
  
  #include "loci_log.h"
  #include "loci_int.h"
  
  void
  of_bsn_tlv_hash_packet_type_push_wire_types(of_object_t *obj)
  {
      unsigned char *buf = OF_OBJECT_BUFFER_INDEX(obj, 0);
      switch (obj->version) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          *(uint16_t *)(buf + 0) = U16_HTON(0x66); /* type */
          break;
      default:
          UNREACHABLE();
      }
  }
  
  
  
  /**
   * \defgroup of_bsn_tlv_hash_packet_type of_bsn_tlv_hash_packet_type
   */
  
  /**
   * Create a new of_bsn_tlv_hash_packet_type object
   *
   * @param version The wire version to use for the object
   * @return Pointer to the newly create object or NULL on error
   *
   * Initializes the new object with it's default fixed length associating
   * a new underlying wire buffer.
   *
   * \ingroup of_bsn_tlv_hash_packet_type
   */
  
  of_object_t *
  of_bsn_tlv_hash_packet_type_new(of_version_t version)
  {
      of_object_t *obj;
      int bytes;
  
      bytes = of_object_fixed_len[version][OF_BSN_TLV_HASH_PACKET_TYPE];
  
      if ((obj = of_object_new(bytes)) == NULL) {
          return NULL;
      }
  
      of_bsn_tlv_hash_packet_type_init(obj, version, bytes, 0);
      of_bsn_tlv_hash_packet_type_push_wire_types(obj);
      of_tlv16_wire_length_set(obj, obj->length);
  
      return obj;
  }
  
  /**
   * Initialize an object of type of_bsn_tlv_hash_packet_type.
   *
   * @param obj Pointer to the object to initialize
   * @param version The wire version to use for the object
   * @param bytes How many bytes in the object
   * @param clean_wire Boolean: If true, clear the wire object control struct
   *
   * If bytes < 0, then the default fixed length is used for the object
   *
   * This is a "coerce" function that sets up the pointers for the
   * accessors properly.
   *
   * If anything other than 0 is passed in for the buffer size, the underlying
   * wire buffer will have 'grow' called.
   */
  
  void
  of_bsn_tlv_hash_packet_type_init(of_object_t *obj,
      of_version_t version, int bytes, int clean_wire)
  {
      LOCI_ASSERT(of_object_fixed_len[version][OF_BSN_TLV_HASH_PACKET_TYPE] >= 0);
      if (clean_wire) {
          MEMSET(obj, 0, sizeof(*obj));
      }
      if (bytes < 0) {
          bytes = of_object_fixed_len[version][OF_BSN_TLV_HASH_PACKET_TYPE];
      }
      obj->version = version;
      obj->length = bytes;
      obj->object_id = OF_BSN_TLV_HASH_PACKET_TYPE;
  
      /* Grow the wire buffer */
      if (obj->wbuf != NULL) {
          int tot_bytes;
  
          tot_bytes = bytes + obj->obj_offset;
          of_wire_buffer_grow(obj->wbuf, tot_bytes);
      }
  }
  
  /**
   * Get value from an object of type of_bsn_tlv_hash_packet_type.
   * @param obj Pointer to an object of type of_bsn_tlv_hash_packet_type.
   * @param value Pointer to the child object of type
   * uint8_t to be filled out.
   *
   */
  void
  of_bsn_tlv_hash_packet_type_value_get(
      of_bsn_tlv_hash_packet_type_t *obj,
      uint8_t *value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_HASH_PACKET_TYPE);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u8_get(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  
  /**
   * Set value in an object of type of_bsn_tlv_hash_packet_type.
   * @param obj Pointer to an object of type of_bsn_tlv_hash_packet_type.
   * @param value The value to write into the object
   */
  void
  of_bsn_tlv_hash_packet_type_value_set(
      of_bsn_tlv_hash_packet_type_t *obj,
      uint8_t value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_HASH_PACKET_TYPE);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u8_set(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  /* Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University */
  /* Copyright (c) 2011, 2012 Open Networking Foundation */
  /* Copyright (c) 2012, 2013 Big Switch Networks, Inc. */
  /* See the file LICENSE.loci which should have been included in the source distribution */
  #ifdef __GNUC__
  
  #ifdef __linux__
  /* glibc */
  #include <features.h>
  #else
  /* NetBSD etc */
  #include <sys/cdefs.h>
  #ifdef __GNUC_PREREQ__
  #define __GNUC_PREREQ __GNUC_PREREQ__
  #endif
  #endif
  
  #ifndef __GNUC_PREREQ
  /* fallback */
  #define __GNUC_PREREQ(maj, min) 0
  #endif
  
  #if __GNUC_PREREQ(4,6)
  #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
  #endif
  
  #endif
  
  #include "loci_log.h"
  #include "loci_int.h"
  
  void
  of_bsn_tlv_hash_seed_push_wire_types(of_object_t *obj)
  {
      unsigned char *buf = OF_OBJECT_BUFFER_INDEX(obj, 0);
      switch (obj->version) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          *(uint16_t *)(buf + 0) = U16_HTON(0x64); /* type */
          break;
      default:
          UNREACHABLE();
      }
  }
  
  
  
  /**
   * \defgroup of_bsn_tlv_hash_seed of_bsn_tlv_hash_seed
   */
  
  /**
   * Create a new of_bsn_tlv_hash_seed object
   *
   * @param version The wire version to use for the object
   * @return Pointer to the newly create object or NULL on error
   *
   * Initializes the new object with it's default fixed length associating
   * a new underlying wire buffer.
   *
   * \ingroup of_bsn_tlv_hash_seed
   */
  
  of_object_t *
  of_bsn_tlv_hash_seed_new(of_version_t version)
  {
      of_object_t *obj;
      int bytes;
  
      bytes = of_object_fixed_len[version][OF_BSN_TLV_HASH_SEED];
  
      if ((obj = of_object_new(bytes)) == NULL) {
          return NULL;
      }
  
      of_bsn_tlv_hash_seed_init(obj, version, bytes, 0);
      of_bsn_tlv_hash_seed_push_wire_types(obj);
      of_tlv16_wire_length_set(obj, obj->length);
  
      return obj;
  }
  
  /**
   * Initialize an object of type of_bsn_tlv_hash_seed.
   *
   * @param obj Pointer to the object to initialize
   * @param version The wire version to use for the object
   * @param bytes How many bytes in the object
   * @param clean_wire Boolean: If true, clear the wire object control struct
   *
   * If bytes < 0, then the default fixed length is used for the object
   *
   * This is a "coerce" function that sets up the pointers for the
   * accessors properly.
   *
   * If anything other than 0 is passed in for the buffer size, the underlying
   * wire buffer will have 'grow' called.
   */
  
  void
  of_bsn_tlv_hash_seed_init(of_object_t *obj,
      of_version_t version, int bytes, int clean_wire)
  {
      LOCI_ASSERT(of_object_fixed_len[version][OF_BSN_TLV_HASH_SEED] >= 0);
      if (clean_wire) {
          MEMSET(obj, 0, sizeof(*obj));
      }
      if (bytes < 0) {
          bytes = of_object_fixed_len[version][OF_BSN_TLV_HASH_SEED];
      }
      obj->version = version;
      obj->length = bytes;
      obj->object_id = OF_BSN_TLV_HASH_SEED;
  
      /* Grow the wire buffer */
      if (obj->wbuf != NULL) {
          int tot_bytes;
  
          tot_bytes = bytes + obj->obj_offset;
          of_wire_buffer_grow(obj->wbuf, tot_bytes);
      }
  }
  
  /**
   * Get seed1 from an object of type of_bsn_tlv_hash_seed.
   * @param obj Pointer to an object of type of_bsn_tlv_hash_seed.
   * @param seed1 Pointer to the child object of type
   * uint32_t to be filled out.
   *
   */
  void
  of_bsn_tlv_hash_seed_seed1_get(
      of_bsn_tlv_hash_seed_t *obj,
      uint32_t *seed1)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_HASH_SEED);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u32_get(wbuf, abs_offset, seed1);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  
  /**
   * Set seed1 in an object of type of_bsn_tlv_hash_seed.
   * @param obj Pointer to an object of type of_bsn_tlv_hash_seed.
   * @param seed1 The value to write into the object
   */
  void
  of_bsn_tlv_hash_seed_seed1_set(
      of_bsn_tlv_hash_seed_t *obj,
      uint32_t seed1)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_HASH_SEED);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u32_set(wbuf, abs_offset, seed1);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  
  /**
   * Get seed2 from an object of type of_bsn_tlv_hash_seed.
   * @param obj Pointer to an object of type of_bsn_tlv_hash_seed.
   * @param seed2 Pointer to the child object of type
   * uint32_t to be filled out.
   *
   */
  void
  of_bsn_tlv_hash_seed_seed2_get(
      of_bsn_tlv_hash_seed_t *obj,
      uint32_t *seed2)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_HASH_SEED);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 8;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u32_get(wbuf, abs_offset, seed2);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  
  /**
   * Set seed2 in an object of type of_bsn_tlv_hash_seed.
   * @param obj Pointer to an object of type of_bsn_tlv_hash_seed.
   * @param seed2 The value to write into the object
   */
  void
  of_bsn_tlv_hash_seed_seed2_set(
      of_bsn_tlv_hash_seed_t *obj,
      uint32_t seed2)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_HASH_SEED);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 8;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u32_set(wbuf, abs_offset, seed2);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  /* Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University */
  /* Copyright (c) 2011, 2012 Open Networking Foundation */
  /* Copyright (c) 2012, 2013 Big Switch Networks, Inc. */
  /* See the file LICENSE.loci which should have been included in the source distribution */
  #ifdef __GNUC__
  
  #ifdef __linux__
  /* glibc */
  #include <features.h>
  #else
  /* NetBSD etc */
  #include <sys/cdefs.h>
  #ifdef __GNUC_PREREQ__
  #define __GNUC_PREREQ __GNUC_PREREQ__
  #endif
  #endif
  
  #ifndef __GNUC_PREREQ
  /* fallback */
  #define __GNUC_PREREQ(maj, min) 0
  #endif
  
  #if __GNUC_PREREQ(4,6)
  #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
  #endif
  
  #endif
  
  #include "loci_log.h"
  #include "loci_int.h"
  
  void
  of_bsn_tlv_hash_type_push_wire_types(of_object_t *obj)
  {
      unsigned char *buf = OF_OBJECT_BUFFER_INDEX(obj, 0);
      switch (obj->version) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          *(uint16_t *)(buf + 0) = U16_HTON(0x65); /* type */
          break;
      default:
          UNREACHABLE();
      }
  }
  
  
  
  /**
   * \defgroup of_bsn_tlv_hash_type of_bsn_tlv_hash_type
   */
  
  /**
   * Create a new of_bsn_tlv_hash_type object
   *
   * @param version The wire version to use for the object
   * @return Pointer to the newly create object or NULL on error
   *
   * Initializes the new object with it's default fixed length associating
   * a new underlying wire buffer.
   *
   * \ingroup of_bsn_tlv_hash_type
   */
  
  of_object_t *
  of_bsn_tlv_hash_type_new(of_version_t version)
  {
      of_object_t *obj;
      int bytes;
  
      bytes = of_object_fixed_len[version][OF_BSN_TLV_HASH_TYPE];
  
      if ((obj = of_object_new(bytes)) == NULL) {
          return NULL;
      }
  
      of_bsn_tlv_hash_type_init(obj, version, bytes, 0);
      of_bsn_tlv_hash_type_push_wire_types(obj);
      of_tlv16_wire_length_set(obj, obj->length);
  
      return obj;
  }
  
  /**
   * Initialize an object of type of_bsn_tlv_hash_type.
   *
   * @param obj Pointer to the object to initialize
   * @param version The wire version to use for the object
   * @param bytes How many bytes in the object
   * @param clean_wire Boolean: If true, clear the wire object control struct
   *
   * If bytes < 0, then the default fixed length is used for the object
   *
   * This is a "coerce" function that sets up the pointers for the
   * accessors properly.
   *
   * If anything other than 0 is passed in for the buffer size, the underlying
   * wire buffer will have 'grow' called.
   */
  
  void
  of_bsn_tlv_hash_type_init(of_object_t *obj,
      of_version_t version, int bytes, int clean_wire)
  {
      LOCI_ASSERT(of_object_fixed_len[version][OF_BSN_TLV_HASH_TYPE] >= 0);
      if (clean_wire) {
          MEMSET(obj, 0, sizeof(*obj));
      }
      if (bytes < 0) {
          bytes = of_object_fixed_len[version][OF_BSN_TLV_HASH_TYPE];
      }
      obj->version = version;
      obj->length = bytes;
      obj->object_id = OF_BSN_TLV_HASH_TYPE;
  
      /* Grow the wire buffer */
      if (obj->wbuf != NULL) {
          int tot_bytes;
  
          tot_bytes = bytes + obj->obj_offset;
          of_wire_buffer_grow(obj->wbuf, tot_bytes);
      }
  }
  
  /**
   * Get value from an object of type of_bsn_tlv_hash_type.
   * @param obj Pointer to an object of type of_bsn_tlv_hash_type.
   * @param value Pointer to the child object of type
   * uint8_t to be filled out.
   *
   */
  void
  of_bsn_tlv_hash_type_value_get(
      of_bsn_tlv_hash_type_t *obj,
      uint8_t *value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_HASH_TYPE);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u8_get(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  
  /**
   * Set value in an object of type of_bsn_tlv_hash_type.
   * @param obj Pointer to an object of type of_bsn_tlv_hash_type.
   * @param value The value to write into the object
   */
  void
  of_bsn_tlv_hash_type_value_set(
      of_bsn_tlv_hash_type_t *obj,
      uint8_t value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_HASH_TYPE);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u8_set(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  /* Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University */
  /* Copyright (c) 2011, 2012 Open Networking Foundation */
  /* Copyright (c) 2012, 2013 Big Switch Networks, Inc. */
  /* See the file LICENSE.loci which should have been included in the source distribution */
  #ifdef __GNUC__
  
  #ifdef __linux__
  /* glibc */
  #include <features.h>
  #else
  /* NetBSD etc */
  #include <sys/cdefs.h>
  #ifdef __GNUC_PREREQ__
  #define __GNUC_PREREQ __GNUC_PREREQ__
  #endif
  #endif
  
  #ifndef __GNUC_PREREQ
  /* fallback */
  #define __GNUC_PREREQ(maj, min) 0
  #endif
  
  #if __GNUC_PREREQ(4,6)
  #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
  #endif
  
  #endif
  
  #include "loci_log.h"
  #include "loci_int.h"
  
  void
  of_bsn_tlv_header_size_push_wire_types(of_object_t *obj)
  {
      unsigned char *buf = OF_OBJECT_BUFFER_INDEX(obj, 0);
      switch (obj->version) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          *(uint16_t *)(buf + 0) = U16_HTON(0x1f); /* type */
          break;
      default:
          UNREACHABLE();
      }
  }
  
  
  
  /**
   * \defgroup of_bsn_tlv_header_size of_bsn_tlv_header_size
   */
  
  /**
   * Create a new of_bsn_tlv_header_size object
   *
   * @param version The wire version to use for the object
   * @return Pointer to the newly create object or NULL on error
   *
   * Initializes the new object with it's default fixed length associating
   * a new underlying wire buffer.
   *
   * \ingroup of_bsn_tlv_header_size
   */
  
  of_object_t *
  of_bsn_tlv_header_size_new(of_version_t version)
  {
      of_object_t *obj;
      int bytes;
  
      bytes = of_object_fixed_len[version][OF_BSN_TLV_HEADER_SIZE];
  
      if ((obj = of_object_new(bytes)) == NULL) {
          return NULL;
      }
  
      of_bsn_tlv_header_size_init(obj, version, bytes, 0);
      of_bsn_tlv_header_size_push_wire_types(obj);
      of_tlv16_wire_length_set(obj, obj->length);
  
      return obj;
  }
  
  /**
   * Initialize an object of type of_bsn_tlv_header_size.
   *
   * @param obj Pointer to the object to initialize
   * @param version The wire version to use for the object
   * @param bytes How many bytes in the object
   * @param clean_wire Boolean: If true, clear the wire object control struct
   *
   * If bytes < 0, then the default fixed length is used for the object
   *
   * This is a "coerce" function that sets up the pointers for the
   * accessors properly.
   *
   * If anything other than 0 is passed in for the buffer size, the underlying
   * wire buffer will have 'grow' called.
   */
  
  void
  of_bsn_tlv_header_size_init(of_object_t *obj,
      of_version_t version, int bytes, int clean_wire)
  {
      LOCI_ASSERT(of_object_fixed_len[version][OF_BSN_TLV_HEADER_SIZE] >= 0);
      if (clean_wire) {
          MEMSET(obj, 0, sizeof(*obj));
      }
      if (bytes < 0) {
          bytes = of_object_fixed_len[version][OF_BSN_TLV_HEADER_SIZE];
      }
      obj->version = version;
      obj->length = bytes;
      obj->object_id = OF_BSN_TLV_HEADER_SIZE;
  
      /* Grow the wire buffer */
      if (obj->wbuf != NULL) {
          int tot_bytes;
  
          tot_bytes = bytes + obj->obj_offset;
          of_wire_buffer_grow(obj->wbuf, tot_bytes);
      }
  }
  
  /**
   * Get value from an object of type of_bsn_tlv_header_size.
   * @param obj Pointer to an object of type of_bsn_tlv_header_size.
   * @param value Pointer to the child object of type
   * uint32_t to be filled out.
   *
   */
  void
  of_bsn_tlv_header_size_value_get(
      of_bsn_tlv_header_size_t *obj,
      uint32_t *value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_HEADER_SIZE);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u32_get(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  
  /**
   * Set value in an object of type of_bsn_tlv_header_size.
   * @param obj Pointer to an object of type of_bsn_tlv_header_size.
   * @param value The value to write into the object
   */
  void
  of_bsn_tlv_header_size_value_set(
      of_bsn_tlv_header_size_t *obj,
      uint32_t value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_HEADER_SIZE);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u32_set(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  /* Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University */
  /* Copyright (c) 2011, 2012 Open Networking Foundation */
  /* Copyright (c) 2012, 2013 Big Switch Networks, Inc. */
  /* See the file LICENSE.loci which should have been included in the source distribution */
  #ifdef __GNUC__
  
  #ifdef __linux__
  /* glibc */
  #include <features.h>
  #else
  /* NetBSD etc */
  #include <sys/cdefs.h>
  #ifdef __GNUC_PREREQ__
  #define __GNUC_PREREQ __GNUC_PREREQ__
  #endif
  #endif
  
  #ifndef __GNUC_PREREQ
  /* fallback */
  #define __GNUC_PREREQ(maj, min) 0
  #endif
  
  #if __GNUC_PREREQ(4,6)
  #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
  #endif
  
  #endif
  
  #include "loci_log.h"
  #include "loci_int.h"
  
  void
  of_bsn_tlv_icmp_code_push_wire_types(of_object_t *obj)
  {
      unsigned char *buf = OF_OBJECT_BUFFER_INDEX(obj, 0);
      switch (obj->version) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          *(uint16_t *)(buf + 0) = U16_HTON(0x45); /* type */
          break;
      default:
          UNREACHABLE();
      }
  }
  
  
  
  /**
   * \defgroup of_bsn_tlv_icmp_code of_bsn_tlv_icmp_code
   */
  
  /**
   * Create a new of_bsn_tlv_icmp_code object
   *
   * @param version The wire version to use for the object
   * @return Pointer to the newly create object or NULL on error
   *
   * Initializes the new object with it's default fixed length associating
   * a new underlying wire buffer.
   *
   * \ingroup of_bsn_tlv_icmp_code
   */
  
  of_object_t *
  of_bsn_tlv_icmp_code_new(of_version_t version)
  {
      of_object_t *obj;
      int bytes;
  
      bytes = of_object_fixed_len[version][OF_BSN_TLV_ICMP_CODE];
  
      if ((obj = of_object_new(bytes)) == NULL) {
          return NULL;
      }
  
      of_bsn_tlv_icmp_code_init(obj, version, bytes, 0);
      of_bsn_tlv_icmp_code_push_wire_types(obj);
      of_tlv16_wire_length_set(obj, obj->length);
  
      return obj;
  }
  
  /**
   * Initialize an object of type of_bsn_tlv_icmp_code.
   *
   * @param obj Pointer to the object to initialize
   * @param version The wire version to use for the object
   * @param bytes How many bytes in the object
   * @param clean_wire Boolean: If true, clear the wire object control struct
   *
   * If bytes < 0, then the default fixed length is used for the object
   *
   * This is a "coerce" function that sets up the pointers for the
   * accessors properly.
   *
   * If anything other than 0 is passed in for the buffer size, the underlying
   * wire buffer will have 'grow' called.
   */
  
  void
  of_bsn_tlv_icmp_code_init(of_object_t *obj,
      of_version_t version, int bytes, int clean_wire)
  {
      LOCI_ASSERT(of_object_fixed_len[version][OF_BSN_TLV_ICMP_CODE] >= 0);
      if (clean_wire) {
          MEMSET(obj, 0, sizeof(*obj));
      }
      if (bytes < 0) {
          bytes = of_object_fixed_len[version][OF_BSN_TLV_ICMP_CODE];
      }
      obj->version = version;
      obj->length = bytes;
      obj->object_id = OF_BSN_TLV_ICMP_CODE;
  
      /* Grow the wire buffer */
      if (obj->wbuf != NULL) {
          int tot_bytes;
  
          tot_bytes = bytes + obj->obj_offset;
          of_wire_buffer_grow(obj->wbuf, tot_bytes);
      }
  }
  
  /**
   * Get value from an object of type of_bsn_tlv_icmp_code.
   * @param obj Pointer to an object of type of_bsn_tlv_icmp_code.
   * @param value Pointer to the child object of type
   * uint8_t to be filled out.
   *
   */
  void
  of_bsn_tlv_icmp_code_value_get(
      of_bsn_tlv_icmp_code_t *obj,
      uint8_t *value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_ICMP_CODE);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u8_get(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  
  /**
   * Set value in an object of type of_bsn_tlv_icmp_code.
   * @param obj Pointer to an object of type of_bsn_tlv_icmp_code.
   * @param value The value to write into the object
   */
  void
  of_bsn_tlv_icmp_code_value_set(
      of_bsn_tlv_icmp_code_t *obj,
      uint8_t value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_ICMP_CODE);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u8_set(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  /* Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University */
  /* Copyright (c) 2011, 2012 Open Networking Foundation */
  /* Copyright (c) 2012, 2013 Big Switch Networks, Inc. */
  /* See the file LICENSE.loci which should have been included in the source distribution */
  #ifdef __GNUC__
  
  #ifdef __linux__
  /* glibc */
  #include <features.h>
  #else
  /* NetBSD etc */
  #include <sys/cdefs.h>
  #ifdef __GNUC_PREREQ__
  #define __GNUC_PREREQ __GNUC_PREREQ__
  #endif
  #endif
  
  #ifndef __GNUC_PREREQ
  /* fallback */
  #define __GNUC_PREREQ(maj, min) 0
  #endif
  
  #if __GNUC_PREREQ(4,6)
  #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
  #endif
  
  #endif
  
  #include "loci_log.h"
  #include "loci_int.h"
  
  void
  of_bsn_tlv_icmp_id_push_wire_types(of_object_t *obj)
  {
      unsigned char *buf = OF_OBJECT_BUFFER_INDEX(obj, 0);
      switch (obj->version) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          *(uint16_t *)(buf + 0) = U16_HTON(0x46); /* type */
          break;
      default:
          UNREACHABLE();
      }
  }
  
  
  
  /**
   * \defgroup of_bsn_tlv_icmp_id of_bsn_tlv_icmp_id
   */
  
  /**
   * Create a new of_bsn_tlv_icmp_id object
   *
   * @param version The wire version to use for the object
   * @return Pointer to the newly create object or NULL on error
   *
   * Initializes the new object with it's default fixed length associating
   * a new underlying wire buffer.
   *
   * \ingroup of_bsn_tlv_icmp_id
   */
  
  of_object_t *
  of_bsn_tlv_icmp_id_new(of_version_t version)
  {
      of_object_t *obj;
      int bytes;
  
      bytes = of_object_fixed_len[version][OF_BSN_TLV_ICMP_ID];
  
      if ((obj = of_object_new(bytes)) == NULL) {
          return NULL;
      }
  
      of_bsn_tlv_icmp_id_init(obj, version, bytes, 0);
      of_bsn_tlv_icmp_id_push_wire_types(obj);
      of_tlv16_wire_length_set(obj, obj->length);
  
      return obj;
  }
  
  /**
   * Initialize an object of type of_bsn_tlv_icmp_id.
   *
   * @param obj Pointer to the object to initialize
   * @param version The wire version to use for the object
   * @param bytes How many bytes in the object
   * @param clean_wire Boolean: If true, clear the wire object control struct
   *
   * If bytes < 0, then the default fixed length is used for the object
   *
   * This is a "coerce" function that sets up the pointers for the
   * accessors properly.
   *
   * If anything other than 0 is passed in for the buffer size, the underlying
   * wire buffer will have 'grow' called.
   */
  
  void
  of_bsn_tlv_icmp_id_init(of_object_t *obj,
      of_version_t version, int bytes, int clean_wire)
  {
      LOCI_ASSERT(of_object_fixed_len[version][OF_BSN_TLV_ICMP_ID] >= 0);
      if (clean_wire) {
          MEMSET(obj, 0, sizeof(*obj));
      }
      if (bytes < 0) {
          bytes = of_object_fixed_len[version][OF_BSN_TLV_ICMP_ID];
      }
      obj->version = version;
      obj->length = bytes;
      obj->object_id = OF_BSN_TLV_ICMP_ID;
  
      /* Grow the wire buffer */
      if (obj->wbuf != NULL) {
          int tot_bytes;
  
          tot_bytes = bytes + obj->obj_offset;
          of_wire_buffer_grow(obj->wbuf, tot_bytes);
      }
  }
  
  /**
   * Get value from an object of type of_bsn_tlv_icmp_id.
   * @param obj Pointer to an object of type of_bsn_tlv_icmp_id.
   * @param value Pointer to the child object of type
   * uint16_t to be filled out.
   *
   */
  void
  of_bsn_tlv_icmp_id_value_get(
      of_bsn_tlv_icmp_id_t *obj,
      uint16_t *value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_ICMP_ID);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u16_get(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  
  /**
   * Set value in an object of type of_bsn_tlv_icmp_id.
   * @param obj Pointer to an object of type of_bsn_tlv_icmp_id.
   * @param value The value to write into the object
   */
  void
  of_bsn_tlv_icmp_id_value_set(
      of_bsn_tlv_icmp_id_t *obj,
      uint16_t value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_ICMP_ID);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u16_set(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  /* Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University */
  /* Copyright (c) 2011, 2012 Open Networking Foundation */
  /* Copyright (c) 2012, 2013 Big Switch Networks, Inc. */
  /* See the file LICENSE.loci which should have been included in the source distribution */
  #ifdef __GNUC__
  
  #ifdef __linux__
  /* glibc */
  #include <features.h>
  #else
  /* NetBSD etc */
  #include <sys/cdefs.h>
  #ifdef __GNUC_PREREQ__
  #define __GNUC_PREREQ __GNUC_PREREQ__
  #endif
  #endif
  
  #ifndef __GNUC_PREREQ
  /* fallback */
  #define __GNUC_PREREQ(maj, min) 0
  #endif
  
  #if __GNUC_PREREQ(4,6)
  #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
  #endif
  
  #endif
  
  #include "loci_log.h"
  #include "loci_int.h"
  
  void
  of_bsn_tlv_icmp_type_push_wire_types(of_object_t *obj)
  {
      unsigned char *buf = OF_OBJECT_BUFFER_INDEX(obj, 0);
      switch (obj->version) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          *(uint16_t *)(buf + 0) = U16_HTON(0x44); /* type */
          break;
      default:
          UNREACHABLE();
      }
  }
  
  
  
  /**
   * \defgroup of_bsn_tlv_icmp_type of_bsn_tlv_icmp_type
   */
  
  /**
   * Create a new of_bsn_tlv_icmp_type object
   *
   * @param version The wire version to use for the object
   * @return Pointer to the newly create object or NULL on error
   *
   * Initializes the new object with it's default fixed length associating
   * a new underlying wire buffer.
   *
   * \ingroup of_bsn_tlv_icmp_type
   */
  
  of_object_t *
  of_bsn_tlv_icmp_type_new(of_version_t version)
  {
      of_object_t *obj;
      int bytes;
  
      bytes = of_object_fixed_len[version][OF_BSN_TLV_ICMP_TYPE];
  
      if ((obj = of_object_new(bytes)) == NULL) {
          return NULL;
      }
  
      of_bsn_tlv_icmp_type_init(obj, version, bytes, 0);
      of_bsn_tlv_icmp_type_push_wire_types(obj);
      of_tlv16_wire_length_set(obj, obj->length);
  
      return obj;
  }
  
  /**
   * Initialize an object of type of_bsn_tlv_icmp_type.
   *
   * @param obj Pointer to the object to initialize
   * @param version The wire version to use for the object
   * @param bytes How many bytes in the object
   * @param clean_wire Boolean: If true, clear the wire object control struct
   *
   * If bytes < 0, then the default fixed length is used for the object
   *
   * This is a "coerce" function that sets up the pointers for the
   * accessors properly.
   *
   * If anything other than 0 is passed in for the buffer size, the underlying
   * wire buffer will have 'grow' called.
   */
  
  void
  of_bsn_tlv_icmp_type_init(of_object_t *obj,
      of_version_t version, int bytes, int clean_wire)
  {
      LOCI_ASSERT(of_object_fixed_len[version][OF_BSN_TLV_ICMP_TYPE] >= 0);
      if (clean_wire) {
          MEMSET(obj, 0, sizeof(*obj));
      }
      if (bytes < 0) {
          bytes = of_object_fixed_len[version][OF_BSN_TLV_ICMP_TYPE];
      }
      obj->version = version;
      obj->length = bytes;
      obj->object_id = OF_BSN_TLV_ICMP_TYPE;
  
      /* Grow the wire buffer */
      if (obj->wbuf != NULL) {
          int tot_bytes;
  
          tot_bytes = bytes + obj->obj_offset;
          of_wire_buffer_grow(obj->wbuf, tot_bytes);
      }
  }
  
  /**
   * Get value from an object of type of_bsn_tlv_icmp_type.
   * @param obj Pointer to an object of type of_bsn_tlv_icmp_type.
   * @param value Pointer to the child object of type
   * uint8_t to be filled out.
   *
   */
  void
  of_bsn_tlv_icmp_type_value_get(
      of_bsn_tlv_icmp_type_t *obj,
      uint8_t *value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_ICMP_TYPE);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u8_get(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  
  /**
   * Set value in an object of type of_bsn_tlv_icmp_type.
   * @param obj Pointer to an object of type of_bsn_tlv_icmp_type.
   * @param value The value to write into the object
   */
  void
  of_bsn_tlv_icmp_type_value_set(
      of_bsn_tlv_icmp_type_t *obj,
      uint8_t value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_ICMP_TYPE);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u8_set(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  /* Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University */
  /* Copyright (c) 2011, 2012 Open Networking Foundation */
  /* Copyright (c) 2012, 2013 Big Switch Networks, Inc. */
  /* See the file LICENSE.loci which should have been included in the source distribution */
  #ifdef __GNUC__
  
  #ifdef __linux__
  /* glibc */
  #include <features.h>
  #else
  /* NetBSD etc */
  #include <sys/cdefs.h>
  #ifdef __GNUC_PREREQ__
  #define __GNUC_PREREQ __GNUC_PREREQ__
  #endif
  #endif
  
  #ifndef __GNUC_PREREQ
  /* fallback */
  #define __GNUC_PREREQ(maj, min) 0
  #endif
  
  #if __GNUC_PREREQ(4,6)
  #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
  #endif
  
  #endif
  
  #include "loci_log.h"
  #include "loci_int.h"
  
  void
  of_bsn_tlv_icmpv6_chksum_push_wire_types(of_object_t *obj)
  {
      unsigned char *buf = OF_OBJECT_BUFFER_INDEX(obj, 0);
      switch (obj->version) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          *(uint16_t *)(buf + 0) = U16_HTON(0x7d); /* type */
          break;
      default:
          UNREACHABLE();
      }
  }
  
  
  
  /**
   * \defgroup of_bsn_tlv_icmpv6_chksum of_bsn_tlv_icmpv6_chksum
   */
  
  /**
   * Create a new of_bsn_tlv_icmpv6_chksum object
   *
   * @param version The wire version to use for the object
   * @return Pointer to the newly create object or NULL on error
   *
   * Initializes the new object with it's default fixed length associating
   * a new underlying wire buffer.
   *
   * \ingroup of_bsn_tlv_icmpv6_chksum
   */
  
  of_object_t *
  of_bsn_tlv_icmpv6_chksum_new(of_version_t version)
  {
      of_object_t *obj;
      int bytes;
  
      bytes = of_object_fixed_len[version][OF_BSN_TLV_ICMPV6_CHKSUM];
  
      if ((obj = of_object_new(bytes)) == NULL) {
          return NULL;
      }
  
      of_bsn_tlv_icmpv6_chksum_init(obj, version, bytes, 0);
      of_bsn_tlv_icmpv6_chksum_push_wire_types(obj);
      of_tlv16_wire_length_set(obj, obj->length);
  
      return obj;
  }
  
  /**
   * Initialize an object of type of_bsn_tlv_icmpv6_chksum.
   *
   * @param obj Pointer to the object to initialize
   * @param version The wire version to use for the object
   * @param bytes How many bytes in the object
   * @param clean_wire Boolean: If true, clear the wire object control struct
   *
   * If bytes < 0, then the default fixed length is used for the object
   *
   * This is a "coerce" function that sets up the pointers for the
   * accessors properly.
   *
   * If anything other than 0 is passed in for the buffer size, the underlying
   * wire buffer will have 'grow' called.
   */
  
  void
  of_bsn_tlv_icmpv6_chksum_init(of_object_t *obj,
      of_version_t version, int bytes, int clean_wire)
  {
      LOCI_ASSERT(of_object_fixed_len[version][OF_BSN_TLV_ICMPV6_CHKSUM] >= 0);
      if (clean_wire) {
          MEMSET(obj, 0, sizeof(*obj));
      }
      if (bytes < 0) {
          bytes = of_object_fixed_len[version][OF_BSN_TLV_ICMPV6_CHKSUM];
      }
      obj->version = version;
      obj->length = bytes;
      obj->object_id = OF_BSN_TLV_ICMPV6_CHKSUM;
  
      /* Grow the wire buffer */
      if (obj->wbuf != NULL) {
          int tot_bytes;
  
          tot_bytes = bytes + obj->obj_offset;
          of_wire_buffer_grow(obj->wbuf, tot_bytes);
      }
  }
  
  /**
   * Get value from an object of type of_bsn_tlv_icmpv6_chksum.
   * @param obj Pointer to an object of type of_bsn_tlv_icmpv6_chksum.
   * @param value Pointer to the child object of type
   * uint16_t to be filled out.
   *
   */
  void
  of_bsn_tlv_icmpv6_chksum_value_get(
      of_bsn_tlv_icmpv6_chksum_t *obj,
      uint16_t *value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_ICMPV6_CHKSUM);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u16_get(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  
  /**
   * Set value in an object of type of_bsn_tlv_icmpv6_chksum.
   * @param obj Pointer to an object of type of_bsn_tlv_icmpv6_chksum.
   * @param value The value to write into the object
   */
  void
  of_bsn_tlv_icmpv6_chksum_value_set(
      of_bsn_tlv_icmpv6_chksum_t *obj,
      uint16_t value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_ICMPV6_CHKSUM);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u16_set(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  /* Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University */
  /* Copyright (c) 2011, 2012 Open Networking Foundation */
  /* Copyright (c) 2012, 2013 Big Switch Networks, Inc. */
  /* See the file LICENSE.loci which should have been included in the source distribution */
  #ifdef __GNUC__
  
  #ifdef __linux__
  /* glibc */
  #include <features.h>
  #else
  /* NetBSD etc */
  #include <sys/cdefs.h>
  #ifdef __GNUC_PREREQ__
  #define __GNUC_PREREQ __GNUC_PREREQ__
  #endif
  #endif
  
  #ifndef __GNUC_PREREQ
  /* fallback */
  #define __GNUC_PREREQ(maj, min) 0
  #endif
  
  #if __GNUC_PREREQ(4,6)
  #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
  #endif
  
  #endif
  
  #include "loci_log.h"
  #include "loci_int.h"
  
  void
  of_bsn_tlv_icmpv6_code_push_wire_types(of_object_t *obj)
  {
      unsigned char *buf = OF_OBJECT_BUFFER_INDEX(obj, 0);
      switch (obj->version) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          *(uint16_t *)(buf + 0) = U16_HTON(0xcd); /* type */
          break;
      default:
          UNREACHABLE();
      }
  }
  
  
  
  /**
   * \defgroup of_bsn_tlv_icmpv6_code of_bsn_tlv_icmpv6_code
   */
  
  /**
   * Create a new of_bsn_tlv_icmpv6_code object
   *
   * @param version The wire version to use for the object
   * @return Pointer to the newly create object or NULL on error
   *
   * Initializes the new object with it's default fixed length associating
   * a new underlying wire buffer.
   *
   * \ingroup of_bsn_tlv_icmpv6_code
   */
  
  of_object_t *
  of_bsn_tlv_icmpv6_code_new(of_version_t version)
  {
      of_object_t *obj;
      int bytes;
  
      bytes = of_object_fixed_len[version][OF_BSN_TLV_ICMPV6_CODE];
  
      if ((obj = of_object_new(bytes)) == NULL) {
          return NULL;
      }
  
      of_bsn_tlv_icmpv6_code_init(obj, version, bytes, 0);
      of_bsn_tlv_icmpv6_code_push_wire_types(obj);
      of_tlv16_wire_length_set(obj, obj->length);
  
      return obj;
  }
  
  /**
   * Initialize an object of type of_bsn_tlv_icmpv6_code.
   *
   * @param obj Pointer to the object to initialize
   * @param version The wire version to use for the object
   * @param bytes How many bytes in the object
   * @param clean_wire Boolean: If true, clear the wire object control struct
   *
   * If bytes < 0, then the default fixed length is used for the object
   *
   * This is a "coerce" function that sets up the pointers for the
   * accessors properly.
   *
   * If anything other than 0 is passed in for the buffer size, the underlying
   * wire buffer will have 'grow' called.
   */
  
  void
  of_bsn_tlv_icmpv6_code_init(of_object_t *obj,
      of_version_t version, int bytes, int clean_wire)
  {
      LOCI_ASSERT(of_object_fixed_len[version][OF_BSN_TLV_ICMPV6_CODE] >= 0);
      if (clean_wire) {
          MEMSET(obj, 0, sizeof(*obj));
      }
      if (bytes < 0) {
          bytes = of_object_fixed_len[version][OF_BSN_TLV_ICMPV6_CODE];
      }
      obj->version = version;
      obj->length = bytes;
      obj->object_id = OF_BSN_TLV_ICMPV6_CODE;
  
      /* Grow the wire buffer */
      if (obj->wbuf != NULL) {
          int tot_bytes;
  
          tot_bytes = bytes + obj->obj_offset;
          of_wire_buffer_grow(obj->wbuf, tot_bytes);
      }
  }
  
  /**
   * Get value from an object of type of_bsn_tlv_icmpv6_code.
   * @param obj Pointer to an object of type of_bsn_tlv_icmpv6_code.
   * @param value Pointer to the child object of type
   * uint8_t to be filled out.
   *
   */
  void
  of_bsn_tlv_icmpv6_code_value_get(
      of_bsn_tlv_icmpv6_code_t *obj,
      uint8_t *value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_ICMPV6_CODE);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u8_get(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  
  /**
   * Set value in an object of type of_bsn_tlv_icmpv6_code.
   * @param obj Pointer to an object of type of_bsn_tlv_icmpv6_code.
   * @param value The value to write into the object
   */
  void
  of_bsn_tlv_icmpv6_code_value_set(
      of_bsn_tlv_icmpv6_code_t *obj,
      uint8_t value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_ICMPV6_CODE);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u8_set(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  /* Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University */
  /* Copyright (c) 2011, 2012 Open Networking Foundation */
  /* Copyright (c) 2012, 2013 Big Switch Networks, Inc. */
  /* See the file LICENSE.loci which should have been included in the source distribution */
  #ifdef __GNUC__
  
  #ifdef __linux__
  /* glibc */
  #include <features.h>
  #else
  /* NetBSD etc */
  #include <sys/cdefs.h>
  #ifdef __GNUC_PREREQ__
  #define __GNUC_PREREQ __GNUC_PREREQ__
  #endif
  #endif
  
  #ifndef __GNUC_PREREQ
  /* fallback */
  #define __GNUC_PREREQ(maj, min) 0
  #endif
  
  #if __GNUC_PREREQ(4,6)
  #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
  #endif
  
  #endif
  
  #include "loci_log.h"
  #include "loci_int.h"
  
  void
  of_bsn_tlv_icmpv6_type_push_wire_types(of_object_t *obj)
  {
      unsigned char *buf = OF_OBJECT_BUFFER_INDEX(obj, 0);
      switch (obj->version) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          *(uint16_t *)(buf + 0) = U16_HTON(0xcc); /* type */
          break;
      default:
          UNREACHABLE();
      }
  }
  
  
  
  /**
   * \defgroup of_bsn_tlv_icmpv6_type of_bsn_tlv_icmpv6_type
   */
  
  /**
   * Create a new of_bsn_tlv_icmpv6_type object
   *
   * @param version The wire version to use for the object
   * @return Pointer to the newly create object or NULL on error
   *
   * Initializes the new object with it's default fixed length associating
   * a new underlying wire buffer.
   *
   * \ingroup of_bsn_tlv_icmpv6_type
   */
  
  of_object_t *
  of_bsn_tlv_icmpv6_type_new(of_version_t version)
  {
      of_object_t *obj;
      int bytes;
  
      bytes = of_object_fixed_len[version][OF_BSN_TLV_ICMPV6_TYPE];
  
      if ((obj = of_object_new(bytes)) == NULL) {
          return NULL;
      }
  
      of_bsn_tlv_icmpv6_type_init(obj, version, bytes, 0);
      of_bsn_tlv_icmpv6_type_push_wire_types(obj);
      of_tlv16_wire_length_set(obj, obj->length);
  
      return obj;
  }
  
  /**
   * Initialize an object of type of_bsn_tlv_icmpv6_type.
   *
   * @param obj Pointer to the object to initialize
   * @param version The wire version to use for the object
   * @param bytes How many bytes in the object
   * @param clean_wire Boolean: If true, clear the wire object control struct
   *
   * If bytes < 0, then the default fixed length is used for the object
   *
   * This is a "coerce" function that sets up the pointers for the
   * accessors properly.
   *
   * If anything other than 0 is passed in for the buffer size, the underlying
   * wire buffer will have 'grow' called.
   */
  
  void
  of_bsn_tlv_icmpv6_type_init(of_object_t *obj,
      of_version_t version, int bytes, int clean_wire)
  {
      LOCI_ASSERT(of_object_fixed_len[version][OF_BSN_TLV_ICMPV6_TYPE] >= 0);
      if (clean_wire) {
          MEMSET(obj, 0, sizeof(*obj));
      }
      if (bytes < 0) {
          bytes = of_object_fixed_len[version][OF_BSN_TLV_ICMPV6_TYPE];
      }
      obj->version = version;
      obj->length = bytes;
      obj->object_id = OF_BSN_TLV_ICMPV6_TYPE;
  
      /* Grow the wire buffer */
      if (obj->wbuf != NULL) {
          int tot_bytes;
  
          tot_bytes = bytes + obj->obj_offset;
          of_wire_buffer_grow(obj->wbuf, tot_bytes);
      }
  }
  
  /**
   * Get value from an object of type of_bsn_tlv_icmpv6_type.
   * @param obj Pointer to an object of type of_bsn_tlv_icmpv6_type.
   * @param value Pointer to the child object of type
   * uint8_t to be filled out.
   *
   */
  void
  of_bsn_tlv_icmpv6_type_value_get(
      of_bsn_tlv_icmpv6_type_t *obj,
      uint8_t *value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_ICMPV6_TYPE);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u8_get(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  
  /**
   * Set value in an object of type of_bsn_tlv_icmpv6_type.
   * @param obj Pointer to an object of type of_bsn_tlv_icmpv6_type.
   * @param value The value to write into the object
   */
  void
  of_bsn_tlv_icmpv6_type_value_set(
      of_bsn_tlv_icmpv6_type_t *obj,
      uint8_t value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_ICMPV6_TYPE);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u8_set(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  /* Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University */
  /* Copyright (c) 2011, 2012 Open Networking Foundation */
  /* Copyright (c) 2012, 2013 Big Switch Networks, Inc. */
  /* See the file LICENSE.loci which should have been included in the source distribution */
  #ifdef __GNUC__
  
  #ifdef __linux__
  /* glibc */
  #include <features.h>
  #else
  /* NetBSD etc */
  #include <sys/cdefs.h>
  #ifdef __GNUC_PREREQ__
  #define __GNUC_PREREQ __GNUC_PREREQ__
  #endif
  #endif
  
  #ifndef __GNUC_PREREQ
  /* fallback */
  #define __GNUC_PREREQ(maj, min) 0
  #endif
  
  #if __GNUC_PREREQ(4,6)
  #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
  #endif
  
  #endif
  
  #include "loci_log.h"
  #include "loci_int.h"
  
  void
  of_bsn_tlv_identifier_push_wire_types(of_object_t *obj)
  {
      unsigned char *buf = OF_OBJECT_BUFFER_INDEX(obj, 0);
      switch (obj->version) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          *(uint16_t *)(buf + 0) = U16_HTON(0xad); /* type */
          break;
      default:
          UNREACHABLE();
      }
  }
  
  
  
  /**
   * \defgroup of_bsn_tlv_identifier of_bsn_tlv_identifier
   */
  
  /**
   * Create a new of_bsn_tlv_identifier object
   *
   * @param version The wire version to use for the object
   * @return Pointer to the newly create object or NULL on error
   *
   * Initializes the new object with it's default fixed length associating
   * a new underlying wire buffer.
   *
   * \ingroup of_bsn_tlv_identifier
   */
  
  of_object_t *
  of_bsn_tlv_identifier_new(of_version_t version)
  {
      of_object_t *obj;
      int bytes;
  
      bytes = of_object_fixed_len[version][OF_BSN_TLV_IDENTIFIER];
  
      if ((obj = of_object_new(bytes)) == NULL) {
          return NULL;
      }
  
      of_bsn_tlv_identifier_init(obj, version, bytes, 0);
      of_bsn_tlv_identifier_push_wire_types(obj);
      of_tlv16_wire_length_set(obj, obj->length);
  
      return obj;
  }
  
  /**
   * Initialize an object of type of_bsn_tlv_identifier.
   *
   * @param obj Pointer to the object to initialize
   * @param version The wire version to use for the object
   * @param bytes How many bytes in the object
   * @param clean_wire Boolean: If true, clear the wire object control struct
   *
   * If bytes < 0, then the default fixed length is used for the object
   *
   * This is a "coerce" function that sets up the pointers for the
   * accessors properly.
   *
   * If anything other than 0 is passed in for the buffer size, the underlying
   * wire buffer will have 'grow' called.
   */
  
  void
  of_bsn_tlv_identifier_init(of_object_t *obj,
      of_version_t version, int bytes, int clean_wire)
  {
      LOCI_ASSERT(of_object_fixed_len[version][OF_BSN_TLV_IDENTIFIER] >= 0);
      if (clean_wire) {
          MEMSET(obj, 0, sizeof(*obj));
      }
      if (bytes < 0) {
          bytes = of_object_fixed_len[version][OF_BSN_TLV_IDENTIFIER];
      }
      obj->version = version;
      obj->length = bytes;
      obj->object_id = OF_BSN_TLV_IDENTIFIER;
  
      /* Grow the wire buffer */
      if (obj->wbuf != NULL) {
          int tot_bytes;
  
          tot_bytes = bytes + obj->obj_offset;
          of_wire_buffer_grow(obj->wbuf, tot_bytes);
      }
  }
  
  /**
   * Get value from an object of type of_bsn_tlv_identifier.
   * @param obj Pointer to an object of type of_bsn_tlv_identifier.
   * @param value Pointer to the child object of type
   * uint32_t to be filled out.
   *
   */
  void
  of_bsn_tlv_identifier_value_get(
      of_bsn_tlv_identifier_t *obj,
      uint32_t *value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_IDENTIFIER);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u32_get(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  
  /**
   * Set value in an object of type of_bsn_tlv_identifier.
   * @param obj Pointer to an object of type of_bsn_tlv_identifier.
   * @param value The value to write into the object
   */
  void
  of_bsn_tlv_identifier_value_set(
      of_bsn_tlv_identifier_t *obj,
      uint32_t value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_IDENTIFIER);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u32_set(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  /* Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University */
  /* Copyright (c) 2011, 2012 Open Networking Foundation */
  /* Copyright (c) 2012, 2013 Big Switch Networks, Inc. */
  /* See the file LICENSE.loci which should have been included in the source distribution */
  #ifdef __GNUC__
  
  #ifdef __linux__
  /* glibc */
  #include <features.h>
  #else
  /* NetBSD etc */
  #include <sys/cdefs.h>
  #ifdef __GNUC_PREREQ__
  #define __GNUC_PREREQ __GNUC_PREREQ__
  #endif
  #endif
  
  #ifndef __GNUC_PREREQ
  /* fallback */
  #define __GNUC_PREREQ(maj, min) 0
  #endif
  
  #if __GNUC_PREREQ(4,6)
  #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
  #endif
  
  #endif
  
  #include "loci_log.h"
  #include "loci_int.h"
  
  void
  of_bsn_tlv_idle_notification_push_wire_types(of_object_t *obj)
  {
      unsigned char *buf = OF_OBJECT_BUFFER_INDEX(obj, 0);
      switch (obj->version) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          *(uint16_t *)(buf + 0) = U16_HTON(0x7); /* type */
          break;
      default:
          UNREACHABLE();
      }
  }
  
  
  
  /**
   * \defgroup of_bsn_tlv_idle_notification of_bsn_tlv_idle_notification
   */
  
  /**
   * Create a new of_bsn_tlv_idle_notification object
   *
   * @param version The wire version to use for the object
   * @return Pointer to the newly create object or NULL on error
   *
   * Initializes the new object with it's default fixed length associating
   * a new underlying wire buffer.
   *
   * \ingroup of_bsn_tlv_idle_notification
   */
  
  of_object_t *
  of_bsn_tlv_idle_notification_new(of_version_t version)
  {
      of_object_t *obj;
      int bytes;
  
      bytes = of_object_fixed_len[version][OF_BSN_TLV_IDLE_NOTIFICATION];
  
      if ((obj = of_object_new(bytes)) == NULL) {
          return NULL;
      }
  
      of_bsn_tlv_idle_notification_init(obj, version, bytes, 0);
      of_bsn_tlv_idle_notification_push_wire_types(obj);
      of_tlv16_wire_length_set(obj, obj->length);
  
      return obj;
  }
  
  /**
   * Initialize an object of type of_bsn_tlv_idle_notification.
   *
   * @param obj Pointer to the object to initialize
   * @param version The wire version to use for the object
   * @param bytes How many bytes in the object
   * @param clean_wire Boolean: If true, clear the wire object control struct
   *
   * If bytes < 0, then the default fixed length is used for the object
   *
   * This is a "coerce" function that sets up the pointers for the
   * accessors properly.
   *
   * If anything other than 0 is passed in for the buffer size, the underlying
   * wire buffer will have 'grow' called.
   */
  
  void
  of_bsn_tlv_idle_notification_init(of_object_t *obj,
      of_version_t version, int bytes, int clean_wire)
  {
      LOCI_ASSERT(of_object_fixed_len[version][OF_BSN_TLV_IDLE_NOTIFICATION] >= 0);
      if (clean_wire) {
          MEMSET(obj, 0, sizeof(*obj));
      }
      if (bytes < 0) {
          bytes = of_object_fixed_len[version][OF_BSN_TLV_IDLE_NOTIFICATION];
      }
      obj->version = version;
      obj->length = bytes;
      obj->object_id = OF_BSN_TLV_IDLE_NOTIFICATION;
  
      /* Grow the wire buffer */
      if (obj->wbuf != NULL) {
          int tot_bytes;
  
          tot_bytes = bytes + obj->obj_offset;
          of_wire_buffer_grow(obj->wbuf, tot_bytes);
      }
  }
  /* Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University */
  /* Copyright (c) 2011, 2012 Open Networking Foundation */
  /* Copyright (c) 2012, 2013 Big Switch Networks, Inc. */
  /* See the file LICENSE.loci which should have been included in the source distribution */
  #ifdef __GNUC__
  
  #ifdef __linux__
  /* glibc */
  #include <features.h>
  #else
  /* NetBSD etc */
  #include <sys/cdefs.h>
  #ifdef __GNUC_PREREQ__
  #define __GNUC_PREREQ __GNUC_PREREQ__
  #endif
  #endif
  
  #ifndef __GNUC_PREREQ
  /* fallback */
  #define __GNUC_PREREQ(maj, min) 0
  #endif
  
  #if __GNUC_PREREQ(4,6)
  #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
  #endif
  
  #endif
  
  #include "loci_log.h"
  #include "loci_int.h"
  
  void
  of_bsn_tlv_idle_time_push_wire_types(of_object_t *obj)
  {
      unsigned char *buf = OF_OBJECT_BUFFER_INDEX(obj, 0);
      switch (obj->version) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          *(uint16_t *)(buf + 0) = U16_HTON(0x5); /* type */
          break;
      default:
          UNREACHABLE();
      }
  }
  
  
  
  /**
   * \defgroup of_bsn_tlv_idle_time of_bsn_tlv_idle_time
   */
  
  /**
   * Create a new of_bsn_tlv_idle_time object
   *
   * @param version The wire version to use for the object
   * @return Pointer to the newly create object or NULL on error
   *
   * Initializes the new object with it's default fixed length associating
   * a new underlying wire buffer.
   *
   * \ingroup of_bsn_tlv_idle_time
   */
  
  of_object_t *
  of_bsn_tlv_idle_time_new(of_version_t version)
  {
      of_object_t *obj;
      int bytes;
  
      bytes = of_object_fixed_len[version][OF_BSN_TLV_IDLE_TIME];
  
      if ((obj = of_object_new(bytes)) == NULL) {
          return NULL;
      }
  
      of_bsn_tlv_idle_time_init(obj, version, bytes, 0);
      of_bsn_tlv_idle_time_push_wire_types(obj);
      of_tlv16_wire_length_set(obj, obj->length);
  
      return obj;
  }
  
  /**
   * Initialize an object of type of_bsn_tlv_idle_time.
   *
   * @param obj Pointer to the object to initialize
   * @param version The wire version to use for the object
   * @param bytes How many bytes in the object
   * @param clean_wire Boolean: If true, clear the wire object control struct
   *
   * If bytes < 0, then the default fixed length is used for the object
   *
   * This is a "coerce" function that sets up the pointers for the
   * accessors properly.
   *
   * If anything other than 0 is passed in for the buffer size, the underlying
   * wire buffer will have 'grow' called.
   */
  
  void
  of_bsn_tlv_idle_time_init(of_object_t *obj,
      of_version_t version, int bytes, int clean_wire)
  {
      LOCI_ASSERT(of_object_fixed_len[version][OF_BSN_TLV_IDLE_TIME] >= 0);
      if (clean_wire) {
          MEMSET(obj, 0, sizeof(*obj));
      }
      if (bytes < 0) {
          bytes = of_object_fixed_len[version][OF_BSN_TLV_IDLE_TIME];
      }
      obj->version = version;
      obj->length = bytes;
      obj->object_id = OF_BSN_TLV_IDLE_TIME;
  
      /* Grow the wire buffer */
      if (obj->wbuf != NULL) {
          int tot_bytes;
  
          tot_bytes = bytes + obj->obj_offset;
          of_wire_buffer_grow(obj->wbuf, tot_bytes);
      }
  }
  
  /**
   * Get value from an object of type of_bsn_tlv_idle_time.
   * @param obj Pointer to an object of type of_bsn_tlv_idle_time.
   * @param value Pointer to the child object of type
   * uint64_t to be filled out.
   *
   */
  void
  of_bsn_tlv_idle_time_value_get(
      of_bsn_tlv_idle_time_t *obj,
      uint64_t *value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_IDLE_TIME);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u64_get(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  
  /**
   * Set value in an object of type of_bsn_tlv_idle_time.
   * @param obj Pointer to an object of type of_bsn_tlv_idle_time.
   * @param value The value to write into the object
   */
  void
  of_bsn_tlv_idle_time_value_set(
      of_bsn_tlv_idle_time_t *obj,
      uint64_t value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_IDLE_TIME);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u64_set(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  /* Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University */
  /* Copyright (c) 2011, 2012 Open Networking Foundation */
  /* Copyright (c) 2012, 2013 Big Switch Networks, Inc. */
  /* See the file LICENSE.loci which should have been included in the source distribution */
  #ifdef __GNUC__
  
  #ifdef __linux__
  /* glibc */
  #include <features.h>
  #else
  /* NetBSD etc */
  #include <sys/cdefs.h>
  #ifdef __GNUC_PREREQ__
  #define __GNUC_PREREQ __GNUC_PREREQ__
  #endif
  #endif
  
  #ifndef __GNUC_PREREQ
  /* fallback */
  #define __GNUC_PREREQ(maj, min) 0
  #endif
  
  #if __GNUC_PREREQ(4,6)
  #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
  #endif
  
  #endif
  
  #include "loci_log.h"
  #include "loci_int.h"
  
  void
  of_bsn_tlv_idle_timeout_push_wire_types(of_object_t *obj)
  {
      unsigned char *buf = OF_OBJECT_BUFFER_INDEX(obj, 0);
      switch (obj->version) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          *(uint16_t *)(buf + 0) = U16_HTON(0x8); /* type */
          break;
      default:
          UNREACHABLE();
      }
  }
  
  
  
  /**
   * \defgroup of_bsn_tlv_idle_timeout of_bsn_tlv_idle_timeout
   */
  
  /**
   * Create a new of_bsn_tlv_idle_timeout object
   *
   * @param version The wire version to use for the object
   * @return Pointer to the newly create object or NULL on error
   *
   * Initializes the new object with it's default fixed length associating
   * a new underlying wire buffer.
   *
   * \ingroup of_bsn_tlv_idle_timeout
   */
  
  of_object_t *
  of_bsn_tlv_idle_timeout_new(of_version_t version)
  {
      of_object_t *obj;
      int bytes;
  
      bytes = of_object_fixed_len[version][OF_BSN_TLV_IDLE_TIMEOUT];
  
      if ((obj = of_object_new(bytes)) == NULL) {
          return NULL;
      }
  
      of_bsn_tlv_idle_timeout_init(obj, version, bytes, 0);
      of_bsn_tlv_idle_timeout_push_wire_types(obj);
      of_tlv16_wire_length_set(obj, obj->length);
  
      return obj;
  }
  
  /**
   * Initialize an object of type of_bsn_tlv_idle_timeout.
   *
   * @param obj Pointer to the object to initialize
   * @param version The wire version to use for the object
   * @param bytes How many bytes in the object
   * @param clean_wire Boolean: If true, clear the wire object control struct
   *
   * If bytes < 0, then the default fixed length is used for the object
   *
   * This is a "coerce" function that sets up the pointers for the
   * accessors properly.
   *
   * If anything other than 0 is passed in for the buffer size, the underlying
   * wire buffer will have 'grow' called.
   */
  
  void
  of_bsn_tlv_idle_timeout_init(of_object_t *obj,
      of_version_t version, int bytes, int clean_wire)
  {
      LOCI_ASSERT(of_object_fixed_len[version][OF_BSN_TLV_IDLE_TIMEOUT] >= 0);
      if (clean_wire) {
          MEMSET(obj, 0, sizeof(*obj));
      }
      if (bytes < 0) {
          bytes = of_object_fixed_len[version][OF_BSN_TLV_IDLE_TIMEOUT];
      }
      obj->version = version;
      obj->length = bytes;
      obj->object_id = OF_BSN_TLV_IDLE_TIMEOUT;
  
      /* Grow the wire buffer */
      if (obj->wbuf != NULL) {
          int tot_bytes;
  
          tot_bytes = bytes + obj->obj_offset;
          of_wire_buffer_grow(obj->wbuf, tot_bytes);
      }
  }
  
  /**
   * Get value from an object of type of_bsn_tlv_idle_timeout.
   * @param obj Pointer to an object of type of_bsn_tlv_idle_timeout.
   * @param value Pointer to the child object of type
   * uint32_t to be filled out.
   *
   */
  void
  of_bsn_tlv_idle_timeout_value_get(
      of_bsn_tlv_idle_timeout_t *obj,
      uint32_t *value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_IDLE_TIMEOUT);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u32_get(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  
  /**
   * Set value in an object of type of_bsn_tlv_idle_timeout.
   * @param obj Pointer to an object of type of_bsn_tlv_idle_timeout.
   * @param value The value to write into the object
   */
  void
  of_bsn_tlv_idle_timeout_value_set(
      of_bsn_tlv_idle_timeout_t *obj,
      uint32_t value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_IDLE_TIMEOUT);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u32_set(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  /* Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University */
  /* Copyright (c) 2011, 2012 Open Networking Foundation */
  /* Copyright (c) 2012, 2013 Big Switch Networks, Inc. */
  /* See the file LICENSE.loci which should have been included in the source distribution */
  #ifdef __GNUC__
  
  #ifdef __linux__
  /* glibc */
  #include <features.h>
  #else
  /* NetBSD etc */
  #include <sys/cdefs.h>
  #ifdef __GNUC_PREREQ__
  #define __GNUC_PREREQ __GNUC_PREREQ__
  #endif
  #endif
  
  #ifndef __GNUC_PREREQ
  /* fallback */
  #define __GNUC_PREREQ(maj, min) 0
  #endif
  
  #if __GNUC_PREREQ(4,6)
  #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
  #endif
  
  #endif
  
  #include "loci_log.h"
  #include "loci_int.h"
  
  void
  of_bsn_tlv_ifp_class_id_push_wire_types(of_object_t *obj)
  {
      unsigned char *buf = OF_OBJECT_BUFFER_INDEX(obj, 0);
      switch (obj->version) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          *(uint16_t *)(buf + 0) = U16_HTON(0xc8); /* type */
          break;
      default:
          UNREACHABLE();
      }
  }
  
  
  
  /**
   * \defgroup of_bsn_tlv_ifp_class_id of_bsn_tlv_ifp_class_id
   */
  
  /**
   * Create a new of_bsn_tlv_ifp_class_id object
   *
   * @param version The wire version to use for the object
   * @return Pointer to the newly create object or NULL on error
   *
   * Initializes the new object with it's default fixed length associating
   * a new underlying wire buffer.
   *
   * \ingroup of_bsn_tlv_ifp_class_id
   */
  
  of_object_t *
  of_bsn_tlv_ifp_class_id_new(of_version_t version)
  {
      of_object_t *obj;
      int bytes;
  
      bytes = of_object_fixed_len[version][OF_BSN_TLV_IFP_CLASS_ID];
  
      if ((obj = of_object_new(bytes)) == NULL) {
          return NULL;
      }
  
      of_bsn_tlv_ifp_class_id_init(obj, version, bytes, 0);
      of_bsn_tlv_ifp_class_id_push_wire_types(obj);
      of_tlv16_wire_length_set(obj, obj->length);
  
      return obj;
  }
  
  /**
   * Initialize an object of type of_bsn_tlv_ifp_class_id.
   *
   * @param obj Pointer to the object to initialize
   * @param version The wire version to use for the object
   * @param bytes How many bytes in the object
   * @param clean_wire Boolean: If true, clear the wire object control struct
   *
   * If bytes < 0, then the default fixed length is used for the object
   *
   * This is a "coerce" function that sets up the pointers for the
   * accessors properly.
   *
   * If anything other than 0 is passed in for the buffer size, the underlying
   * wire buffer will have 'grow' called.
   */
  
  void
  of_bsn_tlv_ifp_class_id_init(of_object_t *obj,
      of_version_t version, int bytes, int clean_wire)
  {
      LOCI_ASSERT(of_object_fixed_len[version][OF_BSN_TLV_IFP_CLASS_ID] >= 0);
      if (clean_wire) {
          MEMSET(obj, 0, sizeof(*obj));
      }
      if (bytes < 0) {
          bytes = of_object_fixed_len[version][OF_BSN_TLV_IFP_CLASS_ID];
      }
      obj->version = version;
      obj->length = bytes;
      obj->object_id = OF_BSN_TLV_IFP_CLASS_ID;
  
      /* Grow the wire buffer */
      if (obj->wbuf != NULL) {
          int tot_bytes;
  
          tot_bytes = bytes + obj->obj_offset;
          of_wire_buffer_grow(obj->wbuf, tot_bytes);
      }
  }
  
  /**
   * Get value from an object of type of_bsn_tlv_ifp_class_id.
   * @param obj Pointer to an object of type of_bsn_tlv_ifp_class_id.
   * @param value Pointer to the child object of type
   * uint32_t to be filled out.
   *
   */
  void
  of_bsn_tlv_ifp_class_id_value_get(
      of_bsn_tlv_ifp_class_id_t *obj,
      uint32_t *value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_IFP_CLASS_ID);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u32_get(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  
  /**
   * Set value in an object of type of_bsn_tlv_ifp_class_id.
   * @param obj Pointer to an object of type of_bsn_tlv_ifp_class_id.
   * @param value The value to write into the object
   */
  void
  of_bsn_tlv_ifp_class_id_value_set(
      of_bsn_tlv_ifp_class_id_t *obj,
      uint32_t value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_IFP_CLASS_ID);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u32_set(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  /* Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University */
  /* Copyright (c) 2011, 2012 Open Networking Foundation */
  /* Copyright (c) 2012, 2013 Big Switch Networks, Inc. */
  /* See the file LICENSE.loci which should have been included in the source distribution */
  #ifdef __GNUC__
  
  #ifdef __linux__
  /* glibc */
  #include <features.h>
  #else
  /* NetBSD etc */
  #include <sys/cdefs.h>
  #ifdef __GNUC_PREREQ__
  #define __GNUC_PREREQ __GNUC_PREREQ__
  #endif
  #endif
  
  #ifndef __GNUC_PREREQ
  /* fallback */
  #define __GNUC_PREREQ(maj, min) 0
  #endif
  
  #if __GNUC_PREREQ(4,6)
  #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
  #endif
  
  #endif
  
  #include "loci_log.h"
  #include "loci_int.h"
  
  void
  of_bsn_tlv_igmp_snooping_push_wire_types(of_object_t *obj)
  {
      unsigned char *buf = OF_OBJECT_BUFFER_INDEX(obj, 0);
      switch (obj->version) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          *(uint16_t *)(buf + 0) = U16_HTON(0x4e); /* type */
          break;
      default:
          UNREACHABLE();
      }
  }
  
  
  
  /**
   * \defgroup of_bsn_tlv_igmp_snooping of_bsn_tlv_igmp_snooping
   */
  
  /**
   * Create a new of_bsn_tlv_igmp_snooping object
   *
   * @param version The wire version to use for the object
   * @return Pointer to the newly create object or NULL on error
   *
   * Initializes the new object with it's default fixed length associating
   * a new underlying wire buffer.
   *
   * \ingroup of_bsn_tlv_igmp_snooping
   */
  
  of_object_t *
  of_bsn_tlv_igmp_snooping_new(of_version_t version)
  {
      of_object_t *obj;
      int bytes;
  
      bytes = of_object_fixed_len[version][OF_BSN_TLV_IGMP_SNOOPING];
  
      if ((obj = of_object_new(bytes)) == NULL) {
          return NULL;
      }
  
      of_bsn_tlv_igmp_snooping_init(obj, version, bytes, 0);
      of_bsn_tlv_igmp_snooping_push_wire_types(obj);
      of_tlv16_wire_length_set(obj, obj->length);
  
      return obj;
  }
  
  /**
   * Initialize an object of type of_bsn_tlv_igmp_snooping.
   *
   * @param obj Pointer to the object to initialize
   * @param version The wire version to use for the object
   * @param bytes How many bytes in the object
   * @param clean_wire Boolean: If true, clear the wire object control struct
   *
   * If bytes < 0, then the default fixed length is used for the object
   *
   * This is a "coerce" function that sets up the pointers for the
   * accessors properly.
   *
   * If anything other than 0 is passed in for the buffer size, the underlying
   * wire buffer will have 'grow' called.
   */
  
  void
  of_bsn_tlv_igmp_snooping_init(of_object_t *obj,
      of_version_t version, int bytes, int clean_wire)
  {
      LOCI_ASSERT(of_object_fixed_len[version][OF_BSN_TLV_IGMP_SNOOPING] >= 0);
      if (clean_wire) {
          MEMSET(obj, 0, sizeof(*obj));
      }
      if (bytes < 0) {
          bytes = of_object_fixed_len[version][OF_BSN_TLV_IGMP_SNOOPING];
      }
      obj->version = version;
      obj->length = bytes;
      obj->object_id = OF_BSN_TLV_IGMP_SNOOPING;
  
      /* Grow the wire buffer */
      if (obj->wbuf != NULL) {
          int tot_bytes;
  
          tot_bytes = bytes + obj->obj_offset;
          of_wire_buffer_grow(obj->wbuf, tot_bytes);
      }
  }
  /* Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University */
  /* Copyright (c) 2011, 2012 Open Networking Foundation */
  /* Copyright (c) 2012, 2013 Big Switch Networks, Inc. */
  /* See the file LICENSE.loci which should have been included in the source distribution */
  #ifdef __GNUC__
  
  #ifdef __linux__
  /* glibc */
  #include <features.h>
  #else
  /* NetBSD etc */
  #include <sys/cdefs.h>
  #ifdef __GNUC_PREREQ__
  #define __GNUC_PREREQ __GNUC_PREREQ__
  #endif
  #endif
  
  #ifndef __GNUC_PREREQ
  /* fallback */
  #define __GNUC_PREREQ(maj, min) 0
  #endif
  
  #if __GNUC_PREREQ(4,6)
  #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
  #endif
  
  #endif
  
  #include "loci_log.h"
  #include "loci_int.h"
  
  void
  of_bsn_tlv_ingress_port_group_id_push_wire_types(of_object_t *obj)
  {
      unsigned char *buf = OF_OBJECT_BUFFER_INDEX(obj, 0);
      switch (obj->version) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          *(uint16_t *)(buf + 0) = U16_HTON(0x8a); /* type */
          break;
      default:
          UNREACHABLE();
      }
  }
  
  
  
  /**
   * \defgroup of_bsn_tlv_ingress_port_group_id of_bsn_tlv_ingress_port_group_id
   */
  
  /**
   * Create a new of_bsn_tlv_ingress_port_group_id object
   *
   * @param version The wire version to use for the object
   * @return Pointer to the newly create object or NULL on error
   *
   * Initializes the new object with it's default fixed length associating
   * a new underlying wire buffer.
   *
   * \ingroup of_bsn_tlv_ingress_port_group_id
   */
  
  of_object_t *
  of_bsn_tlv_ingress_port_group_id_new(of_version_t version)
  {
      of_object_t *obj;
      int bytes;
  
      bytes = of_object_fixed_len[version][OF_BSN_TLV_INGRESS_PORT_GROUP_ID];
  
      if ((obj = of_object_new(bytes)) == NULL) {
          return NULL;
      }
  
      of_bsn_tlv_ingress_port_group_id_init(obj, version, bytes, 0);
      of_bsn_tlv_ingress_port_group_id_push_wire_types(obj);
      of_tlv16_wire_length_set(obj, obj->length);
  
      return obj;
  }
  
  /**
   * Initialize an object of type of_bsn_tlv_ingress_port_group_id.
   *
   * @param obj Pointer to the object to initialize
   * @param version The wire version to use for the object
   * @param bytes How many bytes in the object
   * @param clean_wire Boolean: If true, clear the wire object control struct
   *
   * If bytes < 0, then the default fixed length is used for the object
   *
   * This is a "coerce" function that sets up the pointers for the
   * accessors properly.
   *
   * If anything other than 0 is passed in for the buffer size, the underlying
   * wire buffer will have 'grow' called.
   */
  
  void
  of_bsn_tlv_ingress_port_group_id_init(of_object_t *obj,
      of_version_t version, int bytes, int clean_wire)
  {
      LOCI_ASSERT(of_object_fixed_len[version][OF_BSN_TLV_INGRESS_PORT_GROUP_ID] >= 0);
      if (clean_wire) {
          MEMSET(obj, 0, sizeof(*obj));
      }
      if (bytes < 0) {
          bytes = of_object_fixed_len[version][OF_BSN_TLV_INGRESS_PORT_GROUP_ID];
      }
      obj->version = version;
      obj->length = bytes;
      obj->object_id = OF_BSN_TLV_INGRESS_PORT_GROUP_ID;
  
      /* Grow the wire buffer */
      if (obj->wbuf != NULL) {
          int tot_bytes;
  
          tot_bytes = bytes + obj->obj_offset;
          of_wire_buffer_grow(obj->wbuf, tot_bytes);
      }
  }
  
  /**
   * Get value from an object of type of_bsn_tlv_ingress_port_group_id.
   * @param obj Pointer to an object of type of_bsn_tlv_ingress_port_group_id.
   * @param value Pointer to the child object of type
   * uint32_t to be filled out.
   *
   */
  void
  of_bsn_tlv_ingress_port_group_id_value_get(
      of_bsn_tlv_ingress_port_group_id_t *obj,
      uint32_t *value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_INGRESS_PORT_GROUP_ID);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u32_get(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  
  /**
   * Set value in an object of type of_bsn_tlv_ingress_port_group_id.
   * @param obj Pointer to an object of type of_bsn_tlv_ingress_port_group_id.
   * @param value The value to write into the object
   */
  void
  of_bsn_tlv_ingress_port_group_id_value_set(
      of_bsn_tlv_ingress_port_group_id_t *obj,
      uint32_t value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_INGRESS_PORT_GROUP_ID);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u32_set(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  /* Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University */
  /* Copyright (c) 2011, 2012 Open Networking Foundation */
  /* Copyright (c) 2012, 2013 Big Switch Networks, Inc. */
  /* See the file LICENSE.loci which should have been included in the source distribution */
  #ifdef __GNUC__
  
  #ifdef __linux__
  /* glibc */
  #include <features.h>
  #else
  /* NetBSD etc */
  #include <sys/cdefs.h>
  #ifdef __GNUC_PREREQ__
  #define __GNUC_PREREQ __GNUC_PREREQ__
  #endif
  #endif
  
  #ifndef __GNUC_PREREQ
  /* fallback */
  #define __GNUC_PREREQ(maj, min) 0
  #endif
  
  #if __GNUC_PREREQ(4,6)
  #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
  #endif
  
  #endif
  
  #include "loci_log.h"
  #include "loci_int.h"
  
  void
  of_bsn_tlv_inner_vlan_vid_push_wire_types(of_object_t *obj)
  {
      unsigned char *buf = OF_OBJECT_BUFFER_INDEX(obj, 0);
      switch (obj->version) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          *(uint16_t *)(buf + 0) = U16_HTON(0xc5); /* type */
          break;
      default:
          UNREACHABLE();
      }
  }
  
  
  
  /**
   * \defgroup of_bsn_tlv_inner_vlan_vid of_bsn_tlv_inner_vlan_vid
   */
  
  /**
   * Create a new of_bsn_tlv_inner_vlan_vid object
   *
   * @param version The wire version to use for the object
   * @return Pointer to the newly create object or NULL on error
   *
   * Initializes the new object with it's default fixed length associating
   * a new underlying wire buffer.
   *
   * \ingroup of_bsn_tlv_inner_vlan_vid
   */
  
  of_object_t *
  of_bsn_tlv_inner_vlan_vid_new(of_version_t version)
  {
      of_object_t *obj;
      int bytes;
  
      bytes = of_object_fixed_len[version][OF_BSN_TLV_INNER_VLAN_VID];
  
      if ((obj = of_object_new(bytes)) == NULL) {
          return NULL;
      }
  
      of_bsn_tlv_inner_vlan_vid_init(obj, version, bytes, 0);
      of_bsn_tlv_inner_vlan_vid_push_wire_types(obj);
      of_tlv16_wire_length_set(obj, obj->length);
  
      return obj;
  }
  
  /**
   * Initialize an object of type of_bsn_tlv_inner_vlan_vid.
   *
   * @param obj Pointer to the object to initialize
   * @param version The wire version to use for the object
   * @param bytes How many bytes in the object
   * @param clean_wire Boolean: If true, clear the wire object control struct
   *
   * If bytes < 0, then the default fixed length is used for the object
   *
   * This is a "coerce" function that sets up the pointers for the
   * accessors properly.
   *
   * If anything other than 0 is passed in for the buffer size, the underlying
   * wire buffer will have 'grow' called.
   */
  
  void
  of_bsn_tlv_inner_vlan_vid_init(of_object_t *obj,
      of_version_t version, int bytes, int clean_wire)
  {
      LOCI_ASSERT(of_object_fixed_len[version][OF_BSN_TLV_INNER_VLAN_VID] >= 0);
      if (clean_wire) {
          MEMSET(obj, 0, sizeof(*obj));
      }
      if (bytes < 0) {
          bytes = of_object_fixed_len[version][OF_BSN_TLV_INNER_VLAN_VID];
      }
      obj->version = version;
      obj->length = bytes;
      obj->object_id = OF_BSN_TLV_INNER_VLAN_VID;
  
      /* Grow the wire buffer */
      if (obj->wbuf != NULL) {
          int tot_bytes;
  
          tot_bytes = bytes + obj->obj_offset;
          of_wire_buffer_grow(obj->wbuf, tot_bytes);
      }
  }
  
  /**
   * Get value from an object of type of_bsn_tlv_inner_vlan_vid.
   * @param obj Pointer to an object of type of_bsn_tlv_inner_vlan_vid.
   * @param value Pointer to the child object of type
   * uint16_t to be filled out.
   *
   */
  void
  of_bsn_tlv_inner_vlan_vid_value_get(
      of_bsn_tlv_inner_vlan_vid_t *obj,
      uint16_t *value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_INNER_VLAN_VID);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u16_get(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  
  /**
   * Set value in an object of type of_bsn_tlv_inner_vlan_vid.
   * @param obj Pointer to an object of type of_bsn_tlv_inner_vlan_vid.
   * @param value The value to write into the object
   */
  void
  of_bsn_tlv_inner_vlan_vid_value_set(
      of_bsn_tlv_inner_vlan_vid_t *obj,
      uint16_t value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_INNER_VLAN_VID);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u16_set(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  /* Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University */
  /* Copyright (c) 2011, 2012 Open Networking Foundation */
  /* Copyright (c) 2012, 2013 Big Switch Networks, Inc. */
  /* See the file LICENSE.loci which should have been included in the source distribution */
  #ifdef __GNUC__
  
  #ifdef __linux__
  /* glibc */
  #include <features.h>
  #else
  /* NetBSD etc */
  #include <sys/cdefs.h>
  #ifdef __GNUC_PREREQ__
  #define __GNUC_PREREQ __GNUC_PREREQ__
  #endif
  #endif
  
  #ifndef __GNUC_PREREQ
  /* fallback */
  #define __GNUC_PREREQ(maj, min) 0
  #endif
  
  #if __GNUC_PREREQ(4,6)
  #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
  #endif
  
  #endif
  
  #include "loci_log.h"
  #include "loci_int.h"
  
  void
  of_bsn_tlv_internal_gateway_mac_push_wire_types(of_object_t *obj)
  {
      unsigned char *buf = OF_OBJECT_BUFFER_INDEX(obj, 0);
      switch (obj->version) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          *(uint16_t *)(buf + 0) = U16_HTON(0x1c); /* type */
          break;
      default:
          UNREACHABLE();
      }
  }
  
  
  
  /**
   * \defgroup of_bsn_tlv_internal_gateway_mac of_bsn_tlv_internal_gateway_mac
   */
  
  /**
   * Create a new of_bsn_tlv_internal_gateway_mac object
   *
   * @param version The wire version to use for the object
   * @return Pointer to the newly create object or NULL on error
   *
   * Initializes the new object with it's default fixed length associating
   * a new underlying wire buffer.
   *
   * \ingroup of_bsn_tlv_internal_gateway_mac
   */
  
  of_object_t *
  of_bsn_tlv_internal_gateway_mac_new(of_version_t version)
  {
      of_object_t *obj;
      int bytes;
  
      bytes = of_object_fixed_len[version][OF_BSN_TLV_INTERNAL_GATEWAY_MAC];
  
      if ((obj = of_object_new(bytes)) == NULL) {
          return NULL;
      }
  
      of_bsn_tlv_internal_gateway_mac_init(obj, version, bytes, 0);
      of_bsn_tlv_internal_gateway_mac_push_wire_types(obj);
      of_tlv16_wire_length_set(obj, obj->length);
  
      return obj;
  }
  
  /**
   * Initialize an object of type of_bsn_tlv_internal_gateway_mac.
   *
   * @param obj Pointer to the object to initialize
   * @param version The wire version to use for the object
   * @param bytes How many bytes in the object
   * @param clean_wire Boolean: If true, clear the wire object control struct
   *
   * If bytes < 0, then the default fixed length is used for the object
   *
   * This is a "coerce" function that sets up the pointers for the
   * accessors properly.
   *
   * If anything other than 0 is passed in for the buffer size, the underlying
   * wire buffer will have 'grow' called.
   */
  
  void
  of_bsn_tlv_internal_gateway_mac_init(of_object_t *obj,
      of_version_t version, int bytes, int clean_wire)
  {
      LOCI_ASSERT(of_object_fixed_len[version][OF_BSN_TLV_INTERNAL_GATEWAY_MAC] >= 0);
      if (clean_wire) {
          MEMSET(obj, 0, sizeof(*obj));
      }
      if (bytes < 0) {
          bytes = of_object_fixed_len[version][OF_BSN_TLV_INTERNAL_GATEWAY_MAC];
      }
      obj->version = version;
      obj->length = bytes;
      obj->object_id = OF_BSN_TLV_INTERNAL_GATEWAY_MAC;
  
      /* Grow the wire buffer */
      if (obj->wbuf != NULL) {
          int tot_bytes;
  
          tot_bytes = bytes + obj->obj_offset;
          of_wire_buffer_grow(obj->wbuf, tot_bytes);
      }
  }
  
  /**
   * Get value from an object of type of_bsn_tlv_internal_gateway_mac.
   * @param obj Pointer to an object of type of_bsn_tlv_internal_gateway_mac.
   * @param value Pointer to the child object of type
   * of_mac_addr_t to be filled out.
   *
   */
  void
  of_bsn_tlv_internal_gateway_mac_value_get(
      of_bsn_tlv_internal_gateway_mac_t *obj,
      of_mac_addr_t *value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_INTERNAL_GATEWAY_MAC);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_mac_get(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  
  /**
   * Set value in an object of type of_bsn_tlv_internal_gateway_mac.
   * @param obj Pointer to an object of type of_bsn_tlv_internal_gateway_mac.
   * @param value The value to write into the object
   */
  void
  of_bsn_tlv_internal_gateway_mac_value_set(
      of_bsn_tlv_internal_gateway_mac_t *obj,
      of_mac_addr_t value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_INTERNAL_GATEWAY_MAC);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_mac_set(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  /* Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University */
  /* Copyright (c) 2011, 2012 Open Networking Foundation */
  /* Copyright (c) 2012, 2013 Big Switch Networks, Inc. */
  /* See the file LICENSE.loci which should have been included in the source distribution */
  #ifdef __GNUC__
  
  #ifdef __linux__
  /* glibc */
  #include <features.h>
  #else
  /* NetBSD etc */
  #include <sys/cdefs.h>
  #ifdef __GNUC_PREREQ__
  #define __GNUC_PREREQ __GNUC_PREREQ__
  #endif
  #endif
  
  #ifndef __GNUC_PREREQ
  /* fallback */
  #define __GNUC_PREREQ(maj, min) 0
  #endif
  
  #if __GNUC_PREREQ(4,6)
  #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
  #endif
  
  #endif
  
  #include "loci_log.h"
  #include "loci_int.h"
  
  void
  of_bsn_tlv_internal_mac_push_wire_types(of_object_t *obj)
  {
      unsigned char *buf = OF_OBJECT_BUFFER_INDEX(obj, 0);
      switch (obj->version) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          *(uint16_t *)(buf + 0) = U16_HTON(0x1b); /* type */
          break;
      default:
          UNREACHABLE();
      }
  }
  
  
  
  /**
   * \defgroup of_bsn_tlv_internal_mac of_bsn_tlv_internal_mac
   */
  
  /**
   * Create a new of_bsn_tlv_internal_mac object
   *
   * @param version The wire version to use for the object
   * @return Pointer to the newly create object or NULL on error
   *
   * Initializes the new object with it's default fixed length associating
   * a new underlying wire buffer.
   *
   * \ingroup of_bsn_tlv_internal_mac
   */
  
  of_object_t *
  of_bsn_tlv_internal_mac_new(of_version_t version)
  {
      of_object_t *obj;
      int bytes;
  
      bytes = of_object_fixed_len[version][OF_BSN_TLV_INTERNAL_MAC];
  
      if ((obj = of_object_new(bytes)) == NULL) {
          return NULL;
      }
  
      of_bsn_tlv_internal_mac_init(obj, version, bytes, 0);
      of_bsn_tlv_internal_mac_push_wire_types(obj);
      of_tlv16_wire_length_set(obj, obj->length);
  
      return obj;
  }
  
  /**
   * Initialize an object of type of_bsn_tlv_internal_mac.
   *
   * @param obj Pointer to the object to initialize
   * @param version The wire version to use for the object
   * @param bytes How many bytes in the object
   * @param clean_wire Boolean: If true, clear the wire object control struct
   *
   * If bytes < 0, then the default fixed length is used for the object
   *
   * This is a "coerce" function that sets up the pointers for the
   * accessors properly.
   *
   * If anything other than 0 is passed in for the buffer size, the underlying
   * wire buffer will have 'grow' called.
   */
  
  void
  of_bsn_tlv_internal_mac_init(of_object_t *obj,
      of_version_t version, int bytes, int clean_wire)
  {
      LOCI_ASSERT(of_object_fixed_len[version][OF_BSN_TLV_INTERNAL_MAC] >= 0);
      if (clean_wire) {
          MEMSET(obj, 0, sizeof(*obj));
      }
      if (bytes < 0) {
          bytes = of_object_fixed_len[version][OF_BSN_TLV_INTERNAL_MAC];
      }
      obj->version = version;
      obj->length = bytes;
      obj->object_id = OF_BSN_TLV_INTERNAL_MAC;
  
      /* Grow the wire buffer */
      if (obj->wbuf != NULL) {
          int tot_bytes;
  
          tot_bytes = bytes + obj->obj_offset;
          of_wire_buffer_grow(obj->wbuf, tot_bytes);
      }
  }
  
  /**
   * Get value from an object of type of_bsn_tlv_internal_mac.
   * @param obj Pointer to an object of type of_bsn_tlv_internal_mac.
   * @param value Pointer to the child object of type
   * of_mac_addr_t to be filled out.
   *
   */
  void
  of_bsn_tlv_internal_mac_value_get(
      of_bsn_tlv_internal_mac_t *obj,
      of_mac_addr_t *value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_INTERNAL_MAC);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_mac_get(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  
  /**
   * Set value in an object of type of_bsn_tlv_internal_mac.
   * @param obj Pointer to an object of type of_bsn_tlv_internal_mac.
   * @param value The value to write into the object
   */
  void
  of_bsn_tlv_internal_mac_value_set(
      of_bsn_tlv_internal_mac_t *obj,
      of_mac_addr_t value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_INTERNAL_MAC);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_mac_set(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  /* Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University */
  /* Copyright (c) 2011, 2012 Open Networking Foundation */
  /* Copyright (c) 2012, 2013 Big Switch Networks, Inc. */
  /* See the file LICENSE.loci which should have been included in the source distribution */
  #ifdef __GNUC__
  
  #ifdef __linux__
  /* glibc */
  #include <features.h>
  #else
  /* NetBSD etc */
  #include <sys/cdefs.h>
  #ifdef __GNUC_PREREQ__
  #define __GNUC_PREREQ __GNUC_PREREQ__
  #endif
  #endif
  
  #ifndef __GNUC_PREREQ
  /* fallback */
  #define __GNUC_PREREQ(maj, min) 0
  #endif
  
  #if __GNUC_PREREQ(4,6)
  #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
  #endif
  
  #endif
  
  #include "loci_log.h"
  #include "loci_int.h"
  
  void
  of_bsn_tlv_interval_push_wire_types(of_object_t *obj)
  {
      unsigned char *buf = OF_OBJECT_BUFFER_INDEX(obj, 0);
      switch (obj->version) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          *(uint16_t *)(buf + 0) = U16_HTON(0x3a); /* type */
          break;
      default:
          UNREACHABLE();
      }
  }
  
  
  
  /**
   * \defgroup of_bsn_tlv_interval of_bsn_tlv_interval
   */
  
  /**
   * Create a new of_bsn_tlv_interval object
   *
   * @param version The wire version to use for the object
   * @return Pointer to the newly create object or NULL on error
   *
   * Initializes the new object with it's default fixed length associating
   * a new underlying wire buffer.
   *
   * \ingroup of_bsn_tlv_interval
   */
  
  of_object_t *
  of_bsn_tlv_interval_new(of_version_t version)
  {
      of_object_t *obj;
      int bytes;
  
      bytes = of_object_fixed_len[version][OF_BSN_TLV_INTERVAL];
  
      if ((obj = of_object_new(bytes)) == NULL) {
          return NULL;
      }
  
      of_bsn_tlv_interval_init(obj, version, bytes, 0);
      of_bsn_tlv_interval_push_wire_types(obj);
      of_tlv16_wire_length_set(obj, obj->length);
  
      return obj;
  }
  
  /**
   * Initialize an object of type of_bsn_tlv_interval.
   *
   * @param obj Pointer to the object to initialize
   * @param version The wire version to use for the object
   * @param bytes How many bytes in the object
   * @param clean_wire Boolean: If true, clear the wire object control struct
   *
   * If bytes < 0, then the default fixed length is used for the object
   *
   * This is a "coerce" function that sets up the pointers for the
   * accessors properly.
   *
   * If anything other than 0 is passed in for the buffer size, the underlying
   * wire buffer will have 'grow' called.
   */
  
  void
  of_bsn_tlv_interval_init(of_object_t *obj,
      of_version_t version, int bytes, int clean_wire)
  {
      LOCI_ASSERT(of_object_fixed_len[version][OF_BSN_TLV_INTERVAL] >= 0);
      if (clean_wire) {
          MEMSET(obj, 0, sizeof(*obj));
      }
      if (bytes < 0) {
          bytes = of_object_fixed_len[version][OF_BSN_TLV_INTERVAL];
      }
      obj->version = version;
      obj->length = bytes;
      obj->object_id = OF_BSN_TLV_INTERVAL;
  
      /* Grow the wire buffer */
      if (obj->wbuf != NULL) {
          int tot_bytes;
  
          tot_bytes = bytes + obj->obj_offset;
          of_wire_buffer_grow(obj->wbuf, tot_bytes);
      }
  }
  
  /**
   * Get value from an object of type of_bsn_tlv_interval.
   * @param obj Pointer to an object of type of_bsn_tlv_interval.
   * @param value Pointer to the child object of type
   * uint32_t to be filled out.
   *
   */
  void
  of_bsn_tlv_interval_value_get(
      of_bsn_tlv_interval_t *obj,
      uint32_t *value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_INTERVAL);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u32_get(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  
  /**
   * Set value in an object of type of_bsn_tlv_interval.
   * @param obj Pointer to an object of type of_bsn_tlv_interval.
   * @param value The value to write into the object
   */
  void
  of_bsn_tlv_interval_value_set(
      of_bsn_tlv_interval_t *obj,
      uint32_t value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_INTERVAL);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u32_set(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  /* Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University */
  /* Copyright (c) 2011, 2012 Open Networking Foundation */
  /* Copyright (c) 2012, 2013 Big Switch Networks, Inc. */
  /* See the file LICENSE.loci which should have been included in the source distribution */
  #ifdef __GNUC__
  
  #ifdef __linux__
  /* glibc */
  #include <features.h>
  #else
  /* NetBSD etc */
  #include <sys/cdefs.h>
  #ifdef __GNUC_PREREQ__
  #define __GNUC_PREREQ __GNUC_PREREQ__
  #endif
  #endif
  
  #ifndef __GNUC_PREREQ
  /* fallback */
  #define __GNUC_PREREQ(maj, min) 0
  #endif
  
  #if __GNUC_PREREQ(4,6)
  #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
  #endif
  
  #endif
  
  #include "loci_log.h"
  #include "loci_int.h"
  
  void
  of_bsn_tlv_ip_fragmentation_push_wire_types(of_object_t *obj)
  {
      unsigned char *buf = OF_OBJECT_BUFFER_INDEX(obj, 0);
      switch (obj->version) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          *(uint16_t *)(buf + 0) = U16_HTON(0xc9); /* type */
          break;
      default:
          UNREACHABLE();
      }
  }
  
  
  
  /**
   * \defgroup of_bsn_tlv_ip_fragmentation of_bsn_tlv_ip_fragmentation
   */
  
  /**
   * Create a new of_bsn_tlv_ip_fragmentation object
   *
   * @param version The wire version to use for the object
   * @return Pointer to the newly create object or NULL on error
   *
   * Initializes the new object with it's default fixed length associating
   * a new underlying wire buffer.
   *
   * \ingroup of_bsn_tlv_ip_fragmentation
   */
  
  of_object_t *
  of_bsn_tlv_ip_fragmentation_new(of_version_t version)
  {
      of_object_t *obj;
      int bytes;
  
      bytes = of_object_fixed_len[version][OF_BSN_TLV_IP_FRAGMENTATION];
  
      if ((obj = of_object_new(bytes)) == NULL) {
          return NULL;
      }
  
      of_bsn_tlv_ip_fragmentation_init(obj, version, bytes, 0);
      of_bsn_tlv_ip_fragmentation_push_wire_types(obj);
      of_tlv16_wire_length_set(obj, obj->length);
  
      return obj;
  }
  
  /**
   * Initialize an object of type of_bsn_tlv_ip_fragmentation.
   *
   * @param obj Pointer to the object to initialize
   * @param version The wire version to use for the object
   * @param bytes How many bytes in the object
   * @param clean_wire Boolean: If true, clear the wire object control struct
   *
   * If bytes < 0, then the default fixed length is used for the object
   *
   * This is a "coerce" function that sets up the pointers for the
   * accessors properly.
   *
   * If anything other than 0 is passed in for the buffer size, the underlying
   * wire buffer will have 'grow' called.
   */
  
  void
  of_bsn_tlv_ip_fragmentation_init(of_object_t *obj,
      of_version_t version, int bytes, int clean_wire)
  {
      LOCI_ASSERT(of_object_fixed_len[version][OF_BSN_TLV_IP_FRAGMENTATION] >= 0);
      if (clean_wire) {
          MEMSET(obj, 0, sizeof(*obj));
      }
      if (bytes < 0) {
          bytes = of_object_fixed_len[version][OF_BSN_TLV_IP_FRAGMENTATION];
      }
      obj->version = version;
      obj->length = bytes;
      obj->object_id = OF_BSN_TLV_IP_FRAGMENTATION;
  
      /* Grow the wire buffer */
      if (obj->wbuf != NULL) {
          int tot_bytes;
  
          tot_bytes = bytes + obj->obj_offset;
          of_wire_buffer_grow(obj->wbuf, tot_bytes);
      }
  }
  
  /**
   * Get value from an object of type of_bsn_tlv_ip_fragmentation.
   * @param obj Pointer to an object of type of_bsn_tlv_ip_fragmentation.
   * @param value Pointer to the child object of type
   * uint8_t to be filled out.
   *
   */
  void
  of_bsn_tlv_ip_fragmentation_value_get(
      of_bsn_tlv_ip_fragmentation_t *obj,
      uint8_t *value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_IP_FRAGMENTATION);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u8_get(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  
  /**
   * Set value in an object of type of_bsn_tlv_ip_fragmentation.
   * @param obj Pointer to an object of type of_bsn_tlv_ip_fragmentation.
   * @param value The value to write into the object
   */
  void
  of_bsn_tlv_ip_fragmentation_value_set(
      of_bsn_tlv_ip_fragmentation_t *obj,
      uint8_t value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_IP_FRAGMENTATION);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u8_set(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  /* Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University */
  /* Copyright (c) 2011, 2012 Open Networking Foundation */
  /* Copyright (c) 2012, 2013 Big Switch Networks, Inc. */
  /* See the file LICENSE.loci which should have been included in the source distribution */
  #ifdef __GNUC__
  
  #ifdef __linux__
  /* glibc */
  #include <features.h>
  #else
  /* NetBSD etc */
  #include <sys/cdefs.h>
  #ifdef __GNUC_PREREQ__
  #define __GNUC_PREREQ __GNUC_PREREQ__
  #endif
  #endif
  
  #ifndef __GNUC_PREREQ
  /* fallback */
  #define __GNUC_PREREQ(maj, min) 0
  #endif
  
  #if __GNUC_PREREQ(4,6)
  #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
  #endif
  
  #endif
  
  #include "loci_log.h"
  #include "loci_int.h"
  
  void
  of_bsn_tlv_ip_proto_push_wire_types(of_object_t *obj)
  {
      unsigned char *buf = OF_OBJECT_BUFFER_INDEX(obj, 0);
      switch (obj->version) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          *(uint16_t *)(buf + 0) = U16_HTON(0x43); /* type */
          break;
      default:
          UNREACHABLE();
      }
  }
  
  
  
  /**
   * \defgroup of_bsn_tlv_ip_proto of_bsn_tlv_ip_proto
   */
  
  /**
   * Create a new of_bsn_tlv_ip_proto object
   *
   * @param version The wire version to use for the object
   * @return Pointer to the newly create object or NULL on error
   *
   * Initializes the new object with it's default fixed length associating
   * a new underlying wire buffer.
   *
   * \ingroup of_bsn_tlv_ip_proto
   */
  
  of_object_t *
  of_bsn_tlv_ip_proto_new(of_version_t version)
  {
      of_object_t *obj;
      int bytes;
  
      bytes = of_object_fixed_len[version][OF_BSN_TLV_IP_PROTO];
  
      if ((obj = of_object_new(bytes)) == NULL) {
          return NULL;
      }
  
      of_bsn_tlv_ip_proto_init(obj, version, bytes, 0);
      of_bsn_tlv_ip_proto_push_wire_types(obj);
      of_tlv16_wire_length_set(obj, obj->length);
  
      return obj;
  }
  
  /**
   * Initialize an object of type of_bsn_tlv_ip_proto.
   *
   * @param obj Pointer to the object to initialize
   * @param version The wire version to use for the object
   * @param bytes How many bytes in the object
   * @param clean_wire Boolean: If true, clear the wire object control struct
   *
   * If bytes < 0, then the default fixed length is used for the object
   *
   * This is a "coerce" function that sets up the pointers for the
   * accessors properly.
   *
   * If anything other than 0 is passed in for the buffer size, the underlying
   * wire buffer will have 'grow' called.
   */
  
  void
  of_bsn_tlv_ip_proto_init(of_object_t *obj,
      of_version_t version, int bytes, int clean_wire)
  {
      LOCI_ASSERT(of_object_fixed_len[version][OF_BSN_TLV_IP_PROTO] >= 0);
      if (clean_wire) {
          MEMSET(obj, 0, sizeof(*obj));
      }
      if (bytes < 0) {
          bytes = of_object_fixed_len[version][OF_BSN_TLV_IP_PROTO];
      }
      obj->version = version;
      obj->length = bytes;
      obj->object_id = OF_BSN_TLV_IP_PROTO;
  
      /* Grow the wire buffer */
      if (obj->wbuf != NULL) {
          int tot_bytes;
  
          tot_bytes = bytes + obj->obj_offset;
          of_wire_buffer_grow(obj->wbuf, tot_bytes);
      }
  }
  
  /**
   * Get value from an object of type of_bsn_tlv_ip_proto.
   * @param obj Pointer to an object of type of_bsn_tlv_ip_proto.
   * @param value Pointer to the child object of type
   * uint8_t to be filled out.
   *
   */
  void
  of_bsn_tlv_ip_proto_value_get(
      of_bsn_tlv_ip_proto_t *obj,
      uint8_t *value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_IP_PROTO);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u8_get(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  
  /**
   * Set value in an object of type of_bsn_tlv_ip_proto.
   * @param obj Pointer to an object of type of_bsn_tlv_ip_proto.
   * @param value The value to write into the object
   */
  void
  of_bsn_tlv_ip_proto_value_set(
      of_bsn_tlv_ip_proto_t *obj,
      uint8_t value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_IP_PROTO);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u8_set(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  /* Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University */
  /* Copyright (c) 2011, 2012 Open Networking Foundation */
  /* Copyright (c) 2012, 2013 Big Switch Networks, Inc. */
  /* See the file LICENSE.loci which should have been included in the source distribution */
  #ifdef __GNUC__
  
  #ifdef __linux__
  /* glibc */
  #include <features.h>
  #else
  /* NetBSD etc */
  #include <sys/cdefs.h>
  #ifdef __GNUC_PREREQ__
  #define __GNUC_PREREQ __GNUC_PREREQ__
  #endif
  #endif
  
  #ifndef __GNUC_PREREQ
  /* fallback */
  #define __GNUC_PREREQ(maj, min) 0
  #endif
  
  #if __GNUC_PREREQ(4,6)
  #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
  #endif
  
  #endif
  
  #include "loci_log.h"
  #include "loci_int.h"
  
  void
  of_bsn_tlv_ip_tunnel_type_push_wire_types(of_object_t *obj)
  {
      unsigned char *buf = OF_OBJECT_BUFFER_INDEX(obj, 0);
      switch (obj->version) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          *(uint16_t *)(buf + 0) = U16_HTON(0xa9); /* type */
          break;
      default:
          UNREACHABLE();
      }
  }
  
  
  
  /**
   * \defgroup of_bsn_tlv_ip_tunnel_type of_bsn_tlv_ip_tunnel_type
   */
  
  /**
   * Create a new of_bsn_tlv_ip_tunnel_type object
   *
   * @param version The wire version to use for the object
   * @return Pointer to the newly create object or NULL on error
   *
   * Initializes the new object with it's default fixed length associating
   * a new underlying wire buffer.
   *
   * \ingroup of_bsn_tlv_ip_tunnel_type
   */
  
  of_object_t *
  of_bsn_tlv_ip_tunnel_type_new(of_version_t version)
  {
      of_object_t *obj;
      int bytes;
  
      bytes = of_object_fixed_len[version][OF_BSN_TLV_IP_TUNNEL_TYPE];
  
      if ((obj = of_object_new(bytes)) == NULL) {
          return NULL;
      }
  
      of_bsn_tlv_ip_tunnel_type_init(obj, version, bytes, 0);
      of_bsn_tlv_ip_tunnel_type_push_wire_types(obj);
      of_tlv16_wire_length_set(obj, obj->length);
  
      return obj;
  }
  
  /**
   * Initialize an object of type of_bsn_tlv_ip_tunnel_type.
   *
   * @param obj Pointer to the object to initialize
   * @param version The wire version to use for the object
   * @param bytes How many bytes in the object
   * @param clean_wire Boolean: If true, clear the wire object control struct
   *
   * If bytes < 0, then the default fixed length is used for the object
   *
   * This is a "coerce" function that sets up the pointers for the
   * accessors properly.
   *
   * If anything other than 0 is passed in for the buffer size, the underlying
   * wire buffer will have 'grow' called.
   */
  
  void
  of_bsn_tlv_ip_tunnel_type_init(of_object_t *obj,
      of_version_t version, int bytes, int clean_wire)
  {
      LOCI_ASSERT(of_object_fixed_len[version][OF_BSN_TLV_IP_TUNNEL_TYPE] >= 0);
      if (clean_wire) {
          MEMSET(obj, 0, sizeof(*obj));
      }
      if (bytes < 0) {
          bytes = of_object_fixed_len[version][OF_BSN_TLV_IP_TUNNEL_TYPE];
      }
      obj->version = version;
      obj->length = bytes;
      obj->object_id = OF_BSN_TLV_IP_TUNNEL_TYPE;
  
      /* Grow the wire buffer */
      if (obj->wbuf != NULL) {
          int tot_bytes;
  
          tot_bytes = bytes + obj->obj_offset;
          of_wire_buffer_grow(obj->wbuf, tot_bytes);
      }
  }
  
  /**
   * Get value from an object of type of_bsn_tlv_ip_tunnel_type.
   * @param obj Pointer to an object of type of_bsn_tlv_ip_tunnel_type.
   * @param value Pointer to the child object of type
   * uint16_t to be filled out.
   *
   */
  void
  of_bsn_tlv_ip_tunnel_type_value_get(
      of_bsn_tlv_ip_tunnel_type_t *obj,
      uint16_t *value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_IP_TUNNEL_TYPE);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u16_get(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  
  /**
   * Set value in an object of type of_bsn_tlv_ip_tunnel_type.
   * @param obj Pointer to an object of type of_bsn_tlv_ip_tunnel_type.
   * @param value The value to write into the object
   */
  void
  of_bsn_tlv_ip_tunnel_type_value_set(
      of_bsn_tlv_ip_tunnel_type_t *obj,
      uint16_t value)
  {
      of_wire_buffer_t *wbuf;
      int offset = 0; /* Offset of value relative to the start obj */
      int abs_offset; /* Offset of value relative to start of wbuf */
      of_version_t ver;
  
      LOCI_ASSERT(obj->object_id == OF_BSN_TLV_IP_TUNNEL_TYPE);
      ver = obj->version;
      wbuf = OF_OBJECT_TO_WBUF(obj);
      LOCI_ASSERT(wbuf != NULL);
  
      /* By version, determine offset and current length (where needed) */
      switch (ver) {
      case OF_VERSION_1_3:
      case OF_VERSION_1_4:
          offset = 4;
          break;
      default:
          LOCI_ASSERT(0);
      }
  
      abs_offset = OF_OBJECT_ABSOLUTE_OFFSET(obj, offset);
      LOCI_ASSERT(abs_offset >= 0);
      of_wire_buffer_u16_set(wbuf, abs_offset, value);
  
      OF_LENGTH_CHECK_ASSERT(obj);
  
      return ;
  }
  