summaryrefslogtreecommitdiff
path: root/cesar/cp/msg/inc/msg_cm.h
blob: 9307d91ee58191cc9b2d671e957fac4fda738b26 (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
86
87
88
/* Cesar project {{{
 *
 * Copyright (C) 2007 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    cp/msg/inc/msg_cm.h
 * \brief   MME messages of CM type
 * \ingroup cp_msg
 */
#ifndef MSG_CM_H_
#define MSG_CM_H_

#include "cp/cp_types.h"
#include "cp/interf/inc/interf_types.h"
#include "cp/msg/msg.h"
#include "cp/secu/secu.h"

//#include "cp/msg/inc/msg_cm_conn.h"
#include "cp/msg/inc/msg_cm_convert.h"


typedef struct cm_unassociated_sta_t // 11.5.1
{
    // TODO : set the real types
    nid_t  nid;
    u8  cco_capability;
} __attribute__ ((packed)) cm_unassociated_sta_t;

typedef struct cm_encrypted_payload_t // 11.5.2
{
    peks_t peks;
    u8 avln_status;
    u8 pid;
    u16 prn;
    u8 pmn;   
    u8 iv[16];
    u16 len;
    u8 rf[15];  
} __attribute__ ((packed)) cm_encrypted_payload_t;

typedef struct cm_encrypted_payload_sub_t // 11.5.2
{
    u32 crc;
    u8 pid;
    u16 prn;
    u8 pmn;
    u8 padding[15];
    u8 rf_len;
} __attribute__ ((packed)) cm_encrypted_payload_sub_t;

typedef struct cm_set_key_req_t
{
    u8 key_type;
    u32 my_nonce;
    u32 your_nonce;
    u8 pid;
    u16 prn;
    u8 pmn;
    u8 cco_capa;
    //nid_t nid;
    u8 nid[7];
    u8 new_eks;
    u8 new_key[16];
} __attribute__ ((packed)) cm_set_key_req_t;

void
msg_cm_init(void);

//void msg_cm_unassociated_sta_ind_send(interf_id_t interf_id, mac_adresse_t oda);
void 
msg_cm_unassociated_sta_ind_send(const mac_address_t oda);

void
msg_cm_encrypted_payload_ind_send(
                                const msg_mme_t *encapsulated_msg, 
                                const msg_param_t encapsulated_msg_param,
                                const tei_t tei,
                                const bool last_msg_of_p_run,
                                const cp_pid_t pid,
                                const u16 msg_size
                                );



#endif /*MSG_CM_H_*/