int
ccnxCodecSchemaV1FixedHeaderDecoder_GetVersion(CCNxTlvDictionary *packetDictionary)
{
    PARCBuffer *fixedHeader = ccnxTlvDictionary_GetBuffer(packetDictionary, CCNxCodecSchemaV1TlvDictionary_HeadersFastArray_FixedHeader);
    if (fixedHeader != NULL) {
        parcBuffer_SetPosition(fixedHeader, _fixedHeader_VersionOffset);
        uint8_t version = parcBuffer_GetUint8(fixedHeader);
        return version;
    }

    return -1;
}
int
ccnxCodecSchemaV1FixedHeaderDecoder_GetHeaderLength(CCNxTlvDictionary *packetDictionary)
{
    int length = -1;
    PARCBuffer *fixedHeader = ccnxTlvDictionary_GetBuffer(packetDictionary, CCNxCodecSchemaV1TlvDictionary_HeadersFastArray_FixedHeader);
    if (fixedHeader != NULL) {
        parcBuffer_SetPosition(fixedHeader, _fixedHeader_HeaderLengthOffset);
        uint8_t headerLength = parcBuffer_GetUint8(fixedHeader);

        // 8 is the minimum size of headerLength
        if (headerLength >= _fixedHeaderBytes) {
            length = headerLength;
        }
    }

    return length;
}
static PARCBuffer *
_getPayload(const CCNxTlvDictionary *contentObjectDictionary)
{
    return ccnxTlvDictionary_GetBuffer(contentObjectDictionary,
                                       CCNxCodecSchemaV1TlvDictionary_MessageFastArray_PAYLOAD);
}
static PARCBuffer *
_getKeyIdRestriction(const CCNxTlvDictionary *contentObjectDictionary)
{
    return ccnxTlvDictionary_GetBuffer(contentObjectDictionary, CCNxCodecSchemaV1TlvDictionary_MessageFastArray_KEYID_RESTRICTION);
}
static PARCBuffer *
_ccnxInterestFacadeV1_GetPayload(const CCNxTlvDictionary *interestDictionary)
{
    _assertInvariants(interestDictionary);
    return ccnxTlvDictionary_GetBuffer(interestDictionary, CCNxCodecSchemaV1TlvDictionary_MessageFastArray_PAYLOAD);
}
static PARCBuffer *
_ccnxInterestFacadeV1_GetContentObjectHashRestriction(const CCNxTlvDictionary *interestDictionary)
{
    _assertInvariants(interestDictionary);
    return ccnxTlvDictionary_GetBuffer(interestDictionary, CCNxCodecSchemaV1TlvDictionary_MessageFastArray_OBJHASH_RESTRICTION);
}
static PARCBuffer *
_ccnxInterestFacadeV1_GetKeyIdRestriction(const CCNxTlvDictionary *interestDictionary)
{
    _assertInvariants(interestDictionary);
    return ccnxTlvDictionary_GetBuffer(interestDictionary, CCNxCodecSchemaV1TlvDictionary_MessageFastArray_KEYID_RESTRICTION);
}
PARCBuffer *
ccnxCodecSchemaV1OptionalHeadersDecoder_GetInterestFragmentHeader(CCNxTlvDictionary *packetDictionary)
{
    PARCBuffer *buffer = ccnxTlvDictionary_GetBuffer(packetDictionary, CCNxCodecSchemaV1TlvDictionary_HeadersFastArray_INTFRAG);
    return buffer;
}