summaryrefslogtreecommitdiff
path: root/digital/zigbit/bitcloud/stack/Components/ZDO/include/zdoSecurityManager.h
blob: fb093ec913f43372d54048f04668b20b7af56c28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/************************************************************************//**
  \file zdoSecurityManager.h

  \brief The header file describes the constants, types and internal interface
  of ZDO security manager

  \author
    Atmel Corporation: http://www.atmel.com \n
    Support email: avr@atmel.com

  Copyright (c) 2008-2011, Atmel Corporation. All rights reserved.
  Licensed under Atmel's Limited License Agreement (BitCloudTM).

  \internal
    History:
******************************************************************************/

#ifndef _ZDOSECURITYMANAGER_H
#define _ZDOSECURITYMANAGER_H

/******************************************************************************
                    Includes section
******************************************************************************/
#include <appTimer.h>
#include <zdo.h>

/******************************************************************************
                    Types section
******************************************************************************/
typedef enum
{
  ZDO_IDLE_SECURITY_STATE,
  ZDO_NORMAL_OPERATING_SECURITY_STATE,
  ZDO_WAITING_ESTABLISH_KEY_SECURITY_STATE,
  ZDO_WAITING_TRANSPORT_KEY_SECURITY_STATE,
  ZDO_WAITING_PARENT_AUTHENTICATION_SECURITY_STATE,
  ZDO_WAITING_CHILD_AUTHENTICATION_SECURITY_STATE,
  ZDO_APP_KEY_ESTABLISH_RESPONDER_SECURITY_STATE,
  ZDO_APP_KEY_ESTABLISH_INITIATOR_SECURITY_STATE,
  ZDO_STARTING_NORMAL_OPERATING_SECURITY_STATE,
  ZDO_FAIL_CONFIRM_SECURITY_STATE,
  ZDO_CONFIRM_APP_KEY_SECURITY_STATE,
  ZDO_WAITING_APP_KEY_SECURITY_STATE,
  ZDO_WAITING_TC_LINK_KEY_SECURITY_STATE,
} ZdoSecurityManagerState_t;

typedef struct
{
  ZdoSecurityManagerState_t state;
#ifdef _SECURITY_
  HAL_AppTimer_t             waitTimer;
  HAL_AppTimer_t             delayTimer;
  uint8_t                    newKeySeqNum;
#ifdef _LINK_SECURITY_ 
  union
  {
    APS_AuthenticateReq_t    apsAuthenticateReq;
#ifdef _HI_SECURITY_ 
    APS_EstablishKeyReq_t    apsEstablishKeyReq;
#endif // _HI_SECURITY_ 
#ifdef _CUSTOM_4_SECURITY_MODE_
  APS_RequestKeyReq_t        apsRequestKeyReq;
#endif // _CUSTOM_4_SECURITY_MODE_
  };
#ifdef _HI_SECURITY_ 
  APS_EstablishKeyResp_t     apsEstablishKeyResp;
#endif // _HI_SECURITY_ 
  ZDO_EndToEndAppKeyReq_t   *appKeyReq;
#endif // _LINK_SECURITY_ 
#endif // _SECURITY_
} ZdoSecurityManager_t;

/******************************************************************************
                    Prototypes section
******************************************************************************/
void zdoResetSecurityManager(void);
void zdoAuthenticationStart(void);
void zdoAuthenticationConf(ZDO_Status_t status);
uint8_t ZDO_GetPreconfiguredStatus(void);
void zdoAuthenticateChild(const ExtAddr_t *childAddr);
void zdoSecurityManagerHandler(void);

#endif // _ZDOSECURITYMANAGER_H

// eof zdoSecurityManager.h