loci: convert internal users away from inheritance union

This mostly affects list accessors.
diff --git a/c_gen/c_code_gen.py b/c_gen/c_code_gen.py
index b708c65..239034a 100644
--- a/c_gen/c_code_gen.py
+++ b/c_gen/c_code_gen.py
@@ -1076,13 +1076,13 @@
             e_type = loxi_utils.list_to_entry_type(cls)
             out.write("""
 extern int %(cls)s_first(
-    %(cls)s_t *list, %(e_type)s_t *obj);
+    %(cls)s_t *list, of_list_iter_t iter);
 extern int %(cls)s_next(
-    %(cls)s_t *list, %(e_type)s_t *obj);
+    %(cls)s_t *list, of_list_iter_t iter);
 extern int %(cls)s_append_bind(
-    %(cls)s_t *list, %(e_type)s_t *obj);
+    %(cls)s_t *list, of_list_iter_t iter);
 extern int %(cls)s_append(
-    %(cls)s_t *list, %(e_type)s_t *obj);
+    %(cls)s_t *list, of_list_iter_t iter);
 
 /**
  * Iteration macro for list of type %(cls)s
@@ -1556,10 +1556,6 @@
     @param cls The class name for the function
     @param out The file to which to write
     """
-    if type_maps.class_is_inheritance_root(cls):
-        param = "obj_p"
-    else:
-        param = "obj"
 
     out.write("""
 /**
@@ -1580,20 +1576,9 @@
  */
 
 void
-%(cls)s_init(%(cls)s_t *%(param)s,
+%(cls)s_init(of_object_t *obj,
     of_version_t version, int bytes, int clean_wire)
 {
-""" % dict(cls=cls, param=param))
-
-    # Use an extra pointer to deal with inheritance classes
-    if type_maps.class_is_inheritance_root(cls):
-        out.write("""\
-    %s_header_t *obj;
-
-    obj = &obj_p->header;  /* Need instantiable subclass */
-""" % cls)
-
-    out.write("""
     LOCI_ASSERT(of_object_fixed_len[version][%(enum)s] >= 0);
     if (clean_wire) {
         MEMSET(obj, 0, sizeof(*obj));
@@ -1604,9 +1589,7 @@
     obj->version = version;
     obj->length = bytes;
     obj->object_id = %(enum)s;
-""" % dict(cls=cls, enum=enum_name(cls)))
 
-    out.write("""
     /* Grow the wire buffer */
     if (obj->wbuf != NULL) {
         int tot_bytes;
@@ -1615,8 +1598,7 @@
         of_wire_buffer_grow(obj->wbuf, tot_bytes);
     }
 }
-
-""")
+""" % dict(cls=cls, enum=enum_name(cls)))
 
 def gen_new_fn_body(cls, out):
     """
@@ -1648,15 +1630,15 @@
  * \\ingroup %(cls)s
  */
 
-%(cls)s_t *
+of_object_t *
 %(cls)s_new(of_version_t version)
 {
-    %(cls)s_t *obj;
+    of_object_t *obj;
     int bytes;
 
     bytes = of_object_fixed_len[version][%(enum)s];
 
-    if ((obj = (%(cls)s_t *)of_object_new(%(max_length)s)) == NULL) {
+    if ((obj = of_object_new(%(max_length)s)) == NULL) {
         return NULL;
     }
 
@@ -1717,11 +1699,11 @@
 
     for cls in of_g.standard_class_order:
         out.write("""
-extern %(cls)s_t *
+extern of_object_t *
     %(cls)s_new(of_version_t version);
 """ % dict(cls=cls))
         out.write("""extern void %(cls)s_init(
-    %(cls)s_t *obj, of_version_t version, int bytes, int clean_wire);
+    of_object_t *obj, of_version_t version, int bytes, int clean_wire);
 """ % dict(cls=cls))
 
     out.write("""
@@ -1743,8 +1725,8 @@
  * \ingroup %(cls)s
  */
 static inline void
-%(cls)s_delete(%(cls)s_t *obj) {
-    of_object_delete((of_object_t *)(obj));
+%(cls)s_delete(of_object_t *obj) {
+    of_object_delete(obj);
 }
 """ % dict(cls=cls))
 
diff --git a/c_gen/c_dump_gen.py b/c_gen/c_dump_gen.py
index 4e7db7a..a9074af 100644
--- a/c_gen/c_dump_gen.py
+++ b/c_gen/c_dump_gen.py
@@ -93,7 +93,7 @@
             if type_maps.class_is_inheritance_root(cls):
                 continue
             out.write("""\
-int %(cls)s_%(ver_name)s_dump(loci_writer_f writer, void* cookie, %(cls)s_t *obj);
+int %(cls)s_%(ver_name)s_dump(loci_writer_f writer, void* cookie, of_object_t *obj);
 """ % dict(cls=cls, ver_name=loxi_utils.version_to_name(version)))
 
     out.write("""
@@ -133,7 +133,7 @@
                 continue
             out.write("""
 int
-%(cls)s_%(ver_name)s_dump(loci_writer_f writer, void* cookie, %(cls)s_t *obj)
+%(cls)s_%(ver_name)s_dump(loci_writer_f writer, void* cookie, of_object_t *obj)
 {
     int out = 0;
 """ % dict(cls=cls, ver_name=ver_name))
@@ -150,7 +150,7 @@
 """  % dict(m_type=m_type, v_name=var_name_map(m_type)))
                     if loxi_utils.class_is_list(m_type):
                         base_type = loxi_utils.list_to_entry_type(m_type)
-                        out.write("    %s elt;\n    int rv;\n" % base_type)
+                        out.write("    of_object_t elt;\n    int rv;\n")
             out.write("""
     out += writer(cookie, "Object of type %(cls)s\\n");
 """ % dict(cls=cls))
diff --git a/c_gen/c_match.py b/c_gen/c_match.py
index e5a41ef..a703e4f 100644
--- a/c_gen/c_match.py
+++ b/c_gen/c_match.py
@@ -458,7 +458,7 @@
 static int
 populate_oxm_list(of_match_t *src, of_list_oxm_t *oxm_list)
 {
-    of_oxm_t oxm_entry;
+    of_object_t elt;
 
     /* For each active member, add an OXM entry to the list */
 """)
@@ -466,23 +466,18 @@
         out.write("""\
     if (OF_MATCH_MASK_%(ku)s_ACTIVE_TEST(src)) {
         if (!OF_MATCH_MASK_%(ku)s_EXACT_TEST(src)) {
-            of_oxm_%(key)s_masked_t *elt;
-            elt = &oxm_entry.%(key)s_masked;
-
-            of_oxm_%(key)s_masked_init(elt,
+            of_oxm_%(key)s_masked_init(&elt,
                 oxm_list->version, -1, 1);
-            of_list_oxm_append_bind(oxm_list, &oxm_entry);
-            of_oxm_%(key)s_masked_value_set(elt,
+            of_list_oxm_append_bind(oxm_list, &elt);
+            of_oxm_%(key)s_masked_value_set(&elt,
                    src->fields.%(key)s);
-            of_oxm_%(key)s_masked_value_mask_set(elt,
+            of_oxm_%(key)s_masked_value_mask_set(&elt,
                    src->masks.%(key)s);
         } else {  /* Active, but not masked */
-            of_oxm_%(key)s_t *elt;
-            elt = &oxm_entry.%(key)s;
-            of_oxm_%(key)s_init(elt,
+            of_oxm_%(key)s_init(&elt,
                 oxm_list->version, -1, 1);
-            of_list_oxm_append_bind(oxm_list, &oxm_entry);
-            of_oxm_%(key)s_value_set(elt, src->fields.%(key)s);
+            of_list_oxm_append_bind(oxm_list, &elt);
+            of_oxm_%(key)s_value_set(&elt, src->fields.%(key)s);
         }
     }
 """ % dict(key=key, ku=key.upper()))
@@ -629,7 +624,7 @@
 {
     int rv;
     of_list_oxm_t oxm_list;
-    of_oxm_t oxm_entry;
+    of_object_t oxm_entry;
 """)
 #    for key in match.of_match_members:
 #        out.write("    of_oxm_%s_t *%s;\n" % (key, key))
@@ -643,23 +638,23 @@
     rv = of_list_oxm_first(&oxm_list, &oxm_entry);
 
     while (rv == OF_ERROR_NONE) {
-        switch (oxm_entry.header.object_id) { /* What kind of entry is this */
+        switch (oxm_entry.object_id) { /* What kind of entry is this */
 """)
     for key in match.of_match_members:
         out.write("""
         case OF_OXM_%(ku)s_MASKED:
             of_oxm_%(key)s_masked_value_mask_get(
-                &oxm_entry.%(key)s_masked,
+                &oxm_entry,
                 &dst->masks.%(key)s);
             of_oxm_%(key)s_masked_value_get(
-                &oxm_entry.%(key)s,
+                &oxm_entry,
                 &dst->fields.%(key)s);
             of_memmask(&dst->fields.%(key)s, &dst->masks.%(key)s, sizeof(&dst->fields.%(key)s));
             break;
         case OF_OXM_%(ku)s:
             OF_MATCH_MASK_%(ku)s_EXACT_SET(dst);
             of_oxm_%(key)s_value_get(
-                &oxm_entry.%(key)s,
+                &oxm_entry,
                 &dst->fields.%(key)s);
             break;
 """ % (dict(ku=key.upper(), key=key)))
diff --git a/c_gen/c_show_gen.py b/c_gen/c_show_gen.py
index 9a13b43..a25e366 100644
--- a/c_gen/c_show_gen.py
+++ b/c_gen/c_show_gen.py
@@ -166,7 +166,7 @@
             if type_maps.class_is_inheritance_root(cls):
                 continue
             out.write("""\
-int %(cls)s_%(ver_name)s_show(loci_writer_f writer, void* cookie, %(cls)s_t *obj);
+int %(cls)s_%(ver_name)s_show(loci_writer_f writer, void* cookie, of_object_t *obj);
 """ % dict(cls=cls, ver_name=loxi_utils.version_to_name(version)))
 
     out.write("""
@@ -206,7 +206,7 @@
                 continue
             out.write("""
 int
-%(cls)s_%(ver_name)s_show(loci_writer_f writer, void* cookie, %(cls)s_t *obj)
+%(cls)s_%(ver_name)s_show(loci_writer_f writer, void* cookie, of_object_t *obj)
 {
     int out = 0;
 """ % dict(cls=cls, ver_name=ver_name))
@@ -222,8 +222,7 @@
     %(m_type)s %(v_name)s;
 """  % dict(m_type=m_type, v_name=var_name_map(m_type)))
                     if loxi_utils.class_is_list(m_type):
-                        base_type = loxi_utils.list_to_entry_type(m_type)
-                        out.write("    %s elt;\n    int rv;\n" % base_type)
+                        out.write("    of_object_t elt;\n    int rv;\n")
             for member in members:
                 m_type = member["m_type"]
                 m_name = member["name"]
diff --git a/c_gen/templates/README b/c_gen/templates/README
index 71c4a48..44eedab 100644
--- a/c_gen/templates/README
+++ b/c_gen/templates/README
@@ -60,7 +60,7 @@
     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_list_action_append_bind(&actions, &action);
         of_action_output_port_set(&action, i);
     }
 
diff --git a/c_gen/templates/list.c b/c_gen/templates/list.c
index 9ff6e42..d39af9a 100644
--- a/c_gen/templates/list.c
+++ b/c_gen/templates/list.c
@@ -42,12 +42,12 @@
  */
 
 int
-${cls}_first(${cls}_t *list, ${e_cls}_t *_obj)
+${cls}_first(${cls}_t *list, of_list_iter_t iter)
 {
     int rv;
-    of_object_t *obj = (of_object_t *)_obj;
+    of_object_t *obj = iter.obj;
 
-    ${e_cls}_init(_obj, list->version, -1, 1);
+    ${e_cls}_init(obj, list->version, -1, 1);
 
     if ((rv = of_list_first(list, obj)) < 0) {
         return rv;
@@ -73,10 +73,10 @@
  */
 
 int
-${cls}_next(${cls}_t *list, ${e_cls}_t *_obj)
+${cls}_next(${cls}_t *list, of_list_iter_t iter)
 {
     int rv;
-    of_object_t *obj = (of_object_t *)_obj;
+    of_object_t *obj = iter.obj;
 
     if ((rv = of_list_next(list, obj)) < 0) {
         return rv;
@@ -105,9 +105,9 @@
  */
 
 int
-${cls}_append_bind(${cls}_t *list, ${e_cls}_t *obj)
+${cls}_append_bind(${cls}_t *list, of_list_iter_t iter)
 {
-    return of_list_append_bind(list, (of_object_t *)obj);
+    return of_list_append_bind(list, iter.obj);
 }
 
 /**
@@ -119,7 +119,7 @@
  */
 
 int
-${cls}_append(${cls}_t *list, ${e_cls}_t *obj)
+${cls}_append(${cls}_t *list, of_list_iter_t iter)
 {
-    return of_list_append(list, (of_object_t *)obj);
+    return of_list_append(list, iter.obj);
 }
diff --git a/c_gen/templates/of_utils.c b/c_gen/templates/of_utils.c
index 373ad59..bddbc8d 100644
--- a/c_gen/templates/of_utils.c
+++ b/c_gen/templates/of_utils.c
@@ -54,7 +54,7 @@
 int
 of_action_list_has_out_port(of_list_action_t *actions, of_port_no_t outport)
 {
-    of_action_t elt;
+    of_object_t elt;
     of_action_output_t *output;
     int loop_rv;
     of_port_no_t port_no;
@@ -64,7 +64,7 @@
         return 1;
     }
 
-    output = &elt.output;
+    output = &elt;
     OF_LIST_ACTION_ITER(actions, &elt, loop_rv) {
         if (output->object_id == OF_ACTION_OUTPUT) {
             of_action_output_port_get(output, &port_no);