summaryrefslogtreecommitdiff
path: root/cp/msg/inc/msg_const.h
blob: 5cfb180946efcedb75566ff240737c8753db8b7e (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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
/* Cesar project {{{
 *
 * Copyright (C) 2007 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    cp/msg/inc/msg_const.h
 * \brief   constants of msg module
 * \ingroup cp_msg
 */
#ifndef MSG_CONST_H_
#define MSG_CONST_H_

#include "mac/sar/inc/sar_mf.h"
#include "cp/cp_types.h"


/*
 * Homeplug AV constantes
 */
#define MSG_VLAN_TAG            0       // TBD
#define MSG_MTYPE               0xE188  // 11.1
#define MSG_MME_HEADER_SIZE     23
/*
 * Familles et numéros de message
 */
#define MSG_CC_START    0x0000
#define MSG_CC_STOP     0x005B

#define MSG_CP_START    0x2000
#define MSG_CP_STOP     0x200B

#define MSG_NN_START    0x4000
#define MSG_NN_STOP     0x4013

#define MSG_CM_START    0x6000
#define MSG_CM_STOP     0x604F

#define MSG_UNKNOW      0xFFFF

typedef enum msg_mme_dest_t { MSG_STA, MSG_CCO } msg_mme_dest_t;

/*
 * mm type constants
 * take care of the following :
 * according to Intellon technical reference manual of Homeplug AV firmware p9,
 * the two LSB value of messages should be :
 *      0b00 for REQ
 *      0b01 for CNF
 *      0b10 for IND
 *      0b11 for RSP
 * this is very unclear in the Homeplug AV specification v1.0.10
 */
typedef enum mm_type_t
{
    CC_CCO_APPOINT_REQ          = 0x0000,
    CC_CCO_APPOINT_CNF          = 0x0001,
    CC_BACKUP_APPOINT_REQ       = 0x0004,
    CC_BACKUP_APPOINT_CNF       = 0x0005,
    CC_LINK_INFO_REQ            = 0x0008,
    CC_LINK_INFO_CNF            = 0x0009,
    CC_LINK_INFO_IND            = 0x000A,
    CC_LINK_INFO_RSP            = 0x000B,
    CC_HANDOVER_REQ             = 0x000C,
    CC_HANDOVER_CNF             = 0x000D,
    CC_HANDOVER_INFO_IND        = 0x0010,
    CC_HANDOVER_INFO_RSP        = 0x0011,
    CC_DISCOVER_LIST_REQ        = 0x0014,
    CC_DISCOVER_LIST_CNF        = 0x0015,
    CC_DISCOVER_LIST_IND        = 0x0016,
    CC_LINK_NEW_REQ             = 0x0018,
    CC_LINK_NEW_CNF             = 0x0019,
    CC_LINK_MOD_REQ             = 0x001C,
    CC_LINK_MOD_CNF             = 0x001D,
    CC_LINK_SQZ_REQ             = 0x0020,
    CC_LINK_SQZ_CNF             = 0x0021,
    CC_LINK_REL_REQ             = 0x0024,
    CC_LINK_REL_IND             = 0x0025,
    CC_DETECT_REPORT_REQ        = 0x0028,
    CC_DETECT_REPORT_CNF        = 0x0029,
    CC_WHO_RU_REQ               = 0x002C,
    CC_WHO_RU_CNF               = 0x002D,
    CC_ASSOC_REQ                = 0x0030,
    CC_ASSOC_CNF                = 0x0031,
    CC_LEAVE_REQ                = 0x0034,
    CC_LEAVE_CNF                = 0x0035,
    CC_LEAVE_IND                = 0x0036,
    CC_LEAVE_RSP                = 0x0037,
    CC_SET_TEI_MAP_REQ          = 0x0038,
    CC_SET_TEI_MAP_IND          = 0x0039,
    CC_RELAY_REQ                = 0x003C,
    CC_RELAY_IND                = 0x003D,
    CC_BEACON_RELIABILITY_REQ   = 0x0040,
    CC_BEACON_RELIABILITY_CNF   = 0x0041,
    CC_ALLOC_MOVE_REQ           = 0x0044,
    CC_ALLOC_MOVE_CNF           = 0x0045,
    CC_ACCESS_NEW_REQ           = 0x0048,
    CC_ACCESS_NEW_CNF           = 0x0049,
    CC_ACCESS_NEW_IND           = 0x004A,
    CC_ACCESS_NEW_RSP           = 0x004B,
    CC_ACCESS_REL_REQ           = 0x004C,
    CC_ACCESS_REL_CNF           = 0x004D,
    CC_ACCESS_REL_IND           = 0x004E,
    CC_ACCESS_REL_RSP           = 0x004F,
    CC_DCPPC_IND                = 0x0052,
    CC_DCPPC_RSP                = 0x0053,
    CC_HP1_DET_REQ              = 0x0054,
    CC_HP1_DET_CNF              = 0x0055,
    CC_BLE_UPDATE_IND           = 0x0058,
    
    CP_PROXY_APPOINT_REQ        = 0x2000,
    CP_PROXY_APPOINT_CNF        = 0x2001,
    PH_PROXY_APPOINT_IND        = 0x2006,
    CP_PROXY_WAKE_REQ           = 0x2008,
    
    NN_INL_REQ                  = 0x4000,
    NN_INL_CNF                  = 0x4001,
    NN_NEW_REQ                  = 0x4004,
    NN_NEW_CNF                  = 0x4005,
    NN_NEW_IND                  = 0x4006,
    NN_ADD_ALLOC_REQ            = 0x4008,
    NN_ADD_ALLOC_CNF            = 0x4009,
    NN_ADD_ALLOC_IND            = 0x400A,
    NN_REL_ALLOC_REQ            = 0x400C,
    NN_REL_ALLOC_CNF            = 0x400D,
    NN_REL_NET_IND              = 0x4013,
    
    CM_UNASSOCIATED_STA_IND     = 0x6003,
    CM_ENCRYPTED_PAYLOAD_IND    = 0x6006,
    CM_ENCRYPTED_PAYLOAD_RSP    = 0x6007,
    CM_SET_KEY_REQ              = 0x6008,
    CM_SET_KEY_CNF              = 0x6009,
    CM_GET_KEY_REQ              = 0x600C,
    CM_GET_KEY_CNF              = 0x600D,
    CM_SC_JOIN_REQ              = 0x6010,
    CM_SC_JOIN_CNF              = 0x6011,
    CM_CHAN_EST_IND             = 0x6016,
    CM_TM_UPDATE_IND            = 0x6020,
    CM_AMP_MAP_REQ              = 0x601C,
    CM_AMP_MAP_CNF              = 0x601D,
    CM_BRG_INFO_REQ             = 0x6020,
    CM_BRG_INFO_CNF             = 0x6021,
    CM_CONN_NEW_REQ             = 0x6024,
    CM_CONN_NEW_CNF             = 0x6025,
    CM_CONN_REL_IND             = 0x602A,
    CM_CONN_REL_RSP             = 0x602B,
    CM_CONN_MOD_REQ             = 0x602C,
    CM_CONN_MOD_CNF             = 0x602D,
    CM_CONN_INFO_REQ            = 0x6030,
    CM_CONN_INFO_CNF            = 0x6031,
    CM_STA_CAP_REQ              = 0x6034,
    CM_STA_CAP_CNF              = 0x6035,
    CM_NW_INFO_REQ              = 0x6038,
    CM_NW_INFO_CNF              = 0x6039,
    CM_GET_BEACON_REQ           = 0x603C,
    CM_GET_BEACON_CNF           = 0x603D,
    CM_HFID_REQ                 = 0x6040,
    CM_HFID_CNF                 = 0x6041,
    CM_MME_ERROR_IND            = 0x6046,
    CM_NW_STATS_REQ             = 0x6048,
    CM_NW_STATS_CNF             = 0x6049,
    CM_LINK_STATS_REQ           = 0x604C,
    CM_LINK_STATS_CNF           = 0x604D
} __attribute__ ((packed)) mm_type_t;

/*
 * types of messages
 */
typedef struct msg_fmi_t // Table 11-178
{
    u8 nf_mi :4;    // Number of fragments for message
    u8 fn_mi :4;    // fragment number
    u8 fmsn;        // fragmentation message sequence number 
} msg_fmi_t;

typedef struct msg_mme_t // Table 11-178
{
    mac_adresse_t oda;      // original destination adress
    mac_adresse_t osa;      // original source adress
    u32 v_lan_tag;          // ieee 802.1 tag (optional)
    u16 m_type;             // const = 0x88E1
    u8 mmv;                 // management message version
    mm_type_t mm_type;      // management message type
    msg_fmi_t fmi;
    u8 mm_entry[SAR_MSDU_PAYLOAD_MAX_SIZE - MSG_MME_HEADER_SIZE];
} __attribute__ ((packed)) msg_mme_t;

typedef struct msg_list_mme_t
{
    u8 msg_mame[30]; // Message Name
    msg_mme_dest_t msg_dest; // prefered destination (default if STA)       
    int (*msg_func) (msg_mme_t msg[]); // Function processing the message
} msg_list_mme_t;




#endif /*MSG_CONST_H_*/