TSCH: add brief API explanations (tsch-security.h)
This commit is contained in:
parent
9ef28c7eae
commit
38ff8e5283
1 changed files with 15 additions and 1 deletions
|
@ -118,10 +118,24 @@
|
||||||
typedef uint8_t aes_key[16];
|
typedef uint8_t aes_key[16];
|
||||||
|
|
||||||
/********** Functions *********/
|
/********** Functions *********/
|
||||||
|
/**
|
||||||
|
* \brief Return MIC length
|
||||||
|
* \return The length of MIC (>= 0)
|
||||||
|
*/
|
||||||
int tsch_security_mic_len(const frame802154_t *frame);
|
int tsch_security_mic_len(const frame802154_t *frame);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Protect a frame with encryption and/or MIC
|
||||||
|
* \return The length of a generated MIC (>= 0)
|
||||||
|
*/
|
||||||
int tsch_security_secure_frame(uint8_t *hdr, uint8_t *outbuf,
|
int tsch_security_secure_frame(uint8_t *hdr, uint8_t *outbuf,
|
||||||
int hdrlen, int datalen, struct asn_t *asn);
|
int hdrlen, int datalen, struct asn_t *asn);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Parse and check a frame protected with encryption and/or MIC
|
||||||
|
* \retval 0 On error or security check failure (insecure frame)
|
||||||
|
* \retval 1 On success or no need for security check (good frame)
|
||||||
|
*/
|
||||||
int tsch_security_parse_frame(const uint8_t *hdr, int hdrlen, int datalen,
|
int tsch_security_parse_frame(const uint8_t *hdr, int hdrlen, int datalen,
|
||||||
const frame802154_t *frame, const linkaddr_t *sender, struct asn_t *asn);
|
const frame802154_t *frame, const linkaddr_t *sender, struct asn_t *asn);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue