📄 policyinfo.c
字号:
/* Copyright 2005-2006, Voltage Security, all rights reserved.
*/
#include "vibe.h"
#include "environment.h"
#include "base.h"
#include "libctx.h"
#include "policy.h"
#include "localpolicy.h"
#include "idobj.h"
#include "reciplist.h"
#include "emailschema.h"
#include "errorctx.h"
/* Call this routine when the PolicyGetType is
* VOLT_POLICY_GET_IS_LOCAL_ID.
* <p>If the given identity is local, this function will allocate space
* for a VtItem struct and the actual string data. It will be the name
* of the district to use. The routine will deposit the pointer to the
* VtItem at the address given by districtName.
* <p>If the given identity is not local, this function will return a
* NULL pointer at the address given by districtName.
* <p>The pointer at the address districtName must be initialized to
* NULL.
*
* @param ctx The policy context to use.
* @param libCtx The libCtxt to use.
* @param idObj The identity object to check.
* @param districtName The address where the function will deposit
* either the pointer to the allocated memory, the name of the district
* to use, or else a NULL pointer if the identity is not local.
* @return an int, 0 if the function completed successfully or a
* non-zero error code.
*/
static int VOLT_CALLING_CONV IsIdentityLocalAlloc VOLT_PROTO_LIST ((
VoltPolicyCtx *ctx,
VoltLibCtx *libCtx,
VoltIdentityObject *idObj,
VtItem **districtName
));
/* Call this routine when the PolicyGetType is
* VOLT_POLICY_GET_LOCAL_DOMAIN.
* <p>This function simply returns the local domain. This doesn't check
* to see if something is a local domain, it just returns the local
* domain. The return is a new VtItem with the data field pointing to
* the domain name. This function allocates the space for the VtItem
* and the actual string data.
* <p>If there is no localDomain, the function returns a NULL for the
* domainName.
*
* @param ctx The policy context to use.
* @param libCtx The libCtxt to use.
* @param domainName The address where the function will deposit either
* the pointer to the allocated memory, containing the local domain
* name, or else a NULL pointer if the the policy has no local domain.
* @return an int, 0 if the function completed successfully or a
* non-zero error code.
*/
static int VOLT_CALLING_CONV GetLocalDomainAlloc VOLT_PROTO_LIST ((
VoltPolicyCtx *ctx,
VoltLibCtx *libCtx,
VtItem **domainName
));
/* Call this routine when the PolicyGetType is
* VOLT_POLICY_GET_PROVISIONED_DISTRICT.
* <p>If the given identity is provisioned, this function will allocate
* space for a VtItem struct and the actual string data. It will be the
* name of the district to use. The routine will deposit the pointer to
* the VtItem at the address given by districtName.
* <p>If the given identity is not provisioned, this function will
* return a NULL pointer at the address given by districtName.
* <p>The pointer at the address districtName must be initialized to
* NULL.
*
* @param ctx The policy context to use.
* @param libCtx The libCtxt to use.
* @param idObj The identity object to check.
* @param districtName The address where the function will deposit
* either the pointer to the allocated memory, the name of the district
* to use, or else a NULL pointer if the identity is not provisioned.
* @return an int, 0 if the function completed successfully or a
* non-zero error code.
*/
static int VOLT_CALLING_CONV ProvisionedDistrictAlloc VOLT_PROTO_LIST ((
VoltPolicyCtx *ctx,
VoltLibCtx *libCtx,
VoltIdentityObject *idObj,
VtItem **districtName
));
/* Call this routine when the PolicyGetType is
* VOLT_POLICY_GET_FALL_THROUGH_DISTRICT.
* <p>If the policy has a fall through district, this function will
* allocate space for a VtItem struct and the actual string data. It
* will be the name of the district to use. The routine will deposit
* the pointer to the VtItem at the address given by districtName.
* <p>If there is no fall through district, this function will return a
* NULL pointer at the address given by districtName.
* <p>The pointer at the address districtName must be initialized to
* NULL.
*
* @param ctx The policy context to use.
* @param libCtx The libCtxt to use.
* @param districtName The address where the function will deposit
* either the pointer to the allocated memory, the name of the district
* to use, or else a NULL pointer if there is no fall through district.
* @return an int, 0 if the function completed successfully or a
* non-zero error code.
*/
static int VOLT_CALLING_CONV FallThroughDistrictAlloc VOLT_PROTO_LIST ((
VoltPolicyCtx *ctx,
VoltLibCtx *libCtx,
VtItem **districtName
));
/* Call this routine when the PolicyGetType is
* VOLT_POLICY_GET_REFRESH_RATE_NEGATIVE or
* VOLT_POLICY_GET_REFRESH_RATE_POSITIVE.
* <p>The flag argument indicates which refresh rate is requested,
* negative or positive. The value must be one of the two
* PolicyGetType's, REFRESH_RATE_NEGATIVE or REFRESH_RATE_POSITIVE.
* <p>This function will allocate space for an int and set it to the
* refresh rate.
* <p>If the function can find no "official" refresh rate, it will
* return the address of an int that sets the rate to 0.
* <p>The pointer at the address rate must be initialized to NULL.
*
* @param ctx The policy context to use.
* @param libCtx The libCtxt to use.
* @param flag Indicates which refresh rate is requested,
* REFRESH_RATE_NEGATIVE or REFRESH_RATE_POSITIVE.
* @param rate The address where the function will deposit the pointer
* to the int, the rate (in seconds).
* @return an int, 0 if the function completed successfully or a
* non-zero error code.
*/
static int VOLT_CALLING_CONV RefreshRateAlloc VOLT_PROTO_LIST ((
VoltPolicyCtx *ctx,
VoltLibCtx *libCtx,
VoltPolicyGetType flag,
int **rate
));
/* Call this routine when the PolicyGetType is
* VOLT_POLICY_GET_IS_PARAM_CHECKING_STRICT.
* <p>This function will allocate space for an int and set it to either
* 0 or 1. If 1 (yes/true), the param checking is strict. If 0
* (no/false), the param checking is not strict.
* <p>If the function can find no "official" strictness, it will return
* the address of an int that sets the strict to 1.
* <p>The pointer at the address result must be initialized to NULL.
*
* @param ctx The policy context to use.
* @param libCtx The libCtxt to use.
* @param result The address where the function will deposit the pointer
* to the int, the strictness.
* @return an int, 0 if the function completed successfully or a
* non-zero error code.
*/
static int VOLT_CALLING_CONV IsParamCheckingStrictAlloc VOLT_PROTO_LIST ((
VoltPolicyCtx *ctx,
VoltLibCtx *libCtx,
int **result
));
/* Call this routine when the PolicyGetType is
* VOLT_POLICY_GET_IS_DISTRICT_AGGRESSIVE. An aggressive district is
* one that says the refresh rate negative is 0.
* <p>This function will allocate space for an int and set it to either
* 0 or 1. If 1 (yes/true), the district is aggressive. If 0
* (no/false), the district is not aggressive.
* <p>If the function can find no "official" aggressiveness, it will
* return the address of an int that sets the aggressiveness to 0.
* <p>The pointer at the address result must be initialized to NULL.
*
* @param ctx The policy context to use.
* @param libCtx The libCtxt to use.
* @param result The address where the function will deposit the pointer
* to the int, the aggressiveness.
* @param distObj The district object to check.
* @return an int, 0 if the function completed successfully or a
* non-zero error code.
*/
static int VOLT_CALLING_CONV IsDistrictAggressiveAlloc VOLT_PROTO_LIST ((
VoltPolicyCtx *ctx,
VoltLibCtx *libCtx,
VoltDistrictObject *distObj,
int **result
));
/* Call this routine when the PolicyGetType is
* VOLT_POLICY_GET_IS_TRUSTED_DISTRICT.
* <p>This function will allocate space for an int and set it to either
* 0 or 1. If 1 (yes/true), the district is trusted. If 0 (no/false),
* the trustworthiness of the district is not known.
* <p>If the function can find no "official" trust status, it will
* return the address of an int that sets trust to 0.
* <p>The pointer at the address result must be initialized to NULL.
*
* @param ctx The policy context to use.
* @param libCtx The libCtxt to use.
* @param distObj The district object to check.
* @param result The address where the function will deposit the pointer
* to the int, trusted or not.
* @return an int, 0 if the function completed successfully or a
* non-zero error code.
*/
static int VOLT_CALLING_CONV IsDistrictTrustedAlloc VOLT_PROTO_LIST ((
VoltPolicyCtx *ctx,
VoltLibCtx *libCtx,
VoltDistrictObject *distObj,
int **result
));
/* Call this routine when the PolicyGetType is
* VOLT_POLICY_GET_CREDENTIAL_CACHE_MODE.
* <p>This function will allocate space for an int and set it to either
* -1 (cache for life of process), 0 (no caching), or a positive value
* (cache for that number of seconds).
* <p>If the function can find no "official" cache mode, it will
* return the address of an int that sets the mode to 0.
* <p>The pointer at the address cacheMode must be initialized to NULL.
*
* @param ctx The policy context to use.
* @param libCtx The libCtxt to use.
* @param cacheMode The address where the function will deposit the
* pointer to the int, the mode.
* @return an int, 0 if the function completed successfully or a
* non-zero error code.
*/
static int VOLT_CALLING_CONV CredentialCacheModeAlloc VOLT_PROTO_LIST ((
VoltPolicyCtx *ctx,
VoltLibCtx *libCtx,
int **cacheMode
));
/* Call this routine when the PolicyGetType is
* VOLT_POLICY_GET_SECURE_MAIL_HEADER or VOLT_POLICY_GET_CONTENT_FOOTER.
* <p>The flag indicates which value is requested, if 0, get the
* footer, if not 0, get the header.
* <p>If the policy has the value requested, this function will allocate
* space for a VtItem struct and the actual string data. The routine will
* deposit the pointer to the VtItem at the address given by result.
* <p>If there is no value, this function will return a NULL pointer at
* the address given by result.
* <p>The pointer at the address result must be initialized to NULL.
*
* @param ctx The policy context to use.
* @param libCtx The libCtxt to use.
* @param flag Calling for a header or footer? If the flag is
* VOLT_POLICY_GET_SECURE_MAIL_HEADER, calling for a header, if 0,
* calling for a footer.
* @param result The address where the function will deposit either the
* pointer to the allocated memory, the value, or else a NULL pointer
* if there is no value.
* @return an int, 0 if the function completed successfully or a
* non-zero error code.
*/
static int VOLT_CALLING_CONV HeaderFooterAlloc VOLT_PROTO_LIST ((
VoltPolicyCtx *ctx,
VoltLibCtx *libCtx,
unsigned int flag,
VtItem **result
));
/* Call this routine when the PolicyGetType is
* VOLT_POLICY_GET_MESSAGE_HEADER_INTERNAL.
* <p>If the policy has the value requested, this function will allocate
* space for a VtItem struct and the actual string data. The routine will
* deposit the pointer to the VtItem at the address given by result.
* <p>If there is no value, this function will return a NULL pointer at
* the address given by result.
* <p>The pointer at the address result must be initialized to NULL.
*
* @param ctx The policy context to use.
* @param libCtx The libCtxt to use.
* @param result The address where the function will deposit either the
* pointer to the allocated memory, the value, or else a NULL pointer
* if there is no value.
* @return an int, 0 if the function completed successfully or a
* non-zero error code.
*/
static int VOLT_CALLING_CONV MessageHeaderInternalAlloc VOLT_PROTO_LIST ((
VoltPolicyCtx *ctx,
VoltLibCtx *libCtx,
VtItem **result
));
/* Call this routine when the PolicyGetType is
* VOLT_POLICY_GET_MESSAGE_HEADER_EXTERNAL.
* <p>If the policy has the value requested, this function will allocate
* space for a VtItem struct and the actual string data. The routine will
* deposit the pointer to the VtItem at the address given by result.
* <p>If there is no value, this function will return a NULL pointer at
* the address given by result.
* <p>The pointer at the address result must be initialized to NULL.
*
* @param ctx The policy context to use.
* @param libCtx The libCtxt to use.
* @param result The address where the function will deposit either the
* pointer to the allocated memory, the value, or else a NULL pointer
* if there is no value.
* @return an int, 0 if the function completed successfully or a
* non-zero error code.
*/
static int VOLT_CALLING_CONV MessageHeaderExternalAlloc VOLT_PROTO_LIST ((
VoltPolicyCtx *ctx,
VoltLibCtx *libCtx,
VtItem **result
));
/* Call this routine when the PolicyGetType is
* VOLT_POLICY_GET_ZERO_DOWNLOAD_TEMPLATE.
* <p>If the policy has the value requested, this function will allocate
* space for a VtItem struct and the actual string data. The routine will
* deposit the pointer to the VtItem at the address given by result.
* <p>If there is no value, this function will return a NULL pointer at
* the address given by result.
* <p>The pointer at the address result must be initialized to NULL.
*
* @param ctx The policy context to use.
* @param libCtx The libCtxt to use.
* @param result The address where the function will deposit either the
* pointer to the allocated memory, the value, or else a NULL pointer
* if there is no value.
* @return an int, 0 if the function completed successfully or a
* non-zero error code.
*/
static int VOLT_CALLING_CONV ZdrTemplateAlloc VOLT_PROTO_LIST ((
VoltPolicyCtx *ctx,
VoltLibCtx *libCtx,
VtItem **result
));
/* Call this routine when the PolicyGetType is
* VOLT_POLICY_GET_ZDM2_TEMPLATE.
* <p>If the policy has the value requested, this function will allocate
* space for a VtItem struct and the actual string data. The routine will
* deposit the pointer to the VtItem at the address given by result.
* <p>If there is no value, this function will return a NULL pointer at
* the address given by result.
* <p>The pointer at the address result must be initialized to NULL.
*
* @param ctx The policy context to use.
* @param libCtx The libCtxt to use.
* @param result The address where the function will deposit either the
* pointer to the allocated memory, the value, or else a NULL pointer
* if there is no value.
* @return an int, 0 if the function completed successfully or a
* non-zero error code.
*/
static int VOLT_CALLING_CONV Zdm2TemplateAlloc VOLT_PROTO_LIST ((
VoltPolicyCtx *ctx,
VoltLibCtx *libCtx,
VtItem **result
));
/* Call this routine when the PolicyGetType is
* VOLT_POLICY_GET_HMTL_MESSAGE_BODY_TEMPLATE.
* <p>If the policy has the value requested, this function will allocate
* space for a VtItem struct and the actual string data. The routine will
* deposit the pointer to the VtItem at the address given by result.
* <p>If there is no value, this function will return a NULL pointer at
* the address given by result.
* <p>The pointer at the address result must be initialized to NULL.
*
* @param ctx The policy context to use.
* @param libCtx The libCtxt to use.
* @param result The address where the function will deposit either the
* pointer to the allocated memory, the value, or else a NULL pointer
* if there is no value.
* @return an int, 0 if the function completed successfully or a
* non-zero error code.
*/
static int VOLT_CALLING_CONV HTMLMessageBodyTemplateAlloc VOLT_PROTO_LIST ((
VoltPolicyCtx *ctx,
VoltLibCtx *libCtx,
VtItem **result
));
/* Call this routine when the PolicyGetType is
* VOLT_POLICY_GET_ENCRYPT_RULES.
* <p>If the policy has the value requested, this function will allocate
* space for a VtItem struct and the actual string data. The routine will
* deposit the pointer to the VtItem at the address given by result.
* <p>If there is no value, this function will return a NULL pointer at
* the address given by result.
* <p>The pointer at the address result must be initialized to NULL.
*
* @param ctx The policy context to use.
* @param libCtx The libCtxt to use.
* @param result The address where the function will deposit either the
* pointer to the allocated memory, the value, or else a NULL pointer
* if there is no value.
* @return an int, 0 if the function completed successfully or a
* non-zero error code.
*/
static int VOLT_CALLING_CONV EncryptRulesAlloc VOLT_PROTO_LIST ((
VoltPolicyCtx *ctx,
VoltLibCtx *libCtx,
VtItem **result
));
/* Call this routine when the PolicyGetType is
* VOLT_POLICY_GET_DEFAULT_ZDR_LOCATION.
* <p>If the policy has the value requested, this function will allocate
* space for a VtItem struct and the actual string data. The routine will
* deposit the pointer to the VtItem at the address given by result.
* <p>If there is no value, this function will return a NULL pointer at
* the address given by result.
* <p>The pointer at the address result must be initialized to NULL.
*
* @param ctx The policy context to use.
* @param libCtx The libCtxt to use.
* @param result The address where the function will deposit either the
* pointer to the allocated memory, the value, or else a NULL pointer
* if there is no value.
* @return an int, 0 if the function completed successfully or a
* non-zero error code.
*/
static int VOLT_CALLING_CONV DefaultZdrLocationAlloc VOLT_PROTO_LIST ((
VoltPolicyCtx *ctx,
VoltLibCtx *libCtx,
VtItem **result
));
/* Call this routine when the PolicyGetType is
* VOLT_POLICY_GET_DECRYPT_POLICY.
* <p>This function will allocate space for an int and set it to one of
* the following values.
* VOLT_DECRYPT_ON_VIEW
* VOLT_AUTO_DECRYPT
* <p>The pointer at the address result must be initialized to NULL.
*
* @param ctx The policy context to use.
* @param libCtx The libCtxt to use.
* @param result The address where the function will deposit the pointer
* to the int, the decrypt policy.
* @return an int, 0 if the function completed successfully or a
* non-zero error code.
*/
static int VOLT_CALLING_CONV DecryptPolicyAlloc VOLT_PROTO_LIST ((
VoltPolicyCtx *ctx,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -