First steps in CCNx packet coding. ccnx_encode* routines rewritten in NS3 style (using NS3::Buffer)

diff --git a/model/ccn/ccn.h b/model/ccn/ccn.h
index 6b0443c..af9dcae 100644
--- a/model/ccn/ccn.h
+++ b/model/ccn/ccn.h
@@ -1,4 +1,4 @@
-/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
 /*
  * Copyright (c) 2011 University of California, Los Angeles
  *
diff --git a/model/ccn/ccn_buf_decoder.cc b/model/ccn/ccn_buf_decoder.cc
index 5e1d713..eeb51fa 100644
--- a/model/ccn/ccn_buf_decoder.cc
+++ b/model/ccn/ccn_buf_decoder.cc
@@ -1,4 +1,4 @@
-/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
 /*
  * Copyright (c) 2011 University of California, Los Angeles
  *
@@ -18,15 +18,6 @@
  * Author: Ilya Moiseenko <iliamo@cs.ucla.edu>
  */
 
-/*
- *  ccn_buf_decoder.cc
- *  Abstraction
- *
- *  Created by Ilya on 7/29/11.
- *  Copyright 2011 __MyCompanyName__. All rights reserved.
- *
- */
-
 #include <string.h>
 #include <stdlib.h>
 #include "ccn.h"
@@ -34,26 +25,6 @@
 #include "ccn_coding.h"
 #include "ccn_indexbuf.h"
 
-/**
- * @file ccn_buf_decoder.c
- * @brief Support for Interest and ContentObject decoding.
- * 
- * Part of the CCNx C Library.
- *
- * Copyright (C) 2008, 2009, 2010 Palo Alto Research Center, Inc.
- *
- * This library is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License version 2.1
- * as published by the Free Software Foundation.
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details. You should have received
- * a copy of the GNU Lesser General Public License along with this library;
- * if not, write to the Free Software Foundation, Inc., 51 Franklin Street,
- * Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
 
 struct ccn_buf_decoder *
 ccn_buf_decoder_start(struct ccn_buf_decoder *d,
diff --git a/model/ccn/ccn_buf_encoder.cc b/model/ccn/ccn_buf_encoder.cc
index cc34551..d0d157b 100644
--- a/model/ccn/ccn_buf_encoder.cc
+++ b/model/ccn/ccn_buf_encoder.cc
@@ -1,4 +1,4 @@
-/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
 /*
  * Copyright (c) 2011 University of California, Los Angeles
  *
@@ -18,15 +18,6 @@
  * Author: Ilya Moiseenko <iliamo@cs.ucla.edu>
  */
 
-/*
- *  ccn_buf_encoder.cc
- *  Abstraction
- *
- *  Created by Ilya on 7/29/11.
- *  Copyright 2011 __MyCompanyName__. All rights reserved.
- *
- */
-
 #include <string.h>
 #include <stdarg.h>
 #include <stdio.h>
@@ -38,34 +29,6 @@
 #include "ccn_indexbuf.h"
 
 /**
- * Append a ccnb start marker
- *
- * This forms the basic building block of ccnb-encoded data.
- * @param c is the buffer to append to.
- * @param val is the numval, intepreted according to tt (see enum ccn_tt).
- * @param tt is the type field.
- * @returns 0 for success or -1 for error.
- */
-int
-ccn_charbuf_append_tt(struct ccn_charbuf *c, size_t val, enum ccn_tt tt)
-{
-  unsigned char buf[1+8*((sizeof(val)+6)/7)];
-  unsigned char *p = &(buf[sizeof(buf)-1]);
-  int n = 1;
-  p[0] = (CCN_TT_HBIT & ~CCN_CLOSE) |
-  ((val & CCN_MAX_TINY) << CCN_TT_BITS) |
-  (CCN_TT_MASK & tt);
-  val >>= (7-CCN_TT_BITS);
-  while (val != 0) {
-    (--p)[0] = (((unsigned char)val) & ~CCN_TT_HBIT) | CCN_CLOSE;
-    n++;
-    val >>= 7;
-  }
-  return(ccn_charbuf_append(c, p, n));
-}
-
-
-/**
  * Encode and sign a ContentObject.
  * @param buf is the output buffer where encoded object is written.
  * @param Name is the ccnb-encoded name from ccn_name_init and friends.
@@ -87,45 +50,7 @@
                          )
 {
     int res = 0;
-    //struct ccn_sigc *sig_ctx;
-    //struct ccn_signature *signature;
-    //size_t signature_size;
-    struct ccn_charbuf *content_header;
-    size_t closer_start;
     
-    content_header = ccn_charbuf_create();
-    res |= ccn_charbuf_append_tt(content_header, CCN_DTAG_Content, CCN_DTAG);
-    if (size != 0)
-        res |= ccn_charbuf_append_tt(content_header, size, CCN_BLOB);
-    closer_start = content_header->length;
-    res |= ccn_charbuf_append_closer(content_header);
-    if (res < 0)
-        return(-1);
-    //sig_ctx = ccn_sigc_create();
-    //if (sig_ctx == NULL)
-    //    return(-1);
-    //if (0 != ccn_sigc_init(sig_ctx, digest_algorithm))
-    //    return(-1);
-    //if (0 != ccn_sigc_update(sig_ctx, Name->buf, Name->length))
-    //    return(-1);
-    //if (0 != ccn_sigc_update(sig_ctx, SignedInfo->buf, SignedInfo->length))
-    //    return(-1);
-    //if (0 != ccn_sigc_update(sig_ctx, content_header->buf, closer_start))
-    //    return(-1);
-    //if (0 != ccn_sigc_update(sig_ctx, data, size))
-    //    return(-1);
-    //if (0 != ccn_sigc_update(sig_ctx, content_header->buf + closer_start,
-    //                         content_header->length - closer_start))
-    //    return(-1);
-    //signature = calloc(1, ccn_sigc_signature_max_size(sig_ctx, private_key));
-    //if (signature == NULL)
-    //    return(-1);
-    //res = ccn_sigc_final(sig_ctx, signature, &signature_size, private_key);
-    //if (0 != res) {
-    //    free(signature);
-    //    return(-1);
-    //}
-    //ccn_sigc_destroy(&sig_ctx);
     res |= ccn_charbuf_append_tt(buf, CCN_DTAG_ContentObject, CCN_DTAG);
     //res |= ccn_encode_Signature(buf, digest_algorithm,
     //                            NULL, 0, signature, signature_size);
diff --git a/model/ccn/ccn_charbuf.cc b/model/ccn/ccn_charbuf.cc
index f71b0a0..06c6544 100644
--- a/model/ccn/ccn_charbuf.cc
+++ b/model/ccn/ccn_charbuf.cc
@@ -1,4 +1,4 @@
-/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
 /*
  * Copyright (c) 2011 University of California, Los Angeles
  *
diff --git a/model/ccn/ccn_charbuf.h b/model/ccn/ccn_charbuf.h
index 1b2c61b..066eda2 100644
--- a/model/ccn/ccn_charbuf.h
+++ b/model/ccn/ccn_charbuf.h
@@ -1,4 +1,4 @@
-/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
 /*
  * Copyright (c) 2011 University of California, Los Angeles
  *
diff --git a/model/ccn/ccn_coding.cc b/model/ccn/ccn_coding.cc
deleted file mode 100644
index e7a54e7..0000000
--- a/model/ccn/ccn_coding.cc
+++ /dev/null
@@ -1,284 +0,0 @@
-/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2011 University of California, Los Angeles
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * Author: Ilya Moiseenko <iliamo@cs.ucla.edu>
- */
-
-#include "ccn_coding.h"
-
-/**
- * @file ccn_coding.c
- * @brief Support for scanning and parsing ccnb-encoded data.
- * 
- * Part of the CCNx C Library.
- *
- * Copyright (C) 2008, 2009 Palo Alto Research Center, Inc.
- *
- * This library is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License version 2.1
- * as published by the Free Software Foundation.
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details. You should have received
- * a copy of the GNU Lesser General Public License along with this library;
- * if not, write to the Free Software Foundation, Inc., 51 Franklin Street,
- * Fifth Floor, Boston, MA 02110-1301 USA.
- */
-//#include <ccn/coding.h>
-
-/**
- * This macro documents what's happening in the state machine by
- * hinting at the XML syntax would be emitted in a re-encoder.
- * But it actually does nothing.
- */
-#define XML(goop) ((void)0)
-
-/**
- * Decodes ccnb decoded data
- *
- * @param d holds the current state of the decoder.
- * @param p points to a new block of ccnb data to feed to the decoder.
- * @param n is the size of the input, in bytes.
- * @returns the number of bytes consumed.
- *
- * The client should ensure that the decoder is initialized to all zero
- * before the first call.  In the default mode, the decoder will return
- * only when it runs out of data, encounters an error, or reaches the end
- * of the element that it started at.  This is a good way to pull
- * ccnb-encoded objects from a byte stream.
- *
- * By setting the CCN_DSTATE_PAUSE bit is set in the decoder state, the
- * decoder will additionally return just after recognizing each token.
- * In this instance, use CCN_GET_TT_FROM_DSTATE() to extract
- * the token type from the decoder state;
- * CCN_CLOSE will be reported as CCN_NO_TOKEN.
- *
- * The pause bit persists, so the end test should take that into account
- * by using the CCN_FINAL_DSTATE() macro instead of testing for state 0.
- *
- * Once an error state is entered, no addition input is processed.
- *
- * @see ccn_buf_decoder_start(), ccn_buf_advance(), ccn_buf_check_close()
- */
-ssize_t
-ccn_skeleton_decode(struct ccn_skeleton_decoder *d,
-                    const unsigned char *p, size_t n)
-{
-  enum ccn_decoder_state state = (ccn_decoder_state)(d->state);
-  int tagstate = 0;
-  size_t numval = d->numval;
-  ssize_t i = 0;
-  unsigned char c;
-  size_t chunk;
-  int pause = 0;
-  if (d->state >= 0) {
-    pause = d->state & CCN_DSTATE_PAUSE;
-    tagstate = (d->state >> 8) & 3;
-    state = (ccn_decoder_state)(d->state & 0xFF);
-  }
-  while (i < (ssize_t)n) {
-    switch (state) {
-      case CCN_DSTATE_INITIAL:
-      case CCN_DSTATE_NEWTOKEN: /* start new thing */
-        d->token_index = i + d->index;
-        if (tagstate > 1 && tagstate-- == 2) {
-          XML("\""); /* close off the attribute value */
-        } 
-        if (p[i] == CCN_CLOSE) {
-          i++;
-          if (d->nest <= 0 || tagstate > 1) {
-            state = CCN_DSTATE_ERR_NEST;
-            break;
-          }
-          if (tagstate == 1) {
-            tagstate = 0;
-            XML("/>");
-          }
-          else {
-            XML("</%s>");
-          }
-          d->nest -= 1;
-          if (d->nest == 0) {
-            state = CCN_DSTATE_INITIAL;
-            n = i;
-          }
-          if (pause) {
-            int temp = (int)state;
-            //state |= (((int)CCN_NO_TOKEN) << 16);
-            temp |= (((int)CCN_NO_TOKEN) << 16);
-            state = (ccn_decoder_state)temp;
-            n = i;
-          }
-          break;
-        }
-        numval = 0;
-        state = CCN_DSTATE_NUMVAL;
-        /* FALLTHRU */
-      case CCN_DSTATE_NUMVAL: /* parsing numval */
-        c = p[i++];
-        if ((c & CCN_TT_HBIT) == CCN_CLOSE) {
-          if (numval > ((~(size_t)0U) >> (7 + CCN_TT_BITS)))
-            state = CCN_DSTATE_ERR_OVERFLOW;
-          numval = (numval << 7) + (c & 127);
-        }
-        else {
-          numval = (numval << (7-CCN_TT_BITS)) +
-          ((c >> CCN_TT_BITS) & CCN_MAX_TINY);
-          c &= CCN_TT_MASK;
-          switch (c) {
-            case CCN_EXT:
-              if (tagstate == 1) {
-                tagstate = 0;
-                XML(">");
-              }
-              d->nest += 1;
-              d->element_index = d->token_index;
-              state = CCN_DSTATE_NEWTOKEN;
-              break;
-            case CCN_DTAG:
-              if (tagstate == 1) {
-                tagstate = 0;
-                XML(">");
-              }
-              d->nest += 1;
-              d->element_index = d->token_index;
-              XML("<%s");
-              tagstate = 1;
-              state = CCN_DSTATE_NEWTOKEN;
-              break;
-            case CCN_BLOB:
-              if (tagstate == 1) {
-                tagstate = 0;
-                XML(" ccnbencoding=\"base64Binary\">");
-              }
-              state = CCN_DSTATE_BLOB;
-              if (numval == 0)
-                state = CCN_DSTATE_NEWTOKEN;
-              break;
-            case CCN_UDATA:
-              if (tagstate == 1) {
-                tagstate = 0;
-                XML(">");
-              }
-              state = CCN_DSTATE_UDATA;
-              if (numval == 0)
-                state = CCN_DSTATE_NEWTOKEN;
-              break;
-            case CCN_DATTR:
-              if (tagstate != 1) {
-                state = CCN_DSTATE_ERR_ATTR;
-                break;
-              }
-              tagstate = 3;
-              state = CCN_DSTATE_NEWTOKEN;
-              break;
-            case CCN_ATTR:
-              if (tagstate != 1) {
-                state = CCN_DSTATE_ERR_ATTR;
-                break;
-              }
-              numval += 1; /* encoded as length-1 */
-              state = CCN_DSTATE_ATTRNAME;
-              break;
-            case CCN_TAG:
-              if (tagstate == 1) {
-                tagstate = 0;
-                XML(">");
-              }
-              numval += 1; /* encoded as length-1 */
-              d->nest += 1;
-              d->element_index = d->token_index;
-              state = CCN_DSTATE_TAGNAME;
-              break;
-            default:
-              state = CCN_DSTATE_ERR_CODING;
-          }
-          if (pause) {
-            int temp = (int)state;
-            //state |= (c << 16);
-            temp |= (c << 16);
-            state = (ccn_decoder_state)temp;
-            n = i;
-          }
-        }
-        break;
-      case CCN_DSTATE_TAGNAME: /* parsing tag name */
-        chunk = n - i;
-        if (chunk > numval)
-          chunk = numval;
-        if (chunk == 0) {
-          state = CCN_DSTATE_ERR_BUG;
-          break;
-        }
-        numval -= chunk;
-        i += chunk;
-        if (numval == 0) {
-          if (d->nest == 0) {
-            state = CCN_DSTATE_ERR_NEST;
-            break;
-          }
-          XML("<%s");
-          tagstate = 1;
-          state = CCN_DSTATE_NEWTOKEN;
-        }
-        break;                
-      case CCN_DSTATE_ATTRNAME: /* parsing attribute name */
-        chunk = n - i;
-        if (chunk > numval)
-          chunk = numval;
-        if (chunk == 0) {
-          state = CCN_DSTATE_ERR_BUG;
-          break;
-        }
-        numval -= chunk;
-        i += chunk;
-        if (numval == 0) {
-          if (d->nest == 0) {
-            state = CCN_DSTATE_ERR_ATTR;
-            break;
-          }
-          XML(" %s=\"");
-          tagstate = 3;
-          state = CCN_DSTATE_NEWTOKEN;
-        }
-        break;
-      case CCN_DSTATE_UDATA: /* utf-8 data */
-      case CCN_DSTATE_BLOB: /* BLOB */
-        chunk = n - i;
-        if (chunk > numval)
-          chunk = numval;
-        if (chunk == 0) {
-          state = CCN_DSTATE_ERR_BUG;
-          break;
-        }
-        numval -= chunk;
-        i += chunk;
-        if (numval == 0)
-          state = CCN_DSTATE_NEWTOKEN;
-        break;
-      default:
-        n = i;
-    }
-  }
-  if (state < 0)
-    tagstate = pause = 0;
-  d->state = state | pause | (tagstate << 8); 
-  d->numval = numval;
-  d->index += i;
-  return(i);
-}
diff --git a/model/ccn/ccn_coding.h b/model/ccn/ccn_coding.h
deleted file mode 100644
index acf346c..0000000
--- a/model/ccn/ccn_coding.h
+++ /dev/null
@@ -1,241 +0,0 @@
-/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2011 University of California, Los Angeles
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * Author: Ilya Moiseenko <iliamo@cs.ucla.edu>
- */
-
-/**
- * @file ccn/coding.h
- * 
- * Details of the ccn binary wire encoding.
- *
- * Part of the CCNx C Library.
- *
- * Copyright (C) 2008-2010 Palo Alto Research Center, Inc.
- *
- * This library is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License version 2.1
- * as published by the Free Software Foundation.
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details. You should have received
- * a copy of the GNU Lesser General Public License along with this library;
- * if not, write to the Free Software Foundation, Inc., 51 Franklin Street,
- * Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifndef CCN_CODING_DEFINED
-#define CCN_CODING_DEFINED
-
-#include <sys/types.h>
-#include <stddef.h>
-
-#define CCN_TT_BITS 3
-#define CCN_TT_MASK ((1 << CCN_TT_BITS) - 1)
-#define CCN_MAX_TINY ((1 << (7-CCN_TT_BITS)) - 1)
-#define CCN_TT_HBIT ((unsigned char)(1 << 7))
-
-/**
- * Type tag for a ccnb start marker.
- */
-enum ccn_tt {
-  CCN_EXT,        /**< starts composite extension - numval is subtype */
-  CCN_TAG,        /**< starts composite - numval is tagnamelen-1 */ 
-  CCN_DTAG,       /**< starts composite - numval is tagdict index (enum ccn_dtag) */
-  CCN_ATTR,       /**< attribute - numval is attrnamelen-1, value follows */
-  CCN_DATTR,      /**< attribute numval is attrdict index */
-  CCN_BLOB,       /**< opaque binary data - numval is byte count */
-  CCN_UDATA,      /**< UTF-8 encoded character data - numval is byte count */
-  CCN_NO_TOKEN    /**< should not occur in encoding */
-};
-
-/** CCN_CLOSE terminates composites */
-#define CCN_CLOSE ((unsigned char)(0))
-
-enum ccn_ext_subtype {
-  /* skip smallest values for now */
-  CCN_PROCESSING_INSTRUCTIONS = 16 /* <?name:U value:U?> */
-};
-
-/**
- * DTAG identifies ccnb-encoded elements.
- * c.f. tagname.csvdict
- * See the gen_enum_dtag script for help updating these.
- */
-enum ccn_dtag {
-  CCN_DTAG_Any = 13,
-  CCN_DTAG_Name = 14,
-  CCN_DTAG_Component = 15,
-  CCN_DTAG_Certificate = 16,
-  CCN_DTAG_Collection = 17,
-  CCN_DTAG_CompleteName = 18,
-  CCN_DTAG_Content = 19,
-  CCN_DTAG_SignedInfo = 20,
-  CCN_DTAG_ContentDigest = 21,
-  CCN_DTAG_ContentHash = 22,
-  CCN_DTAG_Count = 24,
-  CCN_DTAG_Header = 25,
-  CCN_DTAG_Interest = 26,	/* 20090915 */
-  CCN_DTAG_Key = 27,
-  CCN_DTAG_KeyLocator = 28,
-  CCN_DTAG_KeyName = 29,
-  CCN_DTAG_Length = 30,
-  CCN_DTAG_Link = 31,
-  CCN_DTAG_LinkAuthenticator = 32,
-  CCN_DTAG_NameComponentCount = 33,	/* DeprecatedInInterest */
-  CCN_DTAG_RootDigest = 36,
-  CCN_DTAG_Signature = 37,
-  CCN_DTAG_Start = 38,
-  CCN_DTAG_Timestamp = 39,
-  CCN_DTAG_Type = 40,
-  CCN_DTAG_Nonce = 41,
-  CCN_DTAG_Scope = 42,
-  CCN_DTAG_Exclude = 43,
-  CCN_DTAG_Bloom = 44,
-  CCN_DTAG_BloomSeed = 45,
-  CCN_DTAG_AnswerOriginKind = 47,
-  CCN_DTAG_InterestLifetime = 48,
-  CCN_DTAG_Witness = 53,
-  CCN_DTAG_SignatureBits = 54,
-  CCN_DTAG_DigestAlgorithm = 55,
-  CCN_DTAG_BlockSize = 56,
-  CCN_DTAG_FreshnessSeconds = 58,
-  CCN_DTAG_FinalBlockID = 59,
-  CCN_DTAG_PublisherPublicKeyDigest = 60,
-  CCN_DTAG_PublisherCertificateDigest = 61,
-  CCN_DTAG_PublisherIssuerKeyDigest = 62,
-  CCN_DTAG_PublisherIssuerCertificateDigest = 63,
-  CCN_DTAG_ContentObject = 64,	/* 20090915 */
-  CCN_DTAG_WrappedKey = 65,
-  CCN_DTAG_WrappingKeyIdentifier = 66,
-  CCN_DTAG_WrapAlgorithm = 67,
-  CCN_DTAG_KeyAlgorithm = 68,
-  CCN_DTAG_Label = 69,
-  CCN_DTAG_EncryptedKey = 70,
-  CCN_DTAG_EncryptedNonceKey = 71,
-  CCN_DTAG_WrappingKeyName = 72,
-  CCN_DTAG_Action = 73,
-  CCN_DTAG_FaceID = 74,
-  CCN_DTAG_IPProto = 75,
-  CCN_DTAG_Host = 76,
-  CCN_DTAG_Port = 77,
-  CCN_DTAG_MulticastInterface = 78,
-  CCN_DTAG_ForwardingFlags = 79,
-  CCN_DTAG_FaceInstance = 80,
-  CCN_DTAG_ForwardingEntry = 81,
-  CCN_DTAG_MulticastTTL = 82,
-  CCN_DTAG_MinSuffixComponents = 83,
-  CCN_DTAG_MaxSuffixComponents = 84,
-  CCN_DTAG_ChildSelector = 85,
-  CCN_DTAG_RepositoryInfo = 86,
-  CCN_DTAG_Version = 87,
-  CCN_DTAG_RepositoryVersion = 88,
-  CCN_DTAG_GlobalPrefix = 89,
-  CCN_DTAG_LocalName = 90,
-  CCN_DTAG_Policy = 91,
-  CCN_DTAG_Namespace = 92,
-  CCN_DTAG_GlobalPrefixName = 93,
-  CCN_DTAG_PolicyVersion = 94,
-  CCN_DTAG_KeyValueSet = 95,
-  CCN_DTAG_KeyValuePair = 96,
-  CCN_DTAG_IntegerValue = 97,
-  CCN_DTAG_DecimalValue = 98,
-  CCN_DTAG_StringValue = 99,
-  CCN_DTAG_BinaryValue = 100,
-  CCN_DTAG_NameValue = 101,
-  CCN_DTAG_Entry = 102,
-  CCN_DTAG_ACL = 103,
-  CCN_DTAG_ParameterizedName = 104,
-  CCN_DTAG_Prefix = 105,
-  CCN_DTAG_Suffix = 106,
-  CCN_DTAG_Root = 107,
-  CCN_DTAG_ProfileName = 108,
-  CCN_DTAG_Parameters = 109,
-  CCN_DTAG_InfoString = 110,
-  CCN_DTAG_StatusResponse = 112,
-  CCN_DTAG_StatusCode = 113,
-  CCN_DTAG_StatusText = 114,
-  CCN_DTAG_SequenceNumber = 256,
-  CCN_DTAG_CCNProtocolDataUnit = 17702112
-};
-
-struct ccn_dict_entry {
-  int index;              /**< matches enum ccn_dtag above */
-  const char *name;       /**< textual name of dtag */
-};
-
-struct ccn_dict {
-  int count;              /**< Count of elements in the table */
-  const struct ccn_dict_entry *dict; /**< the table entries */
-};
-
-/**
- * Table for translating from DTAGs to names and vice versa.
- */
-extern const struct ccn_dict ccn_dtag_dict; /* matches enum ccn_dtag above */
-
-struct ccn_skeleton_decoder { /* initialize to all 0 */
-  ssize_t index;          /**< Number of bytes processed */
-  int state;              /**< Decoder state */
-  int nest;               /**< Element nesting */
-  size_t numval;          /**< Current numval, meaning depends on state */
-  size_t token_index;     /**< Starting index of most-recent token */
-  size_t element_index;   /**< Starting index of most-recent element */
-};
-
-/**
- * The decoder state is one of these, possibly with some
- * additional bits set for internal use.  A complete parse
- * ends up in state 0 or an error state.  Not all possible
- * error states are listed here.
- */
-enum ccn_decoder_state {
-  CCN_DSTATE_INITIAL = 0,
-  CCN_DSTATE_NEWTOKEN,
-  CCN_DSTATE_NUMVAL,
-  CCN_DSTATE_UDATA,
-  CCN_DSTATE_TAGNAME,
-  CCN_DSTATE_ATTRNAME,
-  CCN_DSTATE_BLOB,
-  /* All error states are negative */
-  CCN_DSTATE_ERR_OVERFLOW = -1,
-  CCN_DSTATE_ERR_ATTR     = -2,       
-  CCN_DSTATE_ERR_CODING   = -3,
-  CCN_DSTATE_ERR_NEST     = -4, 
-  CCN_DSTATE_ERR_BUG      = -5
-};
-
-/**
- * If the CCN_DSTATE_PAUSE bit is set in the decoder state,
- * the decoder will return just after recognizing each token.
- * In this instance, use CCN_GET_TT_FROM_DSTATE() to extract
- * the token type from the decoder state;
- * CCN_CLOSE will be reported as CCN_NO_TOKEN.
- * The pause bit persists, so the end test should take that into account
- * by using the CCN_FINAL_DSTATE macro instead of testing for state 0.
- */
-#define CCN_DSTATE_PAUSE (1 << 15)
-#define CCN_GET_TT_FROM_DSTATE(state) (CCN_TT_MASK & ((state) >> 16))
-#define CCN_FINAL_DSTATE(state) (((state) & (CCN_DSTATE_PAUSE-1)) == 0)
-
-ssize_t ccn_skeleton_decode(struct ccn_skeleton_decoder *d,
-                            const unsigned char *p,
-                            size_t n);
-
-#endif
-
diff --git a/model/ccn/ccn_indexbuf.cc b/model/ccn/ccn_indexbuf.cc
index a1cd87d..034c5db 100644
--- a/model/ccn/ccn_indexbuf.cc
+++ b/model/ccn/ccn_indexbuf.cc
@@ -1,4 +1,4 @@
-/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
 /*
  * Copyright (c) 2011 University of California, Los Angeles
  *
diff --git a/model/ccn/ccn_indexbuf.h b/model/ccn/ccn_indexbuf.h
index 9c9a8c9..3e133c3 100644
--- a/model/ccn/ccn_indexbuf.h
+++ b/model/ccn/ccn_indexbuf.h
@@ -1,4 +1,4 @@
-/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
 /*
  * Copyright (c) 2011 University of California, Los Angeles
  *
diff --git a/model/ccn/ccn_name_util.cc b/model/ccn/ccn_name_util.cc
index 94f3991..64405ce 100644
--- a/model/ccn/ccn_name_util.cc
+++ b/model/ccn/ccn_name_util.cc
@@ -1,4 +1,4 @@
-/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
 /*
  * Copyright (c) 2011 University of California, Los Angeles
  *
diff --git a/model/ccn/ccn_name_util.h b/model/ccn/ccn_name_util.h
index 95df0e3..6e5fda7 100644
--- a/model/ccn/ccn_name_util.h
+++ b/model/ccn/ccn_name_util.h
@@ -1,4 +1,4 @@
-/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
 /*
  * Copyright (c) 2011 University of California, Los Angeles
  *
diff --git a/model/ccn/ccn_random.cc b/model/ccn/ccn_random.cc
index 6e2dd0c..6176c79 100644
--- a/model/ccn/ccn_random.cc
+++ b/model/ccn/ccn_random.cc
@@ -1,4 +1,4 @@
-/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
 /*
  * Copyright (c) 2011 University of California, Los Angeles
  *
diff --git a/model/ccn/ccn_random.h b/model/ccn/ccn_random.h
index 0a8be4c..ddd0a38 100644
--- a/model/ccn/ccn_random.h
+++ b/model/ccn/ccn_random.h
@@ -1,4 +1,4 @@
-/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
 /*
  * Copyright (c) 2011 University of California, Los Angeles
  *