/* $Id$ */
/** @file
* IPRT - ASN.1, UTC TIME and GENERALIZED TIME Types.
*/
/*
* Copyright (C) 2006-2014 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* The contents of this file may alternatively be used under the terms
* of the Common Development and Distribution License Version 1.0
* (CDDL) only, as it comes in the "COPYING.CDDL" file of the
* VirtualBox OSE distribution, in which case the provisions of the
* CDDL are applicable instead of those of the GPL.
*
* You may elect to license modified versions of this file under the
* terms and conditions of either the GPL or the CDDL or both.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
/*******************************************************************************
* Global Variables *
*******************************************************************************/
/** The UTC TIME encoding of the IPRT epoch time. */
/** The GENERALIZED TIME encoding of the IPRT epoch time. */
/*
* ASN.1 TIME - Special Methods.
*/
{
AssertReturn(uTag == ASN1_TAG_UTC_TIME || uTag == ASN1_TAG_GENERALIZED_TIME, VERR_INVALID_PARAMETER);
uTag,
if (uTag == ASN1_TAG_UTC_TIME)
{
}
else
{
}
return VINF_SUCCESS;
}
{
if (!iDiff)
{
}
return iDiff;
}
/*
* ASN.1 TIME - Standard Methods.
*/
{
"RTAsn1Time",
sizeof(RTASN1TIME),
0,
NULL,
NULL,
};
{
/* Using UTC TIME since epoch would be encoded using UTC TIME following
X.509 Validity / Whatever time tag guidelines. */
}
RTDECL(int) RTAsn1Time_Clone(PRTASN1TIME pThis, PCRTASN1TIME pSrc, PCRTASN1ALLOCATORVTABLE pAllocator)
{
if (RTAsn1Time_IsPresent(pSrc))
{
if (RT_SUCCESS(rc))
{
return VINF_SUCCESS;
}
return rc;
}
return VINF_SUCCESS;
}
{
if ( pThis
{
}
}
RTDECL(int) RTAsn1Time_Enum(PRTASN1TIME pThis, PFNRTASN1ENUMCALLBACK pfnCallback, uint32_t uDepth, void *pvUser)
{
/* No children to enumerate. */
return VINF_SUCCESS;
}
{
int iDiff;
if (RTAsn1Time_IsPresent(pLeft))
{
if (RTAsn1Time_IsPresent(pRight))
{
}
else
iDiff = -1;
}
else
return iDiff;
}
RTDECL(int) RTAsn1Time_CheckSanity(PCRTASN1TIME pThis, uint32_t fFlags, PRTERRINFO pErrInfo, const char *pszErrorTag)
{
return VINF_SUCCESS;
}
/*
* Generate code for the tag specific methods.
* Note! This is very similar to what we're doing in asn1-ut-string.cpp.
*/
\
{ \
} \
\
RTDECL(int) RT_CONCAT(a_Api,_Clone)(PRTASN1TIME pThis, PCRTASN1TIME pSrc, PCRTASN1ALLOCATORVTABLE pAllocator) \
{ \
} \
\
{ \
|| !RTAsn1Time_IsPresent(pThis) \
} \
\
RTDECL(int) RT_CONCAT(a_Api,_Enum)(PRTASN1TIME pThis, PFNRTASN1ENUMCALLBACK pfnCallback, uint32_t uDepth, void *pvUser) \
{ \
&& ( !RTAsn1Time_IsPresent(pThis) \
/* No children to enumerate. */ \
return VINF_SUCCESS; \
} \
\
{ \
{ \
{ \
} \
else \
} \
return iDiff; \
} \
\
{ \
}
#include "asn1-ut-time-template2.h"
/*
* Generate code for the associated collection types.
*/
#include <iprt/asn1-generator-internal-header.h>
#include <iprt/asn1-generator-core.h>
#include <iprt/asn1-generator-init.h>
#include <iprt/asn1-generator-sanity.h>