예제 #1
0
MetisLogger *
metisTlvSkeleton_GetLogger(const MetisTlvSkeleton *opaque)
{
    const _InternalSkeleton *skeleton = (const _InternalSkeleton *) opaque;
    _assertInvariants(skeleton);
    return skeleton->logger;
}
예제 #2
0
size_t
metisTlvSkeleton_TotalPacketLength(const MetisTlvSkeleton *opaque)
{
    const _InternalSkeleton *skeleton = (const _InternalSkeleton *) opaque;
    _assertInvariants(skeleton);
    return skeleton->tlvOps->totalPacketLength(skeleton->packet);
}
예제 #3
0
bool
metisTlvSkeleton_IsPacketTypeHopByHopFragment(const MetisTlvSkeleton *opaque)
{
    const _InternalSkeleton *skeleton = (const _InternalSkeleton *) opaque;
    _assertInvariants(skeleton);
    return skeleton->tlvOps->isPacketTypeHopByHopFragment(skeleton->packet);
}
예제 #4
0
const uint8_t *
metisTlvSkeleton_GetPacket(const MetisTlvSkeleton *opaque)
{
    const _InternalSkeleton *skeleton = (const _InternalSkeleton *) opaque;
    _assertInvariants(skeleton);
    return skeleton->packet;
}
예제 #5
0
PARCCryptoHash *
metisTlvSkeleton_ComputeContentObjectHash(const MetisTlvSkeleton *opaque)
{
    const _InternalSkeleton *skeleton = (const _InternalSkeleton *) opaque;
    _assertInvariants(skeleton);
    return skeleton->tlvOps->computeContentObjectHash(skeleton->packet);
}
예제 #6
0
static void
_ccnxInterestFacadeV1_AssertValid(const CCNxTlvDictionary *interestDictionary)
{
    _assertInvariants(interestDictionary);
    assertTrue(ccnxTlvDictionary_IsValueName(interestDictionary,
                                             CCNxCodecSchemaV1TlvDictionary_MessageFastArray_NAME), "Name field is not a name");
}
예제 #7
0
static bool
_ccnxInterestFacadeV1_SetContentObjectHashRestriction(CCNxTlvDictionary *interestDictionary, const PARCBuffer *contentObjectHash)
{
    _assertInvariants(interestDictionary);
    return ccnxTlvDictionary_PutBuffer(interestDictionary,
                                       CCNxCodecSchemaV1TlvDictionary_MessageFastArray_OBJHASH_RESTRICTION,
                                       contentObjectHash);
}
예제 #8
0
/**
 * Initialize the skeleton memory
 *
 * Clears all the extents to {0, 0} and sets the tlvOps and packet members for further parsing.
 *
 * @param [in] skeleton The skeleton to initialize
 * @param [in] tlvOps The parser operations to use
 * @param [in] packet the packet buffer (points to byte "0" of the fixed header)
 *
 * Example:
 * @code
 * {
 *    MetisTlvSkeleton skeleton;
 *    _initialize(&skeleton, &MetisTlvSchemaV0_Ops, packet);
 * }
 * @endcode
 */
static void
_initialize(_InternalSkeleton *skeleton, const struct metis_tlv_ops *tlvOps, uint8_t *packet, MetisLogger *logger)
{
    memset(skeleton, 0, sizeof(MetisTlvSkeleton));
    skeleton->packet = packet;
    skeleton->tlvOps = tlvOps;
    skeleton->logger = logger;
    _assertInvariants(skeleton);
}
예제 #9
0
static CCNxName *
_ccnxInterestFacadeV1_GetName(const CCNxTlvDictionary *interestDictionary)
{
    int key = CCNxCodecSchemaV1TlvDictionary_MessageFastArray_NAME;
    _assertInvariants(interestDictionary);
    if (ccnxTlvDictionary_IsValueName(interestDictionary, key)) {
        return ccnxTlvDictionary_GetName(interestDictionary, key);
    }
    return NULL;
}
예제 #10
0
static void
_ccnxInterestFacadeV1_Display(const CCNxTlvDictionary *interestDictionary, size_t indentation)
{
    _assertInvariants(interestDictionary);
    ccnxTlvDictionary_Display(interestDictionary, (unsigned) indentation);
}
예제 #11
0
static uint32_t
_ccnxInterestFacadeV1_GetHopLimit(const CCNxTlvDictionary *interestDictionary)
{
    _assertInvariants(interestDictionary);
    return _fetchUint32(interestDictionary, CCNxCodecSchemaV1TlvDictionary_MessageFastArray_HOPLIMIT, CCNxInterestDefault_HopLimit);
}
예제 #12
0
static PARCBuffer *
_ccnxInterestFacadeV1_GetPayload(const CCNxTlvDictionary *interestDictionary)
{
    _assertInvariants(interestDictionary);
    return ccnxTlvDictionary_GetBuffer(interestDictionary, CCNxCodecSchemaV1TlvDictionary_MessageFastArray_PAYLOAD);
}
예제 #13
0
static PARCBuffer *
_ccnxInterestFacadeV1_GetKeyIdRestriction(const CCNxTlvDictionary *interestDictionary)
{
    _assertInvariants(interestDictionary);
    return ccnxTlvDictionary_GetBuffer(interestDictionary, CCNxCodecSchemaV1TlvDictionary_MessageFastArray_KEYID_RESTRICTION);
}
예제 #14
0
static uint32_t
_ccnxInterestFacadeV1_GetLifetime(const CCNxTlvDictionary *interestDictionary)
{
    _assertInvariants(interestDictionary);
    return _fetchUint32(interestDictionary, CCNxCodecSchemaV1TlvDictionary_HeadersFastArray_InterestLifetime, CCNxInterestDefault_LifetimeMilliseconds);
}
예제 #15
0
static bool
_ccnxInterestFacadeV1_SetHopLimit(CCNxTlvDictionary *interestDictionary, uint32_t hopLimit)
{
    _assertInvariants(interestDictionary);
    return ccnxTlvDictionary_PutInteger(interestDictionary, CCNxCodecSchemaV1TlvDictionary_MessageFastArray_HOPLIMIT, hopLimit);
}
예제 #16
0
static bool
_ccnxInterestFacadeV1_SetKeyIdRestriction(CCNxTlvDictionary *interestDictionary, const PARCBuffer *keyId)
{
    _assertInvariants(interestDictionary);
    return ccnxTlvDictionary_PutBuffer(interestDictionary, CCNxCodecSchemaV1TlvDictionary_MessageFastArray_KEYID_RESTRICTION, keyId);
}