Make everything compile
diff --git a/helper/ccnx-encoding-helper.cc b/helper/ccnx-encoding-helper.cc
index 21ca9ae..7783d7a 100644
--- a/helper/ccnx-encoding-helper.cc
+++ b/helper/ccnx-encoding-helper.cc
@@ -35,17 +35,17 @@
#define CCN_TT_HBIT ((unsigned char)(1 << 7))
size_t
-CcnxEncodingHelper::AppendBlockHeader (Buffer::Iterator start, size_t val, Ccnx::ccn_tt tt)
+CcnxEncodingHelper::AppendBlockHeader (Buffer::Iterator start, size_t val, CcnbParser::ccn_tt tt)
{
unsigned char buf[1+8*((sizeof(val)+6)/7)];
unsigned char *p = &(buf[sizeof(buf)-1]);
size_t n = 1;
- p[0] = (CCN_TT_HBIT & ~Ccnx::CCN_CLOSE) |
+ p[0] = (CCN_TT_HBIT & ~CcnbParser::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) | Ccnx::CCN_CLOSE;
+ (--p)[0] = (((unsigned char)val) & ~CCN_TT_HBIT) | CcnbParser::CCN_CLOSE;
n++;
val >>= 7;
}
@@ -60,7 +60,7 @@
os << number;
size_t written = 0;
- written += AppendBlockHeader (start, os.str().size(), Ccnx::CCN_UDATA);
+ written += AppendBlockHeader (start, os.str().size(), CcnbParser::CCN_UDATA);
written += os.str().size();
start.Write (reinterpret_cast<const unsigned char*>(os.str().c_str()), os.str().size());
@@ -71,7 +71,7 @@
size_t
CcnxEncodingHelper::CcnxEncodingHelper::AppendCloser (Buffer::Iterator start)
{
- start.WriteU8 (Ccnx::CCN_CLOSE);
+ start.WriteU8 (CcnbParser::CCN_CLOSE);
return 1;
}
@@ -81,7 +81,7 @@
size_t written = 0;
BOOST_FOREACH (const std::string &component, name.GetComponents())
{
- written += AppendTaggedBlob (start, Ccnx::CCN_DTAG_Component,
+ written += AppendTaggedBlob (start, CcnbParser::CCN_DTAG_Component,
reinterpret_cast<const uint8_t*>(component.c_str()), component.size());
}
return written;
@@ -98,7 +98,7 @@
for (; required_bytes < 7 && ts != 0; ts >>= 8) // not more than 6 bytes?
required_bytes++;
- size_t len = AppendBlockHeader(start, required_bytes, Ccnx::CCN_BLOB);
+ size_t len = AppendBlockHeader(start, required_bytes, CcnbParser::CCN_BLOB);
// write part with seconds
ts = time.ToInteger (Time::S) >> 4;
@@ -114,13 +114,13 @@
}
size_t
-CcnxEncodingHelper::AppendTaggedBlob (Buffer::Iterator start, Ccnx::ccn_dtag dtag,
+CcnxEncodingHelper::AppendTaggedBlob (Buffer::Iterator start, CcnbParser::ccn_dtag dtag,
const uint8_t *data, size_t size)
{
- size_t written = AppendBlockHeader (start, dtag, Ccnx::CCN_DTAG);
+ size_t written = AppendBlockHeader (start, dtag, CcnbParser::CCN_DTAG);
if (size>0)
{
- written += AppendBlockHeader (start, size, Ccnx::CCN_BLOB);
+ written += AppendBlockHeader (start, size, CcnbParser::CCN_BLOB);
start.Write (data, size);
written += size;
}
@@ -134,58 +134,58 @@
CcnxEncodingHelper::Serialize (Buffer::Iterator start, const CcnxInterestHeader &interest)
{
size_t written = 0;
- written += AppendBlockHeader (start, Ccnx::CCN_DTAG_Interest, Ccnx::CCN_DTAG); // <Interest>
+ written += AppendBlockHeader (start, CcnbParser::CCN_DTAG_Interest, CcnbParser::CCN_DTAG); // <Interest>
- written += AppendBlockHeader (start, Ccnx::CCN_DTAG_Name, Ccnx::CCN_DTAG); // <Name>
+ written += AppendBlockHeader (start, CcnbParser::CCN_DTAG_Name, CcnbParser::CCN_DTAG); // <Name>
written += AppendNameComponents (start, interest.GetName()); // <Component>...</Component>...
written += AppendCloser (start); // </Name>
if (interest.GetMinSuffixComponents() >= 0)
{
- written += AppendBlockHeader (start, Ccnx::CCN_DTAG_MinSuffixComponents, Ccnx::CCN_DTAG);
+ written += AppendBlockHeader (start, CcnbParser::CCN_DTAG_MinSuffixComponents, CcnbParser::CCN_DTAG);
written += AppendNumber (start, interest.GetMinSuffixComponents ());
written += AppendCloser (start);
}
if (interest.GetMaxSuffixComponents() >= 0)
{
- written += AppendBlockHeader (start, Ccnx::CCN_DTAG_MaxSuffixComponents, Ccnx::CCN_DTAG);
+ written += AppendBlockHeader (start, CcnbParser::CCN_DTAG_MaxSuffixComponents, CcnbParser::CCN_DTAG);
written += AppendNumber (start, interest.GetMaxSuffixComponents ());
written += AppendCloser (start);
}
if (interest.GetExclude().size() > 0)
{
- written += AppendBlockHeader (start, Ccnx::CCN_DTAG_Exclude, Ccnx::CCN_DTAG); // <Exclude>
+ written += AppendBlockHeader (start, CcnbParser::CCN_DTAG_Exclude, CcnbParser::CCN_DTAG); // <Exclude>
written += AppendNameComponents (start, interest.GetExclude()); // <Component>...</Component>...
written += AppendCloser (start); // </Exclude>
}
if (interest.IsEnabledChildSelector())
{
- written += AppendBlockHeader (start, Ccnx::CCN_DTAG_ChildSelector, Ccnx::CCN_DTAG);
+ written += AppendBlockHeader (start, CcnbParser::CCN_DTAG_ChildSelector, CcnbParser::CCN_DTAG);
written += AppendNumber (start, 1);
written += AppendCloser (start);
}
if (interest.IsEnabledAnswerOriginKind())
{
- written += AppendBlockHeader (start, Ccnx::CCN_DTAG_AnswerOriginKind, Ccnx::CCN_DTAG);
+ written += AppendBlockHeader (start, CcnbParser::CCN_DTAG_AnswerOriginKind, CcnbParser::CCN_DTAG);
written += AppendNumber (start, 1);
written += AppendCloser (start);
}
if (interest.GetScope() >= 0)
{
- written += AppendBlockHeader (start, Ccnx::CCN_DTAG_Scope, Ccnx::CCN_DTAG);
+ written += AppendBlockHeader (start, CcnbParser::CCN_DTAG_Scope, CcnbParser::CCN_DTAG);
written += AppendNumber (start, interest.GetScope ());
written += AppendCloser (start);
}
if (!interest.GetInterestLifetime().IsZero())
{
- written += AppendBlockHeader (start, Ccnx::CCN_DTAG_InterestLifetime, Ccnx::CCN_DTAG);
+ written += AppendBlockHeader (start, CcnbParser::CCN_DTAG_InterestLifetime, CcnbParser::CCN_DTAG);
written += AppendTimestampBlob (start, interest.GetInterestLifetime());
written += AppendCloser (start);
}
if (interest.GetNonce()>0)
{
uint32_t nonce = interest.GetNonce();
- written += AppendTaggedBlob (start, Ccnx::CCN_DTAG_Nonce,
+ written += AppendTaggedBlob (start, CcnbParser::CCN_DTAG_Nonce,
reinterpret_cast<const uint8_t*>(&nonce),
sizeof(nonce));
}
@@ -198,32 +198,32 @@
CcnxEncodingHelper::Serialize (Buffer::Iterator start, const CcnxContentObjectHeader &contentObject)
{
size_t written = 0;
- written += AppendBlockHeader (start, Ccnx::CCN_DTAG_ContentObject, Ccnx::CCN_DTAG); // <ContentObject>
+ written += AppendBlockHeader (start, CcnbParser::CCN_DTAG_ContentObject, CcnbParser::CCN_DTAG); // <ContentObject>
// fake signature
- written += AppendBlockHeader (start, Ccnx::CCN_DTAG_Signature, Ccnx::CCN_DTAG); // <Signature>
+ written += AppendBlockHeader (start, CcnbParser::CCN_DTAG_Signature, CcnbParser::CCN_DTAG); // <Signature>
// Signature ::= DigestAlgorithm?
// Witness?
// SignatureBits
- written += AppendTaggedBlob (start, Ccnx::CCN_DTAG_SignatureBits, 0, 0); // <SignatureBits />
+ written += AppendTaggedBlob (start, CcnbParser::CCN_DTAG_SignatureBits, 0, 0); // <SignatureBits />
written += AppendCloser (start); // </Signature>
- written += AppendBlockHeader (start, Ccnx::CCN_DTAG_Name, Ccnx::CCN_DTAG); // <Name>
+ written += AppendBlockHeader (start, CcnbParser::CCN_DTAG_Name, CcnbParser::CCN_DTAG); // <Name>
written += AppendNameComponents (start, contentObject.GetName()); // <Component>...</Component>...
written += AppendCloser (start); // </Name>
// fake signature
- written += AppendBlockHeader (start, Ccnx::CCN_DTAG_SignedInfo, Ccnx::CCN_DTAG); // <SignedInfo>
+ written += AppendBlockHeader (start, CcnbParser::CCN_DTAG_SignedInfo, CcnbParser::CCN_DTAG); // <SignedInfo>
// SignedInfo ::= PublisherPublicKeyDigest
// Timestamp
// Type?
// FreshnessSeconds?
// FinalBlockID?
// KeyLocator?
- written += AppendTaggedBlob (start, Ccnx::CCN_DTAG_PublisherPublicKeyDigest, 0, 0); // <PublisherPublicKeyDigest />
+ written += AppendTaggedBlob (start, CcnbParser::CCN_DTAG_PublisherPublicKeyDigest, 0, 0); // <PublisherPublicKeyDigest />
written += AppendCloser (start); // </SignedInfo>
- written += AppendBlockHeader (start, Ccnx::CCN_DTAG_Content, Ccnx::CCN_DTAG); // <Content>
+ written += AppendBlockHeader (start, CcnbParser::CCN_DTAG_Content, CcnbParser::CCN_DTAG); // <Content>
// there is no closing tag !!!
return written;