Initial import

LoxiGen is the work of several developers, not just myself.
diff --git a/c_gen/templates/.gitignore b/c_gen/templates/.gitignore
new file mode 100644
index 0000000..c3ed10e
--- /dev/null
+++ b/c_gen/templates/.gitignore
@@ -0,0 +1 @@
+*.cache
diff --git a/c_gen/templates/Doxyfile b/c_gen/templates/Doxyfile
new file mode 100644
index 0000000..983aba9
--- /dev/null
+++ b/c_gen/templates/Doxyfile
@@ -0,0 +1,1551 @@
+# Doxyfile 1.6.3
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING      = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME           = "LOCI OpenFlow Interfaces"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER         =
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       = doc
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS         = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
+# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
+# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
+# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak,
+# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
+
+OUTPUT_LANGUAGE        = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF           = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF       =
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC    = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB  = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES        = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH        =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH    =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES            = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF      = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF           = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS           = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES  = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE               = 8
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES                =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C  = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA   = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN   = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL   = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it parses.
+# With this tag you can assign which parser to use for a given extension.
+# Doxygen has a built-in mapping, but you can override or extend it using this tag.
+# The format is ext=language, where ext is a file extension, and language is one of
+# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP,
+# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat
+# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran),
+# use: inc=Fortran f=C. Note that for custom extensions you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
+
+EXTENSION_MAPPING      =
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT    = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT        = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT            = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT   = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING            = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT   = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE      = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL            = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE        = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC         = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES  = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS  = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES   = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES     = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS  = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS      = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS          = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES       = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES       = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES     = YES
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
+# will list include files with double quotes in the documentation
+# rather than with sharp brackets.
+
+FORCE_LOCAL_INCLUDES   = NO
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS       = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS        = YES
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the (brief and detailed) documentation of class members so that constructors and destructors are listed first. If set to NO (the default) the constructors will appear in the respective orders defined by SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES       = YES
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME     = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST      = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST       = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS       =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES  = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES        = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES       = NO
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES             = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page.
+# This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES        = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER    =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
+# doxygen. The layout file controls the global structure of the generated output files
+# in an output format independent way. The create the layout file that represents
+# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
+# file name after the option, if omitted DoxygenLayout.xml will be used as the name
+# of the layout file.
+
+LAYOUT_FILE            =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET                  = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS               = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED   = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR      = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC       = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT            = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE           =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT                  = src inc/loci
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING         = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS          =
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE              = NO
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE                =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS       = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS       =
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS        =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH           =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS       =
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE      = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH             =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output.
+# If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER           =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis.
+# Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match.
+# The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS        =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES    = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER         = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES         = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS    = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION    = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code.
+# Otherwise they will link to the documentation.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS              = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS       = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX     = NO
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX    = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX          =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT            = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION    = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER            =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER            =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET        =
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting
+# this to NO can help when comparing the output of multiple runs.
+
+HTML_TIMESTAMP         = YES
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS     = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS  = NO
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+
+GENERATE_DOCSET        = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME        = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID       = org.doxygen.Project
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP      = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE               =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION           =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI           = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING     =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND             = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
+# are set, an additional index file will be generated that can be used as input for
+# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
+# HTML documentation.
+
+GENERATE_QHP           = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE               =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#namespace
+
+QHP_NAMESPACE          = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+
+QHP_VIRTUAL_FOLDER     = doc
+
+# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add.
+# For more information please see
+# http://doc.trolltech.com/qthelpproject.html#custom-filters
+
+QHP_CUST_FILTER_NAME   =
+
+# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">Qt Help Project / Custom Filters</a>.
+
+QHP_CUST_FILTER_ATTRS  =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's
+# filter section matches.
+# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">Qt Help Project / Filter Attributes</a>.
+
+QHP_SECT_FILTER_ATTRS  =
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file.
+
+QHG_LOCATION           =
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
+#  will be generated, which together with the HTML files, form an Eclipse help
+#  plugin. To install this plugin and make it available under the help contents
+# menu in Eclipse, the contents of the directory containing the HTML and XML
+# files needs to be copied into the plugins directory of eclipse. The name of
+# the directory within the plugins directory should be the same as
+# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before the help appears.
+
+GENERATE_ECLIPSEHELP   = NO
+
+# A unique identifier for the eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have
+# this name.
+
+ECLIPSE_DOC_ID         = org.doxygen.Project
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX          = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to YES, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
+# Windows users are probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW      = NO
+
+# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list.
+
+USE_INLINE_TREES       = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH         = 250
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE       = 10
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box for the HTML output. The underlying search engine uses javascript
+# and DHTML and should work on any modern browser. Note that when using HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) there is already a search function so this one should
+# typically be disabled. For large projects the javascript based search engine
+# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
+
+SEARCHENGINE           = YES
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be implemented using a PHP enabled web server instead of at the web client using Javascript. Doxygen will generate the search PHP script and index
+# file to put on the web server. The advantage of the server based approach is that it scales better to large projects and allows full text search. The disadvances is that it is more difficult to setup
+# and does not have live searching capabilities.
+
+SERVER_BASED_SEARCH    = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX         = YES
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT           = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+# Note that when enabling USE_PDFLATEX this option is only used for
+# generating bitmaps for formulas in the HTML output, but not in the
+# Makefile that is written to the output directory.
+
+LATEX_CMD_NAME         = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME     = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX          = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE             = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES         =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER           =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS         = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX           = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE        = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES     = NO
+
+# If LATEX_SOURCE_CODE is set to YES then doxygen will include source code with syntax highlighting in the LaTeX output. Note that which sources are shown also depends on other settings such as SOURCE_BROWSER.
+
+LATEX_SOURCE_CODE      = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF           = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF            = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS         = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE    =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE    =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN           = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT             = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION          = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS              = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML           = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT             = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA             =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD                =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING     = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD       = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX          = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader.
+# This is useful
+# if you want to understand what is going on.
+# On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY         = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING   = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION        = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF     = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES        = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH           =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS  =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED             =
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED      =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS   = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+#
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+#
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES               =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE       =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS           = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS        = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS         = YES
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH            =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS   = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT               = NO
+
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME           = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE           = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH           =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH            = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH    = YES
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS           = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK               = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS     = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH          = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH      = YES
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH             = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH           = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY    = YES
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH        = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT       = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH               =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS           =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES    = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH    = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT        = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS      = YES
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND        = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP            = YES
diff --git a/c_gen/templates/README b/c_gen/templates/README
new file mode 100644
index 0000000..71c4a48
--- /dev/null
+++ b/c_gen/templates/README
@@ -0,0 +1,73 @@
+Introduction
+============
+
+LOCI is the C language module of LOXI, the Logical OpenFlow Extensible
+Interface. It provides a framework for managing OpenFlow objects in
+an object oriented fashion.
+
+All files in LOCI, even this README, are generated by LOXI. Please make
+modifications to LOXI instead of to these files directly.
+
+Compilation
+===========
+
+It's expected that users of LOCI will want to integrate it into their own build
+system. As an example, here's a simple command line to create a shared library
+on Linux:
+
+    gcc -fPIC -shared -I inc src/*.c -o loci.so
+
+LOCI has no dependencies beyond the C standard library.
+
+Documentation
+=============
+
+A Doxygen configuration file is provided. Just run `doxygen` to generate HTML
+documentation pages. Each OpenFlow object is linked to under the "Modules"
+tab.
+
+Usage
+=====
+
+Currently the best example code for using LOCI is the switchlight-core
+repository.
+
+Here's example code that creates a flow mod:
+
+    /* Create the match */
+    of_match_t match;
+    memset(&match, 0, sizeof(match));
+    match.fields.in_port = 1;
+    OF_MATCH_MASK_IN_PORT_EXACT_SET(&match);
+    match.fields.eth_type = 0x8000;
+    OF_MATCH_MASK_ETH_TYPE_EXACT_SET(&match);
+
+    /* Create a flow mod */
+    of_flow_add_t *flow_add = of_flow_add_new(OF_VERSION_1_0);
+    of_flow_add_idle_timeout_set(flow_add, 5);
+    of_flow_add_cookie_set(flow_add, 42);
+    of_flow_add_priority_set(flow_add, 10000);
+    of_flow_add_buffer_id_set(flow_add, -1);
+    if (of_flow_add_match_set(flow_add, &match)) {
+        fprintf(stderr, "Failed to set the match field\n");
+        abort();
+    }
+
+    /* Populate the action list */
+    of_list_action_t actions;
+    of_flow_add_actions_bind(flow_add, &actions);
+    int i;
+    for (i = 1; i <= 4; i++) {
+        of_action_output_t action;
+        of_action_output_init(&action, flow_add->version, -1, 1);
+        of_list_action_append_bind(&actions, (of_action_t *)&action);
+        of_action_output_port_set(&action, i);
+    }
+
+    /* Use the underlying buffer */
+    void *buf = WBUF_BUF(OF_OBJECT_TO_WBUF(flow_add));
+    uint16_t len = flow_add->length;
+    /* ... */
+
+    /* Free the flow mod */
+    of_flow_add_delete(flow_add);
diff --git a/c_gen/templates/bsn_ext.h b/c_gen/templates/bsn_ext.h
new file mode 100644
index 0000000..6afa211
--- /dev/null
+++ b/c_gen/templates/bsn_ext.h
@@ -0,0 +1,44 @@
+:: # Copyright 2013, Big Switch Networks, Inc.
+:: #
+:: # LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
+:: # the following special exception:
+:: #
+:: # LOXI Exception
+:: #
+:: # As a special exception to the terms of the EPL, you may distribute libraries
+:: # generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
+:: # that copyright and licensing notices generated by LoxiGen are not altered or removed
+:: # from the LoxiGen Libraries and the notice provided below is (i) included in
+:: # the LoxiGen Libraries, if distributed in source code form and (ii) included in any
+:: # documentation for the LoxiGen Libraries, if distributed in binary form.
+:: #
+:: # Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler."
+:: #
+:: # You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain
+:: # a copy of the EPL at:
+:: #
+:: # http://www.eclipse.org/legal/epl-v10.html
+:: #
+:: # Unless required by applicable law or agreed to in writing, software
+:: # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+:: # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+:: # EPL for the specific language governing permissions and limitations
+:: # under the EPL.
+::
+/* Copyright 2013, Big Switch Networks, Inc. */
+
+/**
+ * BSN OpenFlow extension definition header file
+ */
+
+#ifndef _LOCI_BSN_EXT_H_
+#define _LOCI_BSN_EXT_H_
+
+/* Mirroring for destination, bit in port_config */
+#define OF_PORT_CONFIG_BSN_MIRROR_DEST (1 << 31) /* Mirror destination only */
+
+/* Point at which mirroring is to occur */
+#define OF_BSN_MIRROR_STAGE_INGRESS 0
+#define OF_BSN_MIRROR_STAGE_EGRESS 1
+
+#endif /* _LOCI_BSN_EXT_H_ */
diff --git a/c_gen/templates/loci_dox.h b/c_gen/templates/loci_dox.h
new file mode 100644
index 0000000..86c29db
--- /dev/null
+++ b/c_gen/templates/loci_dox.h
@@ -0,0 +1,55 @@
+:: # Copyright 2013, Big Switch Networks, Inc.
+:: #
+:: # LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
+:: # the following special exception:
+:: #
+:: # LOXI Exception
+:: #
+:: # As a special exception to the terms of the EPL, you may distribute libraries
+:: # generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
+:: # that copyright and licensing notices generated by LoxiGen are not altered or removed
+:: # from the LoxiGen Libraries and the notice provided below is (i) included in
+:: # the LoxiGen Libraries, if distributed in source code form and (ii) included in any
+:: # documentation for the LoxiGen Libraries, if distributed in binary form.
+:: #
+:: # Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler."
+:: #
+:: # You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain
+:: # a copy of the EPL at:
+:: #
+:: # http://www.eclipse.org/legal/epl-v10.html
+:: #
+:: # Unless required by applicable law or agreed to in writing, software
+:: # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+:: # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+:: # EPL for the specific language governing permissions and limitations
+:: # under the EPL.
+::
+/* Copyright 2013, Big Switch Networks, Inc. */
+
+/**************************************************************************//**
+ * 
+ * loci Doxygen Header
+ * 
+ *****************************************************************************/
+#ifndef __LOCI_DOX_H__
+#define __LOCI_DOX_H__
+
+/**
+ * @defgroup loci loci - loci Description
+ *
+
+The documentation overview for this module should go here. 
+
+ *
+ * @{
+ *
+ * @defgroup loci-loci Public Interface
+ * @defgroup loci-config Compile Time Configuration
+ * @defgroup loci-porting Porting Macros
+ * 
+ * @}
+ *
+ */
+
+#endif /* __LOCI_DOX_H__ */
diff --git a/c_gen/templates/loci_dump.h b/c_gen/templates/loci_dump.h
new file mode 100644
index 0000000..12bba6e
--- /dev/null
+++ b/c_gen/templates/loci_dump.h
@@ -0,0 +1,101 @@
+:: # Copyright 2013, Big Switch Networks, Inc.
+:: #
+:: # LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
+:: # the following special exception:
+:: #
+:: # LOXI Exception
+:: #
+:: # As a special exception to the terms of the EPL, you may distribute libraries
+:: # generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
+:: # that copyright and licensing notices generated by LoxiGen are not altered or removed
+:: # from the LoxiGen Libraries and the notice provided below is (i) included in
+:: # the LoxiGen Libraries, if distributed in source code form and (ii) included in any
+:: # documentation for the LoxiGen Libraries, if distributed in binary form.
+:: #
+:: # Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler."
+:: #
+:: # You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain
+:: # a copy of the EPL at:
+:: #
+:: # http://www.eclipse.org/legal/epl-v10.html
+:: #
+:: # Unless required by applicable law or agreed to in writing, software
+:: # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+:: # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+:: # EPL for the specific language governing permissions and limitations
+:: # under the EPL.
+::
+/* Copyright 2012, Big Switch Networks, Inc. */
+
+#if !defined(_LOCI_DUMP_H_)
+#define _LOCI_DUMP_H_
+
+#include <loci/loci_base.h>
+#include <loci/of_match.h>
+#include <stdio.h>
+
+/* g++ requires this to pick up PRI, etc.
+ * See  http://gcc.gnu.org/ml/gcc-help/2006-10/msg00223.html
+ */
+#if !defined(__STDC_FORMAT_MACROS)
+#define __STDC_FORMAT_MACROS
+#endif
+#include <inttypes.h>
+
+typedef int (*loci_obj_dump_f)(loci_writer_f writer, void *cookie, of_object_t *obj);
+
+/****************************************************************
+ *
+ * Per-datatype dump macros
+ *
+ ****************************************************************/
+#define LOCI_DUMP_u8(writer, cookie, val) writer(cookie, "%u", (val))
+#define LOCI_DUMP_u16(writer, cookie, val) writer(cookie, "%u (0x%x)", (val), (val))
+#define LOCI_DUMP_u32(writer, cookie, val) writer(cookie, "%u (0x%x)", (val), (val))
+#define LOCI_DUMP_u64(writer, cookie, val) writer(cookie, "%" PRIu64 "(0x%" PRIx64 ")", (val), (val))
+
+/* @todo Add checks for special port numbers */
+#define LOCI_DUMP_port_no(writer, cookie, val) LOCI_DUMP_u32(writer, cookie, val)
+#define LOCI_DUMP_fm_cmd(writer, cookie, val) LOCI_DUMP_u16(writer, cookie, val)
+
+/* @todo Decode wildcards */
+#define LOCI_DUMP_wc_bmap(writer, cookie, val)         \
+    writer(cookie, "0x%" PRIx64, (val))
+#define LOCI_DUMP_match_bmap(writer, cookie, val)      \
+    writer(cookie, "0x%" PRIx64, (val))
+
+/* @todo Dump first N bytes of data */
+#define LOCI_DUMP_octets(writer, cookie, val)                                      \
+    writer(cookie, "%d bytes at location %p", (val).bytes, (val).data)
+
+#define LOCI_DUMP_mac(writer, cookie, val)                                 \
+    writer(cookie, "%02x:%02x:%02x:%02x:%02x:%02x",            \
+               (val).addr[0], (val).addr[1], (val).addr[2],     \
+               (val).addr[3], (val).addr[4], (val).addr[5])
+
+#define LOCI_DUMP_ipv4(writer, cookie, val)                                        \
+    writer(cookie, "%d.%d.%d.%d", val >> 24, (val >> 16) & 0xff,       \
+               (val >> 8) & 0xff, val & 0xff)
+
+#define LOCI_DUMP_ipv6(writer, cookie, val)                                        \
+    writer(cookie, "%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x", \
+               (val).addr[0], (val).addr[1], (val).addr[2], (val).addr[3], \
+               (val).addr[4], (val).addr[5], (val).addr[6], (val).addr[7], \
+               (val).addr[8], (val).addr[9], (val).addr[10], (val).addr[11], \
+               (val).addr[12], (val).addr[13], (val).addr[14], (val).addr[15])
+
+#define LOCI_DUMP_string(writer, cookie, val) writer(cookie, "%s", val)
+
+#define LOCI_DUMP_port_name(writer, cookie, val) LOCI_DUMP_string(writer, cookie, val)
+#define LOCI_DUMP_tab_name(writer, cookie, val) LOCI_DUMP_string(writer, cookie, val)
+#define LOCI_DUMP_desc_str(writer, cookie, val) LOCI_DUMP_string(writer, cookie, val)
+#define LOCI_DUMP_ser_num(writer, cookie, val) LOCI_DUMP_string(writer, cookie, val)
+
+int loci_dump_match(loci_writer_f writer, void* cookie, of_match_t *match);
+#define LOCI_DUMP_match(writer, cookie, val) loci_dump_match(writer, cookie, &val)
+
+/**
+ * Generic version for any object
+ */
+int of_object_dump(loci_writer_f writer, void *cookie, of_object_t *obj);
+#endif /* _LOCI_DUMP_H_ */
diff --git a/c_gen/templates/loci_int.h b/c_gen/templates/loci_int.h
new file mode 100644
index 0000000..ce5ecb0
--- /dev/null
+++ b/c_gen/templates/loci_int.h
@@ -0,0 +1,45 @@
+:: # Copyright 2013, Big Switch Networks, Inc.
+:: #
+:: # LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
+:: # the following special exception:
+:: #
+:: # LOXI Exception
+:: #
+:: # As a special exception to the terms of the EPL, you may distribute libraries
+:: # generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
+:: # that copyright and licensing notices generated by LoxiGen are not altered or removed
+:: # from the LoxiGen Libraries and the notice provided below is (i) included in
+:: # the LoxiGen Libraries, if distributed in source code form and (ii) included in any
+:: # documentation for the LoxiGen Libraries, if distributed in binary form.
+:: #
+:: # Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler."
+:: #
+:: # You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain
+:: # a copy of the EPL at:
+:: #
+:: # http://www.eclipse.org/legal/epl-v10.html
+:: #
+:: # Unless required by applicable law or agreed to in writing, software
+:: # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+:: # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+:: # EPL for the specific language governing permissions and limitations
+:: # under the EPL.
+::
+/* Copyright 2013, Big Switch Networks, Inc. */
+
+/******************************************************************************
+ *
+ *  /module/src/loci_int.h
+ *
+ *  loci Internal Header
+ *
+ *****************************************************************************/
+#ifndef __LOCI_INT_H__
+#define __LOCI_INT_H__
+
+
+
+
+
+#include <loci/loci.h> 
+#endif /* __LOCI_INT_H__ */
diff --git a/c_gen/templates/loci_log.c b/c_gen/templates/loci_log.c
new file mode 100644
index 0000000..cf34eae
--- /dev/null
+++ b/c_gen/templates/loci_log.c
@@ -0,0 +1,44 @@
+:: # Copyright 2013, Big Switch Networks, Inc.
+:: #
+:: # LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
+:: # the following special exception:
+:: #
+:: # LOXI Exception
+:: #
+:: # As a special exception to the terms of the EPL, you may distribute libraries
+:: # generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
+:: # that copyright and licensing notices generated by LoxiGen are not altered or removed
+:: # from the LoxiGen Libraries and the notice provided below is (i) included in
+:: # the LoxiGen Libraries, if distributed in source code form and (ii) included in any
+:: # documentation for the LoxiGen Libraries, if distributed in binary form.
+:: #
+:: # Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler."
+:: #
+:: # You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain
+:: # a copy of the EPL at:
+:: #
+:: # http://www.eclipse.org/legal/epl-v10.html
+:: #
+:: # Unless required by applicable law or agreed to in writing, software
+:: # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+:: # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+:: # EPL for the specific language governing permissions and limitations
+:: # under the EPL.
+::
+/* Copyright 2012, Big Switch Networks, Inc. */
+
+#include <stdarg.h>
+
+#include "loci_log.h"
+
+#include <loci/loci.h>
+
+static int
+loci_null_logger(loci_log_level_t level,
+                 const char *fname, const char *file, int line,
+                 const char *format, ...)
+{
+    return 0;
+}
+
+loci_logger_f loci_logger = loci_null_logger;
diff --git a/c_gen/templates/loci_log.h b/c_gen/templates/loci_log.h
new file mode 100644
index 0000000..3e22d81
--- /dev/null
+++ b/c_gen/templates/loci_log.h
@@ -0,0 +1,57 @@
+:: # Copyright 2013, Big Switch Networks, Inc.
+:: #
+:: # LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
+:: # the following special exception:
+:: #
+:: # LOXI Exception
+:: #
+:: # As a special exception to the terms of the EPL, you may distribute libraries
+:: # generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
+:: # that copyright and licensing notices generated by LoxiGen are not altered or removed
+:: # from the LoxiGen Libraries and the notice provided below is (i) included in
+:: # the LoxiGen Libraries, if distributed in source code form and (ii) included in any
+:: # documentation for the LoxiGen Libraries, if distributed in binary form.
+:: #
+:: # Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler."
+:: #
+:: # You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain
+:: # a copy of the EPL at:
+:: #
+:: # http://www.eclipse.org/legal/epl-v10.html
+:: #
+:: # Unless required by applicable law or agreed to in writing, software
+:: # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+:: # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+:: # EPL for the specific language governing permissions and limitations
+:: # under the EPL.
+::
+/* Copyright 2012, Big Switch Networks, Inc. */
+
+#if !defined(_LOCI_LOG_H_)
+#define _LOCI_LOG_H_
+
+#include <loci/loci_base.h>
+#include <loci/of_match.h>
+#include <stdio.h>
+
+/* g++ requires this to pick up PRI, etc.
+ * See  http://gcc.gnu.org/ml/gcc-help/2006-10/msg00223.html
+ */
+#if !defined(__STDC_FORMAT_MACROS)
+#define __STDC_FORMAT_MACROS
+#endif
+#include <inttypes.h>
+
+/**
+ * Per level log macros.  printf semantics
+ */
+
+#define LOCI_LOG_COMMON(level, ...) loci_logger(level, __func__, __FILE__, __LINE__, __VA_ARGS__)
+#define LOCI_LOG_TRACE(...) LOCI_LOG_COMMON(LOCI_LOG_LEVEL_TRACE, __VA_ARGS__)
+#define LOCI_LOG_VERBOSE(...) LOCI_LOG_COMMON(LOCI_LOG_LEVEL_VERBOSE, __VA_ARGS__)
+#define LOCI_LOG_INFO(...) LOCI_LOG_COMMON(LOCI_LOG_LEVEL_INFO, __VA_ARGS__)
+#define LOCI_LOG_WARN(...) LOCI_LOG_COMMON(LOCI_LOG_LEVEL_WARN, __VA_ARGS__)
+#define LOCI_LOG_ERROR(...) LOCI_LOG_COMMON(LOCI_LOG_LEVEL_ERROR, __VA_ARGS__)
+#define LOCI_LOG_MSG(...) LOCI_LOG_COMMON(LOCI_LOG_LEVEL_MSG, __VA_ARGS__)
+
+#endif /* _LOCI_LOG_H_ */
diff --git a/c_gen/templates/loci_show.h b/c_gen/templates/loci_show.h
new file mode 100644
index 0000000..86efab1
--- /dev/null
+++ b/c_gen/templates/loci_show.h
@@ -0,0 +1,328 @@
+:: # Copyright 2013, Big Switch Networks, Inc.
+:: #
+:: # LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
+:: # the following special exception:
+:: #
+:: # LOXI Exception
+:: #
+:: # As a special exception to the terms of the EPL, you may distribute libraries
+:: # generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
+:: # that copyright and licensing notices generated by LoxiGen are not altered or removed
+:: # from the LoxiGen Libraries and the notice provided below is (i) included in
+:: # the LoxiGen Libraries, if distributed in source code form and (ii) included in any
+:: # documentation for the LoxiGen Libraries, if distributed in binary form.
+:: #
+:: # Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler."
+:: #
+:: # You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain
+:: # a copy of the EPL at:
+:: #
+:: # http://www.eclipse.org/legal/epl-v10.html
+:: #
+:: # Unless required by applicable law or agreed to in writing, software
+:: # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+:: # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+:: # EPL for the specific language governing permissions and limitations
+:: # under the EPL.
+::
+/* Copyright 2012, Big Switch Networks, Inc. */
+
+#if !defined(_LOCI_SHOW_H_)
+#define _LOCI_SHOW_H_
+
+#include <loci/loci_base.h>
+#include <loci/of_match.h>
+#include <stdio.h>
+
+/* g++ requires this to pick up PRI, etc.
+ * See  http://gcc.gnu.org/ml/gcc-help/2006-10/msg00223.html
+ */
+#if !defined(__STDC_FORMAT_MACROS)
+#define __STDC_FORMAT_MACROS
+#endif
+#include <inttypes.h>
+
+typedef int (*loci_obj_show_f)(loci_writer_f writer,
+                               void *cookie, of_object_t *obj);
+
+/****************************************************************
+ *
+ * Per-datatype dump macros
+ *
+ ****************************************************************/
+#define LOCI_SHOW_u8(writer, cookie, val) writer(cookie, "%u", (val))
+#define LOCI_SHOW_u16(writer, cookie, val) writer(cookie, "%u (0x%x)", (val), (val))
+#define LOCI_SHOW_u32(writer, cookie, val) writer(cookie, "%u (0x%x)", (val), (val))
+#define LOCI_SHOW_u64(writer, cookie, val) writer(cookie, "%" PRIu64 "(0x%" PRIx64 ")", (val), (val))
+
+#define LOCI_SHOW_D_INT(cookie, macro, val) writer(cookie, "%" macro , val); 
+#define LOCI_SHOW_X_INT(cookie, macro, val) writer(cookie, "0x%" macro, val); 
+
+#define LOCI_SHOW_x8(writer, cookie, val) LOCI_SHOW_X_INT(cookie,  PRIx8, val)
+#define LOCI_SHOW_x16(writer, cookie, val) LOCI_SHOW_X_INT(cookie, PRIx16, val)
+#define LOCI_SHOW_x32(writer, cookie, val) LOCI_SHOW_X_INT(cookie, PRIx32, val)
+#define LOCI_SHOW_x64(writer, cookie, val) LOCI_SHOW_X_INT(cookie, PRIx64, val)
+#define LOCI_SHOW_d8(writer, cookie, val) LOCI_SHOW_D_INT(cookie, PRId8, val)
+#define LOCI_SHOW_d16(writer, cookie, val) LOCI_SHOW_D_INT(cookie, PRId16, val)
+#define LOCI_SHOW_d32(writer, cookie, val) LOCI_SHOW_D_INT(cookie, PRId32, val)
+#define LOCI_SHOW_d64(writer, cookie, val) LOCI_SHOW_D_INT(cookie, PRId64, val)
+
+
+
+/**
+ * Field-specific show macros. 
+ */
+#define LOCI_SHOW_u32_ipv6_flabel(writer, cookie, val)     LOCI_SHOW_u32(writer, cookie, val)
+#define LOCI_SHOW_u8_vlan_pcp(writer, cookie, val)         LOCI_SHOW_u8(writer, cookie, val)
+#define LOCI_SHOW_u32_ipv4_src(writer, cookie, val)        LOCI_SHOW_ipv4(writer, cookie, val)
+#define LOCI_SHOW_ipv6_ipv6_dst(writer, cookie, val)       LOCI_SHOW_ipv6(writer, cookie, val)
+#define LOCI_SHOW_u32_arp_tpa(writer, cookie, val)         LOCI_SHOW_ipv4(writer, cookie, val)
+#define LOCI_SHOW_u8_icmpv6_type(writer, cookie, val)      LOCI_SHOW_u8(writer, cookie, val)
+#define LOCI_SHOW_mac_arp_sha(writer, cookie, val)         LOCI_SHOW_mac(writer, cookie, val)
+#define LOCI_SHOW_ipv6_ipv6_src(writer, cookie, val)       LOCI_SHOW_ipv6(writer, cookie, val)
+#define LOCI_SHOW_u16_sctp_src(writer, cookie, val)        LOCI_SHOW_u16(writer, cookie, val)
+#define LOCI_SHOW_u8_icmpv6_code(writer, cookie, val)      LOCI_SHOW_x8(writer, cookie, val)
+#define LOCI_SHOW_mac_eth_dst(writer, cookie, val)         LOCI_SHOW_mac(writer, cookie, val)
+#define LOCI_SHOW_mac_ipv6_nd_sll(writer, cookie, val)     LOCI_SHOW_mac(writer, cookie, val)
+#define LOCI_SHOW_u8_mpls_tc(writer, cookie, val)          LOCI_SHOW_x8(writer, cookie, val)
+#define LOCI_SHOW_u16_arp_op(writer, cookie, val)          LOCI_SHOW_u16(writer, cookie, val)
+#define LOCI_SHOW_u16_eth_type(writer, cookie, val)        LOCI_SHOW_x16(writer, cookie, val)
+#define LOCI_SHOW_ipv6_ipv6_nd_target(writer, cookie, val) LOCI_SHOW_ipv6(writer, cookie, val)
+#define LOCI_SHOW_u16_vlan_vid(writer, cookie, val)        LOCI_SHOW_u16(writer, cookie, val)
+#define LOCI_SHOW_mac_arp_tha(writer, cookie, val)         LOCI_SHOW_mac(writer, cookie, val)
+#define LOCI_SHOW_port_no_in_port(writer, cookie, val)     LOCI_SHOW_port_no(writer, cookie, val)
+#define LOCI_SHOW_u8_ip_dscp(writer, cookie, val)          LOCI_SHOW_x8(writer, cookie, val)
+#define LOCI_SHOW_u16_sctp_dst(writer, cookie, val)        LOCI_SHOW_u16(writer, cookie, val)
+#define LOCI_SHOW_u8_icmpv4_code(writer, cookie, val)      LOCI_SHOW_u8(writer, cookie, val)
+#define LOCI_SHOW_u16_tcp_src(writer, cookie, val)         LOCI_SHOW_u16(writer, cookie, val)
+#define LOCI_SHOW_u32_arp_spa(writer, cookie, val)         LOCI_SHOW_ipv4(writer, cookie, val)
+#define LOCI_SHOW_u8_ip_ecn(writer, cookie, val)           LOCI_SHOW_u8(writer, cookie, val)
+#define LOCI_SHOW_u16_udp_dst(writer, cookie, val)         LOCI_SHOW_u16(writer, cookie, val)
+#define LOCI_SHOW_port_no_in_phy_port(writer, cookie, val) LOCI_SHOW_port_no(writer, cookie, val)
+#define LOCI_SHOW_u32_ipv4_dst(writer, cookie, val)        LOCI_SHOW_ipv4(writer, cookie, val)
+#define LOCI_SHOW_mac_eth_src(writer, cookie, val)         LOCI_SHOW_mac(writer, cookie, val)
+#define LOCI_SHOW_u16_udp_src(writer, cookie, val)         LOCI_SHOW_u16(writer, cookie, val)
+#define LOCI_SHOW_mac_ipv6_nd_tll(writer, cookie, val)     LOCI_SHOW_mac(writer, cookie, val)
+#define LOCI_SHOW_u8_icmpv4_type(writer, cookie, val)      LOCI_SHOW_u8(writer, cookie, val)
+#define LOCI_SHOW_u32_mpls_label(writer, cookie, val)      LOCI_SHOW_u32(writer, cookie, val)
+#define LOCI_SHOW_u16_tcp_dst(writer, cookie, val)         LOCI_SHOW_u16(writer, cookie, val)
+#define LOCI_SHOW_u8_ip_proto(writer, cookie, val)         LOCI_SHOW_u8(writer, cookie, val)
+#define LOCI_SHOW_u64_metadata(writer, cookie, val)        LOCI_SHOW_x64(writer, cookie, val)
+
+
+
+
+/* @todo Add checks for special port numbers */
+#define LOCI_SHOW_port_no(writer, cookie, val) writer(cookie, "%d", val)
+#define LOCI_SHOW_fm_cmd(writer, cookie, val) LOCI_SHOW_u16(writer, cookie, val)
+
+/* @todo Decode wildcards */
+#define LOCI_SHOW_wc_bmap(writer, cookie, val)         \
+    writer(cookie, "0x%" PRIx64, (val))
+#define LOCI_SHOW_match_bmap(writer, cookie, val)      \
+    writer(cookie, "0x%" PRIx64, (val))
+
+/* @todo Dump first N bytes of data */
+#define LOCI_SHOW_octets(writer, cookie, val)                                      \
+    writer(cookie, "%d bytes at location %p", (val).bytes, (val).data)
+
+#define LOCI_SHOW_mac(writer, cookie, val)                                 \
+    writer(cookie, "%02x:%02x:%02x:%02x:%02x:%02x",            \
+               (val).addr[0], (val).addr[1], (val).addr[2],     \
+               (val).addr[3], (val).addr[4], (val).addr[5])
+
+#define LOCI_SHOW_ipv4(writer, cookie, val)                                        \
+    writer(cookie, "%d.%d.%d.%d", val >> 24, (val >> 16) & 0xff,       \
+               (val >> 8) & 0xff, val & 0xff)
+
+#define LOCI_SHOW_ipv6(writer, cookie, val)                                        \
+    writer(cookie, "%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x", \
+               (val).addr[0], (val).addr[1], (val).addr[2], (val).addr[3], \
+               (val).addr[4], (val).addr[5], (val).addr[6], (val).addr[7], \
+               (val).addr[8], (val).addr[9], (val).addr[10], (val).addr[11], \
+               (val).addr[12], (val).addr[13], (val).addr[14], (val).addr[15])
+
+#define LOCI_SHOW_string(writer, cookie, val) writer(cookie, "%s", val)
+
+#define LOCI_SHOW_port_name(writer, cookie, val) LOCI_SHOW_string(writer, cookie, val)
+#define LOCI_SHOW_tab_name(writer, cookie, val) LOCI_SHOW_string(writer, cookie, val)
+#define LOCI_SHOW_desc_str(writer, cookie, val) LOCI_SHOW_string(writer, cookie, val)
+#define LOCI_SHOW_ser_num(writer, cookie, val) LOCI_SHOW_string(writer, cookie, val)
+
+int loci_show_match(loci_writer_f writer, void *cookie, of_match_t *match);
+#define LOCI_SHOW_match(writer, cookie, val) loci_show_match(writer, cookie, &val)
+
+/**
+ * Generic version for any object
+ */
+int of_object_show(loci_writer_f writer, void *cookie, of_object_t *obj);
+
+
+
+
+/**
+ * Choose a representation for each field that 
+ * makes the most sense for display to the user. 
+ */
+#define LOCI_SHOW_u32_xid(writer, cookie, val) LOCI_SHOW_x32(writer, cookie, val)
+#define LOCI_SHOW_u16_flags(writer, cookie, val) LOCI_SHOW_x16(writer, cookie, val)
+#define LOCI_SHOW_u64_packet_count(writer, cookie, val) LOCI_SHOW_u64(writer, cookie, val)
+#define LOCI_SHOW_u64_byte_count(writer, cookie, val) LOCI_SHOW_u64(writer, cookie, val)
+#define LOCI_SHOW_u32_flow_count(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
+#define LOCI_SHOW_match_match(writer, cookie, val) LOCI_SHOW_match(writer, cookie, val)
+#define LOCI_SHOW_u8_table_id(writer, cookie, val) LOCI_SHOW_u8(writer, cookie, val)
+#define LOCI_SHOW_port_no_out_port(writer, cookie, val) LOCI_SHOW_port_no(writer, cookie, val)
+#define LOCI_SHOW_u32_experimenter(writer, cookie, val) LOCI_SHOW_x32(writer, cookie, val)
+#define LOCI_SHOW_u32_subtype(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
+#define LOCI_SHOW_u8_index(writer, cookie, val) LOCI_SHOW_u8(writer, cookie, val)
+#define LOCI_SHOW_u32_mask(writer, cookie, val) LOCI_SHOW_x32(writer, cookie, val)
+#define LOCI_SHOW_u8_report_mirror_ports(writer, cookie, val) LOCI_SHOW_x8(writer, cookie, val)
+#define LOCI_SHOW_desc_str_mfr_desc(writer, cookie, val) LOCI_SHOW_desc_str(writer, cookie, val)
+#define LOCI_SHOW_desc_str_hw_desc(writer, cookie, val) LOCI_SHOW_desc_str(writer, cookie, val)
+#define LOCI_SHOW_desc_str_sw_desc(writer, cookie, val) LOCI_SHOW_desc_str(writer, cookie, val)
+#define LOCI_SHOW_ser_num_serial_num(writer, cookie, val) LOCI_SHOW_ser_num(writer, cookie, val)
+#define LOCI_SHOW_desc_str_dp_desc(writer, cookie, val) LOCI_SHOW_desc_str(writer, cookie, val)
+#define LOCI_SHOW_octets_data(writer, cookie, val) LOCI_SHOW_octets(writer, cookie, val)
+#define LOCI_SHOW_u16_err_type(writer, cookie, val) LOCI_SHOW_u16(writer, cookie, val)
+#define LOCI_SHOW_u16_code(writer, cookie, val) LOCI_SHOW_u16(writer, cookie, val)
+#define LOCI_SHOW_u64_datapath_id(writer, cookie, val) LOCI_SHOW_x64(writer, cookie, val)
+#define LOCI_SHOW_u32_n_buffers(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
+#define LOCI_SHOW_u8_n_tables(writer, cookie, val) LOCI_SHOW_u8(writer, cookie, val)
+#define LOCI_SHOW_u32_capabilities(writer, cookie, val) LOCI_SHOW_x32(writer, cookie, val)
+#define LOCI_SHOW_u32_actions(writer, cookie, val) LOCI_SHOW_x32(writer, cookie, val)
+#define LOCI_SHOW_u64_cookie(writer, cookie, val) LOCI_SHOW_x64(writer, cookie, val)
+#define LOCI_SHOW_u16_idle_timeout(writer, cookie, val) LOCI_SHOW_u16(writer, cookie, val)
+#define LOCI_SHOW_u16_hard_timeout(writer, cookie, val) LOCI_SHOW_u16(writer, cookie, val)
+#define LOCI_SHOW_u16_priority(writer, cookie, val) LOCI_SHOW_u16(writer, cookie, val)
+#define LOCI_SHOW_u32_buffer_id(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
+#define LOCI_SHOW_u8_reason(writer, cookie, val) LOCI_SHOW_x8(writer, cookie, val)
+#define LOCI_SHOW_u32_duration_sec(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
+#define LOCI_SHOW_u32_duration_nsec(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
+#define LOCI_SHOW_u16_miss_send_len(writer, cookie, val) LOCI_SHOW_u16(writer, cookie, val)
+#define LOCI_SHOW_u32_role(writer, cookie, val) LOCI_SHOW_x32(writer, cookie, val)
+#define LOCI_SHOW_u16_total_len(writer, cookie, val) LOCI_SHOW_u16(writer, cookie, val)
+#define LOCI_SHOW_port_no_port_no(writer, cookie, val) LOCI_SHOW_port_no(writer, cookie, val)
+#define LOCI_SHOW_mac_hw_addr(writer, cookie, val) LOCI_SHOW_mac(writer, cookie, val)
+#define LOCI_SHOW_u32_config(writer, cookie, val) LOCI_SHOW_x32(writer, cookie, val)
+#define LOCI_SHOW_u32_advertise(writer, cookie, val) LOCI_SHOW_x32(writer, cookie, val)
+#define LOCI_SHOW_port_no_port(writer, cookie, val) LOCI_SHOW_port_no(writer, cookie, val)
+#define LOCI_SHOW_u32_queue_id(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
+#define LOCI_SHOW_u32_dest_port(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
+#define LOCI_SHOW_u32_vlan_tag(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
+#define LOCI_SHOW_u8_copy_stage(writer, cookie, val) LOCI_SHOW_u8(writer, cookie, val)
+#define LOCI_SHOW_u16_max_len(writer, cookie, val) LOCI_SHOW_u16(writer, cookie, val)
+#define LOCI_SHOW_mac_dl_addr(writer, cookie, val) LOCI_SHOW_mac(writer, cookie, val)
+#define LOCI_SHOW_u32_nw_addr(writer, cookie, val) LOCI_SHOW_ipv4(writer, cookie, val)
+#define LOCI_SHOW_u8_nw_tos(writer, cookie, val) LOCI_SHOW_u8(writer, cookie, val)
+#define LOCI_SHOW_u16_tp_port(writer, cookie, val) LOCI_SHOW_u16(writer, cookie, val)
+#define LOCI_SHOW_wc_bmap_wildcards(writer, cookie, val) LOCI_SHOW_wc_bmap(writer, cookie, val)
+#define LOCI_SHOW_port_name_name(writer, cookie, val) LOCI_SHOW_port_name(writer, cookie, val)
+#define LOCI_SHOW_u32_state(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
+#define LOCI_SHOW_u32_curr(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
+#define LOCI_SHOW_u32_advertised(writer, cookie, val) LOCI_SHOW_x32(writer, cookie, val)
+#define LOCI_SHOW_u32_supported(writer, cookie, val) LOCI_SHOW_x32(writer, cookie, val)
+#define LOCI_SHOW_u32_peer(writer, cookie, val) LOCI_SHOW_x32(writer, cookie, val)
+#define LOCI_SHOW_u64_rx_packets(writer, cookie, val) LOCI_SHOW_u64(writer, cookie, val)
+#define LOCI_SHOW_u64_tx_packets(writer, cookie, val) LOCI_SHOW_u64(writer, cookie, val)
+#define LOCI_SHOW_u64_rx_bytes(writer, cookie, val) LOCI_SHOW_u64(writer, cookie, val)
+#define LOCI_SHOW_u64_tx_bytes(writer, cookie, val) LOCI_SHOW_u64(writer, cookie, val)
+#define LOCI_SHOW_u64_rx_dropped(writer, cookie, val) LOCI_SHOW_u64(writer, cookie, val)
+#define LOCI_SHOW_u64_tx_dropped(writer, cookie, val) LOCI_SHOW_u64(writer, cookie, val)
+#define LOCI_SHOW_u64_rx_errors(writer, cookie, val) LOCI_SHOW_u64(writer, cookie, val)
+#define LOCI_SHOW_u64_tx_errors(writer, cookie, val) LOCI_SHOW_u64(writer, cookie, val)
+#define LOCI_SHOW_u64_rx_frame_err(writer, cookie, val) LOCI_SHOW_u64(writer, cookie, val)
+#define LOCI_SHOW_u64_rx_over_err(writer, cookie, val) LOCI_SHOW_u64(writer, cookie, val)
+#define LOCI_SHOW_u64_rx_crc_err(writer, cookie, val) LOCI_SHOW_u64(writer, cookie, val)
+#define LOCI_SHOW_u64_collisions(writer, cookie, val) LOCI_SHOW_u64(writer, cookie, val)
+#define LOCI_SHOW_u16_rate(writer, cookie, val) LOCI_SHOW_u16(writer, cookie, val)
+#define LOCI_SHOW_tab_name_name(writer, cookie, val) LOCI_SHOW_tab_name(writer, cookie, val)
+#define LOCI_SHOW_u32_max_entries(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
+#define LOCI_SHOW_u32_active_count(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
+#define LOCI_SHOW_u64_lookup_count(writer, cookie, val) LOCI_SHOW_u64(writer, cookie, val)
+#define LOCI_SHOW_u64_matched_count(writer, cookie, val) LOCI_SHOW_u64(writer, cookie, val)
+#define LOCI_SHOW_u32_out_group(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
+#define LOCI_SHOW_u64_cookie_mask(writer, cookie, val) LOCI_SHOW_x64(writer, cookie, val)
+#define LOCI_SHOW_u32_reserved(writer, cookie, val) LOCI_SHOW_x32(writer, cookie, val)
+#define LOCI_SHOW_u16_command(writer, cookie, val) LOCI_SHOW_u16(writer, cookie, val)
+#define LOCI_SHOW_u8_group_type(writer, cookie, val) LOCI_SHOW_u8(writer, cookie, val)
+#define LOCI_SHOW_u32_group_id(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
+#define LOCI_SHOW_u16_ethertype(writer, cookie, val) LOCI_SHOW_x16(writer, cookie, val)
+#define LOCI_SHOW_u8_mpls_ttl(writer, cookie, val) LOCI_SHOW_u8(writer, cookie, val)
+#define LOCI_SHOW_u8_nw_ecn(writer, cookie, val) LOCI_SHOW_u8(writer, cookie, val)
+#define LOCI_SHOW_u8_nw_ttl(writer, cookie, val) LOCI_SHOW_u8(writer, cookie, val)
+#define LOCI_SHOW_u16_weight(writer, cookie, val) LOCI_SHOW_u16(writer, cookie, val)
+#define LOCI_SHOW_port_no_watch_port(writer, cookie, val) LOCI_SHOW_port_no(writer, cookie, val)
+#define LOCI_SHOW_u32_watch_group(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
+#define LOCI_SHOW_u32_ref_count(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
+#define LOCI_SHOW_u64_metadata_mask(writer, cookie, val) LOCI_SHOW_x64(writer, cookie, val)
+#define LOCI_SHOW_mac_eth_src_mask(writer, cookie, val) LOCI_SHOW_mac(writer, cookie, val)
+#define LOCI_SHOW_mac_eth_dst_mask(writer, cookie, val) LOCI_SHOW_mac(writer, cookie, val)
+#define LOCI_SHOW_u32_ipv4_src_mask(writer, cookie, val) LOCI_SHOW_ipv4(writer, cookie, val)
+#define LOCI_SHOW_u32_ipv4_dst_mask(writer, cookie, val) LOCI_SHOW_ipv4(writer, cookie, val)
+#define LOCI_SHOW_u32_curr_speed(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
+#define LOCI_SHOW_u32_max_speed(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
+#define LOCI_SHOW_match_bmap_match(writer, cookie, val) LOCI_SHOW_match_bmap(writer, cookie, val)
+#define LOCI_SHOW_u32_instructions(writer, cookie, val) LOCI_SHOW_x32(writer, cookie, val)
+#define LOCI_SHOW_u32_write_actions(writer, cookie, val) LOCI_SHOW_x32(writer, cookie, val)
+#define LOCI_SHOW_u32_apply_actions(writer, cookie, val) LOCI_SHOW_x32(writer, cookie, val)
+#define LOCI_SHOW_u32_types(writer, cookie, val) LOCI_SHOW_x32(writer, cookie, val)
+#define LOCI_SHOW_u32_max_groups_all(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
+#define LOCI_SHOW_u32_max_groups_select(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
+#define LOCI_SHOW_u32_max_groups_indirect(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
+#define LOCI_SHOW_u32_max_groups_ff(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
+#define LOCI_SHOW_u32_actions_all(writer, cookie, val) LOCI_SHOW_x32(writer, cookie, val)
+#define LOCI_SHOW_u32_actions_select(writer, cookie, val) LOCI_SHOW_x32(writer, cookie, val)
+#define LOCI_SHOW_u32_actions_indirect(writer, cookie, val) LOCI_SHOW_x32(writer, cookie, val)
+#define LOCI_SHOW_u32_actions_ff(writer, cookie, val) LOCI_SHOW_x32(writer, cookie, val)
+#define LOCI_SHOW_u64_generation_id(writer, cookie, val) LOCI_SHOW_x64(writer, cookie, val)
+#define LOCI_SHOW_octets_field(writer, cookie, val) LOCI_SHOW_octets(writer, cookie, val)
+#define LOCI_SHOW_u16_value(writer, cookie, val) LOCI_SHOW_u16(writer, cookie, val)
+#define LOCI_SHOW_u16_value_mask(writer, cookie, val) LOCI_SHOW_x16(writer, cookie, val)
+#define LOCI_SHOW_mac_value(writer, cookie, val) LOCI_SHOW_mac(writer, cookie, val)
+#define LOCI_SHOW_mac_value_mask(writer, cookie, val) LOCI_SHOW_mac(writer, cookie, val)
+#define LOCI_SHOW_u32_value(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
+#define LOCI_SHOW_u32_value_mask(writer, cookie, val) LOCI_SHOW_x32(writer, cookie, val)
+#define LOCI_SHOW_u32_oxm_header(writer, cookie, val) LOCI_SHOW_x32(writer, cookie, val)
+#define LOCI_SHOW_u8_value(writer, cookie, val) LOCI_SHOW_u8(writer, cookie, val)
+#define LOCI_SHOW_u8_value_mask(writer, cookie, val) LOCI_SHOW_x8(writer, cookie, val)
+#define LOCI_SHOW_port_no_value(writer, cookie, val) LOCI_SHOW_port_no(writer, cookie, val)
+#define LOCI_SHOW_port_no_value_mask(writer, cookie, val) LOCI_SHOW_port_no(writer, cookie, val)
+#define LOCI_SHOW_ipv6_value(writer, cookie, val) LOCI_SHOW_ipv6(writer, cookie, val)
+#define LOCI_SHOW_ipv6_value_mask(writer, cookie, val) LOCI_SHOW_ipv6(writer, cookie, val)
+#define LOCI_SHOW_u64_value(writer, cookie, val) LOCI_SHOW_u64(writer, cookie, val)
+#define LOCI_SHOW_u64_value_mask(writer, cookie, val) LOCI_SHOW_x64(writer, cookie, val)
+#define LOCI_SHOW_u64_write_setfields(writer, cookie, val) LOCI_SHOW_x64(writer, cookie, val)
+#define LOCI_SHOW_u64_apply_setfields(writer, cookie, val) LOCI_SHOW_x64(writer, cookie, val)
+#define LOCI_SHOW_u64_metadata_match(writer, cookie, val) LOCI_SHOW_x64(writer, cookie, val)
+#define LOCI_SHOW_u64_metadata_write(writer, cookie, val) LOCI_SHOW_x64(writer, cookie, val)
+#define LOCI_SHOW_u32_packet_in_mask_equal_master(writer, cookie, val) LOCI_SHOW_x32(writer, cookie, val)
+#define LOCI_SHOW_u32_packet_in_mask_slave(writer, cookie, val) LOCI_SHOW_x32(writer, cookie, val)
+#define LOCI_SHOW_u32_port_status_mask_equal_master(writer, cookie, val) LOCI_SHOW_x32(writer, cookie, val)
+#define LOCI_SHOW_u32_port_status_mask_slave(writer, cookie, val) LOCI_SHOW_x32(writer, cookie, val)
+#define LOCI_SHOW_u32_flow_removed_mask_equal_master(writer, cookie, val) LOCI_SHOW_x32(writer, cookie, val)
+#define LOCI_SHOW_u32_flow_removed_mask_slave(writer, cookie, val) LOCI_SHOW_x32(writer, cookie, val)
+#define LOCI_SHOW_u8_auxiliary_id(writer, cookie, val) LOCI_SHOW_u8(writer, cookie, val)
+#define LOCI_SHOW_u32_meter_id(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
+#define LOCI_SHOW_u32_rate(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
+#define LOCI_SHOW_u32_burst_size(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
+#define LOCI_SHOW_u8_prec_level(writer, cookie, val) LOCI_SHOW_u8(writer, cookie, val)
+#define LOCI_SHOW_u64_packet_band_count(writer, cookie, val) LOCI_SHOW_u64(writer, cookie, val)
+#define LOCI_SHOW_u64_byte_band_count(writer, cookie, val) LOCI_SHOW_u64(writer, cookie, val)
+#define LOCI_SHOW_u32_max_meter(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
+#define LOCI_SHOW_u32_band_types(writer, cookie, val) LOCI_SHOW_x32(writer, cookie, val)
+#define LOCI_SHOW_u8_max_bands(writer, cookie, val) LOCI_SHOW_u8(writer, cookie, val)
+#define LOCI_SHOW_u8_max_color(writer, cookie, val) LOCI_SHOW_u8(writer, cookie, val)
+#define LOCI_SHOW_u64_packet_in_count(writer, cookie, val) LOCI_SHOW_u64(writer, cookie, val)
+#define LOCI_SHOW_u64_byte_in_count(writer, cookie, val) LOCI_SHOW_u64(writer, cookie, val)
+#define LOCI_SHOW_octets_experimenter_data(writer, cookie, val) LOCI_SHOW_octets(writer, cookie, val)
+#define LOCI_SHOW_u32_dst(writer, cookie, val)        LOCI_SHOW_ipv4(writer, cookie, val)
+#define LOCI_SHOW_u32_service(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
+#define LOCI_SHOW_u32_status(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
+#define LOCI_SHOW_u16_subtype(writer, cookie, val) LOCI_SHOW_u16(writer, cookie, val)
+#define LOCI_SHOW_u32_ipv4_addr(writer, cookie, val) LOCI_SHOW_ipv4(writer, cookie, val)
+#define LOCI_SHOW_u32_ipv4_netmask(writer, cookie, val) LOCI_SHOW_ipv4(writer, cookie, val)
+
+
+
+
+#endif /* _LOCI_SHOW_H_ */
diff --git a/c_gen/templates/locitest/locitest_config.c b/c_gen/templates/locitest/locitest_config.c
new file mode 100644
index 0000000..c7c6fa2
--- /dev/null
+++ b/c_gen/templates/locitest/locitest_config.c
@@ -0,0 +1,49 @@
+:: # Copyright 2013, Big Switch Networks, Inc.
+:: #
+:: # LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
+:: # the following special exception:
+:: #
+:: # LOXI Exception
+:: #
+:: # As a special exception to the terms of the EPL, you may distribute libraries
+:: # generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
+:: # that copyright and licensing notices generated by LoxiGen are not altered or removed
+:: # from the LoxiGen Libraries and the notice provided below is (i) included in
+:: # the LoxiGen Libraries, if distributed in source code form and (ii) included in any
+:: # documentation for the LoxiGen Libraries, if distributed in binary form.
+:: #
+:: # Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler."
+:: #
+:: # You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain
+:: # a copy of the EPL at:
+:: #
+:: # http://www.eclipse.org/legal/epl-v10.html
+:: #
+:: # Unless required by applicable law or agreed to in writing, software
+:: # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+:: # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+:: # EPL for the specific language governing permissions and limitations
+:: # under the EPL.
+::
+/* Copyright 2012, Big Switch Networks, Inc. */
+
+/******************************************************************************
+ *
+ *  /module/src/locitest_config.c
+ *
+ *  locitest Config Information
+ *
+ *****************************************************************************/
+#include <locitest/locitest_config.h> 
+#include <locitest/locitest.h> 
+#include "locitest_int.h" 
+#include <stdlib.h>
+#include <string.h>
+
+
+
+/* <auto.start.cdefs(LOCITEST_CONFIG_HEADER).source> */
+/* <auto.end.cdefs(LOCITEST_CONFIG_HEADER).source> */
+
+
+
diff --git a/c_gen/templates/locitest/locitest_enums.c b/c_gen/templates/locitest/locitest_enums.c
new file mode 100644
index 0000000..7c3f074
--- /dev/null
+++ b/c_gen/templates/locitest/locitest_enums.c
@@ -0,0 +1,47 @@
+:: # Copyright 2013, Big Switch Networks, Inc.
+:: #
+:: # LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
+:: # the following special exception:
+:: #
+:: # LOXI Exception
+:: #
+:: # As a special exception to the terms of the EPL, you may distribute libraries
+:: # generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
+:: # that copyright and licensing notices generated by LoxiGen are not altered or removed
+:: # from the LoxiGen Libraries and the notice provided below is (i) included in
+:: # the LoxiGen Libraries, if distributed in source code form and (ii) included in any
+:: # documentation for the LoxiGen Libraries, if distributed in binary form.
+:: #
+:: # Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler."
+:: #
+:: # You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain
+:: # a copy of the EPL at:
+:: #
+:: # http://www.eclipse.org/legal/epl-v10.html
+:: #
+:: # Unless required by applicable law or agreed to in writing, software
+:: # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+:: # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+:: # EPL for the specific language governing permissions and limitations
+:: # under the EPL.
+::
+/* Copyright 2012, Big Switch Networks, Inc. */
+
+/******************************************************************************
+ *
+ *  /module/src/locitest_enums.c
+ *
+ *  locitest Enum Definitions
+ *
+ *****************************************************************************/
+#include <locitest/locitest_config.h> 
+#include <locitest/locitest.h> 
+#include "locitest_int.h" 
+
+
+
+#include <stdlib.h>
+#include <string.h>
+
+/* <auto.start.enum(ALL).source> */
+/* <auto.end.enum(ALL).source> */
diff --git a/c_gen/templates/locitest/locitest_int.h b/c_gen/templates/locitest/locitest_int.h
new file mode 100644
index 0000000..b058604
--- /dev/null
+++ b/c_gen/templates/locitest/locitest_int.h
@@ -0,0 +1,46 @@
+:: # Copyright 2013, Big Switch Networks, Inc.
+:: #
+:: # LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
+:: # the following special exception:
+:: #
+:: # LOXI Exception
+:: #
+:: # As a special exception to the terms of the EPL, you may distribute libraries
+:: # generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
+:: # that copyright and licensing notices generated by LoxiGen are not altered or removed
+:: # from the LoxiGen Libraries and the notice provided below is (i) included in
+:: # the LoxiGen Libraries, if distributed in source code form and (ii) included in any
+:: # documentation for the LoxiGen Libraries, if distributed in binary form.
+:: #
+:: # Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler."
+:: #
+:: # You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain
+:: # a copy of the EPL at:
+:: #
+:: # http://www.eclipse.org/legal/epl-v10.html
+:: #
+:: # Unless required by applicable law or agreed to in writing, software
+:: # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+:: # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+:: # EPL for the specific language governing permissions and limitations
+:: # under the EPL.
+::
+/* Copyright 2012, Big Switch Networks, Inc. */
+
+/******************************************************************************
+ *
+ *  /module/src/locitest_int.h
+ *
+ *  locitest Internal Header
+ *
+ *****************************************************************************/
+#ifndef __LOCITEST_INT_H__
+#define __LOCITEST_INT_H__
+
+
+#include <locitest/locitest_config.h>
+
+
+
+#include <locitest/locitest.h> 
+#endif /* __LOCITEST_INT_H__ */
diff --git a/c_gen/templates/locitest/test_ext.c b/c_gen/templates/locitest/test_ext.c
new file mode 100644
index 0000000..1efcaf6
--- /dev/null
+++ b/c_gen/templates/locitest/test_ext.c
@@ -0,0 +1,69 @@
+:: # Copyright 2013, Big Switch Networks, Inc.
+:: #
+:: # LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
+:: # the following special exception:
+:: #
+:: # LOXI Exception
+:: #
+:: # As a special exception to the terms of the EPL, you may distribute libraries
+:: # generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
+:: # that copyright and licensing notices generated by LoxiGen are not altered or removed
+:: # from the LoxiGen Libraries and the notice provided below is (i) included in
+:: # the LoxiGen Libraries, if distributed in source code form and (ii) included in any
+:: # documentation for the LoxiGen Libraries, if distributed in binary form.
+:: #
+:: # Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler."
+:: #
+:: # You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain
+:: # a copy of the EPL at:
+:: #
+:: # http://www.eclipse.org/legal/epl-v10.html
+:: #
+:: # Unless required by applicable law or agreed to in writing, software
+:: # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+:: # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+:: # EPL for the specific language governing permissions and limitations
+:: # under the EPL.
+::
+/* Copyright 2012, Big Switch Networks, Inc. */
+
+/**
+ * Test extensions
+ */
+
+#include <locitest/test_common.h>
+
+/**
+ * Simple tests for extension objects
+ */
+
+int
+test_ext_objs(void)
+{
+    of_action_bsn_mirror_t *obj;
+
+    obj = of_action_bsn_mirror_new(OF_VERSION_1_0);
+    TEST_ASSERT(obj != NULL);
+    TEST_ASSERT(obj->object_id == OF_ACTION_BSN_MIRROR);
+
+    TEST_ASSERT(of_action_to_object_id(OF_EXPERIMENTER_TYPE, OF_VERSION_1_0) ==
+                OF_ACTION_EXPERIMENTER);
+
+    TEST_ASSERT(of_action_id_to_object_id(OF_EXPERIMENTER_TYPE, OF_VERSION_1_0) ==
+                OF_ACTION_ID_EXPERIMENTER);
+
+    TEST_ASSERT(of_instruction_to_object_id(OF_EXPERIMENTER_TYPE, OF_VERSION_1_0) ==
+                OF_INSTRUCTION_EXPERIMENTER);
+
+    TEST_ASSERT(of_queue_prop_to_object_id(OF_EXPERIMENTER_TYPE, OF_VERSION_1_0) ==
+                OF_QUEUE_PROP_EXPERIMENTER);
+
+    TEST_ASSERT(of_meter_band_to_object_id(OF_EXPERIMENTER_TYPE, OF_VERSION_1_0) ==
+                OF_METER_BAND_EXPERIMENTER);
+
+    TEST_ASSERT(of_table_feature_prop_to_object_id(OF_EXPERIMENTER_TYPE,
+                                                   OF_VERSION_1_3) ==
+                OF_TABLE_FEATURE_PROP_EXPERIMENTER);
+
+    return TEST_PASS;
+}
diff --git a/c_gen/templates/locitest/test_list_limits.c b/c_gen/templates/locitest/test_list_limits.c
new file mode 100644
index 0000000..aef91d8
--- /dev/null
+++ b/c_gen/templates/locitest/test_list_limits.c
@@ -0,0 +1,100 @@
+:: # Copyright 2013, Big Switch Networks, Inc.
+:: #
+:: # LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
+:: # the following special exception:
+:: #
+:: # LOXI Exception
+:: #
+:: # As a special exception to the terms of the EPL, you may distribute libraries
+:: # generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
+:: # that copyright and licensing notices generated by LoxiGen are not altered or removed
+:: # from the LoxiGen Libraries and the notice provided below is (i) included in
+:: # the LoxiGen Libraries, if distributed in source code form and (ii) included in any
+:: # documentation for the LoxiGen Libraries, if distributed in binary form.
+:: #
+:: # Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler."
+:: #
+:: # You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain
+:: # a copy of the EPL at:
+:: #
+:: # http://www.eclipse.org/legal/epl-v10.html
+:: #
+:: # Unless required by applicable law or agreed to in writing, software
+:: # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+:: # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+:: # EPL for the specific language governing permissions and limitations
+:: # under the EPL.
+::
+/* Copyright 2013, Big Switch Networks, Inc. */
+
+/**
+ * Test that list append fails gracefully when running out of wire buffer
+ * space.
+ */
+
+#include <locitest/test_common.h>
+
+static int
+test_list_limits(void)
+{
+    of_flow_stats_reply_t *obj = of_flow_stats_reply_new(OF_VERSION_1_0);
+    of_list_flow_stats_entry_t list;
+    of_flow_stats_entry_t *element = of_flow_stats_entry_new(OF_VERSION_1_0);
+    int i = 0;
+
+    of_flow_stats_reply_entries_bind(obj, &list);
+
+    ASSERT(element != NULL);
+
+
+    while (1) {
+        int rv = of_list_flow_stats_entry_append(&list, element);
+        ASSERT(rv == OF_ERROR_NONE || rv == OF_ERROR_RESOURCE);
+        if (rv != OF_ERROR_NONE) {
+            break;
+        }
+        i++;
+    }
+
+    ASSERT(i == 744);
+
+    of_flow_stats_entry_delete(element);
+    of_flow_stats_reply_delete(obj);
+    return TEST_PASS;
+}
+
+static int
+test_list_limits_bind(void)
+{
+    of_flow_stats_reply_t *obj = of_flow_stats_reply_new(OF_VERSION_1_0);
+    of_list_flow_stats_entry_t list;
+    int i = 0;
+    of_flow_stats_reply_entries_bind(obj, &list);
+
+
+    while (1) {
+        of_flow_stats_entry_t element;
+        int rv; 
+        of_flow_stats_entry_init(&element, OF_VERSION_1_0, -1, 1);
+        rv = of_list_flow_stats_entry_append_bind(&list, &element);
+        ASSERT(rv == OF_ERROR_NONE || rv == OF_ERROR_RESOURCE);
+        if (rv != OF_ERROR_NONE) {
+            break;
+        }
+        i++;
+    }
+
+    ASSERT(i == 744);
+
+    of_flow_stats_reply_delete(obj);
+    return TEST_PASS;
+}
+
+int
+run_list_limits_tests(void)
+{
+    RUN_TEST(list_limits);
+    RUN_TEST(list_limits_bind);
+
+    return TEST_PASS;
+}
diff --git a/c_gen/templates/locitest/test_match_utils.c b/c_gen/templates/locitest/test_match_utils.c
new file mode 100644
index 0000000..6e4a95e
--- /dev/null
+++ b/c_gen/templates/locitest/test_match_utils.c
@@ -0,0 +1,222 @@
+:: # Copyright 2013, Big Switch Networks, Inc.
+:: #
+:: # LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
+:: # the following special exception:
+:: #
+:: # LOXI Exception
+:: #
+:: # As a special exception to the terms of the EPL, you may distribute libraries
+:: # generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
+:: # that copyright and licensing notices generated by LoxiGen are not altered or removed
+:: # from the LoxiGen Libraries and the notice provided below is (i) included in
+:: # the LoxiGen Libraries, if distributed in source code form and (ii) included in any
+:: # documentation for the LoxiGen Libraries, if distributed in binary form.
+:: #
+:: # Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler."
+:: #
+:: # You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain
+:: # a copy of the EPL at:
+:: #
+:: # http://www.eclipse.org/legal/epl-v10.html
+:: #
+:: # Unless required by applicable law or agreed to in writing, software
+:: # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+:: # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+:: # EPL for the specific language governing permissions and limitations
+:: # under the EPL.
+::
+/* Copyright 2013, Big Switch Networks, Inc. */
+
+/**
+ *
+ * Match utility test cases
+ *
+ */
+
+#include <locitest/test_common.h>
+
+int
+test_match_utils(void)
+{
+    of_mac_addr_t m1 = {{0,0,1,1,3,3}};
+    of_mac_addr_t m2 = {{0,0,1,1,3,3}};  /* m1 == m2 */
+    of_mac_addr_t m3 = {{0,0,1,1,1,1}};  /* m1 is more specific than m3 */
+    of_mac_addr_t m4 = {{0xf,0,1,1,3,3}};  /* m1 is not more specific m4 */
+    of_mac_addr_t m5 = {{0,0,1,1,3,0xf}};  /* m1 is not more specific m5 */
+
+    of_mac_addr_t m_mask1 = {{0xff, 0xff, 0xff, 0xff, 0xff, 0xff}};
+    of_mac_addr_t m_mask2 = {{0xff, 0xff, 0xff, 0xff, 0, 0}};
+
+    /* m1 matches m2 for mask1 */
+    /* m1 matches m2 for mask2 */
+    /* m1 does not match m3, m4, m5 for mask1 */
+    /* m1 matches m3, m5 for mask2 */
+    /* m1 does not match m4 for mask2 */
+
+    of_ipv6_t i1 = {{0,0,0,0,1,1,1,1,3,3,3,3,7,7,7,7}};  /* same as above */
+    of_ipv6_t i2 = {{0,0,0,0,1,1,1,1,3,3,3,3,7,7,7,7}};  
+    of_ipv6_t i3 = {{0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1}};
+    of_ipv6_t i4 = {{0xf,0,0,0,1,1,1,1,3,3,3,3,7,7,7,7}};
+    of_ipv6_t i5 = {{0,0,0,0,1,1,1,1,3,3,3,3,7,7,7,0xf}};
+
+    of_ipv6_t i_mask1 = {{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+                          0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}};
+    of_ipv6_t i_mask2 = {{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+                          0, 0, 0, 0, 0, 0, 0, 0}};
+
+    /* Same relationships as above */
+
+    uint32_t v1 = 3;  /* same as above */
+    uint32_t v2 = 3;
+    uint32_t v3 = 1;
+    uint32_t v4 = 4;
+    uint32_t v5 = (1 << 31) | 1;
+
+    uint32_t u32_mask1 = -1;
+    uint32_t u32_mask2 = 1;
+
+    uint64_t w1 = 3;  /* same as above */
+    uint64_t w2 = 3;
+    uint64_t w3 = 1;
+    uint64_t w4 = 4;
+    uint64_t w5 = (1LL << 63) | 1LL;
+
+    uint64_t u64_mask1 = -1;
+    uint64_t u64_mask2 = 1;
+
+    /* Match structures */
+    of_match_t match1, match2;
+
+    TEST_ASSERT(OF_MORE_SPECIFIC_MAC_ADDR(&m1, &m2));
+    TEST_ASSERT(OF_MORE_SPECIFIC_MAC_ADDR(&m1, &m3));
+    TEST_ASSERT(!OF_MORE_SPECIFIC_MAC_ADDR(&m1, &m4));
+    TEST_ASSERT(!OF_MORE_SPECIFIC_MAC_ADDR(&m1, &m5));
+
+    TEST_ASSERT(OF_MORE_SPECIFIC_IPV6(&i1, &i2));
+    TEST_ASSERT(OF_MORE_SPECIFIC_IPV6(&i1, &i3));
+    TEST_ASSERT(!OF_MORE_SPECIFIC_IPV6(&i1, &i4));
+    TEST_ASSERT(!OF_MORE_SPECIFIC_IPV6(&i1, &i5));
+
+    TEST_ASSERT(OF_MORE_SPECIFIC_INT(v1, v2));
+    TEST_ASSERT(OF_MORE_SPECIFIC_INT(v1, v3));
+    TEST_ASSERT(!OF_MORE_SPECIFIC_INT(v1, v4));
+    TEST_ASSERT(!OF_MORE_SPECIFIC_INT(v1, v5));
+
+    TEST_ASSERT(OF_MORE_SPECIFIC_INT(w1, w2));
+    TEST_ASSERT(OF_MORE_SPECIFIC_INT(w1, w3));
+    TEST_ASSERT(!OF_MORE_SPECIFIC_INT(w1, w4));
+    TEST_ASSERT(!OF_MORE_SPECIFIC_INT(w1, w5));
+
+    /* Test restricted matches on macs */
+    TEST_ASSERT(OF_RESTRICTED_MATCH_MAC_ADDR(&m1, &m2, &m_mask1));
+    TEST_ASSERT(!OF_RESTRICTED_MATCH_MAC_ADDR(&m1, &m3, &m_mask1));
+    TEST_ASSERT(!OF_RESTRICTED_MATCH_MAC_ADDR(&m1, &m4, &m_mask1));
+    TEST_ASSERT(!OF_RESTRICTED_MATCH_MAC_ADDR(&m1, &m5, &m_mask1));
+
+    TEST_ASSERT(OF_RESTRICTED_MATCH_MAC_ADDR(&m1, &m2, &m_mask2));
+    TEST_ASSERT(OF_RESTRICTED_MATCH_MAC_ADDR(&m1, &m3, &m_mask2));
+    TEST_ASSERT(!OF_RESTRICTED_MATCH_MAC_ADDR(&m1, &m4, &m_mask2));
+    TEST_ASSERT(OF_RESTRICTED_MATCH_MAC_ADDR(&m1, &m5, &m_mask2));
+
+    /* Test overlap */
+    TEST_ASSERT(OF_OVERLAP_MAC_ADDR(&m1, &m2, &m_mask1, &m_mask2));
+    TEST_ASSERT(OF_OVERLAP_MAC_ADDR(&m1, &m3, &m_mask1, &m_mask2));
+    TEST_ASSERT(!OF_OVERLAP_MAC_ADDR(&m1, &m3, &m_mask1, &m_mask1));
+    TEST_ASSERT(!OF_OVERLAP_MAC_ADDR(&m1, &m4, &m_mask1, &m_mask2));
+    TEST_ASSERT(OF_OVERLAP_MAC_ADDR(&m1, &m5, &m_mask1, &m_mask2));
+
+    /* Test restricted matches on ipv6 */
+    TEST_ASSERT(OF_RESTRICTED_MATCH_IPV6(&i1, &i2, &i_mask1));
+    TEST_ASSERT(!OF_RESTRICTED_MATCH_IPV6(&i1, &i3, &i_mask1));
+    TEST_ASSERT(!OF_RESTRICTED_MATCH_IPV6(&i1, &i4, &i_mask1));
+    TEST_ASSERT(!OF_RESTRICTED_MATCH_IPV6(&i1, &i5, &i_mask1));
+
+    TEST_ASSERT(OF_RESTRICTED_MATCH_IPV6(&i1, &i2, &i_mask2));
+    TEST_ASSERT(OF_RESTRICTED_MATCH_IPV6(&i1, &i3, &i_mask2));
+    TEST_ASSERT(!OF_RESTRICTED_MATCH_IPV6(&i1, &i4, &i_mask2));
+    TEST_ASSERT(OF_RESTRICTED_MATCH_IPV6(&i1, &i5, &i_mask2));
+
+    /* Test overlap */
+    TEST_ASSERT(OF_OVERLAP_IPV6(&i1, &i2, &i_mask1, &i_mask2));
+    TEST_ASSERT(OF_OVERLAP_IPV6(&i1, &i3, &i_mask1, &i_mask2));
+    TEST_ASSERT(!OF_OVERLAP_IPV6(&i1, &i3, &i_mask1, &i_mask1));
+    TEST_ASSERT(!OF_OVERLAP_IPV6(&i1, &i4, &i_mask1, &i_mask2));
+    TEST_ASSERT(OF_OVERLAP_IPV6(&i1, &i5, &i_mask1, &i_mask2));
+
+    /* Test restricted matches on uint32 */
+    TEST_ASSERT(OF_RESTRICTED_MATCH_INT(v1, v2, u32_mask1));
+    TEST_ASSERT(!OF_RESTRICTED_MATCH_INT(v1, v3, u32_mask1));
+    TEST_ASSERT(!OF_RESTRICTED_MATCH_INT(v1, v4, u32_mask1));
+    TEST_ASSERT(!OF_RESTRICTED_MATCH_INT(v1, v5, u32_mask1));
+
+    TEST_ASSERT(OF_RESTRICTED_MATCH_INT(v1, v2, u32_mask2));
+    TEST_ASSERT(OF_RESTRICTED_MATCH_INT(v1, v3, u32_mask2));
+    TEST_ASSERT(!OF_RESTRICTED_MATCH_INT(v1, v4, u32_mask2));
+    TEST_ASSERT(OF_RESTRICTED_MATCH_INT(v1, v5, u32_mask2));
+
+    /* Test overlap */
+    TEST_ASSERT(OF_OVERLAP_INT(v1, v2, u32_mask1, u32_mask2));
+    TEST_ASSERT(OF_OVERLAP_INT(v1, v3, u32_mask1, u32_mask2));
+    TEST_ASSERT(!OF_OVERLAP_INT(v1, v3, u32_mask1, u32_mask1));
+    TEST_ASSERT(!OF_OVERLAP_INT(v1, v4, u32_mask1, u32_mask2));
+    TEST_ASSERT(OF_OVERLAP_INT(v1, v5, u32_mask1, u32_mask2));
+
+    /* Test restricted matches on uint64 */
+    TEST_ASSERT(OF_RESTRICTED_MATCH_INT(w1, w2, u64_mask1));
+    TEST_ASSERT(!OF_RESTRICTED_MATCH_INT(w1, w3, u64_mask1));
+    TEST_ASSERT(!OF_RESTRICTED_MATCH_INT(w1, w4, u64_mask1));
+    TEST_ASSERT(!OF_RESTRICTED_MATCH_INT(w1, w5, u64_mask1));
+
+    TEST_ASSERT(OF_RESTRICTED_MATCH_INT(w1, w2, u64_mask2));
+    TEST_ASSERT(OF_RESTRICTED_MATCH_INT(w1, w3, u64_mask2));
+    TEST_ASSERT(!OF_RESTRICTED_MATCH_INT(w1, w4, u64_mask2));
+    TEST_ASSERT(OF_RESTRICTED_MATCH_INT(w1, w5, u64_mask2));
+
+    /* Test overlap */
+    TEST_ASSERT(OF_OVERLAP_INT(w1, w2, u64_mask1, u64_mask2));
+    TEST_ASSERT(OF_OVERLAP_INT(w1, w3, u64_mask1, u64_mask2));
+    TEST_ASSERT(!OF_OVERLAP_INT(w1, w3, u64_mask1, u64_mask1));
+    TEST_ASSERT(!OF_OVERLAP_INT(w1, w4, u64_mask1, u64_mask2));
+    TEST_ASSERT(OF_OVERLAP_INT(w1, w5, u64_mask1, u64_mask2));
+
+    /* Test match stuctures */
+    of_match_populate(&match1, OF_VERSION_1_2, 1);
+    of_match_populate(&match2, OF_VERSION_1_2, 1);
+    TEST_ASSERT(of_match_eq(&match1, &match2));
+    TEST_ASSERT(of_match_eq(&match2, &match1));
+    TEST_ASSERT(of_match_more_specific(&match1, &match2));
+    TEST_ASSERT(of_match_more_specific(&match2, &match1));
+    TEST_ASSERT(of_match_overlap(&match1, &match2));
+    TEST_ASSERT(of_match_overlap(&match2, &match1));
+
+    /* Change match2 so it still is extended by match1 */
+    memset(&match2.masks.eth_dst, 0, sizeof(of_mac_addr_t));
+    TEST_ASSERT(of_match_more_specific(&match1, &match2));
+    TEST_ASSERT(!of_match_more_specific(&match2, &match1));
+    TEST_ASSERT(!of_match_eq(&match1, &match2));
+    TEST_ASSERT(of_match_overlap(&match1, &match2));
+    TEST_ASSERT(of_match_overlap(&match2, &match1));
+
+    /* Now change a value so that matches disagree */
+    match2.fields.in_port++;
+    TEST_ASSERT(!of_match_more_specific(&match1, &match2));
+    TEST_ASSERT(!of_match_overlap(&match1, &match2));
+    TEST_ASSERT(!of_match_overlap(&match2, &match1));
+    /* Clear inport mask on match2 and should extend again */
+    match2.masks.in_port = 0;
+    TEST_ASSERT(of_match_more_specific(&match1, &match2));
+    TEST_ASSERT(of_match_overlap(&match1, &match2));
+    TEST_ASSERT(of_match_overlap(&match2, &match1));
+
+    /* Now change mask so the overlap, but not more specific */
+    match1.fields.in_port = 0x7;
+    match1.masks.in_port = 0x7;
+    match2.fields.in_port = 0xe;
+    match2.masks.in_port = 0xe;
+    TEST_ASSERT(!of_match_more_specific(&match1, &match2));
+    TEST_ASSERT(!of_match_more_specific(&match2, &match1));
+    TEST_ASSERT(of_match_overlap(&match1, &match2));
+    TEST_ASSERT(of_match_overlap(&match2, &match1));
+    
+    return TEST_PASS;
+}
diff --git a/c_gen/templates/locitest/test_setup_from_add.c b/c_gen/templates/locitest/test_setup_from_add.c
new file mode 100644
index 0000000..6988572
--- /dev/null
+++ b/c_gen/templates/locitest/test_setup_from_add.c
@@ -0,0 +1,132 @@
+:: # Copyright 2013, Big Switch Networks, Inc.
+:: #
+:: # LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
+:: # the following special exception:
+:: #
+:: # LOXI Exception
+:: #
+:: # As a special exception to the terms of the EPL, you may distribute libraries
+:: # generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
+:: # that copyright and licensing notices generated by LoxiGen are not altered or removed
+:: # from the LoxiGen Libraries and the notice provided below is (i) included in
+:: # the LoxiGen Libraries, if distributed in source code form and (ii) included in any
+:: # documentation for the LoxiGen Libraries, if distributed in binary form.
+:: #
+:: # Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler."
+:: #
+:: # You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain
+:: # a copy of the EPL at:
+:: #
+:: # http://www.eclipse.org/legal/epl-v10.html
+:: #
+:: # Unless required by applicable law or agreed to in writing, software
+:: # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+:: # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+:: # EPL for the specific language governing permissions and limitations
+:: # under the EPL.
+::
+/* Copyright 2013, Big Switch Networks, Inc. */
+
+/**
+ * Test code for setup from flow add routines
+ */
+
+#include <locitest/test_common.h>
+
+#if !defined(__APPLE__)
+#include <mcheck.h>
+#define MCHECK_INIT mcheck(NULL)
+#else /* mcheck not available under OS X */
+#define MCHECK_INIT do { } while (0)
+#endif
+
+
+static int
+test_removed_setup_from_add(void)
+{
+    of_flow_removed_t *removed;
+    of_flow_add_t *add;
+    of_match_t m1, m2;
+
+    TEST_ASSERT((add = of_flow_add_new(OF_VERSION_1_0)) != NULL);
+    TEST_ASSERT((removed = of_flow_removed_new(OF_VERSION_1_0)) != NULL);
+
+    TEST_ASSERT(of_flow_add_OF_VERSION_1_0_populate(add, 1) != 0);
+    TEST_ASSERT(of_flow_add_match_get(add, &m1) == 0);
+
+    TEST_ASSERT(of_flow_removed_setup_from_flow_add(removed, add) == 0);
+    TEST_ASSERT(of_flow_removed_match_get(removed, &m2) == 0);
+    TEST_ASSERT(memcmp(&m1, &m2, sizeof(m1)) == 0);
+
+    of_flow_add_delete(add);
+    of_flow_removed_delete(removed);
+
+    return TEST_PASS;
+}
+
+
+static int
+test_stats_entry_setup_from_add(void)
+{
+    of_flow_add_t *add;
+    of_flow_stats_entry_t *entry;
+    of_match_t m1, m2;
+    of_list_action_t *list;
+    of_list_action_t list_out;
+
+    TEST_ASSERT((add = of_flow_add_new(OF_VERSION_1_0)) != NULL);
+    TEST_ASSERT((entry = of_flow_stats_entry_new(OF_VERSION_1_0)) != NULL);
+
+    TEST_ASSERT(of_flow_add_OF_VERSION_1_0_populate(add, 1) != 0);
+    TEST_ASSERT(of_flow_add_match_get(add, &m1) == 0);
+
+    TEST_ASSERT(of_flow_stats_entry_setup_from_flow_add(entry, add, NULL) == 0);
+    TEST_ASSERT(of_flow_stats_entry_match_get(entry, &m2) == 0);
+    TEST_ASSERT(memcmp(&m1, &m2, sizeof(m1)) == 0);
+
+    of_flow_add_delete(add);
+    of_flow_stats_entry_delete(entry);
+
+    /* @todo check action lists agree */
+
+    /* Same with an external action list */
+
+    TEST_ASSERT((add = of_flow_add_new(OF_VERSION_1_0)) != NULL);
+    TEST_ASSERT((entry = of_flow_stats_entry_new(OF_VERSION_1_0)) != NULL);
+
+    TEST_ASSERT(of_flow_add_OF_VERSION_1_0_populate(add, 1) != 0);
+    TEST_ASSERT(of_flow_add_match_get(add, &m1) == 0);
+
+    list = of_list_action_new(OF_VERSION_1_0);
+    TEST_ASSERT(list != NULL);
+    TEST_ASSERT(of_list_action_OF_VERSION_1_0_populate(list, 1) != 0);
+
+    /* Verify matches agree */
+    TEST_ASSERT(of_flow_stats_entry_setup_from_flow_add(entry, add, list) == 0);
+    TEST_ASSERT(of_flow_stats_entry_match_get(entry, &m2) == 0);
+    TEST_ASSERT(memcmp(&m1, &m2, sizeof(m1)) == 0);
+
+    of_list_action_init(&list_out, OF_VERSION_1_0, 0, 1);
+    of_flow_stats_entry_actions_bind(entry, &list_out);
+
+    /* Verify lists agree */
+    TEST_ASSERT(list->length == list_out.length);
+    TEST_ASSERT(memcmp(WBUF_BUF(list->wire_object.wbuf),
+                       WBUF_BUF(list_out.wire_object.wbuf),
+                       list->length));
+
+    of_flow_add_delete(add);
+    of_list_action_delete(list);
+    of_flow_stats_entry_delete(entry);
+
+    return TEST_PASS;
+}
+
+
+int run_setup_from_add_tests(void)
+{
+    RUN_TEST(removed_setup_from_add);
+    RUN_TEST(stats_entry_setup_from_add);
+
+    return TEST_PASS;
+}
diff --git a/c_gen/templates/locitest/test_utils.c b/c_gen/templates/locitest/test_utils.c
new file mode 100644
index 0000000..adc6d42
--- /dev/null
+++ b/c_gen/templates/locitest/test_utils.c
@@ -0,0 +1,128 @@
+:: # Copyright 2013, Big Switch Networks, Inc.
+:: #
+:: # LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
+:: # the following special exception:
+:: #
+:: # LOXI Exception
+:: #
+:: # As a special exception to the terms of the EPL, you may distribute libraries
+:: # generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
+:: # that copyright and licensing notices generated by LoxiGen are not altered or removed
+:: # from the LoxiGen Libraries and the notice provided below is (i) included in
+:: # the LoxiGen Libraries, if distributed in source code form and (ii) included in any
+:: # documentation for the LoxiGen Libraries, if distributed in binary form.
+:: #
+:: # Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler."
+:: #
+:: # You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain
+:: # a copy of the EPL at:
+:: #
+:: # http://www.eclipse.org/legal/epl-v10.html
+:: #
+:: # Unless required by applicable law or agreed to in writing, software
+:: # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+:: # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+:: # EPL for the specific language governing permissions and limitations
+:: # under the EPL.
+::
+/* Copyright 2013, Big Switch Networks, Inc. */
+
+/**
+ *
+ * Test utility functions
+ *
+ */
+
+#include <locitest/test_common.h>
+#include <loci/of_utils.h>
+
+/**
+ * Test has output port utility function
+ */
+int
+test_has_outport(void)
+{
+    of_list_action_t *list;
+    of_action_t elt;
+    of_action_set_dl_src_t *set_dl_src;
+    of_action_output_t *output;
+
+    set_dl_src = &elt.set_dl_src;
+    output = &elt.output;
+
+    list = of_list_action_new(OF_VERSION_1_0);
+    TEST_ASSERT(list != NULL);
+
+    TEST_ASSERT(of_action_list_has_out_port(list, OF_PORT_DEST_WILDCARD));
+    TEST_ASSERT(!of_action_list_has_out_port(list, 1));
+
+    /* Add some other action */
+    of_action_set_dl_src_init(set_dl_src, OF_VERSION_1_0, -1, 1);
+    TEST_OK(of_list_action_append_bind(list, (of_action_t *)set_dl_src));
+
+    TEST_ASSERT(of_action_list_has_out_port(list, OF_PORT_DEST_WILDCARD));
+    TEST_ASSERT(!of_action_list_has_out_port(list, 1));
+
+    /* Add port 2 */
+    of_action_output_init(output, OF_VERSION_1_0, -1, 1);
+    TEST_OK(of_list_action_append_bind(list, (of_action_t *)output));
+    of_action_output_port_set(output, 2);
+
+    TEST_ASSERT(of_action_list_has_out_port(list, OF_PORT_DEST_WILDCARD));
+    TEST_ASSERT(!of_action_list_has_out_port(list, 1));
+    TEST_ASSERT(of_action_list_has_out_port(list, 2));
+
+    /* Add port 1 */
+    of_action_output_init(output, OF_VERSION_1_0, -1, 1);
+    TEST_OK(of_list_action_append_bind(list, (of_action_t *)output));
+    of_action_output_port_set(output, 1);
+
+    TEST_ASSERT(of_action_list_has_out_port(list, OF_PORT_DEST_WILDCARD));
+    TEST_ASSERT(of_action_list_has_out_port(list, 1));
+    TEST_ASSERT(of_action_list_has_out_port(list, 2));
+
+    /* Start over and put action at front of list */
+    of_list_action_delete(list);
+
+    list = of_list_action_new(OF_VERSION_1_0);
+    TEST_ASSERT(list != NULL);
+
+    /* Add port 2 */
+    of_action_output_init(output, OF_VERSION_1_0, -1, 1);
+    TEST_OK(of_list_action_append_bind(list, (of_action_t *)output));
+    of_action_output_port_set(output, 2);
+
+    TEST_ASSERT(of_action_list_has_out_port(list, OF_PORT_DEST_WILDCARD));
+    TEST_ASSERT(!of_action_list_has_out_port(list, 1));
+    TEST_ASSERT(of_action_list_has_out_port(list, 2));
+
+    /* Add some other action */
+    of_action_set_dl_src_init(set_dl_src, OF_VERSION_1_0, -1, 1);
+    TEST_OK(of_list_action_append_bind(list, (of_action_t *)set_dl_src));
+
+    TEST_ASSERT(of_action_list_has_out_port(list, OF_PORT_DEST_WILDCARD));
+    TEST_ASSERT(!of_action_list_has_out_port(list, 1));
+    TEST_ASSERT(of_action_list_has_out_port(list, 2));
+
+    /* Add port 1 */
+    of_action_output_init(output, OF_VERSION_1_0, -1, 1);
+    TEST_OK(of_list_action_append_bind(list, (of_action_t *)output));
+    of_action_output_port_set(output, 1);
+
+    TEST_ASSERT(of_action_list_has_out_port(list, OF_PORT_DEST_WILDCARD));
+    TEST_ASSERT(of_action_list_has_out_port(list, 1));
+    TEST_ASSERT(of_action_list_has_out_port(list, 2));
+
+    of_list_action_delete(list);
+
+    return TEST_PASS;
+}
+
+int
+run_utility_tests(void)
+{
+    RUN_TEST(has_outport);
+    RUN_TEST(dump_objs);
+
+    return TEST_PASS;
+}
diff --git a/c_gen/templates/locitest/test_validator.c b/c_gen/templates/locitest/test_validator.c
new file mode 100644
index 0000000..cac67f7
--- /dev/null
+++ b/c_gen/templates/locitest/test_validator.c
@@ -0,0 +1,113 @@
+:: # Copyright 2013, Big Switch Networks, Inc.
+:: #
+:: # LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
+:: # the following special exception:
+:: #
+:: # LOXI Exception
+:: #
+:: # As a special exception to the terms of the EPL, you may distribute libraries
+:: # generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
+:: # that copyright and licensing notices generated by LoxiGen are not altered or removed
+:: # from the LoxiGen Libraries and the notice provided below is (i) included in
+:: # the LoxiGen Libraries, if distributed in source code form and (ii) included in any
+:: # documentation for the LoxiGen Libraries, if distributed in binary form.
+:: #
+:: # Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler."
+:: #
+:: # You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain
+:: # a copy of the EPL at:
+:: #
+:: # http://www.eclipse.org/legal/epl-v10.html
+:: #
+:: # Unless required by applicable law or agreed to in writing, software
+:: # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+:: # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+:: # EPL for the specific language governing permissions and limitations
+:: # under the EPL.
+::
+/* Copyright 2013, Big Switch Networks, Inc. */
+
+/**
+ * Test message validator
+ *
+ * Run the message validator on corrupt messages to ensure it catches them.
+ */
+
+#include "loci_log.h"
+
+#include <locitest/test_common.h>
+#include <loci/loci_validator.h>
+
+static int
+test_validate_fixed_length(void)
+{
+    of_table_stats_request_t *obj = of_table_stats_request_new(OF_VERSION_1_0);
+    of_message_t msg = OF_OBJECT_TO_MESSAGE(obj);
+
+    TEST_ASSERT(of_validate_message(msg, of_message_length_get(msg)) == 0);
+
+    of_message_length_set(msg, of_message_length_get(msg) - 1);
+    TEST_ASSERT(of_validate_message(msg, of_message_length_get(msg)) == -1);
+
+    of_table_stats_request_delete(obj);
+    return TEST_PASS;
+}
+
+static int
+test_validate_fixed_length_list(void)
+{
+    of_table_stats_reply_t *obj = of_table_stats_reply_new(OF_VERSION_1_0);
+    of_list_table_stats_entry_t list;
+    of_table_stats_entry_t element;
+    of_message_t msg; 
+    of_table_stats_reply_entries_bind(obj, &list);
+    of_table_stats_entry_init(&element, OF_VERSION_1_0, -1, 1);
+    of_list_table_stats_entry_append_bind(&list, &element);
+    of_list_table_stats_entry_append_bind(&list, &element);
+    msg = OF_OBJECT_TO_MESSAGE(obj);
+
+    TEST_ASSERT(of_validate_message(msg, of_message_length_get(msg)) == 0);
+
+    of_message_length_set(msg, of_message_length_get(msg) - 1);
+    TEST_ASSERT(of_validate_message(msg, of_message_length_get(msg)) == -1);
+
+    of_table_stats_reply_delete(obj);
+    return TEST_PASS;
+}
+
+static int
+test_validate_tlv16_list(void)
+{
+    of_flow_modify_t *obj = of_flow_modify_new(OF_VERSION_1_0);
+    of_list_action_t list;
+    of_action_set_tp_dst_t element1;
+    of_action_output_t element2;
+    of_message_t msg; 
+    of_flow_modify_actions_bind(obj, &list);
+    of_action_set_tp_dst_init(&element1, OF_VERSION_1_0, -1, 1);
+    of_list_action_append_bind(&list, (of_action_t *)&element1);
+    of_action_output_init(&element2, OF_VERSION_1_0, -1, 1);
+    of_list_action_append_bind(&list, (of_action_t *)&element2);
+    msg = OF_OBJECT_TO_MESSAGE(obj);
+
+    TEST_ASSERT(of_validate_message(msg, of_message_length_get(msg)) == 0);
+
+    of_message_length_set(msg, of_message_length_get(msg) - 1);
+    TEST_ASSERT(of_validate_message(msg, of_message_length_get(msg)) == -1);
+
+    of_message_length_set(msg, of_message_length_get(msg) + 2);
+    TEST_ASSERT(of_validate_message(msg, of_message_length_get(msg)) == -1);
+
+    of_flow_modify_delete(obj);
+    return TEST_PASS;
+}
+
+int
+run_validator_tests(void)
+{
+    RUN_TEST(validate_fixed_length);
+    RUN_TEST(validate_fixed_length_list);
+    RUN_TEST(validate_tlv16_list);
+
+    return TEST_PASS;
+}
diff --git a/c_gen/templates/locitest/unittest.h b/c_gen/templates/locitest/unittest.h
new file mode 100644
index 0000000..7ffc413
--- /dev/null
+++ b/c_gen/templates/locitest/unittest.h
@@ -0,0 +1,56 @@
+:: # Copyright 2013, Big Switch Networks, Inc.
+:: #
+:: # LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
+:: # the following special exception:
+:: #
+:: # LOXI Exception
+:: #
+:: # As a special exception to the terms of the EPL, you may distribute libraries
+:: # generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
+:: # that copyright and licensing notices generated by LoxiGen are not altered or removed
+:: # from the LoxiGen Libraries and the notice provided below is (i) included in
+:: # the LoxiGen Libraries, if distributed in source code form and (ii) included in any
+:: # documentation for the LoxiGen Libraries, if distributed in binary form.
+:: #
+:: # Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler."
+:: #
+:: # You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain
+:: # a copy of the EPL at:
+:: #
+:: # http://www.eclipse.org/legal/epl-v10.html
+:: #
+:: # Unless required by applicable law or agreed to in writing, software
+:: # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+:: # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+:: # EPL for the specific language governing permissions and limitations
+:: # under the EPL.
+::
+/* Copyright 2013, Big Switch Networks, Inc. */
+
+#ifndef UNITTEST_H
+#define UNITTEST_H
+
+#include <stdio.h>
+
+#define TEST_PASS 1
+#define TEST_FAIL 0
+
+#define TESTCASE(foo, rv) do {                                          \
+        fprintf(stderr, "test %s:", #foo);                              \
+        fprintf(stderr, "  %s\n", (rv = test_##foo()) ? "PASS" : "FAIL"); \
+    } while (0)
+
+#define TEST_ASSERT(result) if (!(result)) do {                         \
+        fprintf(stderr, "\nTEST ASSERT FAILURE "                        \
+               #result " :: %s:%d\n",__FILE__,__LINE__);                \
+        ASSERT(0);                                                      \
+        return TEST_FAIL;                                               \
+    } while (0)
+
+#define TEST_ASSERT_EQUAL(expected, result) \
+    TEST_ASSERT(((expected) == (result)))
+
+#define TEST_ASSERT_NOT_EQUAL(expected, result) \
+    TEST_ASSERT(((expected) != (result)))
+
+#endif
diff --git a/c_gen/templates/of_buffer.h b/c_gen/templates/of_buffer.h
new file mode 100644
index 0000000..05cc587
--- /dev/null
+++ b/c_gen/templates/of_buffer.h
@@ -0,0 +1,139 @@
+:: # Copyright 2013, Big Switch Networks, Inc.
+:: #
+:: # LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
+:: # the following special exception:
+:: #
+:: # LOXI Exception
+:: #
+:: # As a special exception to the terms of the EPL, you may distribute libraries
+:: # generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
+:: # that copyright and licensing notices generated by LoxiGen are not altered or removed
+:: # from the LoxiGen Libraries and the notice provided below is (i) included in
+:: # the LoxiGen Libraries, if distributed in source code form and (ii) included in any
+:: # documentation for the LoxiGen Libraries, if distributed in binary form.
+:: #
+:: # Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler."
+:: #
+:: # You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain
+:: # a copy of the EPL at:
+:: #
+:: # http://www.eclipse.org/legal/epl-v10.html
+:: #
+:: # Unless required by applicable law or agreed to in writing, software
+:: # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+:: # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+:: # EPL for the specific language governing permissions and limitations
+:: # under the EPL.
+::
+/* Copyright 2013, Big Switch Networks, Inc. */
+
+/****************************************************************
+ *
+ * Low level buffer manipulation functions
+ * Requires low level type defs
+ *
+ ****************************************************************/
+
+#ifndef _OF_BUFFER_H_
+#define _OF_BUFFER_H_
+
+#include <loci/loci_base.h>
+#include <stdio.h>
+
+/* Function type used for a "free" operation of a low level buffer */
+typedef void (*of_buffer_free_f)(void *buf);
+
+
+/****************************************************************
+ *
+ * Low level buffers accessors handling endian and alignment
+ *
+ ****************************************************************/
+
+static inline void
+buf_ipv6_get(uint8_t *buf, of_ipv6_t *val) {
+    MEMCPY(val, buf, sizeof(*val));
+    IPV6_NTOH(val, val); /* probably a no-op */
+}
+
+static inline void
+buf_mac_get(uint8_t *buf, of_mac_addr_t *val) {
+    MEMCPY(val, buf, sizeof(*val));
+}
+
+static inline void
+buf_u64_get(uint8_t *buf, uint64_t *val) {
+    MEMCPY(val, buf, sizeof(*val));
+    *val = U64_NTOH(*val);
+}
+
+static inline void
+buf_u32_get(uint8_t *buf, uint32_t *val) {
+    MEMCPY(val, buf, sizeof(*val));
+    *val = U32_NTOH(*val);
+}
+
+static inline void
+buf_u16_get(uint8_t *buf, uint16_t *val) {
+    MEMCPY(val, buf, sizeof(uint16_t));
+    *val = U16_NTOH(*val);
+}
+
+static inline void
+buf_u8_get(uint8_t *buf, uint8_t *val) {
+    *val = *buf;
+}
+
+static inline void
+buf_octets_get(uint8_t *buf, uint8_t *dst, int bytes) {
+    MEMCPY(dst, buf, bytes);
+}
+
+static inline void
+buf_ipv6_set(uint8_t *buf, of_ipv6_t *val) {
+    /* FIXME:  If this is not a NO-OP, need to change the code */
+#if 1
+    MEMCPY(buf, val, sizeof(*val));
+#else
+    of_ipv6_t w_val;
+    MEMCPY(&w_val, val sizeof(w_val));
+    IPV6_HTON(w_val, w_val);
+    MEMCPY(buf, &w_val, sizeof(w_val));
+#endif
+}
+
+static inline void
+buf_mac_addr_set(uint8_t *buf, of_mac_addr_t *val) {
+    MEMCPY(buf, val, sizeof(of_mac_addr_t));
+}
+
+static inline void
+buf_u64_set(uint8_t *buf, uint64_t val) {
+    val = U64_HTON(val);
+    MEMCPY(buf, &val, sizeof(uint64_t));
+}
+
+static inline void
+buf_u32_set(uint8_t *buf, uint32_t val) {
+    val = U32_HTON(val);
+    MEMCPY(buf, &val, sizeof(uint32_t));
+}
+
+static inline void
+buf_u16_set(uint8_t *buf, uint16_t val) {
+    val = U16_NTOH(val);
+    MEMCPY(buf, &val, sizeof(uint16_t));
+}
+
+static inline void
+buf_u8_set(uint8_t *buf, uint8_t val) {
+    *buf = val;
+}
+
+static inline void
+buf_octets_set(uint8_t *buf, uint8_t *src, int bytes) {
+    MEMCPY(buf, src, bytes);
+}
+
+
+#endif /* _OF_BUFFER_H_ */
diff --git a/c_gen/templates/of_doc.h b/c_gen/templates/of_doc.h
new file mode 100644
index 0000000..9e352f0
--- /dev/null
+++ b/c_gen/templates/of_doc.h
@@ -0,0 +1,439 @@
+:: # Copyright 2013, Big Switch Networks, Inc.
+:: #
+:: # LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
+:: # the following special exception:
+:: #
+:: # LOXI Exception
+:: #
+:: # As a special exception to the terms of the EPL, you may distribute libraries
+:: # generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
+:: # that copyright and licensing notices generated by LoxiGen are not altered or removed
+:: # from the LoxiGen Libraries and the notice provided below is (i) included in
+:: # the LoxiGen Libraries, if distributed in source code form and (ii) included in any
+:: # documentation for the LoxiGen Libraries, if distributed in binary form.
+:: #
+:: # Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler."
+:: #
+:: # You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain
+:: # a copy of the EPL at:
+:: #
+:: # http://www.eclipse.org/legal/epl-v10.html
+:: #
+:: # Unless required by applicable law or agreed to in writing, software
+:: # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+:: # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+:: # EPL for the specific language governing permissions and limitations
+:: # under the EPL.
+::
+/* Copyright 2013, Big Switch Networks, Inc. */
+
+/**
+ * @file of_doc.h
+ * @brief Documentation of sample functions
+ *
+ * This file is for documentation purposes only
+ *
+ * Once the code is in a working state, this documentation will be 
+ * transfered to the actual source files
+ *
+ * The functions documented here are simple templates for accessors that
+ * are used for all accessor members of LOCI objects.  Data types are
+ * divided into:
+ *
+ * @li @c scalar Things like uint8_t, uint16_t, of_mac_addr_t as well as
+ * fixed length strings
+ * @li @c octets Arbitrary length strings of binary data
+ * @li @c composite Data members which are structures
+ * @li @c list The list abstraction for data members
+ * @li @c list_element An element of a list (usually a composite object)
+ *
+ * List elements get special treatment for iterating across a list or 
+ * appending new entries to the list.  All others have 'set' and 'get'
+ * operations.  
+ *
+ * Scalars operations are "stateless" in that they simply
+ * update the underlying data or return that data.  
+ *
+ * Composites and list members update structures to point to the
+ * underlying data.  As a result, care must be taken that objects are
+ * not freed when linked composite or list members remain referring to
+ * the underlying data structure.  Currently: Note that reference
+ * counting won't solve this with the current approach as the
+ * referring objects may be automatic and not subject to alloc/free
+ * operations.
+ */
+
+
+
+/**
+ * Generic documentation for scalar get methods
+ * @param obj The object being accessed
+ * @param value A pointer to a scalar instance of the proper type
+ * @return OF_ERROR_XXX
+ *
+ * Accesses the underlying wire buffer at the appropriate offset to
+ * retrieve and convert the value, placing the result in *value.
+ *
+ * Examples of scalar types include:
+ * @li uint8_t
+ * @li uint16_t
+ * @li uint32_t
+ * @li uint64_t
+ * @li of_mac_addr_t
+ *
+ * Examples calls include:
+ * @li rv = of_port_status_reason_get(obj, &reason)
+ * @li rv = of_table_mod_config_get(obj, &config)
+ *
+ * An object instance can call directly as:
+ * @li rv = obj->reason_get(obj, &reason);    obj is an of_table_mod_t *
+ * @li rv = obj->config_get(obj, &config);    obj is an of_table_mod_t *
+ */
+extern int of_object_scalar_member_get(of_object_t *obj, uint32_t *value);
+
+/**
+ * Generic documentation for scalar set methods
+ * @param obj The object being accessed
+ * @param value Call by value parameter with the value to set
+ * @return OF_ERROR_XXX
+ *
+ * Converts value to the proper wire representation and writes it to
+ * the underlying wire buffer at the appropriate offset.
+ */
+extern int of_object_scalar_member_set(of_object_t *obj, uint32_t value);
+
+/**
+ * Generic documentation for an octets data get method
+ * @param obj The object being accessed
+ * @param value A pointer to an of_octets_t structure to be filled out 
+ * @return OF_ERROR_XXX
+ *
+ * NOTE: 
+ * Sets *bytes to the number of bytes in the octet string.
+ */
+extern int of_object_octets_member_data_get(of_object_t *obj, of_octets_t *value);
+
+/**
+ * Generic documentation for an octets data set method
+ * @param obj The object being accessed
+ * @param value Pointer to an of_octets_t structure pointing to memory from
+ * which data will be copied to wire buffer
+ * @return OF_ERROR_XXX
+ *
+ * Copies data from the memory pointed to by value into the underlying 
+ * wire buffer, extending the buffer if necessary.  The length of obj 
+ * is updated.
+ *
+ * If the length of obj changes (because the existing octets instance is of
+ * a different length) its internal length accessor is called to update
+ * anything tracking its length.  This may call the object's parent
+ * length accessor with the update.
+ */
+extern int of_object_octets_member_data_set(of_object_t *obj, of_octets_t *value);
+
+/**
+ * Generic documentation for an octets pointer get method
+ * @param obj The object being accessed
+ * @param value Pointer to an of_octets_t structure to be initialized
+ * @return OF_ERROR_XXX
+ *
+ * Set the octets object *value to point to the underlying data buffer.  The
+ * length member of *value is set as well.
+ *
+ * The result should be treated as READ ONLY information as modifying
+ * the buffer could cause corruption of the underlying LOCI object.
+ * To change the value (especially the length) of an octets data member,
+ * allocate and set a memory buffer and use the octets_member_data_set 
+ * function.
+ */
+extern int of_object_octets_member_ptr_get(of_object_t *obj, of_octets_t *value);
+
+/**
+ * Generic documentation for a composite sub-object get method
+ * @param obj The object being accessed
+ * @param value Pointer to an object (the sub-object) of the proper type
+ * @return OF_ERROR_XXX
+ *
+ * A composite is a structure with multiple components.  On a 'get'
+ * operation, a pointer (value) to an unused instance of the appropriate 
+ * type is passed to this routine.  That instance is intialized with the
+ * proper accessor functions for the sub-object type and the wire object
+ * is set up to point to obj's wire buffer at the appropriate offset.
+ *
+ * If changes are made to the sub-object (*value) and those changes
+ * affect the length, then the corresponding composite_set must be
+ * called to commit those changes to the parent.
+ */
+extern int of_object_composite_member_get(of_object_t *obj, 
+                                          of_object_t *value);
+
+/**
+ * Generic documentation for a composite sub-object set method
+ * @param obj The object being accessed
+ * @param value Pointer to an object (the sub-object) of the proper type
+ * @return OF_ERROR_XXX
+ *
+ * A composite is a structure with multiple components.  On a 'set'
+ * operation, a pointer (value) to an instance of the appropriate type
+ * is passed to this routine.  
+ *
+ * If the parent (obj) and the child (value) point to the same underlying
+ * wire object, then the changes to the underlying buffer are already
+ * recorded.
+ *
+ * Otherwise, any existing value of the sub-object is replaced
+ * by copying the wire buffer contents from value's wire buffer to obj's
+ * wire buffer at the appropriate offset.
+ *
+ * In either case, the length of the parent will be updated if it changes.
+ */
+extern int of_object_composite_member_set(of_object_t *obj, 
+                                          of_object_t *value);
+
+/**
+ * Generic documentation for a list sub-object get method
+ * @param obj The object being accessed
+ * @param value Pointer to an object (the list sub-object)
+ * @return OF_ERROR_XXX
+ *
+ * A list is an array of instances of objects of a common (possibly
+ * polymorphic) type.  On a 'get' operation, a pointer (value) to an
+ *  unused instance of the appropriate list type is passed to this
+ * routine.  That instance is intialized with the proper accessor
+ * functions for the list type and the wire object is set up to point
+ * to obj's wire buffer at the appropriate offset.
+ *
+ * Currently, the list object returned by a 'get' operation should not
+ * be altered, although changes that do not affect the length of
+ * sub-objects will work.
+ *
+ * Rather, lists should either be cleared and set from completely new
+ * instances using 'list_set', or they may be built using the append
+ * operations described below.
+ *
+ * @sa of_object_list_append_bind
+ * @sa of_object_list_append
+ */
+extern int of_object_list_member_get(of_object_t *obj, 
+                                     of_list_object_t *value);
+
+/**
+ * Generic documentation for a list entry first call
+ * @param obj The list object being accessed
+ * @param value Pointer to a generic list entry instance
+ * @return OF_ERROR_RANGE if the list is empty
+ *
+ * A list is an array of instances of objects of a common (possibly
+ * polymorphic) type.  
+ *
+ * This routine is intended for iterating through a list for
+ * reading.  Normally a 'get' operation will be done on the parent
+ * of the list to retrieve (a pointer to) the list, and then this routine
+ * will be called to set up a generic entry representing the first 
+ * element of the list.
+ *
+ * @sa of_object_list_entry_next
+ */
+extern int of_object_list_entry_first(of_list_object_t *obj, 
+                                      of_object_t *value);
+
+/**
+ * Generic documentation for a list entry next call
+ * @param obj The list object being accessed
+ * @param value Pointer to a generic list entry instance
+ * @return OF_ERROR_RANGE if the value already points to the last item 
+ * in the list
+
+ * A list is an array of instances of objects of a common (possibly
+ * polymorphic) type.  
+ *
+ * The corresponding list_entry_first must be called on the pair of
+ * parameters initially.  There after, this routine will advance the
+ * pointers in the wire object of value to the subsequent entry in the
+ * list.
+ *
+ * Changes should not be made to list items using these routines,
+ * although 'set' operations which do not change the length of the
+ * instance will work.
+ *
+ * @sa of_object_list_entry_first
+ */
+extern int of_object_list_entry_next(of_list_object_t *obj, 
+                                     of_object_t *value);
+
+/**
+ * Generic documentation for a list append bind function
+ * @param obj The list object being accessed
+ * @param value Pointer to a generic list entry instance
+ * @return OF_ERROR_XXX
+ *
+ * A list is an array of instances of objects of a common (possibly
+ * polymorphic) type.
+ *
+ * This function prepares the list for the process of appending an
+ * item to its tail.  The parameter value is a pointer to a generic
+ * list entry instance.  Its wire buffer is bound to that of the list
+ * at the end of the list.  The length of the list is updated according
+ * to the current value setting which must be accurate.
+ *
+ * Note that since the child has not been bound to a buffer, no
+ * values have been properly recorded for the object; they must
+ * be set after this _bind call.
+ *
+ * @sa of_object_list_entry_append
+ */
+extern int of_object_list_entry_append_bind(of_list_object_t *obj, 
+                                            of_object_t *value);
+
+/**
+ * Generic documentation for a list append function
+ * @param obj The list object being accessed
+ * @param value Pointer to a list object to be appended
+ * @return OF_ERROR_XXX
+ *
+ * A list is an array of instances of objects of a common (possibly
+ * polymorphic) type.
+ *
+ * This function takes a fully formed list entry, value, and copies
+ * that value to the end of the list.  No object ownership changes
+ * with this call.
+ *
+ * @sa of_object_list_entry_append_bind
+ */
+extern int of_object_list_entry_append(of_list_object_t *obj, 
+                                       of_object_t *value);
+
+/* This is from loci.h */
+
+/**
+ * Inheritance super class for of_queue_prop
+ *
+ * This class is the union of of_queue_prop classes.  You can refer
+ * to it untyped by refering to the member 'header' whose structure
+ * is common across all sub-classes.
+ */
+
+union of_queue_prop_u {
+    of_queue_prop_header_t header; /* Generic instance */
+    of_queue_prop_min_rate_t min_rate;
+    of_queue_prop_max_rate_t max_rate;
+    of_queue_prop_experimenter_t experimenter;
+};
+
+/**
+ * Inheritance super class for of_action
+ *
+ * This class is the union of of_action classes.  You can refer
+ * to it untyped by refering to the member 'header' whose structure
+ * is common across all sub-classes.
+ */
+
+union of_action_u {
+    of_action_header_t header; /* Generic instance */
+    of_action_copy_ttl_out_t copy_ttl_out;
+    of_action_set_mpls_tc_t set_mpls_tc;
+    of_action_set_field_t set_field;
+    of_action_set_nw_tos_t set_nw_tos;
+    of_action_dec_mpls_ttl_t dec_mpls_ttl;
+    of_action_set_nw_dst_t set_nw_dst;
+    of_action_set_mpls_label_t set_mpls_label;
+    of_action_group_t group;
+    of_action_set_nw_src_t set_nw_src;
+    of_action_set_vlan_vid_t set_vlan_vid;
+    of_action_set_mpls_ttl_t set_mpls_ttl;
+    of_action_pop_vlan_t pop_vlan;
+    of_action_set_tp_dst_t set_tp_dst;
+    of_action_pop_mpls_t pop_mpls;
+    of_action_push_vlan_t push_vlan;
+    of_action_set_vlan_pcp_t set_vlan_pcp;
+    of_action_enqueue_t enqueue;
+    of_action_set_tp_src_t set_tp_src;
+    of_action_experimenter_t experimenter;
+    of_action_set_nw_ttl_t set_nw_ttl;
+    of_action_copy_ttl_in_t copy_ttl_in;
+    of_action_set_nw_ecn_t set_nw_ecn;
+    of_action_strip_vlan_t strip_vlan;
+    of_action_set_dl_dst_t set_dl_dst;
+    of_action_push_mpls_t push_mpls;
+    of_action_dec_nw_ttl_t dec_nw_ttl;
+    of_action_set_dl_src_t set_dl_src;
+    of_action_set_queue_t set_queue;
+    of_action_output_t output;
+};
+
+/**
+ * Inheritance super class for of_instruction
+ *
+ * This class is the union of of_instruction classes.  You can refer
+ * to it untyped by refering to the member 'header' whose structure
+ * is common across all sub-classes.
+ */
+
+union of_instruction_u {
+    of_instruction_header_t header; /* Generic instance */
+    of_instruction_clear_actions_t clear_actions;
+    of_instruction_write_actions_t write_actions;
+    of_instruction_goto_table_t goto_table;
+    of_instruction_apply_actions_t apply_actions;
+    of_instruction_experimenter_t experimenter;
+    of_instruction_write_metadata_t write_metadata;
+};
+
+/**
+ * Inheritance super class for of_oxm
+ *
+ * This class is the union of of_oxm classes.  You can refer
+ * to it untyped by refering to the member 'header' whose structure
+ * is common across all sub-classes.
+ */
+
+union of_oxm_u {
+    of_oxm_header_t header; /* Generic instance */
+    of_oxm_ipv6_flabel_t ipv6_flabel;
+    of_oxm_ipv6_dst_masked_t ipv6_dst_masked;
+    of_oxm_vlan_pcp_t vlan_pcp;
+    of_oxm_ipv4_src_t ipv4_src;
+    of_oxm_ipv6_dst_t ipv6_dst;
+    of_oxm_arp_tpa_t arp_tpa;
+    of_oxm_icmpv6_type_t icmpv6_type;
+    of_oxm_arp_sha_t arp_sha;
+    of_oxm_ipv6_src_t ipv6_src;
+    of_oxm_sctp_src_t sctp_src;
+    of_oxm_icmpv6_code_t icmpv6_code;
+    of_oxm_metadata_masked_t metadata_masked;
+    of_oxm_eth_src_masked_t eth_src_masked;
+    of_oxm_eth_dst_t eth_dst;
+    of_oxm_ipv6_nd_sll_t ipv6_nd_sll;
+    of_oxm_mpls_tc_t mpls_tc;
+    of_oxm_arp_op_t arp_op;
+    of_oxm_vlan_vid_masked_t vlan_vid_masked;
+    of_oxm_eth_type_t eth_type;
+    of_oxm_in_phy_port_t in_phy_port;
+    of_oxm_vlan_vid_t vlan_vid;
+    of_oxm_arp_tha_t arp_tha;
+    of_oxm_arp_tpa_masked_t arp_tpa_masked;
+    of_oxm_in_port_t in_port;
+    of_oxm_ip_dscp_t ip_dscp;
+    of_oxm_sctp_dst_t sctp_dst;
+    of_oxm_icmpv4_code_t icmpv4_code;
+    of_oxm_eth_dst_masked_t eth_dst_masked;
+    of_oxm_tcp_src_t tcp_src;
+    of_oxm_ip_ecn_t ip_ecn;
+    of_oxm_ipv6_src_masked_t ipv6_src_masked;
+    of_oxm_ipv4_src_masked_t ipv4_src_masked;
+    of_oxm_udp_dst_t udp_dst;
+    of_oxm_arp_spa_t arp_spa;
+    of_oxm_ipv6_nd_target_t ipv6_nd_target;
+    of_oxm_ipv4_dst_t ipv4_dst;
+    of_oxm_ipv4_dst_masked_t ipv4_dst_masked;
+    of_oxm_eth_src_t eth_src;
+    of_oxm_udp_src_t udp_src;
+    of_oxm_ipv6_nd_tll_t ipv6_nd_tll;
+    of_oxm_icmpv4_type_t icmpv4_type;
+    of_oxm_mpls_label_t mpls_label;
+    of_oxm_tcp_dst_t tcp_dst;
+    of_oxm_ip_proto_t ip_proto;
+    of_oxm_metadata_t metadata;
+    of_oxm_arp_spa_masked_t arp_spa_masked;
+};
+
diff --git a/c_gen/templates/of_message.h b/c_gen/templates/of_message.h
new file mode 100644
index 0000000..77066bc
--- /dev/null
+++ b/c_gen/templates/of_message.h
@@ -0,0 +1,252 @@
+:: # Copyright 2013, Big Switch Networks, Inc.
+:: #
+:: # LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
+:: # the following special exception:
+:: #
+:: # LOXI Exception
+:: #
+:: # As a special exception to the terms of the EPL, you may distribute libraries
+:: # generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
+:: # that copyright and licensing notices generated by LoxiGen are not altered or removed
+:: # from the LoxiGen Libraries and the notice provided below is (i) included in
+:: # the LoxiGen Libraries, if distributed in source code form and (ii) included in any
+:: # documentation for the LoxiGen Libraries, if distributed in binary form.
+:: #
+:: # Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler."
+:: #
+:: # You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain
+:: # a copy of the EPL at:
+:: #
+:: # http://www.eclipse.org/legal/epl-v10.html
+:: #
+:: # Unless required by applicable law or agreed to in writing, software
+:: # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+:: # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+:: # EPL for the specific language governing permissions and limitations
+:: # under the EPL.
+::
+/* Copyright 2013, Big Switch Networks, Inc. */
+
+/*
+ * These routines manipulate a low level buffer assuming it holds
+ * an OpenFlow message. 
+ */
+
+#if !defined(_OF_MESSAGE_H_)
+#define _OF_MESSAGE_H_
+
+#include <loci/of_buffer.h>
+
+typedef uint8_t *of_message_t;
+
+/* A few key common header offsets */
+#define OF_MESSAGE_VERSION_OFFSET 0
+#define OF_MESSAGE_TYPE_OFFSET 1
+#define OF_MESSAGE_LENGTH_OFFSET 2
+#define OF_MESSAGE_XID_OFFSET 4
+#define OF_MESSAGE_HEADER_LENGTH 8
+#define OF_MESSAGE_STATS_TYPE_OFFSET 8
+#define OF_MESSAGE_FLOW_MOD_COMMAND_OFFSET(version) ((version) == 1 ? 56 : 25)
+
+#define OF_MESSAGE_MIN_LENGTH 8
+#define OF_MESSAGE_MIN_STATS_LENGTH (OF_MESSAGE_STATS_TYPE_OFFSET + 2)
+#define OF_MESSAGE_MIN_FLOW_MOD_LENGTH(version)  ((version) == 1 ? 57 : 26)
+
+#define OF_MESSAGE_EXPERIMENTER_ID_OFFSET 8
+#define OF_MESSAGE_EXPERIMENTER_SUBTYPE_OFFSET 12
+#define OF_MESSAGE_EXPERIMENTER_MIN_LENGTH 16
+
+/**
+ * The "default" free message function; NULL means use nominal malloc/free
+ */
+#define OF_MESSAGE_FREE_FUNCTION NULL
+
+/**
+ * Map a message to the uint8_t * start of the message
+ */
+#define OF_MESSAGE_TO_BUFFER(msg) ((uint8_t *)(msg))
+
+/**
+ * Map a uint8_t * to a message object
+ */
+#define OF_BUFFER_TO_MESSAGE(buf) ((of_message_t)(buf))
+
+/****************************************************************
+ *
+ * Message field accessors.
+ *
+ * These do no range checking and assume a buffer with sufficient
+ * length to access the data.  These are low level accessors used
+ * during the parsing and coersion stage of message processing.
+ *
+ * Fields include:  version, message type, message length,
+ * transaction id, stats type (now multi-part type), experimenter id,
+ * experimenter type
+ *
+ ****************************************************************/
+
+/**
+ * @brief Get/set version of a message
+ * @param msg Pointer to the message buffer of sufficient length
+ * @param version Data for set operation
+ * @returns get returns version
+ */
+
+static inline of_version_t
+of_message_version_get(of_message_t msg) {
+    return (of_version_t)msg[OF_MESSAGE_VERSION_OFFSET];
+}
+
+static inline void
+of_message_version_set(of_message_t msg, of_version_t version) {
+    buf_u8_set(msg, (uint8_t)version);
+}
+
+/**
+ * @brief Get/set OpenFlow type of a message
+ * @param msg Pointer to the message buffer of sufficient length
+ * @param value Data for set operation
+ * @returns get returns message type
+ */
+
+static inline uint8_t
+of_message_type_get(of_message_t msg) {
+    return msg[OF_MESSAGE_TYPE_OFFSET];
+}
+
+static inline void
+of_message_type_set(of_message_t msg, uint8_t value) {
+    buf_u8_set(msg + OF_MESSAGE_TYPE_OFFSET, value);
+}
+
+/**
+ * @brief Get/set in-buffer length of a message
+ * @param msg Pointer to the message buffer of sufficient length
+ * @param len Data for set operation
+ * @returns get returns length in host order
+ */
+
+static inline uint16_t
+of_message_length_get(of_message_t msg) {
+    uint16_t val;
+    buf_u16_get(msg + OF_MESSAGE_LENGTH_OFFSET, &val);
+    return val;
+}
+
+static inline void
+of_message_length_set(of_message_t msg, uint16_t len) {
+    buf_u16_set(msg + OF_MESSAGE_LENGTH_OFFSET, len);
+}
+
+
+/**
+ * @brief Get/set transaction ID of a message
+ * @param msg Pointer to the message buffer of sufficient length
+ * @param xid Data for set operation
+ * @returns get returns xid in host order
+ */
+
+static inline uint32_t
+of_message_xid_get(of_message_t msg) {
+    uint32_t val;
+    buf_u32_get(msg + OF_MESSAGE_XID_OFFSET, &val);
+    return val;
+}
+
+static inline void
+of_message_xid_set(of_message_t msg, uint32_t xid) {
+    buf_u32_set(msg + OF_MESSAGE_XID_OFFSET, xid);
+}
+
+/**
+ * @brief Get/set stats type of a message
+ * @param msg Pointer to the message buffer of sufficient length
+ * @param type Data for set operation
+ * @returns get returns stats type in host order
+ */
+
+static inline uint16_t
+of_message_stats_type_get(of_message_t msg) {
+    uint16_t val;
+    buf_u16_get(msg + OF_MESSAGE_STATS_TYPE_OFFSET, &val);
+    return val;
+}
+
+static inline void
+of_message_stats_type_set(of_message_t msg, uint16_t type) {
+    buf_u16_set(msg + OF_MESSAGE_STATS_TYPE_OFFSET, type);
+}
+
+
+/**
+ * @brief Get/set experimenter ID of a message
+ * @param msg Pointer to the message buffer of sufficient length
+ * @param experimenter_id Data for set operation
+ * @returns get returns experimenter id in host order
+ */
+
+static inline uint32_t
+of_message_experimenter_id_get(of_message_t msg) {
+    uint32_t val;
+    buf_u32_get(msg + OF_MESSAGE_EXPERIMENTER_ID_OFFSET, &val);
+    return val;
+}
+
+static inline void
+of_message_experimenter_id_set(of_message_t msg, uint32_t experimenter_id) {
+    buf_u32_set(msg + OF_MESSAGE_EXPERIMENTER_ID_OFFSET, experimenter_id);
+}
+
+
+/**
+ * @brief Get/set experimenter message type (subtype) of a message
+ * @param msg Pointer to the message buffer of sufficient length
+ * @param subtype Data for set operation
+ * @returns get returns experimenter message type in host order
+ */
+
+static inline uint32_t
+of_message_experimenter_subtype_get(of_message_t msg) {
+    uint32_t val;
+    buf_u32_get(msg + OF_MESSAGE_EXPERIMENTER_SUBTYPE_OFFSET, &val);
+    return val;
+}
+
+static inline void
+of_message_experimenter_subtype_set(of_message_t msg,
+                                    uint32_t subtype) {
+    buf_u32_set(msg + OF_MESSAGE_EXPERIMENTER_SUBTYPE_OFFSET,
+                subtype);
+}
+
+/**
+ * Flow mod command changed from 16 to 8 bits on the wire from 1.0 to 1.1
+ */
+static inline uint8_t
+of_message_flow_mod_command_get(of_message_t msg, of_version_t version) {
+    uint16_t val16;
+    uint8_t val8;
+
+    if (version == OF_VERSION_1_0) {
+        buf_u16_get(msg + OF_MESSAGE_FLOW_MOD_COMMAND_OFFSET(version), &val16);
+        val8 = val16;
+    } else {
+        buf_u8_get(msg + OF_MESSAGE_FLOW_MOD_COMMAND_OFFSET(version), &val8);
+    }
+    return val8;
+}
+
+static inline void
+of_message_flow_mod_command_set(of_message_t msg, of_version_t version, 
+                                uint8_t command) {
+    uint16_t val16;
+
+    if (version == OF_VERSION_1_0) {
+        val16 = command;
+        buf_u16_set(msg + OF_MESSAGE_FLOW_MOD_COMMAND_OFFSET(version), val16);
+    } else {
+        buf_u8_set(msg + OF_MESSAGE_FLOW_MOD_COMMAND_OFFSET(version), command);
+    }
+}
+
+#endif /* _OF_MESSAGE_H_ */
diff --git a/c_gen/templates/of_object.c b/c_gen/templates/of_object.c
new file mode 100644
index 0000000..a5cfecd
--- /dev/null
+++ b/c_gen/templates/of_object.c
@@ -0,0 +1,728 @@
+:: # Copyright 2013, Big Switch Networks, Inc.
+:: #
+:: # LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
+:: # the following special exception:
+:: #
+:: # LOXI Exception
+:: #
+:: # As a special exception to the terms of the EPL, you may distribute libraries
+:: # generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
+:: # that copyright and licensing notices generated by LoxiGen are not altered or removed
+:: # from the LoxiGen Libraries and the notice provided below is (i) included in
+:: # the LoxiGen Libraries, if distributed in source code form and (ii) included in any
+:: # documentation for the LoxiGen Libraries, if distributed in binary form.
+:: #
+:: # Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler."
+:: #
+:: # You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain
+:: # a copy of the EPL at:
+:: #
+:: # http://www.eclipse.org/legal/epl-v10.html
+:: #
+:: # Unless required by applicable law or agreed to in writing, software
+:: # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+:: # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+:: # EPL for the specific language governing permissions and limitations
+:: # under the EPL.
+::
+/* Copyright 2013, Big Switch Networks, Inc. */
+
+/****************************************************************
+ *
+ * of_object.c
+ *
+ * These are the low level object constructor/destructor operators.
+ *
+ ****************************************************************/
+
+#include "loci_log.h"
+#include <loci/loci.h>
+#include <loci/loci_validator.h>
+
+#if defined(OF_OBJECT_TRACKING)
+#include <BigList/biglist.h>
+
+loci_object_track_t loci_global_tracking;
+
+#define TRACK (&loci_global_tracking)
+#define TRACK_OBJS (TRACK->objects)
+#define CHECK_MAX(val, max) if ((val) > (max)) (max) = (val)
+
+#endif
+
+/**
+ * Create a generic new object and possibly underlying wire buffer
+ * @param bytes The number of bytes to allocate in the underlying buffer
+ *
+ * If bytes <= 0, do not allocate a wire buffer.
+ *
+ * Note that this is an internal function.  The class specific
+ * new functions should be called to properly initialize and track an
+ * OF object.
+ */
+
+of_object_t *
+of_object_new(int bytes)
+{
+    of_object_t *obj;
+
+    if ((obj = (of_object_t *)MALLOC(sizeof(of_generic_t))) == NULL) {
+        return NULL;
+    }
+    MEMSET(obj, 0, sizeof(of_generic_t));
+
+    if (bytes > 0) {
+        if ((obj->wire_object.wbuf = of_wire_buffer_new(bytes)) == NULL) {
+            FREE(obj);
+            return NULL;
+        }
+        obj->wire_object.owned = 1;
+    }
+
+    return obj;
+}
+
+/**
+ * The delete function for LOCI objects
+ *
+ * @param obj Pointer to the object to be deleted
+ *
+ * This can be called on any LOCI object; it should not need to be
+ * overridden.
+ */
+
+void
+of_object_delete(of_object_t *obj)
+{
+    if (obj == NULL) {
+        return;
+    }
+
+#if defined(OF_OBJECT_TRACKING)
+    ASSERT(obj->track_info.magic == OF_OBJECT_TRACKING_MAGIC &&
+           "of_object double free?");
+    LOCI_LOG_TRACE("OF obj delete %p.  Wire buf %p.\n", obj,
+                   obj->wire_object.wbuf);
+    ASSERT(TRACK->count_current > 0);
+    TRACK->count_current -= 1;
+    TRACK->deletes += 1;
+
+    TRACK_OBJS = biglist_remove_link_free(TRACK_OBJS,
+                                          obj->track_info.bl_entry);
+    obj->track_info.magic = 0;
+#endif
+
+    /*
+     * Make callback if present
+     */
+    if (obj->track_info.delete_cb != NULL) {
+        obj->track_info.delete_cb(obj);
+    }
+
+    if (obj->wire_object.owned) {
+        of_wire_buffer_free(obj->wire_object.wbuf);
+    }
+
+    FREE(obj);
+}
+
+/**
+ * Duplicate an object
+ * @param src The object to be duplicated
+ * @returns Pointer to the duplicate or NULL on error.  Caller is responsible
+ * for freeing the returned object.
+ */
+
+of_object_t *
+of_object_dup_(of_object_t *src)
+{
+    of_object_t *dst;
+    of_object_init_f init_fn;
+
+    if ((dst = (of_object_t *)MALLOC(sizeof(of_generic_t))) == NULL) {
+        return NULL;
+    }
+
+    MEMSET(dst, 0, sizeof(*dst));
+
+    /* Allocate a minimal wire buffer assuming we will not write to it. */
+    if ((dst->wire_object.wbuf = of_wire_buffer_new(src->length)) == NULL) {
+        FREE(dst);
+        return NULL;
+    }
+
+    dst->wire_object.owned = 1;
+
+    init_fn = of_object_init_map[src->object_id];
+    init_fn(dst, src->version, src->length, 0);
+
+    MEMCPY(OF_OBJECT_BUFFER_INDEX(dst, 0),
+           OF_OBJECT_BUFFER_INDEX(src, 0),
+           src->length);
+
+    return dst;
+}
+
+#if defined(OF_OBJECT_TRACKING)
+
+/**
+ * Record an object for tracking
+ *
+ * @param obj The object being tracked
+ * @param file The file name where the allocation is happening
+ * @param line The line number in the file where the alloc is happening
+ */
+
+void
+of_object_track(of_object_t *obj, const char *file, int line)
+{
+    if (obj != NULL) {
+        LOCI_LOG_TRACE("OF obj track %p, wire buf %p\n%s:%d\\n",
+                      obj, obj->wire_object.wbuf, file, line);
+        obj->track_info.file = file;
+        obj->track_info.line = line;
+        TRACK_OBJS = biglist_prepend(TRACK_OBJS, (void *)obj);
+        obj->track_info.bl_entry = TRACK_OBJS;
+        obj->track_info.magic = OF_OBJECT_TRACKING_MAGIC;
+
+        TRACK->allocs += 1;
+        TRACK->count_current += 1;
+        CHECK_MAX(TRACK->count_current, TRACK->count_max);
+    }
+}
+
+/**
+ * The dup function when tracking is enabled
+ */
+
+of_object_t *
+of_object_dup_tracking(of_object_t *src, const char *file, int line)
+{
+    of_object_t *obj;
+
+    obj = of_object_dup_(src);
+    of_object_track(obj, file, line);
+
+    return obj;
+}
+
+/**
+ * Display track info for one object
+ */
+
+void
+of_object_track_output(of_object_t *obj, loci_writer_f writer, void* cookie)
+{
+    const char *offset;
+    static const char *unknown = "Unknown file";
+
+    if (obj->track_info.file) {
+        offset = strstr(obj->track_info.file, "Modules/");
+        if (offset == NULL) {
+            offset = obj->track_info.file;
+        } else {
+            offset += 8; /* Jump over Modules/ too */
+        }
+    } else {
+        offset = unknown;
+    }
+    writer(cookie, "obj %p. type %s.\n%s:%d\n",
+               obj, of_object_id_str[obj->object_id],
+               offset, obj->track_info.line);
+}
+
+/**
+ * Dump out the current object list from LOCI
+ *
+ * @param log_fn The output printf vector
+ *
+ */
+
+void
+of_object_track_report(loci_writer_f writer, void* cookie)
+{
+    biglist_t *elt;
+    of_object_t *obj;
+    int count = 0;
+
+    writer(cookie, "\nLOCI Outstanding object list.\n");
+    writer(cookie, "Objs: Current %d. Max %d. Created %d. Deleted %d\n",
+               TRACK->count_current, TRACK->count_max, TRACK->allocs,
+               TRACK->deletes);
+    if (TRACK_OBJS) {
+        BIGLIST_FOREACH_DATA(elt, TRACK_OBJS, of_object_t *, obj) {
+            of_object_track_output(obj, writer, cookie);
+            ++count;
+        }
+    }
+    if (count != TRACK->count_current) {
+        writer(cookie, "\nERROR:  List has %d, but track count is %d\n",
+                   count, TRACK->count_current);
+    }
+    writer(cookie, "\nEnd of outstanding object list\n");
+}
+
+#endif
+
+/**
+ * Generic new from message call
+ */
+
+of_object_t *
+of_object_new_from_message(of_message_t msg, int len)
+{
+    of_object_id_t object_id;
+    of_object_t *obj;
+    of_version_t version;
+
+    version = of_message_version_get(msg);
+    if (!OF_VERSION_OKAY(version)) {
+        return NULL;
+    }
+
+    if (of_validate_message(msg, len) != 0) {
+        LOCI_LOG_ERROR("message validation failed\n");
+        return NULL;
+    }
+
+    object_id = of_message_to_object_id(msg, len);
+    ASSERT(object_id != OF_OBJECT_INVALID);
+
+    if ((obj = of_object_new(-1)) == NULL) {
+        return NULL;
+    }
+
+    of_object_init_map[object_id](obj, version, 0, 0);
+
+    if (of_object_buffer_bind(obj, OF_MESSAGE_TO_BUFFER(msg), len, 
+                              OF_MESSAGE_FREE_FUNCTION) < 0) {
+        FREE(obj);
+        return NULL;
+    }
+    obj->length = len;
+    obj->version = version;
+
+#if defined(OF_OBJECT_TRACKING)
+    /* @FIXME Would be nice to get caller; for now only in cxn_instance */
+    of_object_track(obj, __FILE__, __LINE__);
+#endif
+
+    return obj;
+}
+
+/**
+ * Bind an existing buffer to an LOCI object
+ *
+ * @param obj Pointer to the object to be updated
+ * @param buf Pointer to the buffer to bind to obj
+ * @param bytes Length of buf
+ * @param buf_free An optional free function to be applied to
+ * buf on deallocation
+ *
+ * This can be called on any LOCI object; it should not need to be
+ * overridden.
+ */
+
+int
+of_object_buffer_bind(of_object_t *obj, uint8_t *buf, int bytes, 
+                      of_buffer_free_f buf_free)
+{
+    of_wire_object_t *wobj;
+    of_wire_buffer_t *wbuf;
+
+    ASSERT(buf != NULL);
+    ASSERT(bytes > 0);
+    // ASSERT(wobj is not bound);
+
+    wobj = &obj->wire_object;
+    MEMSET(wobj, 0, sizeof(*wobj));
+
+    wbuf = of_wire_buffer_new_bind(buf, bytes, buf_free);
+    if (wbuf == NULL) {
+        return OF_ERROR_RESOURCE;
+    }
+
+    wobj->wbuf = wbuf;
+    wobj->owned = 1;
+    obj->length = bytes;
+
+    return OF_ERROR_NONE;
+}
+
+/**
+ * Connect a child to a parent at the wire buffer level
+ *
+ * @param parent The top level object to bind to
+ * @param child The sub-object connecting to the parent
+ * @param offset The offset at which to attach the child RELATIVE 
+ * TO THE PARENT in the buffer
+ * @param bytes The amount of the buffer dedicated to the child; see below
+ * @param inc_ref_count Should the ref count of the parent be incremented
+ * 
+ * This is used for 'get' accessors for composite types as well as
+ * iterator functions for lists, both read (first/next) and write
+ * (append_init, append_advance).
+ *
+ * Connect a child object to a parent by setting up the child's
+ * wire_object to point to the parent's underlying buffer.  The value
+ * of the parameter bytes is important in determining how the child
+ * is initialized:
+ * @li If bytes <= 0, the length and type of the child are not modified;
+ * no additional space is added to the buffer.
+ * @li If bytes > 0, the current wire buffer is grown to 
+ * accomodate this many bytes.  This is to support append operations.
+ *
+ * If an error is returned, future references to the child object
+ * (until it is reinitialized) are undefined.
+ */
+static void
+object_child_attach(of_object_t *parent, of_object_t *child, 
+                       int offset, int bytes)
+{
+    of_wire_object_t *c_wobj; /* Pointer to child's wire object */
+    of_wire_buffer_t *wbuf; /* Pointer to common wire buffer manager */
+
+    child->parent = parent;
+    wbuf = parent->wire_object.wbuf;
+
+    /* Set up the child's wire buf to point to same as parent */
+    c_wobj = &child->wire_object;
+    c_wobj->wbuf = wbuf;
+    c_wobj->obj_offset = parent->wire_object.obj_offset + offset;
+    c_wobj->owned = 0;
+
+    /*
+     * bytes determines if this is a read or write setup.
+     * If > 0, grow the buffer to accomodate the space
+     * Otherwise do nothing
+     */
+    if (bytes > 0) { /* Set internal length, request buffer space */
+        int tot_bytes; /* Total bytes to request for buffer if updated */
+
+        /* Set up space for the child in the parent's buffer */
+        tot_bytes = parent->wire_object.obj_offset + offset + bytes;
+
+        of_wire_buffer_grow(wbuf, tot_bytes);
+        child->length = bytes;
+    }
+    /* if bytes == 0 don't do anything */
+}
+
+/**
+ * Check for room in an object's wire buffer.
+ * @param obj The object being checked
+ * @param new_len The desired length
+ * @return Boolean
+ */
+
+int
+of_object_can_grow(of_object_t *obj, int new_len)
+{
+    return OF_OBJECT_ABSOLUTE_OFFSET(obj, new_len) <=
+        WBUF_ALLOC_BYTES(obj->wire_object.wbuf);
+}
+
+/**
+ * Set the xid of a message object
+ * @param obj The object being accessed
+ * @param xid The xid value to store in the wire buffer
+ * @return OF_ERROR_
+ * Since the XID is common across all versions, this is used
+ * for all XID accessors.
+ */
+
+int
+of_object_xid_set(of_object_t *obj, uint32_t xid)
+{
+    of_wire_buffer_t *wbuf;
+
+    if ((wbuf = OF_OBJECT_TO_WBUF(obj)) == NULL) {
+        return OF_ERROR_PARAM;
+    }
+    of_wire_buffer_u32_set(wbuf, 
+        OF_OBJECT_ABSOLUTE_OFFSET(obj, OF_MESSAGE_XID_OFFSET), xid);
+    return OF_ERROR_NONE;
+}
+
+/**
+ * Get the xid of a message object
+ * @param obj The object being accessed
+ * @param xid Pointer to where to store the xid value
+ * @return OF_ERROR_
+ * Since the XID is common across all versions, this is used
+ * for all XID accessors.
+ */
+
+int
+of_object_xid_get(of_object_t *obj, uint32_t *xid)
+{
+    of_wire_buffer_t *wbuf;
+
+    if ((wbuf = OF_OBJECT_TO_WBUF(obj)) == NULL) {
+        return OF_ERROR_PARAM;
+    }
+    of_wire_buffer_u32_get(wbuf, 
+        OF_OBJECT_ABSOLUTE_OFFSET(obj, OF_MESSAGE_XID_OFFSET), xid);
+    return OF_ERROR_NONE;
+}
+
+/****************************************************************
+ *
+ * Generic list operation implementations
+ *
+ ****************************************************************/
+
+/**
+ * Set up a child for appending to a parent list
+ * @param parent The parent; must be a list object
+ * @param child The child object; must be of type list element
+ * @return OF_ERROR_
+ *
+ * Attaches the wire buffer of the parent to the child by pointing
+ * the child to the end of the parent.
+ * 
+ * Set the wire length and type from the child.
+ * Update the parent length adding the current child length
+ *
+ * After calling this function, the child object may be updated
+ * resulting in changes to the parent's wire buffer
+ * 
+ */ 
+
+int
+of_list_append_bind(of_object_t *parent, of_object_t *child)
+{
+    if (parent == NULL || child == NULL ||
+           parent->wire_object.wbuf == NULL) {
+        return OF_ERROR_PARAM;
+    }
+
+    if (!of_object_can_grow(parent, parent->length + child->length)) {
+        return OF_ERROR_RESOURCE;
+    }
+
+    object_child_attach(parent, child, parent->length, 
+                        child->length);
+
+    /* Update the wire length and type if needed */
+    if (child->wire_length_set) {
+        child->wire_length_set(child, child->length);
+    }
+
+    if (child->wire_type_set) {
+        child->wire_type_set(child, child->object_id);
+    }
+
+    /* Update the parent's length */
+    of_object_parent_length_update(parent, child->length);
+
+    OF_LENGTH_CHECK_ASSERT(parent);
+
+    return OF_ERROR_NONE;
+}
+
+/**
+ * Generic atomic list append operation
+ * @param list The list to which an item is being appended
+ * @param item THe item to append to the list
+ *
+ * The contents of the item are copied to the end of the list.
+ * Currently assumes the list is at the end of its parent.
+ */
+int
+of_list_append(of_object_t *list, of_object_t *item)
+{
+    int new_len;
+
+    new_len = list->length + item->length;
+
+    if (!of_object_can_grow(list, new_len)) {
+        return OF_ERROR_RESOURCE;
+    }
+
+    of_wire_buffer_grow(list->wire_object.wbuf,
+                        OF_OBJECT_ABSOLUTE_OFFSET(list, new_len));
+
+    MEMCPY(OF_OBJECT_BUFFER_INDEX(list, list->length),
+           OF_OBJECT_BUFFER_INDEX(item, 0), item->length);
+
+    /* Update the list's length */
+    of_object_parent_length_update(list, item->length);
+
+    OF_LENGTH_CHECK_ASSERT(list);
+
+    return OF_ERROR_NONE;
+}
+
+/**
+ * Generic list first function
+ * @param parent The parent; must be a list object
+ * @param child The child object; must be of type list element
+ * @return OF_ERROR_RANGE if list is empty
+ * @return OF_ERROR_
+ *
+ * Sets up the child to point to the first element in the list
+ *
+ * Child init must be called before this is called.
+ *
+ * @note TREAT AS PRIVATE
+ * Does not fully initialized object
+ */
+int
+of_list_first(of_object_t *parent, of_object_t *child)
+{
+    if (parent->length == 0) { /* Empty list */
+        return OF_ERROR_RANGE;
+    }
+
+    object_child_attach(parent, child, 0, 0);
+
+    return OF_ERROR_NONE;
+}
+
+/**
+ * Return boolean indicating if child is pointing to last entry in parent
+ * @param parent The parent; must be a list object
+ * @param child The child object; must be of type list element
+ * @return OF_ERROR_RANGE if list is empty
+ * @return OF_ERROR_
+ *
+ */
+static int
+of_list_is_last(of_object_t *parent, of_object_t *child)
+{
+    if (child->wire_object.obj_offset + child->length >= 
+        parent->wire_object.obj_offset + parent->length) {
+        return 1;
+    }
+
+    return 0;
+}
+
+/**
+ * Generic list next function
+ * @param parent The parent; must be a list object
+ * @param child The child object; must be of type list element
+ * @return OF_ERROR_RANGE if at end of list
+ * @return OF_ERROR_
+ *
+ * Advances the child to point to the subsequent element in the list.
+ * The wire buffer object must not have been modified since the 
+ * previous call to _first or _next.
+ *
+ * @note TREAT AS PRIVATE
+ * Does not fully initialized object
+ */ 
+int
+of_list_next(of_object_t *parent, of_object_t *child)
+{
+    int offset;
+
+    ASSERT(child->length > 0);
+
+    /* Get offset of parent */
+    if (of_list_is_last(parent, child)) {
+        return OF_ERROR_RANGE; /* We were on the last object */
+    }
+
+    /* Offset is relative to parent start */
+    offset = (child->wire_object.obj_offset - parent->wire_object.obj_offset) +
+        child->length;
+    object_child_attach(parent, child, offset, 0);
+
+    return OF_ERROR_NONE;
+}
+
+void
+of_object_wire_buffer_steal(of_object_t *obj, uint8_t **buffer)
+{
+    ASSERT(obj != NULL);
+    of_wire_buffer_steal(obj->wire_object.wbuf, buffer);
+    obj->wire_object.wbuf = NULL;
+}
+
+/*
+ * Set member:
+ *    get_wbuf_extent
+ *    find offset of start of member
+ *    if offset is at wbuf_extent (append new data)
+ *        copy data at extent
+ *        update parent length
+ *    else
+ *        find length of current entry
+ *        move from end of current to extent to create (or remove) space
+ *        copy data to offset
+ *        update my length -- NEED LOCAL INFO TO DO THIS for some cases
+ */
+
+/* Also need: get offset of member for all combinations */
+/* Also need: get length of member for all combinations */
+#if 0
+/**
+ * Append the wire buffer data from src to the end of dst's wire buffer
+ */
+int
+of_object_append_buffer(of_object_t *dst, of_object_t *src)
+{
+    of_wire_buffer_t *s_wbuf, *d_wbuf;
+    int orig_len, dst_offset, src_offset;
+
+    d_wbuf = OF_OBJECT_TO_WBUF(dst);
+    s_wbuf = OF_OBJECT_TO_WBUF(src);
+    dst_offset = dst->wire_object.obj_offset + dst_length;
+    src_offset = src->wire_object.obj_offset;
+    OF_WIRE_BUFFER_INIT_CHECK(d_wbuf, dst_offset + src->length);
+    MEMCPY(OF_WBUF_BUFFER_POINTER(d_wbuf, dst_offset),
+           OF_WBUF_BUFFER_POINTER(s_wbuf, 0), src->length);
+
+    orig_len = dst->length;
+    dst->length += src->length;
+
+    return OF_ERROR_NONE;
+}
+
+/**
+ * Set the length of the actions object in a packet_in object
+ */
+
+int
+of_packet_out_actions_length_set(of_packet_t *obj, int len)
+{
+    if (obj == NULL || obj->object_id != OF_PACKET_IN ||
+        obj->wire_object.wbuf == NULL) {
+        return OF_ERROR_PARAM;
+    }
+
+    obj->actions_len_set(obj, len);
+}
+
+int
+_packet_out_data_offset_get(of_packet_t *obj)
+{
+    if (obj == NULL || obj->object_id != OF_PACKET_IN ||
+        obj->wire_object.wbuf == NULL) {
+        return -1;
+    }
+
+    return OF_PACKET_OUT_FIXED_LENGTH + _packet_out_actions_length_get(obj);
+}
+
+
+/**
+ * Simple length derivation function
+ *
+ * Most variable length fields are alone at the end of a structure.
+ * Their length is a simple calculation, just the total length of
+ * the parent minus the length of the non-variable part of the 
+ * parent's class type.
+ *
+ * @param parent The parent object
+ * @param length (out) Where to store the length of the final 
+ * variable length member
+ */
+int
+of_object_simple_length_derive(of_object_t *obj, int *length)
+{
+    
+}
+#endif
diff --git a/c_gen/templates/of_object.h b/c_gen/templates/of_object.h
new file mode 100644
index 0000000..cb9342e
--- /dev/null
+++ b/c_gen/templates/of_object.h
@@ -0,0 +1,176 @@
+:: # Copyright 2013, Big Switch Networks, Inc.
+:: #
+:: # LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
+:: # the following special exception:
+:: #
+:: # LOXI Exception
+:: #
+:: # As a special exception to the terms of the EPL, you may distribute libraries
+:: # generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
+:: # that copyright and licensing notices generated by LoxiGen are not altered or removed
+:: # from the LoxiGen Libraries and the notice provided below is (i) included in
+:: # the LoxiGen Libraries, if distributed in source code form and (ii) included in any
+:: # documentation for the LoxiGen Libraries, if distributed in binary form.
+:: #
+:: # Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler."
+:: #
+:: # You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain
+:: # a copy of the EPL at:
+:: #
+:: # http://www.eclipse.org/legal/epl-v10.html
+:: #
+:: # Unless required by applicable law or agreed to in writing, software
+:: # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+:: # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+:: # EPL for the specific language governing permissions and limitations
+:: # under the EPL.
+::
+/* Copyright 2013, Big Switch Networks, Inc. */
+
+/*
+ * @fixme THIS FILE NEEDS CLEANUP.  It may just go away.
+ * 
+ * Low level internal header file.  Defines inheritance mechanism for
+ * LOCI objects.  In general, the routines in this file should not be
+ * called directly.  Rather the class-specific operations should be 
+ * used from loci.h.
+ *
+ * TREAT THESE FUNCTIONS AS PRIVATE.  THEY ARE GENERALLY HELPER
+ * FUNCTIONS FOR LOCI TYPE SPECIFIC IMPLEMENTATIONS
+ */
+
+#if !defined(_OF_OBJECT_H_)
+#define _OF_OBJECT_H_
+
+#include <loci/of_buffer.h>
+#include <loci/of_match.h>
+#include <loci/loci_base.h>
+#include <loci/of_message.h>
+
+#if defined(OF_OBJECT_TRACKING)
+#include <BigList/biglist.h>
+#endif
+
+/**
+ * This is the number of bytes reserved for metadata in each
+ * of_object_t instance.
+ */
+#define OF_OBJECT_METADATA_BYTES 32
+
+/****************************************************************
+ * General list operations: first, next, append_setup, append_advance
+ ****************************************************************/
+
+/* General list first operation */
+extern int of_list_first(of_object_t *parent, of_object_t *child);
+
+/* General list next operation */
+extern int of_list_next(of_object_t *parent, of_object_t *child);
+
+/* General list append bind operation */
+extern int of_list_append_bind(of_object_t *parent, of_object_t *child);
+
+/* Append a copy of item to list */
+extern int of_list_append(of_object_t *list, of_object_t *item);
+
+extern of_object_t *of_object_new(int bytes);
+extern of_object_t * of_object_dup_(of_object_t *src);
+
+/**
+ * Callback function prototype for deleting an object
+ */
+typedef void (*of_object_delete_callback_f)(of_object_t *obj);
+
+#if defined(OF_OBJECT_TRACKING)
+/**
+ * When tracking is enabled, the location of each new or dup
+ * call of an OF object is recorded and a list is kept of all
+ * outstanding objects.
+ *
+ * This dovetails with using objects to track outstanding operations
+ * for barrier processing.
+ */
+
+/**
+ * Global tracking stats
+ */
+typedef struct loci_object_track_s {
+    biglist_t *objects;
+    int count_current;
+    uint32_t count_max;
+    uint32_t allocs;
+    uint32_t deletes;
+} loci_object_track_t;
+
+extern loci_object_track_t loci_global_tracking;
+
+/* Remap dup call to tracking */
+extern of_object_t * of_object_dup_tracking(of_object_t *src,
+                                            const char *file, int line);
+#define of_object_dup(src) of_object_dup_tracking(src, __FILE__, __LINE__)
+extern void of_object_track(of_object_t *obj, const char *file, int line);
+
+extern void of_object_track_output(of_object_t *obj, loci_writer_f writer, void* cookie); 
+extern void of_object_track_report(loci_writer_f writer, void* cookie); 
+
+/**
+ * The data stored in each object related to tracking and
+ * The LOCI client may install a delete callback function to allow
+ * the notification of an object's destruction.
+ */
+
+typedef struct of_object_track_info_s {
+    of_object_delete_callback_f delete_cb;  /* To be implemented */
+    void *delete_cookie;
+
+    /* Track file and line where allocated */
+    const char *file;
+    int line;
+    biglist_t *bl_entry; /* Pointer to self */
+    uint32_t magic; /* validation value */
+} of_object_track_info_t;
+
+#define OF_OBJECT_TRACKING_MAGIC 0x11235813
+#else
+
+/* Use native dup call */
+#define of_object_dup of_object_dup_
+
+/**
+ * When tracking is not enabled, we still support a delete callback
+ */
+
+typedef struct of_object_track_info_s {
+    of_object_delete_callback_f delete_cb;  /* To be implemented */
+    void *delete_cookie;
+} of_object_track_info_t;
+
+#endif
+
+extern int of_object_xid_set(of_object_t *obj, uint32_t xid);
+extern int of_object_xid_get(of_object_t *obj, uint32_t *xid);
+
+/* Bind a buffer to an object, usually for parsing the buffer */
+extern int of_object_buffer_bind(of_object_t *obj, uint8_t *buf, 
+                                 int bytes, of_buffer_free_f buf_free);
+
+
+/**
+ * Steal a wire buffer from an object.
+ * @param obj The object whose buffer is being removed
+ * @param buffer[out] A handle for the pointer to the uint8_t * returned
+ *
+ * The wire buffer is taken from the object and its wirebuffer is set to
+ * NULL.  The ref_count of the wire buffer is not changed.
+ */
+extern void of_object_wire_buffer_steal(of_object_t *obj, uint8_t **buffer);
+extern int of_object_append_buffer(of_object_t *dst, of_object_t *src);
+
+extern of_object_t *of_object_new_from_message(of_message_t msg, int len);
+
+/* Delete an OpenFlow object without reference to its type */
+extern void of_object_delete(of_object_t *obj);
+
+int of_object_can_grow(of_object_t *obj, int new_len);
+
+#endif /* _OF_OBJECT_H_ */
diff --git a/c_gen/templates/of_type_maps.c b/c_gen/templates/of_type_maps.c
new file mode 100644
index 0000000..ef1df37
--- /dev/null
+++ b/c_gen/templates/of_type_maps.c
@@ -0,0 +1,799 @@
+:: # Copyright 2013, Big Switch Networks, Inc.
+:: #
+:: # LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
+:: # the following special exception:
+:: #
+:: # LOXI Exception
+:: #
+:: # As a special exception to the terms of the EPL, you may distribute libraries
+:: # generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
+:: # that copyright and licensing notices generated by LoxiGen are not altered or removed
+:: # from the LoxiGen Libraries and the notice provided below is (i) included in
+:: # the LoxiGen Libraries, if distributed in source code form and (ii) included in any
+:: # documentation for the LoxiGen Libraries, if distributed in binary form.
+:: #
+:: # Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler."
+:: #
+:: # You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain
+:: # a copy of the EPL at:
+:: #
+:: # http://www.eclipse.org/legal/epl-v10.html
+:: #
+:: # Unless required by applicable law or agreed to in writing, software
+:: # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+:: # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+:: # EPL for the specific language governing permissions and limitations
+:: # under the EPL.
+::
+/* Copyright 2013, Big Switch Networks, Inc. */
+
+/****************************************************************
+ *
+ * Functions related to mapping wire values to object types
+ * and lengths
+ *
+ ****************************************************************/
+
+#include <loci/loci.h>
+#include <loci/of_message.h>
+
+/****************************************************************
+ * Top level OpenFlow message length functions
+ ****************************************************************/
+
+/**
+ * Get the length of a message object as reported on the wire
+ * @param obj The object to check
+ * @param bytes (out) Where the length is stored
+ * @returns OF_ERROR_ code
+ */
+void
+of_object_message_wire_length_get(of_object_t *obj, int *bytes)
+{
+    of_wire_buffer_t *wbuf = OF_OBJECT_TO_WBUF(obj);
+    ASSERT(wbuf != NULL);
+    // ASSERT(obj is message)
+    *bytes = of_message_length_get(OF_OBJECT_TO_MESSAGE(obj));
+}
+
+/**
+ * Set the length of a message object as reported on the wire
+ * @param obj The object to check
+ * @param bytes The new length of the object
+ * @returns OF_ERROR_ code
+ */
+void
+of_object_message_wire_length_set(of_object_t *obj, int bytes)
+{
+    of_wire_buffer_t *wbuf = OF_OBJECT_TO_WBUF(obj);
+    ASSERT(wbuf != NULL);
+
+    // ASSERT(obj is message)
+    of_message_length_set(OF_OBJECT_TO_MESSAGE(obj), bytes);
+}
+
+/****************************************************************
+ * TLV16 type/length functions
+ ****************************************************************/
+
+/**
+ * Many objects are TLVs and use uint16 for the type and length values
+ * stored on the wire at the beginning of the buffer.
+ */
+#define TLV16_WIRE_TYPE_OFFSET 0
+#define TLV16_WIRE_LENGTH_OFFSET 2
+
+/**
+ * Get the length field from the wire for a standard TLV
+ * object that uses uint16 for both type and length.
+ * @param obj The object being referenced
+ * @param bytes (out) Where to store the length
+ */
+
+void
+of_tlv16_wire_length_get(of_object_t *obj, int *bytes)
+{
+    uint16_t val16;
+    of_wire_buffer_t *wbuf = OF_OBJECT_TO_WBUF(obj);
+    ASSERT(wbuf != NULL);
+
+    of_wire_buffer_u16_get(wbuf, 
+           OF_OBJECT_ABSOLUTE_OFFSET(obj, TLV16_WIRE_LENGTH_OFFSET), &val16);
+    *bytes = val16;
+}
+
+/**
+ * Set the length field in the wire buffer for a standard TLV
+ * object that uses uint16 for both type and length.
+ * @param obj The object being referenced
+ * @param bytes The length value to use
+ */
+
+void
+of_tlv16_wire_length_set(of_object_t *obj, int bytes)
+{
+    of_wire_buffer_t *wbuf = OF_OBJECT_TO_WBUF(obj);
+    ASSERT(wbuf != NULL);
+
+    of_wire_buffer_u16_set(wbuf, 
+        OF_OBJECT_ABSOLUTE_OFFSET(obj, TLV16_WIRE_LENGTH_OFFSET), bytes);
+}
+
+/**
+ * Get the type field from the wire for a standard TLV object that uses
+ * uint16 for both type and length.
+ * @param obj The object being referenced
+ * @param wire_type (out) Where to store the type
+ */
+
+static void
+of_tlv16_wire_type_get(of_object_t *obj, int *wire_type)
+{
+    uint16_t val16;
+    of_wire_buffer_t *wbuf = OF_OBJECT_TO_WBUF(obj);
+
+    of_wire_buffer_u16_get(wbuf, OF_OBJECT_ABSOLUTE_OFFSET(obj, 
+           TLV16_WIRE_TYPE_OFFSET), &val16);
+
+    *wire_type = val16;
+}
+
+/**
+ * Set the object ID based on the wire buffer for any TLV object
+ * @param obj The object being referenced
+ * @param id The ID value representing what should be stored.
+ */
+
+void
+of_tlv16_wire_object_id_set(of_object_t *obj, of_object_id_t id)
+{
+    int wire_type;
+    of_wire_buffer_t *wbuf = OF_OBJECT_TO_WBUF(obj);
+    ASSERT(wbuf != NULL);
+
+    wire_type = of_object_to_type_map[obj->version][id];
+    ASSERT(wire_type >= 0);
+
+    of_wire_buffer_u16_set(wbuf, 
+        OF_OBJECT_ABSOLUTE_OFFSET(obj, TLV16_WIRE_TYPE_OFFSET), wire_type);
+
+    if (wire_type == OF_EXPERIMENTER_TYPE) {
+        of_extension_object_id_set(obj, id);
+    }
+}
+
+/**
+ * Get the object ID of an extended action
+ * @param obj The object being referenced
+ * @param id Where to store the object ID
+ * @fixme:  This should be auto generated
+ *
+ * If unable to map to known extension, set id to generic "experimenter"
+ */
+
+#define OF_ACTION_EXPERIMENTER_ID_OFFSET 4
+#define OF_ACTION_EXPERIMENTER_SUBTYPE_OFFSET 8
+
+
+static void
+extension_action_object_id_get(of_object_t *obj, of_object_id_t *id)
+{
+    uint32_t exp_id;
+    uint8_t *buf;
+
+    *id = OF_ACTION_EXPERIMENTER;
+
+    buf = OF_OBJECT_BUFFER_INDEX(obj, 0);
+    
+    buf_u32_get(buf + OF_ACTION_EXPERIMENTER_ID_OFFSET, &exp_id);
+
+    switch (exp_id) {
+    case OF_EXPERIMENTER_ID_BSN: {
+        uint32_t subtype;
+        buf_u32_get(buf + OF_ACTION_EXPERIMENTER_SUBTYPE_OFFSET, &subtype);
+        switch (subtype) {
+        case 1: *id = OF_ACTION_BSN_MIRROR; break;
+        case 2: *id = OF_ACTION_BSN_SET_TUNNEL_DST; break;
+        }
+        break;
+    }
+    case OF_EXPERIMENTER_ID_NICIRA: {
+        uint16_t subtype;
+        buf_u16_get(buf + OF_ACTION_EXPERIMENTER_SUBTYPE_OFFSET, &subtype);
+        switch (subtype) {
+        case 18: *id = OF_ACTION_NICIRA_DEC_TTL; break;
+        }
+        break;
+    }
+    }
+}
+
+/**
+ * Set wire data for extension objects, not messages.
+ *
+ * Currently only handles BSN mirror; ignores all others
+ */
+
+void
+of_extension_object_id_set(of_object_t *obj, of_object_id_t id)
+{
+    uint8_t *buf = OF_OBJECT_BUFFER_INDEX(obj, 0);
+    
+    switch (id) {
+    case OF_ACTION_BSN_MIRROR:
+    case OF_ACTION_ID_BSN_MIRROR:
+        buf_u32_set(buf + OF_ACTION_EXPERIMENTER_ID_OFFSET,
+                    OF_EXPERIMENTER_ID_BSN);
+        buf_u32_set(buf + OF_ACTION_EXPERIMENTER_SUBTYPE_OFFSET, 1);
+        break;
+    case OF_ACTION_BSN_SET_TUNNEL_DST:
+    case OF_ACTION_ID_BSN_SET_TUNNEL_DST:
+        buf_u32_set(buf + OF_ACTION_EXPERIMENTER_ID_OFFSET,
+                    OF_EXPERIMENTER_ID_BSN);
+        buf_u32_set(buf + OF_ACTION_EXPERIMENTER_SUBTYPE_OFFSET, 2);
+        break;
+    case OF_ACTION_NICIRA_DEC_TTL:
+    case OF_ACTION_ID_NICIRA_DEC_TTL:
+        buf_u32_set(buf + OF_ACTION_EXPERIMENTER_ID_OFFSET,
+                    OF_EXPERIMENTER_ID_NICIRA);
+        buf_u16_set(buf + OF_ACTION_EXPERIMENTER_SUBTYPE_OFFSET, 18);
+        break;
+    default:
+        break;
+    }
+}
+
+/**
+ * Get the object ID of an extended action
+ * @param obj The object being referenced
+ * @param id Where to store the object ID
+ * @fixme:  This should be auto generated
+ *
+ * If unable to map to known extension, set id to generic "experimenter"
+ */
+
+static void
+extension_action_id_object_id_get(of_object_t *obj, of_object_id_t *id)
+{
+    uint32_t exp_id;
+    uint8_t *buf;
+
+    *id = OF_ACTION_ID_EXPERIMENTER;
+
+    buf = OF_OBJECT_BUFFER_INDEX(obj, 0);
+    
+    buf_u32_get(buf + OF_ACTION_EXPERIMENTER_ID_OFFSET, &exp_id);
+
+    switch (exp_id) {
+    case OF_EXPERIMENTER_ID_BSN: {
+        uint32_t subtype;
+        buf_u32_get(buf + OF_ACTION_EXPERIMENTER_SUBTYPE_OFFSET, &subtype);
+        switch (subtype) {
+        case 1: *id = OF_ACTION_ID_BSN_MIRROR; break;
+        case 2: *id = OF_ACTION_ID_BSN_SET_TUNNEL_DST; break;
+        }
+        break;
+    }
+    case OF_EXPERIMENTER_ID_NICIRA: {
+        uint16_t subtype;
+        buf_u16_get(buf + OF_ACTION_EXPERIMENTER_SUBTYPE_OFFSET, &subtype);
+        switch (subtype) {
+        case 18: *id = OF_ACTION_ID_NICIRA_DEC_TTL; break;
+        }
+        break;
+    }
+    }
+}
+
+
+/**
+ * Get the object ID based on the wire buffer for an action object
+ * @param obj The object being referenced
+ * @param id Where to store the object ID
+ */
+
+
+void
+of_action_wire_object_id_get(of_object_t *obj, of_object_id_t *id)
+{
+    int wire_type;
+
+    of_tlv16_wire_type_get(obj, &wire_type);
+    if (wire_type == OF_EXPERIMENTER_TYPE) {
+        extension_action_object_id_get(obj, id);
+        return;
+    }
+
+    ASSERT(wire_type >= 0 && wire_type < OF_ACTION_ITEM_COUNT);
+
+    *id = of_action_type_to_id[obj->version][wire_type];
+    ASSERT(*id != OF_OBJECT_INVALID);
+}
+
+/**
+ * Get the object ID based on the wire buffer for an action ID object
+ * @param obj The object being referenced
+ * @param id Where to store the object ID
+ */
+
+
+void
+of_action_id_wire_object_id_get(of_object_t *obj, of_object_id_t *id)
+{
+    int wire_type;
+
+    of_tlv16_wire_type_get(obj, &wire_type);
+    if (wire_type == OF_EXPERIMENTER_TYPE) {
+        extension_action_id_object_id_get(obj, id);
+        return;
+    }
+
+    ASSERT(wire_type >= 0 && wire_type < OF_ACTION_ID_ITEM_COUNT);
+
+    *id = of_action_id_type_to_id[obj->version][wire_type];
+    ASSERT(*id != OF_OBJECT_INVALID);
+}
+
+/**
+ * @fixme to do when we have instruction extensions
+ * See extension_action above
+ */
+
+static int
+extension_instruction_object_id_get(of_object_t *obj, of_object_id_t *id)
+{
+    (void)obj;
+
+    *id = OF_INSTRUCTION_EXPERIMENTER;
+
+    return OF_ERROR_NONE;
+}
+
+/**
+ * Get the object ID based on the wire buffer for an instruction object
+ * @param obj The object being referenced
+ * @param id Where to store the object ID
+ */
+
+void
+of_instruction_wire_object_id_get(of_object_t *obj, of_object_id_t *id)
+{
+    int wire_type;
+
+    of_tlv16_wire_type_get(obj, &wire_type);
+    if (wire_type == OF_EXPERIMENTER_TYPE) {
+        extension_instruction_object_id_get(obj, id);
+        return;
+    }
+
+    ASSERT(wire_type >= 0 && wire_type < OF_INSTRUCTION_ITEM_COUNT);
+
+    *id = of_instruction_type_to_id[obj->version][wire_type];
+    ASSERT(*id != OF_OBJECT_INVALID);
+}
+
+
+/**
+ * @fixme to do when we have queue_prop extensions
+ * See extension_action above
+ */
+
+static void
+extension_queue_prop_object_id_get(of_object_t *obj, of_object_id_t *id)
+{
+    (void)obj;
+
+    *id = OF_QUEUE_PROP_EXPERIMENTER;
+}
+
+/**
+ * Get the object ID based on the wire buffer for an queue_prop object
+ * @param obj The object being referenced
+ * @param id Where to store the object ID
+ */
+
+void
+of_queue_prop_wire_object_id_get(of_object_t *obj, of_object_id_t *id)
+{
+    int wire_type;
+
+    of_tlv16_wire_type_get(obj, &wire_type);
+    if (wire_type == OF_EXPERIMENTER_TYPE) {
+        extension_queue_prop_object_id_get(obj, id);
+        return;
+    }
+
+    ASSERT(wire_type >= 0 && wire_type < OF_QUEUE_PROP_ITEM_COUNT);
+
+    *id = of_queue_prop_type_to_id[obj->version][wire_type];
+    ASSERT(*id != OF_OBJECT_INVALID);
+}
+
+
+/**
+ * @fixme to do when we have table_feature_prop extensions
+ * See extension_action above
+ */
+
+static void
+extension_table_feature_prop_object_id_get(of_object_t *obj, of_object_id_t *id)
+{
+    (void)obj;
+
+    *id = OF_TABLE_FEATURE_PROP_EXPERIMENTER;
+}
+
+/**
+ * Table feature property object ID determination
+ *
+ * @param obj The object being referenced
+ * @param id Where to store the object ID
+ */
+
+void
+of_table_feature_prop_wire_object_id_get(of_object_t *obj, of_object_id_t *id)
+{
+    int wire_type;
+
+    of_tlv16_wire_type_get(obj, &wire_type);
+    if (wire_type == OF_EXPERIMENTER_TYPE) {
+        extension_table_feature_prop_object_id_get(obj, id);
+        return;
+    }
+
+    ASSERT(wire_type >= 0 && wire_type < OF_TABLE_FEATURE_PROP_ITEM_COUNT);
+
+    *id = of_table_feature_prop_type_to_id[obj->version][wire_type];
+    ASSERT(*id != OF_OBJECT_INVALID);
+}
+
+/**
+ * Get the object ID based on the wire buffer for meter_band object
+ * @param obj The object being referenced
+ * @param id Where to store the object ID
+ */
+
+void
+of_meter_band_wire_object_id_get(of_object_t *obj, of_object_id_t *id)
+{
+    int wire_type;
+
+    of_tlv16_wire_type_get(obj, &wire_type);
+    if (wire_type == OF_EXPERIMENTER_TYPE) {
+        *id = OF_METER_BAND_EXPERIMENTER;
+        return;
+    }
+
+    ASSERT(wire_type >= 0 && wire_type < OF_METER_BAND_ITEM_COUNT);
+
+    *id = of_meter_band_type_to_id[obj->version][wire_type];
+    ASSERT(*id != OF_OBJECT_INVALID);
+}
+
+/**
+ * Get the object ID based on the wire buffer for a hello_elem object
+ * @param obj The object being referenced
+ * @param id Where to store the object ID
+ */
+
+void
+of_hello_elem_wire_object_id_get(of_object_t *obj, of_object_id_t *id)
+{
+    int wire_type;
+
+    of_tlv16_wire_type_get(obj, &wire_type);
+    ASSERT(wire_type >= 0 && wire_type < OF_HELLO_ELEM_ITEM_COUNT);
+    *id = of_hello_elem_type_to_id[obj->version][wire_type];
+    ASSERT(*id != OF_OBJECT_INVALID);
+}
+
+/****************************************************************
+ * OXM type/length functions.
+ ****************************************************************/
+
+/* Where does the OXM type-length header lie in the buffer */
+#define OXM_HDR_OFFSET 0
+
+/**
+ * Get the OXM header (type-length fields) from the wire buffer
+ * associated with an OXM object
+ *
+ * Will return if error; set hdr to the OXM header
+ */
+
+#define _GET_OXM_TYPE_LEN(obj, tl_p, wbuf) do {                         \
+        wbuf = OF_OBJECT_TO_WBUF(obj);                                  \
+        ASSERT(wbuf != NULL);                                           \
+        of_wire_buffer_u32_get(wbuf,                                    \
+            OF_OBJECT_ABSOLUTE_OFFSET(obj, OXM_HDR_OFFSET), (tl_p));    \
+    } while (0)
+
+#define _SET_OXM_TYPE_LEN(obj, tl_p, wbuf) do {                         \
+        wbuf = OF_OBJECT_TO_WBUF(obj);                                  \
+        ASSERT(wbuf != NULL);                                           \
+        of_wire_buffer_u32_set(wbuf,                                    \
+            OF_OBJECT_ABSOLUTE_OFFSET(obj, OXM_HDR_OFFSET), (tl_p));    \
+    } while (0)
+
+/**
+ * Get the length of an OXM object from the wire buffer
+ * @param obj The object whose wire buffer is an OXM type
+ * @param bytes (out) Where length is stored 
+ */
+
+void
+of_oxm_wire_length_get(of_object_t *obj, int *bytes)
+{
+    uint32_t type_len;
+    of_wire_buffer_t *wbuf;
+
+    _GET_OXM_TYPE_LEN(obj, &type_len, wbuf);
+    *bytes = OF_OXM_LENGTH_GET(type_len);
+}
+
+/**
+ * Set the length of an OXM object in the wire buffer
+ * @param obj The object whose wire buffer is an OXM type
+ * @param bytes Value to store in wire buffer
+ */
+
+void
+of_oxm_wire_length_set(of_object_t *obj, int bytes)
+{
+    uint32_t type_len;
+    of_wire_buffer_t *wbuf;
+
+    ASSERT(bytes >= 0 && bytes < 256);
+
+    /* Read-modify-write */
+    _GET_OXM_TYPE_LEN(obj, &type_len, wbuf);
+    OF_OXM_LENGTH_SET(type_len, bytes);
+    of_wire_buffer_u32_set(wbuf, 
+           OF_OBJECT_ABSOLUTE_OFFSET(obj, OXM_HDR_OFFSET), type_len);
+}
+
+/**
+ * Get the object ID of an OXM object based on the wire buffer type
+ * @param obj The object whose wire buffer is an OXM type
+ * @param id (out) Where the ID is stored 
+ */
+
+void
+of_oxm_wire_object_id_get(of_object_t *obj, of_object_id_t *id)
+{
+    uint32_t type_len;
+    int wire_type;
+    of_wire_buffer_t *wbuf;
+
+    _GET_OXM_TYPE_LEN(obj, &type_len, wbuf);
+    wire_type = OF_OXM_MASKED_TYPE_GET(type_len);
+    *id = of_oxm_to_object_id(wire_type, obj->version);
+}
+
+/**
+ * Set the wire type of an OXM object based on the object ID passed
+ * @param obj The object whose wire buffer is an OXM type
+ * @param id The object ID mapped to an OXM wire type which is stored
+ */
+
+void
+of_oxm_wire_object_id_set(of_object_t *obj, of_object_id_t id)
+{
+    uint32_t type_len;
+    int wire_type;
+    of_wire_buffer_t *wbuf;
+
+    ASSERT(OF_OXM_VALID_ID(id));
+
+    /* Read-modify-write */
+    _GET_OXM_TYPE_LEN(obj, &type_len, wbuf);
+    wire_type = of_object_to_wire_type(id, obj->version);
+    ASSERT(wire_type >= 0);
+    OF_OXM_MASKED_TYPE_SET(type_len, wire_type);
+    of_wire_buffer_u32_set(wbuf, 
+           OF_OBJECT_ABSOLUTE_OFFSET(obj, OXM_HDR_OFFSET), type_len);
+}
+
+
+
+#define OF_U16_LEN_LENGTH_OFFSET 0
+
+/**
+ * Get the wire length for an object with a uint16 length as first member
+ * @param obj The object being referenced
+ * @param bytes Pointer to location to store length
+ */
+void
+of_u16_len_wire_length_get(of_object_t *obj, int *bytes)
+{
+    of_wire_buffer_t *wbuf = OF_OBJECT_TO_WBUF(obj);
+    uint16_t u16;
+
+    ASSERT(wbuf != NULL);
+
+    of_wire_buffer_u16_get(wbuf, 
+           OF_OBJECT_ABSOLUTE_OFFSET(obj, OF_U16_LEN_LENGTH_OFFSET),
+           &u16);
+
+    *bytes = u16;
+}
+
+/**
+ * Set the wire length for an object with a uint16 length as first member
+ * @param obj The object being referenced
+ * @param bytes The length of the object
+ */
+
+void
+of_u16_len_wire_length_set(of_object_t *obj, int bytes)
+{
+    of_wire_buffer_t *wbuf = OF_OBJECT_TO_WBUF(obj);
+    ASSERT(wbuf != NULL);
+
+    /* ASSERT(obj is u16-len entry) */
+
+    of_wire_buffer_u16_set(wbuf, 
+           OF_OBJECT_ABSOLUTE_OFFSET(obj, OF_U16_LEN_LENGTH_OFFSET),
+           bytes);
+}
+
+
+#define OF_PACKET_QUEUE_LENGTH_OFFSET(ver) \
+    (((ver) >= OF_VERSION_1_2) ? 8 : 4)
+
+/**
+ * Get the wire length for a packet queue object
+ * @param obj The object being referenced
+ * @param bytes Pointer to location to store length
+ *
+ * The length is a uint16 at the offset indicated above
+ */
+void
+of_packet_queue_wire_length_get(of_object_t *obj, int *bytes)
+{
+    of_wire_buffer_t *wbuf = OF_OBJECT_TO_WBUF(obj);
+    uint16_t u16;
+    int offset;
+
+    ASSERT(wbuf != NULL);
+
+    /* ASSERT(obj is packet queue obj) */
+    offset = OF_PACKET_QUEUE_LENGTH_OFFSET(obj->version);
+    of_wire_buffer_u16_get(wbuf, OF_OBJECT_ABSOLUTE_OFFSET(obj, offset),
+                           &u16);
+
+    *bytes = u16;
+}
+
+/**
+ * Set the wire length for a 1.2 packet queue object
+ * @param obj The object being referenced
+ * @param bytes The length of the object
+ *
+ * The length is a uint16 at the offset indicated above
+ */
+
+void
+of_packet_queue_wire_length_set(of_object_t *obj, int bytes)
+{
+    of_wire_buffer_t *wbuf = OF_OBJECT_TO_WBUF(obj);
+    int offset;
+
+    ASSERT(wbuf != NULL);
+
+    /* ASSERT(obj is packet queue obj) */
+    offset = OF_PACKET_QUEUE_LENGTH_OFFSET(obj->version);
+    of_wire_buffer_u16_set(wbuf, OF_OBJECT_ABSOLUTE_OFFSET(obj, offset),
+                                  bytes);
+}
+
+/**
+ * Get the wire length for a meter band stats list
+ * @param obj The object being referenced
+ * @param bytes Pointer to location to store length
+ *
+ * Must a meter_stats object as a parent
+ */
+
+void
+of_list_meter_band_stats_wire_length_get(of_object_t *obj, int *bytes)
+{
+    ASSERT(obj->parent != NULL);
+    ASSERT(obj->parent->object_id == OF_METER_STATS);
+
+    /* We're counting on the parent being properly initialized already.
+     * The length is stored in a uint16 at offset 4 of the parent.
+     */
+    *bytes = obj->parent->length - OF_OBJECT_FIXED_LENGTH(obj->parent);
+}
+
+#define OF_METER_STATS_LENGTH_OFFSET 4
+
+/**
+ * Get/set the wire length for a meter stats object
+ * @param obj The object being referenced
+ * @param bytes Pointer to location to store length
+ *
+ * It's almost a TLV....
+ */
+
+void
+of_meter_stats_wire_length_get(of_object_t *obj, int *bytes)
+{
+    uint16_t val16;
+    of_wire_buffer_t *wbuf = OF_OBJECT_TO_WBUF(obj);
+    ASSERT(wbuf != NULL);
+    of_wire_buffer_u16_get(wbuf, 
+               OF_OBJECT_ABSOLUTE_OFFSET(obj, OF_METER_STATS_LENGTH_OFFSET),
+               &val16);
+    *bytes = val16;
+}
+
+void
+of_meter_stats_wire_length_set(of_object_t *obj, int bytes)
+{
+    of_wire_buffer_t *wbuf = OF_OBJECT_TO_WBUF(obj);
+    ASSERT(wbuf != NULL);
+
+    of_wire_buffer_u16_set(wbuf, 
+        OF_OBJECT_ABSOLUTE_OFFSET(obj, OF_METER_STATS_LENGTH_OFFSET), bytes);
+}
+
+/*
+ * Non-message extension push wire values
+ */
+
+int
+of_extension_object_wire_push(of_object_t *obj)
+{
+    of_action_bsn_mirror_t *action_mirror;
+    of_action_id_bsn_mirror_t *action_id_mirror;
+    of_action_bsn_set_tunnel_dst_t *action_set_tunnel_dst;
+    of_action_id_bsn_set_tunnel_dst_t *action_id_set_tunnel_dst;
+    of_action_nicira_dec_ttl_t *action_nicira_dec_ttl;
+    of_action_id_nicira_dec_ttl_t *action_id_nicira_dec_ttl;
+
+    /* Push exp type, subtype */
+    switch (obj->object_id) {
+    case OF_ACTION_BSN_MIRROR:
+        action_mirror = (of_action_bsn_mirror_t *)obj;
+        of_action_bsn_mirror_experimenter_set(action_mirror,
+            OF_EXPERIMENTER_ID_BSN);
+        of_action_bsn_mirror_subtype_set(action_mirror, 1);
+        break;
+    case OF_ACTION_ID_BSN_MIRROR:
+        action_id_mirror = (of_action_id_bsn_mirror_t *)obj;
+        of_action_id_bsn_mirror_experimenter_set(action_id_mirror,
+            OF_EXPERIMENTER_ID_BSN);
+        of_action_id_bsn_mirror_subtype_set(action_id_mirror, 1);
+        break;
+    case OF_ACTION_BSN_SET_TUNNEL_DST:
+        action_set_tunnel_dst = (of_action_bsn_set_tunnel_dst_t *)obj;
+        of_action_bsn_set_tunnel_dst_experimenter_set(action_set_tunnel_dst,
+            OF_EXPERIMENTER_ID_BSN);
+        of_action_bsn_set_tunnel_dst_subtype_set(action_set_tunnel_dst, 2);
+        break;
+    case OF_ACTION_ID_BSN_SET_TUNNEL_DST:
+        action_id_set_tunnel_dst = (of_action_id_bsn_set_tunnel_dst_t *)obj;
+        of_action_id_bsn_set_tunnel_dst_experimenter_set(action_id_set_tunnel_dst,
+            OF_EXPERIMENTER_ID_BSN);
+        of_action_id_bsn_set_tunnel_dst_subtype_set(action_id_set_tunnel_dst, 2);
+        break;
+    case OF_ACTION_NICIRA_DEC_TTL:
+        action_nicira_dec_ttl = (of_action_nicira_dec_ttl_t *)obj;
+        of_action_nicira_dec_ttl_experimenter_set(action_nicira_dec_ttl,
+            OF_EXPERIMENTER_ID_NICIRA);
+        of_action_nicira_dec_ttl_subtype_set(action_nicira_dec_ttl, 18);
+        break;
+    case OF_ACTION_ID_NICIRA_DEC_TTL:
+        action_id_nicira_dec_ttl = (of_action_id_nicira_dec_ttl_t *)obj;
+        of_action_id_nicira_dec_ttl_experimenter_set(action_id_nicira_dec_ttl,
+            OF_EXPERIMENTER_ID_NICIRA);
+        of_action_id_nicira_dec_ttl_subtype_set(action_id_nicira_dec_ttl, 18);
+        break;
+    default:
+        break;
+    }
+
+    return OF_ERROR_NONE;
+}
diff --git a/c_gen/templates/of_utils.c b/c_gen/templates/of_utils.c
new file mode 100644
index 0000000..f9c1972
--- /dev/null
+++ b/c_gen/templates/of_utils.c
@@ -0,0 +1,78 @@
+:: # Copyright 2013, Big Switch Networks, Inc.
+:: #
+:: # LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
+:: # the following special exception:
+:: #
+:: # LOXI Exception
+:: #
+:: # As a special exception to the terms of the EPL, you may distribute libraries
+:: # generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
+:: # that copyright and licensing notices generated by LoxiGen are not altered or removed
+:: # from the LoxiGen Libraries and the notice provided below is (i) included in
+:: # the LoxiGen Libraries, if distributed in source code form and (ii) included in any
+:: # documentation for the LoxiGen Libraries, if distributed in binary form.
+:: #
+:: # Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler."
+:: #
+:: # You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain
+:: # a copy of the EPL at:
+:: #
+:: # http://www.eclipse.org/legal/epl-v10.html
+:: #
+:: # Unless required by applicable law or agreed to in writing, software
+:: # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+:: # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+:: # EPL for the specific language governing permissions and limitations
+:: # under the EPL.
+::
+/* Copyright 2013, Big Switch Networks, Inc. */
+
+/****************************************************************
+ * File: of_utils.h
+ *
+ * Some utilities provided based on LOCI code generation
+ *
+ ****************************************************************/
+
+#include <loci/of_utils.h>
+
+
+/**
+ * Check if the given port is used as an output for any entry on the list
+ * @param actions The list of actions being checked
+ * @param outport The port being sought
+ * @returns Boolean, true if entry has an output action to outport
+ *
+ * @fixme VERSION Currently only OF 1.0 supported
+ * @fixme Check for error return in accessor
+ *
+ * If outport is "wildcard", the test should be ignored, so return true
+ */
+
+int
+of_action_list_has_out_port(of_list_action_t *actions, of_port_no_t outport)
+{
+    of_action_t elt;
+    of_action_output_t *output;
+    int loop_rv;
+    of_port_no_t port_no;
+    int rv = 0;
+
+    if (outport == OF_PORT_DEST_WILDCARD) { /* Same as OFPP_ANY */
+        return 1;
+    }
+
+    output = &elt.output;
+    OF_LIST_ACTION_ITER(actions, &elt, loop_rv) {
+        if (output->object_id == OF_ACTION_OUTPUT) {
+            of_action_output_port_get(output, &port_no);
+            if (port_no == outport) {
+                rv = 1;
+                break;
+            }
+        }
+    }
+
+    return rv;
+}
+
diff --git a/c_gen/templates/of_utils.h b/c_gen/templates/of_utils.h
new file mode 100644
index 0000000..1a3a29a
--- /dev/null
+++ b/c_gen/templates/of_utils.h
@@ -0,0 +1,45 @@
+:: # Copyright 2013, Big Switch Networks, Inc.
+:: #
+:: # LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
+:: # the following special exception:
+:: #
+:: # LOXI Exception
+:: #
+:: # As a special exception to the terms of the EPL, you may distribute libraries
+:: # generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
+:: # that copyright and licensing notices generated by LoxiGen are not altered or removed
+:: # from the LoxiGen Libraries and the notice provided below is (i) included in
+:: # the LoxiGen Libraries, if distributed in source code form and (ii) included in any
+:: # documentation for the LoxiGen Libraries, if distributed in binary form.
+:: #
+:: # Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler."
+:: #
+:: # You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain
+:: # a copy of the EPL at:
+:: #
+:: # http://www.eclipse.org/legal/epl-v10.html
+:: #
+:: # Unless required by applicable law or agreed to in writing, software
+:: # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+:: # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+:: # EPL for the specific language governing permissions and limitations
+:: # under the EPL.
+::
+/* Copyright 2013, Big Switch Networks, Inc. */
+
+/****************************************************************
+ * File: of_utils.h
+ *
+ * Header file for some utilities provided based on LOCI code generation
+ *
+ ****************************************************************/
+
+#ifndef OF_UTILS_H
+#define OF_UTILS_H
+
+#include <loci/loci.h>
+
+extern int of_action_list_has_out_port(of_list_action_t *actions, 
+                                       of_port_no_t outport);
+
+#endif
diff --git a/c_gen/templates/of_wire_buf.c b/c_gen/templates/of_wire_buf.c
new file mode 100644
index 0000000..acfcb84
--- /dev/null
+++ b/c_gen/templates/of_wire_buf.c
@@ -0,0 +1,159 @@
+:: # Copyright 2013, Big Switch Networks, Inc.
+:: #
+:: # LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
+:: # the following special exception:
+:: #
+:: # LOXI Exception
+:: #
+:: # As a special exception to the terms of the EPL, you may distribute libraries
+:: # generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
+:: # that copyright and licensing notices generated by LoxiGen are not altered or removed
+:: # from the LoxiGen Libraries and the notice provided below is (i) included in
+:: # the LoxiGen Libraries, if distributed in source code form and (ii) included in any
+:: # documentation for the LoxiGen Libraries, if distributed in binary form.
+:: #
+:: # Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler."
+:: #
+:: # You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain
+:: # a copy of the EPL at:
+:: #
+:: # http://www.eclipse.org/legal/epl-v10.html
+:: #
+:: # Unless required by applicable law or agreed to in writing, software
+:: # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+:: # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+:: # EPL for the specific language governing permissions and limitations
+:: # under the EPL.
+::
+/* Copyright 2013, Big Switch Networks, Inc. */
+
+/****************************************************************
+ *
+ * of_wire_buf.c
+ *
+ * Implementation of more complicated of_wire_buf operations
+ *
+ ****************************************************************/
+
+#include <loci/loci.h>
+
+#if 0
+static of_match_v1_t *
+wire_buf_v1_to_match(of_wire_buffer_t *wbuf, int offset)
+{
+    of_match_v1_t *match;
+    match = of_match_v1_new(OF_VERSION_1_0);
+    return match;
+}
+
+/*
+ * First pass at wire buf to match conversions.  These involve a lot
+ * of copying and could be made more efficient.
+ */
+int
+of_wire_buffer_of_match_get(of_object_t *obj, int offset, of_match_t *match)
+{
+    switch (obj->version) {
+    case OF_VERSION_1_0:
+        break;
+    case OF_VERSION_1_1:
+        break;
+    case OF_VERSION_1_2:
+        break;
+    default:
+        return OF_ERROR_VERSION;
+        break;
+    }
+
+    return OF_ERROR_NONE;
+}
+
+/**
+ * Write a host match structure into the wire buffer
+ * @param obj The object that owns the buffer to write to
+ * @param offset The start location in the wire buffer
+ * @param match Pointer to the host match object
+ * @param cur_len The current length of the object in the buffer
+ *
+ * If the current length is different than the length of the new data
+ * being written, then move the remains of the buffer.  This only applies
+ * to version 1.2 (though it should apply to 1.1).
+ */
+
+int
+of_wire_buffer_of_match_set(of_object_t *obj, int offset, 
+                            of_match_t *match, int cur_len)
+{
+    // of_octets_t octets;
+
+    switch (obj->version) {
+    case OF_VERSION_1_0:
+        break;
+    case OF_VERSION_1_1:
+        break;
+    case OF_VERSION_1_2:
+        // of_match_v3_serialize(match, &octets);
+        break;
+    default:
+        return OF_ERROR_VERSION;
+        break;
+    }
+
+    return OF_ERROR_NONE;
+}
+#endif
+
+/**
+ * Replace data in the data buffer, possibly with a new
+ * length or appending to buffer.
+ *
+ * @param wbuf The wire buffer being updated.
+ * @param offset The start point of the update
+ * @param old_len The number of bytes being replaced
+ * @param data Source of bytes to write into the buffer
+ * @param new_len The number of bytes to write
+ *
+ * The buffer may grow for this operation.  Current byte count
+ * is pre-grow for the replace.
+ *
+ * The current byte count for the buffer is updated.
+ * 
+ */
+
+void
+of_wire_buffer_replace_data(of_wire_buffer_t *wbuf, 
+                            int offset, 
+                            int old_len,
+                            uint8_t *data,
+                            int new_len)
+{
+    int bytes;
+    uint8_t *src_ptr, *dst_ptr;
+    int cur_bytes;
+
+    ASSERT(wbuf != NULL);
+
+    cur_bytes = wbuf->current_bytes;
+
+    /* Doesn't make sense; mismatch in current buffer info */
+    ASSERT(old_len + offset <= wbuf->current_bytes);
+
+    if (old_len < new_len) {
+        of_wire_buffer_grow(wbuf, offset + new_len);
+    } else {
+        wbuf->current_bytes += (new_len - old_len); // may decrease size
+    }
+
+    if ((old_len + offset < cur_bytes) && (old_len != new_len)) {
+        /* Need to move back of buffer */
+        src_ptr = &wbuf->buf[offset + old_len];
+        dst_ptr = &wbuf->buf[offset + new_len];
+        bytes = cur_bytes - (offset + old_len);
+        MEMMOVE(dst_ptr, src_ptr, bytes);
+    }
+
+    dst_ptr = &wbuf->buf[offset];
+    MEMCPY(dst_ptr, data, new_len);
+
+    ASSERT(wbuf->current_bytes == cur_bytes + (new_len - old_len));
+}
diff --git a/c_gen/templates/of_wire_buf.h b/c_gen/templates/of_wire_buf.h
new file mode 100644
index 0000000..cf1ee17
--- /dev/null
+++ b/c_gen/templates/of_wire_buf.h
@@ -0,0 +1,884 @@
+:: # Copyright 2013, Big Switch Networks, Inc.
+:: #
+:: # LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
+:: # the following special exception:
+:: #
+:: # LOXI Exception
+:: #
+:: # As a special exception to the terms of the EPL, you may distribute libraries
+:: # generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
+:: # that copyright and licensing notices generated by LoxiGen are not altered or removed
+:: # from the LoxiGen Libraries and the notice provided below is (i) included in
+:: # the LoxiGen Libraries, if distributed in source code form and (ii) included in any
+:: # documentation for the LoxiGen Libraries, if distributed in binary form.
+:: #
+:: # Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler."
+:: #
+:: # You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain
+:: # a copy of the EPL at:
+:: #
+:: # http://www.eclipse.org/legal/epl-v10.html
+:: #
+:: # Unless required by applicable law or agreed to in writing, software
+:: # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+:: # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+:: # EPL for the specific language governing permissions and limitations
+:: # under the EPL.
+::
+/* Copyright 2013, Big Switch Networks, Inc. */
+
+#if !defined(_OF_WIRE_BUF_H_)
+#define _OF_WIRE_BUF_H_
+
+#include <string.h>
+#include <loci/loci_base.h>
+#include <loci/of_object.h>
+#include <loci/of_match.h>
+#include <loci/of_buffer.h>
+
+/****************************************************************
+ *
+ * Wire buffer declaration, constructor, data alloc, delete
+ *
+ ****************************************************************/
+
+/* Maximum length of an OpenFlow message. All wire buffers allocated for
+ * new objects (that don't come from a message) are this length to avoid
+ * needing to grow the buffers. */
+#define OF_WIRE_BUFFER_MAX_LENGTH 65535
+
+/**
+ * Buffer management structure
+ */
+typedef struct of_wire_buffer_s {
+    /** Pointer to a monolithic data buffer */
+    uint8_t *buf;
+
+    /** Length of buffer actually allocated */
+    int alloc_bytes;
+    /** Current extent actually used */
+    int current_bytes;
+    /** If not NULL, use this to dealloc buf */
+    of_buffer_free_f free;
+} of_wire_buffer_t;
+
+/**
+ * Decouples object from underlying wire buffer
+ *
+ * Called a 'slice' in some places.
+ */
+typedef struct of_wire_object_s {
+    /** A pointer to the underlying buffer's management structure. */
+    of_wire_buffer_t *wbuf;  
+    /** The start offset for this object relative to the start of the
+     * underlying buffer */
+    int obj_offset;
+    /* Boolean, whether the object owns the wire buffer. */
+    char owned;
+} of_wire_object_t;
+
+#define WBUF_BUF(wbuf) (wbuf)->buf
+#define WBUF_ALLOC_BYTES(wbuf) (wbuf)->alloc_bytes
+#define WBUF_CURRENT_BYTES(wbuf) (wbuf)->current_bytes
+
+/**
+ * For read access, throw an error code if current buffer
+ * is not big enough.
+ * @param wbuf Pointer to an of_wire_buffer_t structure
+ * @param offset The extent of the buffer required
+ */
+#define OF_WIRE_BUFFER_ACCESS_CHECK(wbuf, offset)                      \
+    ASSERT(((wbuf) != NULL) && (WBUF_BUF(wbuf) != NULL) &&             \
+           (offset > 0) && (WBUF_CURRENT_BYTES(wbuf) >= offset))
+
+/*
+ * Index a wire buffer
+ * Index a wire object (from obj_offset)
+ * Index a LOCI object
+ */
+
+/**
+ * Return a pointer to a particular offset in a wire buffer's data
+ * @param wbuf Pointer to an of_wire_buffer_t structure
+ * @param offset The location to reference
+ */
+#define OF_WIRE_BUFFER_INDEX(wbuf, offset) (&((WBUF_BUF(wbuf))[offset]))
+
+/**
+ * Return a pointer to a particular offset in the underlying buffer
+ * associated with a wire object
+ * @param wobj Pointer to an of_wire_object_t structure
+ * @param offset The location to reference relative to the start of the object
+ */
+#define OF_WIRE_OBJECT_INDEX(wobj, offset) \
+    OF_WIRE_BUFFER_INDEX((wobj)->wbuf, (offset) + (wobj)->obj_offset)
+
+/****************************************************************
+ * Object specific macros; of_object_t includes a wire_object
+ ****************************************************************/
+
+/**
+ * Return a pointer to a particular offset in the underlying buffer
+ * associated with a wire object
+ * @param obj Pointer to an of_object_t object
+ * @param offset The location to reference relative to the start of the object
+ */
+#define OF_OBJECT_BUFFER_INDEX(obj, offset) \
+    OF_WIRE_OBJECT_INDEX(&((obj)->wire_object), offset)
+
+/**
+ * Return the absolute offset as an integer from a object-relative offset
+ * @param obj Pointer to an of_wire_object_t structure
+ * @param offset The location to reference relative to the start of the object
+ */
+#define OF_OBJECT_ABSOLUTE_OFFSET(obj, offset) \
+    ((obj)->wire_object.obj_offset + offset)
+
+
+/**
+ * Map a generic object to the underlying wire buffer object (not the octets)
+ *
+ * Treat as private
+ */
+#define OF_OBJECT_TO_WBUF(obj) ((obj)->wire_object.wbuf)
+
+
+
+/**
+ * Minimum allocation size for wire buffer object
+ */
+#define OF_WIRE_BUFFER_MIN_ALLOC_BYTES 128
+
+/**
+ * Allocate a wire buffer object and the underlying data buffer.
+ * The wire buffer is initally empty (current_bytes == 0).
+ * @param a_bytes The number of bytes to allocate.
+ * @returns A wire buffer object if successful or NULL
+ */
+static inline of_wire_buffer_t *
+of_wire_buffer_new(int a_bytes)
+{
+    of_wire_buffer_t *wbuf;
+
+    wbuf = (of_wire_buffer_t *)MALLOC(sizeof(of_wire_buffer_t));
+    if (wbuf == NULL) {
+        return NULL;
+    }
+    MEMSET(wbuf, 0, sizeof(of_wire_buffer_t));
+
+    if (a_bytes < OF_WIRE_BUFFER_MIN_ALLOC_BYTES) {
+        a_bytes = OF_WIRE_BUFFER_MIN_ALLOC_BYTES;
+    }
+
+    if ((wbuf->buf = (uint8_t *)MALLOC(a_bytes)) == NULL) {
+        FREE(wbuf);
+        return NULL;
+    }
+    MEMSET(wbuf->buf, 0, a_bytes);
+    wbuf->current_bytes = 0;
+    wbuf->alloc_bytes = a_bytes;
+
+    return (of_wire_buffer_t *)wbuf;
+}
+
+/**
+ * Allocate a wire buffer object and bind it to an existing buffer.
+ * @param buf       Existing buffer.
+ * @param bytes     Size of buf.
+ * @param buf_free  Function called to deallocate buf.
+ * @returns A wire buffer object if successful or NULL
+ */
+static inline of_wire_buffer_t *
+of_wire_buffer_new_bind(uint8_t *buf, int bytes, of_buffer_free_f buf_free)
+{
+    of_wire_buffer_t *wbuf;
+
+    wbuf = (of_wire_buffer_t *)MALLOC(sizeof(of_wire_buffer_t));
+    if (wbuf == NULL) {
+        return NULL;
+    }
+
+    wbuf->buf = buf;
+    wbuf->free = buf_free;
+    wbuf->current_bytes = bytes;
+    wbuf->alloc_bytes = bytes;
+
+    return (of_wire_buffer_t *)wbuf;
+}
+
+static inline void
+of_wire_buffer_free(of_wire_buffer_t *wbuf)
+{
+    if (wbuf == NULL) return;
+
+    if (wbuf->buf != NULL) {
+        if (wbuf->free != NULL) {
+            wbuf->free(wbuf->buf);
+        } else {
+            FREE(wbuf->buf);
+        }
+    }
+
+    FREE(wbuf);
+}
+
+static inline void
+of_wire_buffer_steal(of_wire_buffer_t *wbuf, uint8_t **buffer)
+{
+    *buffer = wbuf->buf;
+    /* Mark underlying data buffer as taken */
+    wbuf->buf = NULL;
+    of_wire_buffer_free(wbuf);
+}
+
+/**
+ * Increase the currently used length of the wire buffer.
+ * Will fail an assertion if the allocated length is not long enough.
+ *
+ * @param wbuf Pointer to the wire buffer structure
+ * @param bytes Total number of bytes buffer should grow to
+ */
+
+static inline void
+of_wire_buffer_grow(of_wire_buffer_t *wbuf, int bytes)
+{
+    ASSERT(wbuf != NULL);
+    ASSERT(wbuf->alloc_bytes >= bytes);
+    if (bytes > wbuf->current_bytes) {
+        wbuf->current_bytes = bytes;
+    }
+}
+
+/* TBD */
+
+
+/**
+ * Get a uint8_t scalar from a wire buffer
+ * @param wbuf The pointer to the wire buffer structure
+ * @param offset Offset in the wire buffer
+ * @param value Pointer to where to put value
+ *
+ * The underlying buffer accessor funtions handle endian and alignment.
+ */
+
+static inline void
+of_wire_buffer_u8_get(of_wire_buffer_t *wbuf, int offset, uint8_t *value)
+{
+    OF_WIRE_BUFFER_ACCESS_CHECK(wbuf, offset + (int) sizeof(uint8_t));
+    buf_u8_get(OF_WIRE_BUFFER_INDEX(wbuf, offset), value);
+}
+
+/**
+ * Set a uint8_t scalar in a wire buffer
+ * @param wbuf The pointer to the wire buffer structure
+ * @param offset Offset in the wire buffer
+ * @param value The value to store
+ *
+ * The underlying buffer accessor funtions handle endian and alignment.
+ */
+
+static inline void
+of_wire_buffer_u8_set(of_wire_buffer_t *wbuf, int offset, uint8_t value)
+{
+    OF_WIRE_BUFFER_ACCESS_CHECK(wbuf, offset + (int) sizeof(uint8_t));
+    buf_u8_set(OF_WIRE_BUFFER_INDEX(wbuf, offset), value);
+}
+
+/**
+ * Get a uint16_t scalar from a wire buffer
+ * @param wbuf The pointer to the wire buffer structure
+ * @param offset Offset in the wire buffer
+ * @param value Pointer to where to put value
+ *
+ * The underlying buffer accessor funtions handle endian and alignment.
+ */
+
+static inline void
+of_wire_buffer_u16_get(of_wire_buffer_t *wbuf, int offset, uint16_t *value)
+{
+    OF_WIRE_BUFFER_ACCESS_CHECK(wbuf, offset + (int) sizeof(uint16_t));
+    buf_u16_get(OF_WIRE_BUFFER_INDEX(wbuf, offset), value);
+}
+
+/**
+ * Set a uint16_t scalar in a wire buffer
+ * @param wbuf The pointer to the wire buffer structure
+ * @param offset Offset in the wire buffer
+ * @param value The value to store
+ *
+ * The underlying buffer accessor funtions handle endian and alignment.
+ */
+
+static inline void
+of_wire_buffer_u16_set(of_wire_buffer_t *wbuf, int offset, uint16_t value)
+{
+    OF_WIRE_BUFFER_ACCESS_CHECK(wbuf, offset + (int) sizeof(uint16_t));
+    buf_u16_set(OF_WIRE_BUFFER_INDEX(wbuf, offset), value);
+}
+
+/**
+ * Get a uint32_t scalar from a wire buffer
+ * @param wbuf The pointer to the wire buffer structure
+ * @param offset Offset in the wire buffer
+ * @param value Pointer to where to put value
+ *
+ * The underlying buffer accessor funtions handle endian and alignment.
+ */
+
+static inline void
+of_wire_buffer_u32_get(of_wire_buffer_t *wbuf, int offset, uint32_t *value)
+{
+    OF_WIRE_BUFFER_ACCESS_CHECK(wbuf, offset + (int) sizeof(uint32_t));
+    buf_u32_get(OF_WIRE_BUFFER_INDEX(wbuf, offset), value);
+}
+
+/**
+ * Set a uint32_t scalar in a wire buffer
+ * @param wbuf The pointer to the wire buffer structure
+ * @param offset Offset in the wire buffer
+ * @param value The value to store
+ *
+ * The underlying buffer accessor funtions handle endian and alignment.
+ */
+
+static inline void
+of_wire_buffer_u32_set(of_wire_buffer_t *wbuf, int offset, uint32_t value)
+{
+    OF_WIRE_BUFFER_ACCESS_CHECK(wbuf, offset + (int) sizeof(uint32_t));
+    buf_u32_set(OF_WIRE_BUFFER_INDEX(wbuf, offset), value);
+}
+
+/**
+ * Get a uint64_t scalar from a wire buffer
+ * @param wbuf The pointer to the wire buffer structure
+ * @param offset Offset in the wire buffer
+ * @param value Pointer to where to put value
+ *
+ * The underlying buffer accessor funtions handle endian and alignment.
+ */
+
+static inline void
+of_wire_buffer_u64_get(of_wire_buffer_t *wbuf, int offset, uint64_t *value)
+{
+    OF_WIRE_BUFFER_ACCESS_CHECK(wbuf, offset + (int) sizeof(uint64_t));
+    buf_u64_get(OF_WIRE_BUFFER_INDEX(wbuf, offset), value);
+}
+
+/**
+ * Set a uint64_t scalar in a wire buffer
+ * @param wbuf The pointer to the wire buffer structure
+ * @param offset Offset in the wire buffer
+ * @param value The value to store
+ *
+ * The underlying buffer accessor funtions handle endian and alignment.
+ */
+
+static inline void
+of_wire_buffer_u64_set(of_wire_buffer_t *wbuf, int offset, uint64_t value)
+{
+    OF_WIRE_BUFFER_ACCESS_CHECK(wbuf, offset + (int) sizeof(uint64_t));
+    buf_u64_set(OF_WIRE_BUFFER_INDEX(wbuf, offset), value);
+}
+
+/**
+ * Get a generic OF match structure from a wire buffer
+ * @param wbuf The pointer to the wire buffer structure
+ * @param offset Offset in the wire buffer
+ * @param value Pointer to the structure to update
+ *
+ * NOT IMPLEMENTED.
+ *
+ */
+
+static inline void
+of_wire_buffer_match_get(int version, of_wire_buffer_t *wbuf, int offset,
+                      of_match_t *value)
+{
+    ASSERT(0);
+}
+
+/**
+ * Set a generic OF match structure in a wire buffer
+ * @param wbuf The pointer to the wire buffer structure
+ * @param offset Offset in the wire buffer
+ * @param value Pointer to the structure to store
+ *
+ * NOT IMPLEMENTED.
+ *
+ */
+
+static inline void
+of_wire_buffer_match_set(int version, of_wire_buffer_t *wbuf, int offset,
+                      of_match_t *value)
+{
+    ASSERT(0);
+}
+
+/**
+ * Get a port description object from a wire buffer
+ * @param wbuf The pointer to the wire buffer structure
+ * @param offset Offset in the wire buffer
+ * @param value Pointer to the structure to fill out
+ *
+ * NOT IMPLEMENTED.
+ *
+ * @fixme Where should this go?
+ */
+
+static inline void
+of_wire_buffer_of_port_desc_get(int version, of_wire_buffer_t *wbuf, int offset,
+                             void *value)
+{
+    ASSERT(0);
+}
+
+/**
+ * Set a port description object in a wire buffer
+ * @param wbuf The pointer to the wire buffer structure
+ * @param offset Offset in the wire buffer
+ * @param value Pointer to the structure to fill out
+ *
+ * NOT IMPLEMENTED.
+ *
+ * @fixme Where should this go?
+ */
+
+static inline void
+of_wire_buffer_of_port_desc_set(int version, of_wire_buffer_t *wbuf, int offset,
+                             void *value)
+{
+    ASSERT(0);
+}
+
+/**
+ * Get a port number scalar from a wire buffer
+ * @param wbuf The pointer to the wire buffer structure
+ * @param offset Offset in the wire buffer
+ * @param value Pointer to where to put value
+ *
+ * Port numbers are version specific.
+ */
+
+static inline void
+of_wire_buffer_port_no_get(int version, of_wire_buffer_t *wbuf, int offset,
+                        of_port_no_t *value)
+{
+    uint16_t v16;
+    uint32_t v32;
+
+    switch (version) {
+    case OF_VERSION_1_0:
+        of_wire_buffer_u16_get(wbuf, offset, &v16);
+        *value = v16;
+        break;
+    case OF_VERSION_1_1:
+    case OF_VERSION_1_2:
+    case OF_VERSION_1_3:
+        of_wire_buffer_u32_get(wbuf, offset, &v32);
+        *value = v32;
+        break;
+    default:
+        ASSERT(0);
+    }
+}
+
+/**
+ * Set a port number scalar from a wire buffer
+ * @param wbuf The pointer to the wire buffer structure
+ * @param offset Offset in the wire buffer
+ * @param value The value to store in the buffer
+ *
+ * Port numbers are version specific.
+ */
+
+static inline void
+of_wire_buffer_port_no_set(int version, of_wire_buffer_t *wbuf, int offset,
+                      of_port_no_t value)
+{
+
+    switch (version) {
+    case OF_VERSION_1_0:
+        of_wire_buffer_u16_set(wbuf, offset, (uint16_t)value);
+        break;
+    case OF_VERSION_1_1:
+    case OF_VERSION_1_2:
+    case OF_VERSION_1_3:
+        of_wire_buffer_u32_set(wbuf, offset, (uint32_t)value);
+        break;
+    default:
+        ASSERT(0);
+    }
+}
+
+/**
+ * Get a flow mod command value from a wire buffer
+ * @param wbuf The pointer to the wire buffer structure
+ * @param offset Offset in the wire buffer
+ * @param value Pointer to where to put value
+ */
+
+static inline void
+of_wire_buffer_fm_cmd_get(int version, of_wire_buffer_t *wbuf, int offset,
+                        of_fm_cmd_t *value)
+{
+    uint16_t v16;
+    uint8_t v8;
+
+    switch (version) {
+    case OF_VERSION_1_0:
+        of_wire_buffer_u16_get(wbuf, offset, &v16);
+        *value = v16;
+        break;
+    case OF_VERSION_1_1:
+    case OF_VERSION_1_2:
+    case OF_VERSION_1_3:
+        of_wire_buffer_u8_get(wbuf, offset, &v8);
+        *value = v8;
+        break;
+    default:
+        ASSERT(0);
+    }
+}
+
+/**
+ * Set a flow mod command value in a wire buffer
+ * @param wbuf The pointer to the wire buffer structure
+ * @param offset Offset in the wire buffer
+ * @param value The value to store
+ */
+
+static inline void
+of_wire_buffer_fm_cmd_set(int version, of_wire_buffer_t *wbuf, int offset,
+                      of_fm_cmd_t value)
+{
+    switch (version) {
+    case OF_VERSION_1_0:
+        of_wire_buffer_u16_set(wbuf, offset, (uint16_t)value);
+        break;
+    case OF_VERSION_1_1:
+    case OF_VERSION_1_2:
+    case OF_VERSION_1_3:
+        of_wire_buffer_u8_set(wbuf, offset, (uint8_t)value);
+        break;
+    default:
+        ASSERT(0);
+    }
+}
+
+/**
+ * Get a wild card bitmap value from a wire buffer
+ * @param wbuf The pointer to the wire buffer structure
+ * @param offset Offset in the wire buffer
+ * @param value Pointer to where to store the value
+ */
+
+static inline void
+of_wire_buffer_wc_bmap_get(int version, of_wire_buffer_t *wbuf, int offset,
+                        of_wc_bmap_t *value)
+{
+    uint32_t v32;
+    uint64_t v64;
+
+    switch (version) {
+    case OF_VERSION_1_0:
+    case OF_VERSION_1_1:
+        of_wire_buffer_u32_get(wbuf, offset, &v32);
+        *value = v32;
+        break;
+    case OF_VERSION_1_2:
+    case OF_VERSION_1_3:
+        of_wire_buffer_u64_get(wbuf, offset, &v64);
+        *value = v64;
+        break;
+    default:
+        ASSERT(0);
+    }
+}
+
+/**
+ * Set a wild card bitmap value in a wire buffer
+ * @param wbuf The pointer to the wire buffer structure
+ * @param offset Offset in the wire buffer
+ * @param value The value to store
+ */
+
+static inline void
+of_wire_buffer_wc_bmap_set(int version, of_wire_buffer_t *wbuf, int offset,
+                      of_wc_bmap_t value)
+{
+    switch (version) {
+    case OF_VERSION_1_0:
+    case OF_VERSION_1_1:
+        of_wire_buffer_u32_set(wbuf, offset, (uint32_t)value);
+        break;
+    case OF_VERSION_1_2:
+    case OF_VERSION_1_3:
+        of_wire_buffer_u64_set(wbuf, offset, (uint64_t)value);
+        break;
+    default:
+        ASSERT(0);
+    }
+}
+
+/* match bitmap and wildcard bitmaps followed the same pattern */
+#define of_wire_buffer_match_bmap_get of_wire_buffer_wc_bmap_get
+#define of_wire_buffer_match_bmap_set of_wire_buffer_wc_bmap_set
+
+/* Derived functions, mostly for fixed length name strings */
+#define of_wire_buffer_char_get of_wire_buffer_u8_get
+#define of_wire_buffer_char_set of_wire_buffer_u8_set
+
+
+/**
+ * Get an octet object from a wire buffer
+ * @param wbuf The pointer to the wire buffer structure
+ * @param offset Offset in the wire buffer
+ * @param value Pointer to where to put value
+ *
+ * of_octets_t is treated specially as the high level functions pass around
+ * pointers for "get" operators.
+ *
+ * Important: The length of data to copy is stored in the value->bytes
+ * variable.
+ */
+
+static inline void
+of_wire_buffer_octets_data_get(of_wire_buffer_t *wbuf, int offset,
+                               of_octets_t *value)
+{
+    OF_WIRE_BUFFER_ACCESS_CHECK(wbuf, offset + OF_OCTETS_BYTES_GET(value));
+    buf_octets_get(OF_WIRE_BUFFER_INDEX(wbuf, offset),
+                   OF_OCTETS_POINTER_GET(value),
+                   OF_OCTETS_BYTES_GET(value));
+}
+
+/**
+ * Set an octet object in a wire buffer
+ * @param wbuf The pointer to the wire buffer structure
+ * @param offset Offset in the wire buffer
+ * @param value Pointer to the octet stream to store
+ * @param cur_len Current length of data in the buffer
+ *
+ * of_octets_t is treated specially as the high level functions pass around
+ * pointers for "get" operators.
+ *
+ * @fixme Need to take into account cur_len
+ */
+
+static inline void
+of_wire_buffer_octets_data_set(of_wire_buffer_t *wbuf, int offset,
+                               of_octets_t *value, int cur_len)
+{
+    // FIXME need to adjust length of octets member in buffer
+    ASSERT(cur_len == 0 || cur_len == value->bytes);
+
+    OF_WIRE_BUFFER_ACCESS_CHECK(wbuf, offset + OF_OCTETS_BYTES_GET(value));
+    buf_octets_set(OF_WIRE_BUFFER_INDEX(wbuf, offset),
+                   OF_OCTETS_POINTER_GET(value),
+                   OF_OCTETS_BYTES_GET(value));
+}
+
+static inline void
+_wbuf_octets_set(of_wire_buffer_t *wbuf, int offset, uint8_t *src, int bytes) {
+    of_octets_t octets;
+    OF_OCTETS_POINTER_SET(&octets, src);
+    OF_OCTETS_BYTES_SET(&octets, bytes);
+    of_wire_buffer_octets_data_set(wbuf, offset, &octets, bytes);
+}
+
+static inline void
+_wbuf_octets_get(of_wire_buffer_t *wbuf, int offset, uint8_t *dst, int bytes) {
+    of_octets_t octets;
+    OF_OCTETS_POINTER_SET(&octets, dst);
+    OF_OCTETS_BYTES_SET(&octets, bytes);
+    of_wire_buffer_octets_data_get(wbuf, offset, &octets);
+}
+
+
+/**
+ * Get a MAC address from a wire buffer
+ * @param wbuf The pointer to the wire buffer structure
+ * @param offset Offset in the wire buffer
+ * @param mac Pointer to the mac address location
+ *
+ * Uses the octets function.
+ */
+
+#define of_wire_buffer_mac_get(buf, offset, mac) \
+    _wbuf_octets_get(buf, offset, (uint8_t *)mac, 6)
+
+/**
+ * Set a MAC address in a wire buffer
+ * @param wbuf The pointer to the wire buffer structure
+ * @param offset Offset in the wire buffer
+ * @param mac The variable holding the mac address to store
+ *
+ * Uses the octets function.
+ */
+
+#define of_wire_buffer_mac_set(buf, offset, mac) \
+    _wbuf_octets_set(buf, offset, (uint8_t *)&mac, 6)
+
+
+/**
+ * Get a port name string from a wire buffer
+ * @param wbuf The pointer to the wire buffer structure
+ * @param offset Offset in the wire buffer
+ * @param mac The mac address
+ *
+ * Uses the octets function.
+ */
+#define of_wire_buffer_port_name_get(buf, offset, portname) \
+    _wbuf_octets_get(buf, offset, (uint8_t *)portname, \
+                           OF_MAX_PORT_NAME_LEN)
+
+/**
+ * Set a port name address in a wire buffer
+ * @param wbuf The pointer to the wire buffer structure
+ * @param offset Offset in the wire buffer
+ * @param portname Where to store the port name
+ *
+ * Uses the octets function.
+ */
+
+#define of_wire_buffer_port_name_set(buf, offset, portname) \
+    _wbuf_octets_set(buf, offset, (uint8_t *)portname, \
+                           OF_MAX_PORT_NAME_LEN)
+
+
+/**
+ * Get a table name string from a wire buffer
+ * @param wbuf The pointer to the wire buffer structure
+ * @param offset Offset in the wire buffer
+ * @param portname The port name
+ *
+ * Uses the octets function.
+ */
+
+#define of_wire_buffer_tab_name_get(buf, offset, tabname) \
+    _wbuf_octets_get(buf, offset, (uint8_t *)tabname, \
+                           OF_MAX_TABLE_NAME_LEN)
+
+/**
+ * Set a table name address in a wire buffer
+ * @param wbuf The pointer to the wire buffer structure
+ * @param offset Offset in the wire buffer
+ * @param mac Where to store the table name
+ *
+ * Uses the octets function.
+ */
+
+#define of_wire_buffer_tab_name_set(buf, offset, tabname) \
+    _wbuf_octets_set(buf, offset, (uint8_t *)tabname, \
+                           OF_MAX_TABLE_NAME_LEN)
+
+/**
+ * Get a description string from a wire buffer
+ * @param wbuf The pointer to the wire buffer structure
+ * @param offset Offset in the wire buffer
+ * @param desc Where to store the description string
+ *
+ * Uses the octets function.
+ */
+
+#define of_wire_buffer_desc_str_get(buf, offset, desc) \
+    _wbuf_octets_get(buf, offset, (uint8_t *)desc, OF_DESC_STR_LEN)
+
+/**
+ * Set a description string in a wire buffer
+ * @param wbuf The pointer to the wire buffer structure
+ * @param offset Offset in the wire buffer
+ * @param desc The description string
+ *
+ * Uses the octets function.
+ */
+
+#define of_wire_buffer_desc_str_set(buf, offset, desc) \
+    _wbuf_octets_set(buf, offset, (uint8_t *)desc, OF_DESC_STR_LEN)
+
+/**
+ * Get a serial number string from a wire buffer
+ * @param wbuf The pointer to the wire buffer structure
+ * @param offset Offset in the wire buffer
+ * @param sernum Where to store the serial number string
+ *
+ * Uses the octets function.
+ */
+
+#define of_wire_buffer_ser_num_get(buf, offset, sernum) \
+    _wbuf_octets_get(buf, offset, (uint8_t *)sernum, OF_SERIAL_NUM_LEN)
+
+/**
+ * Set a serial number string in a wire buffer
+ * @param wbuf The pointer to the wire buffer structure
+ * @param offset Offset in the wire buffer
+ * @param desc The serial number string
+ *
+ * Uses the octets function.
+ */
+
+#define of_wire_buffer_ser_num_set(buf, offset, sernum) \
+    _wbuf_octets_set(buf, offset, (uint8_t *)sernum, OF_SERIAL_NUM_LEN)
+
+/**
+ * Get an ipv6 address from a wire buffer
+ * @param wbuf The pointer to the wire buffer structure
+ * @param offset Offset in the wire buffer
+ * @param addr Pointer to where to store the ipv6 address
+ *
+ * Uses the octets function.
+ */
+
+#define of_wire_buffer_ipv6_get(buf, offset, addr) \
+    _wbuf_octets_get(buf, offset, (uint8_t *)addr, sizeof(of_ipv6_t))
+
+/**
+ * Set an ipv6 address in a wire buffer
+ * @param wbuf The pointer to the wire buffer structure
+ * @param offset Offset in the wire buffer
+ * @param addr The variable holding ipv6 address to store
+ *
+ * Uses the octets function.
+ */
+
+#define of_wire_buffer_ipv6_set(buf, offset, addr) \
+    _wbuf_octets_set(buf, offset, (uint8_t *)&addr, sizeof(of_ipv6_t))
+
+/* Relocate data from start offset to the end of the buffer to a new position */
+static inline void
+of_wire_buffer_move_end(of_wire_buffer_t *wbuf, int start_offset, int new_offset)
+{
+    int bytes;
+    int new_length;
+
+    if (new_offset > start_offset) {
+        bytes =  new_offset - start_offset;
+        new_length = wbuf->alloc_bytes + bytes;
+        OF_WIRE_BUFFER_ACCESS_CHECK(wbuf, new_length);
+    } else {
+        bytes =  start_offset - new_offset;
+        new_length = wbuf->alloc_bytes - bytes;
+    }
+
+    MEMMOVE(&wbuf->buf[new_offset], &wbuf->buf[start_offset], bytes);
+    wbuf->alloc_bytes = new_length;
+}
+
+/* Given a wire buffer object and the offset of the start of an of_match struct,
+ * return its total length in the buffer
+ */
+static inline int
+of_match_bytes(of_wire_buffer_t *wbuf, int offset) {
+    uint16_t len;
+    of_wire_buffer_u16_get(wbuf, offset + 2, &len);
+    return OF_MATCH_BYTES(len);
+}
+
+extern void
+of_wire_buffer_replace_data(of_wire_buffer_t *wbuf, 
+                            int offset, 
+                            int old_len,
+                            uint8_t *data,
+                            int new_len);
+
+#endif /* _OF_WIRE_BUF_H_ */