summaryrefslogtreecommitdiffhomepage
path: root/digital/zigbit/bitcloud/stack/Components/NWK/include/private/nwkTxSecurity.h
blob: fc9d0120046e83611d110365cb25ae39c8ee1e3b (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
/**************************************************************************//**
  \file nwkTxSecurity.h

  \brief Interface of transmission security.

  \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:
    2009-08-31 M. Gekk - Created.
   Last change:
    $Id: nwkTxSecurity.h 17721 2011-06-27 10:38:42Z mgekk $
 ******************************************************************************/
#if !defined _NWK_TX_SECURITY_H
#define _NWK_TX_SECURITY_H

#if defined _SECURITY_
/******************************************************************************
                               Includes section
 ******************************************************************************/
#include <nwkConfig.h>
#include <mac.h>
#include <sspSfp.h>
#include <nwkTx.h>

/******************************************************************************
                              Prototypes section
 ******************************************************************************/
/**************************************************************************//**
  \brief Check of that enciphering for a proceeding network packet is required.

  \param[in] outPkt - pointer to a network output packet.
  \return 'true' if encrypting is required otherwise 'false'
 ******************************************************************************/
NWK_PRIVATE bool nwkIsEncryptingRequired(NwkOutputPacket_t *const outPkt);

/**************************************************************************//**
  \brief Request to encrypt an output network packet.

  \param[in] encryptReq - encrypt frame primitive's parameters structure.
  \param[in] macDataReq - MCPS-DATA request primitive's parameters structure.
  \return None.
 ******************************************************************************/
NWK_PRIVATE void nwkEncryptOutputPacket(SSP_EncryptFrameReq_t *const encryptReq,
  const MAC_DataReq_t *const macDataReq);

/**************************************************************************//**
  \brief Request to decrypt an output network packet.

  \param[in] decryptReq - decrypt frame primitive's parameters structure.
  \param[in] macDataReq - MCPS-DATA request primitive's parameters structure.
  \return None.
 ******************************************************************************/
NWK_PRIVATE void nwkDecryptOutputPacket(SSP_DecryptFrameReq_t *const decryptReq,
  const MAC_DataReq_t *const macDataReq);

#else /* _SECURITY_ */

#define nwkIsEncryptingRequired(outPkt) false
#define nwkIsDecryptingRequired(outPkt) false

#endif /* _SECURITY_ */
#endif /* _NWK_TX_SECURITY_H */
/** eof nwkTxSecurity.h */