summaryrefslogtreecommitdiff
path: root/cesar/cp/secu/inc/secu_p_run.h
blob: 0d0444bd60640bfa669e4ab11d2fad2c87f9f220 (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
/* Cesar project {{{
 *
 * Copyright (C) 2007 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    cp/secu/seculib.h
 * \brief   All functions related to protocolrun
 * \ingroup cp_secu
 */
#ifndef SECU_PRUN_H_
#define SECU_PRUN_H_

#include "cp/secu/secu.h"


void
secu_p_run_init(void);

/**
 * nonce generation
 * \param p_sec         station security context
 * \return error code or 0 if success
 */
void
secu_gen_nonce (const tei_t tei);


/**
 * Re-init protocol run parameters
 * \param p_sec         security context of station or CCO
 * \param PID           PID of the  futur protocol run
 * \return              error code or 0 if success
 */
void
secu_start_new_protocol_run(const tei_t tei, const cp_pid_t pid, protocol_run_t *p_run);

/**
 * Check parameters of received protocol run
 * \param p_sec         security context of station or CCO
 * \param to_check      the parameters to check
 * \return              error code or 0 if success
 */
E_ErrCode 
secu_check_protocol_run_param (const tei_t tei, const protocol_run_t to_check);

/**
 * generate parameters of the received protocol run
 * \param p_sec         security context of station or CCO
 * \param gen           the generated parameters
 * \param last_msg      set true if this is the last message of the protocol run
 * \return              error code or 0 if success
 */
E_ErrCode
secu_gen_protocol_run_param (const tei_t tei, const bool last_msg, protocol_run_t *gen);


#endif /*SECU_PRUN_H_*/