p≡p engine
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

96 lines
2.3 KiB

/**
* @file map_asn1.h
* @brief map asn1 to pEp structs and back
* @license GNU General Public License 3.0 - see LICENSE.txt
*/
#ifndef MAP_ASN1_H
#define MAP_ASN1_H
#include "pEpEngine.h"
#include "identity_list.h"
#include "../asn.1/Identity.h"
#include "../asn.1/IdentityList.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* <!-- Identity_from_Struct() -->
*
* @brief Convert pEp_identity into ASN.1 Identity_t
*
* @param ident[in] pEp_identity to convert
* @param result[in,out] Identity_t to update or NULL to alloc a new one
*
* @retval pointer to updated or allocated result
*
* @warning if a new struct is allocated, the ownership goes to the caller
*
*/
Identity_t *Identity_from_Struct(
const pEp_identity *ident,
Identity_t *result
);
/**
* <!-- Identity_to_Struct() -->
*
* @brief Convert ASN.1 Identity_t into pEp_identity
*
* @param ident[in] Identity_t to convert
* @param result[inout] pEp_identity to update or NULL to alloc a new one
*
* @retval pointer to updated or allocated result
*
* @warning if a new struct is allocated, the ownership goes to the caller
*
*/
pEp_identity *Identity_to_Struct(Identity_t *ident, pEp_identity *result);
/**
* <!-- IdentityList_from_identity_list() -->
*
* @brief Convert identity_list_t into ASN.1 IdentityList_t
*
* @param list[in] identity_list to convert
* @param result[inout] IdentityList_t to update or NULL to alloc a new one
*
* @retval pointer to updated or allocated result
*
* @warning if a new struct is allocated, the ownership goes to the caller
*
*/
IdentityList_t *IdentityList_from_identity_list(
const identity_list *list,
IdentityList_t *result
);
/**
* <!-- IdentityList_to_identity_list() -->
*
* @brief Convert ASN.1 IdentityList_t to identity_list_t
*
* @param list[in] ASN.1 IdentityList_t to convert
* @param result[inout] identity_list_t to update or NULL to alloc a new one
*
* @retval pointer to updated or allocated result
*
* @warning if a new struct is allocated, the ownership goes to the caller
*
*/
identity_list *IdentityList_to_identity_list(IdentityList_t *list, identity_list *result);
#ifdef __cplusplus
}
#endif
#endif