89 lines
2.7 KiB
C
89 lines
2.7 KiB
C
|
/****************************************************************************
|
||
|
|
||
|
Copyright(c) 2019 by Aerospace C.Power (Chongqing) Microelectronics. ALL RIGHTS RESERVED.
|
||
|
|
||
|
This Information is proprietary to Aerospace C.Power (Chongqing) Microelectronics and MAY NOT
|
||
|
be copied by any method or incorporated into another program without
|
||
|
the express written consent of Aerospace C.Power. This Information or any portion
|
||
|
thereof remains the property of Aerospace C.Power. The Information contained herein
|
||
|
is believed to be accurate and Aerospace C.Power assumes no responsibility or
|
||
|
liability for its use in any way and conveys no license or title under
|
||
|
any patent or copyright and makes no representation or warranty that this
|
||
|
Information is free from patent or copyright infringement.
|
||
|
|
||
|
****************************************************************************/
|
||
|
|
||
|
#ifndef CVG_SEC_AUTH_DAK_H
|
||
|
#define CVG_SEC_AUTH_DAK_H
|
||
|
|
||
|
/* os shim includes */
|
||
|
#include "os_types.h"
|
||
|
|
||
|
/* public api includes */
|
||
|
#include "cvg_api.h"
|
||
|
#include "plc_fr.h"
|
||
|
|
||
|
/* cvg module internal includes */
|
||
|
#include "cvg.h"
|
||
|
|
||
|
#ifdef __cplusplus
|
||
|
extern "C" {
|
||
|
#endif
|
||
|
|
||
|
#if (PLC_SUPPORT_AUTH_TYPE == PLC_AUTH_TYPE_DAK)
|
||
|
|
||
|
/*
|
||
|
* @brief cvg_sec_auth_add_dak() - add authrize dak into dak-mac pair list
|
||
|
* table
|
||
|
* @param vdev: the vdev to be set
|
||
|
* @param cnt: number of dak-mac pair to be added
|
||
|
* @param dak_pair: dak-mac pair array
|
||
|
*
|
||
|
* return:
|
||
|
* 0 -- for success case
|
||
|
* otherwise -- error code
|
||
|
*/
|
||
|
uint8_t cvg_sec_auth_add_dak(cvg_vdev_t *vdev, uint16_t cnt,
|
||
|
iot_plc_dak_mac_pair_t *dak_pair);
|
||
|
|
||
|
/*
|
||
|
* @brief cvg_sec_auth_rm_dak() - delete authrize dak from dak-mac pair
|
||
|
* list table
|
||
|
* @param vdev: the vdev to be set
|
||
|
* @param cnt: number of dak-mac pair to be deleted
|
||
|
* @param dak_pair: dak-mac pair array
|
||
|
*
|
||
|
* return:
|
||
|
* 0 -- for success case
|
||
|
* otherwise -- error code
|
||
|
*/
|
||
|
uint8_t cvg_sec_auth_rm_dak(cvg_vdev_t *vdev, uint16_t cnt,
|
||
|
iot_plc_dak_mac_pair_t *dak_pair);
|
||
|
|
||
|
/*
|
||
|
* @brief cvg_sec_auth_rm_all_dak() - delete all authrize dak from dak-mac pair
|
||
|
* list table
|
||
|
* @param vdev: the vdev to be set
|
||
|
*
|
||
|
* return:
|
||
|
* 0 -- for success case
|
||
|
* otherwise -- error code
|
||
|
*/
|
||
|
uint8_t cvg_sec_auth_rm_all_dak(cvg_vdev_t *vdev);
|
||
|
|
||
|
#else /* (PLC_SUPPORT_AUTH_TYPE == PLC_AUTH_TYPE_DAK) */
|
||
|
|
||
|
#define cvg_sec_auth_add_dak(vdev, cnt, dak_pair) (ERR_NOSUPP)
|
||
|
|
||
|
#define cvg_sec_auth_rm_dak(vdev, cnt, dak_pair) (ERR_NOSUPP)
|
||
|
|
||
|
#define cvg_sec_auth_rm_all_dak(vdev) (ERR_NOSUPP)
|
||
|
|
||
|
#endif /* (PLC_SUPPORT_AUTH_TYPE == PLC_AUTH_TYPE_DAK) */
|
||
|
|
||
|
#ifdef __cplusplus
|
||
|
}
|
||
|
#endif
|
||
|
|
||
|
#endif /* CVG_SEC_AUTH_DAK_H */
|