summaryrefslogtreecommitdiff
path: root/cesar/cp2/msg/test/src/msg_cc.c
blob: 370dfde18e8231a4d95ed230a016431612d99a0b (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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
/* Cesar project {{{
 *
 * Copyright (C) 2008 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    cp2/msg/test/src/msg_cc.c
 * \brief   Test the MSG_CC Family functions.
 * \ingroup cp2_msg
 *
 */
#include "common/std.h"

#include "common/defs/ethernet.h"
#include "common/defs/homeplugAV.h"

#include "lib/test.h"
#include "lib/swap.h"
#include "lib/bitstream.h"

#include "cp2/cp.h"
#include "cp2/msg/msg.h"
#include "cp2/sta/mgr/sta_mgr.h"
#include "cp2/sta/mgr/sta_own_data.h"

#include "cp2/inc/context.h"
#include "cp2/msg/inc/msg.h"

#include "stdio.h"

struct mme_header_t
{
    mac_t oda;
    mac_t osa;
    uint vlan;
    uint mtype;
    uint mmv;
    cp_mmtype_t mmtype;
    uint fmi_inf;
    uint fmi_mi;
    uint fmi_ssn;
};
typedef struct mme_header_t mme_header_t;

static u8 buffer[2048] __attribute__((aligned(2048)));
cp_t cp;
mac_config_t mac_config;
bitstream_t stream;
mme_header_t header;
mac_t own_mac_addr = 0x123456789ABCull;

mme_header_t expected;
test_t test;

static void
test_read_header (bool vlan_present)
{
    bitstream_init (&stream, buffer, 1518, BITSTREAM_READ);

    bitstream_access (&stream, &header.oda, 48);
    bitstream_access (&stream, &header.osa, 48);
    if (vlan_present)
        bitstream_access (&stream, &header.vlan, 32);
    bitstream_access (&stream, &header.mtype, 16);
    header.mtype = swap16 (header.mtype);
    bitstream_access (&stream, &header.mmv, 8);
    bitstream_access (&stream, &header.mmtype, 16);
    bitstream_access (&stream, &header.fmi_inf, 4);
    bitstream_access (&stream, &header.fmi_mi, 4);
    bitstream_access (&stream, &header.fmi_ssn, 8);

    test_begin (test, "Header")
    {
        test_fail_if (header.oda != expected.oda, "Wrong dest mac address");
        test_fail_if (header.osa != expected.osa, "Wrong source mac address");
        test_fail_if (header.mtype != HPAV_MTYPE_MME,
                      "Wrong MTYPE");
        test_fail_if (header.mmv != HPAV_MMV, "Wrong source mac address");
        test_fail_if (header.mmtype != expected.mmtype,
                      "Wrong MMTYPE");
        test_fail_if (header.fmi_inf != expected.fmi_inf, "Wrong FMI");
        test_fail_if (header.fmi_mi != expected.fmi_mi, "Wrong FMI ni");
        test_fail_if (header.fmi_ssn != expected.fmi_ssn, "Wrong FMI SSN");
    }
    test_end;
}

void
test_case_msg_cc_who_ru (void)
{
    cp_mme_peer_t peer;
    cp_nid_t nid;
    u64 data;
    cp_mme_rx_t *mme;
    cp_msg_cc_who_ru_cnf_t cnf;
    cp_sta_own_data_t *own_data;
    u8 hfid[CP_HFID_SIZE+1];
    uint i;

    test_case_begin (test, "CC_WHO_RU.REQ : Send");

    peer.mac = 0x23456789ABCDull;
    peer.vlan_tag = 0x0;
    peer.tei = 0xA;
    peer.all_sta = false;

    nid = 0x123456789ABCDEull;

    cp_msg_cc_who_ru_req_send (&cp, &peer, nid);

    expected.oda = peer.mac;
    expected.osa = own_mac_addr;
    expected.mmtype = CC_WHO_RU_REQ;
    expected.fmi_inf = 0;
    expected.fmi_mi = 0;
    expected.fmi_ssn = 0;

    test_read_header (false);
    test_begin (test, "NID")
    {
        bitstream_access (&stream, &data, 56);
        test_fail_if (data != nid, "Wrong NID");
    }
    test_end;
    bitstream_finalise (&stream);

    test_case_begin (test, "CC_WHO_RU.REQ : Receive");

    mme = cp_msg_mme_read_header (&cp, buffer, 60, 0xA, (uint*) &data);
    cp_msg_cc_who_ru_req_receive (&cp, mme, &data);

    test_begin (test, "Verify")
    {
        test_fail_if (nid != data, "Wrong NID");
    }
    test_end;

    slab_release (mme);


    test_case_begin (test, "CC_WHO_RU.CNF : Send");

    cnf.nid = nid;
    cnf.cco_mac = own_mac_addr;
    strcpy (cnf.avln_hfid, "Hello world\0");
    cp_msg_cc_who_ru_cnf_send (&cp, &peer, &cnf);

    expected.mmtype = CC_WHO_RU_CNF;
    test_read_header (false);

    test_begin (test, "verify")
    {
        bitstream_access (&stream, &data, 56);
        test_fail_if (data != nid, "Wrong NID");
        bitstream_access (&stream, &data, 48);
        test_fail_if (data != own_mac_addr, "Wrong Mac @");

        for (i = 0; i < CP_HFID_SIZE; i++)
            bitstream_access (&stream, &hfid[i], 8);

        data = strcmp ((char *)hfid, "Hello world\0");
        test_fail_if (data != 0, "Wrong HFID");
    }
    test_end;


    test_case_begin (test, "CC_WHO_RU.CNF : Receive");
    own_data = cp_sta_mgr_get_sta_own_data (&cp);
    own_data->is_cco = true;

    mme = cp_msg_mme_read_header (&cp, buffer, 60, 0xA, (uint *) &data);
    cp_msg_cc_who_ru_cnf_receive (&cp, mme, &cnf);

    test_begin (test, "Verify")
    {
        test_fail_if (mme->mmtype != CC_WHO_RU_CNF, "Wrong MMTYPE");
        test_fail_if (cnf.nid != nid, "Wrong NID");
        test_fail_if (cnf.cco_mac != own_mac_addr, "Wrong mac @");
        data = strcmp (cnf.avln_hfid, "Hello world\0");
        test_fail_if (data != 0, "Wrong HFID");
    }
    test_end;

    slab_release (mme);
}

void
test_case_msg_cc_assoc (void)
{
    cp_mme_peer_t peer;
    u64 data;
    cp_nid_t nid;
    cp_snid_t snid;
    cp_mme_rx_t *mme;
    cp_msg_cc_assoc_req_t req;
    cp_msg_cc_assoc_cnf_t cnf;

    test_case_begin (test, "CC_ASSOC.REQ : Send");

    peer.mac = 0x23456789ABCDull;
    peer.vlan_tag = 0x0;
    peer.tei = 0x0;
    peer.all_sta = false;

    nid = 0x123456789ABCDull;
    snid = 0xf;

    req.request_type = CP_MSG_CC_ASSOC_REQ_TYPE_NEW;
    req.nid = nid;
    req.cco_cap = CP_CCO_LEVEL;
    req.proxy_cap = 1;

    cp_msg_cc_assoc_req_send (&cp, &peer, &req);

    expected.oda = peer.mac;
    expected.osa = own_mac_addr;
    expected.mmtype = CC_ASSOC_REQ;
    expected.fmi_inf = 0;
    expected.fmi_mi = 0;
    expected.fmi_ssn = 0;

    test_read_header (false);
    test_begin (test, "NID")
    {
        bitstream_access (&stream, &data, 8);
        test_fail_if (data != CP_MSG_CC_ASSOC_REQ_TYPE_NEW,
                      "Wrong request type");

        bitstream_access (&stream, &data, 56);
        test_fail_if (data != nid, "Wrong NID");

        bitstream_access (&stream, &data, 8);
        test_fail_if (data != req.cco_cap, "Wrong CCO cap");

        bitstream_access (&stream, &data, 8);
        test_fail_if (data != req.proxy_cap, "Wrong Proxy cap");
    }
    test_end;
    bitstream_finalise (&stream);

    test_case_begin (test, "CC_ASSOC.REQ : Receive");

    mme = cp_msg_mme_read_header (&cp, buffer, 60, 0xA, (uint *) &data);
    cp_msg_cc_assoc_req_receive (&cp, mme, &req);

    test_begin (test, "Verify")
    {
        test_fail_if (mme->mmtype != CC_ASSOC_REQ, "Wrong MMtype");
        test_fail_if (req.request_type != CP_MSG_CC_ASSOC_REQ_TYPE_NEW,
                      "Wrong request type");
        test_fail_if (req.nid != nid, "Wrong NID");
        test_fail_if (req.cco_cap != CP_CCO_LEVEL, "Wrong CCO cap");
        test_fail_if (req.proxy_cap != 1, "Wrong proxy type");
    }
    test_end;

    slab_release (mme);

    test_case_begin (test, "CC_ASSOC.CNF : SEND");

    cnf.result = CP_MSG_CC_ASSOC_CNF_RESULT_SUCCESS;
    cnf.nid = nid;
    cnf.snid = snid;
    cnf.sta_tei = 0xB;
    cnf.lease_time_min = 10;

    cp_msg_cc_assoc_cnf_send (&cp, &peer, &cnf);

    expected.oda = peer.mac;
    expected.osa = own_mac_addr;
    expected.mmtype = CC_ASSOC_CNF;
    expected.fmi_inf = 0;
    expected.fmi_mi = 0;
    expected.fmi_ssn = 0;

    test_read_header (false);
    test_begin (test, "SEND")
    {
        bitstream_access (&stream, &data, 8);
        test_fail_if (data != CP_MSG_CC_ASSOC_CNF_RESULT_SUCCESS,
                      "Wrong result type");

        bitstream_access (&stream, &data, 56);
        test_fail_if (data != nid, "Wrong NID");

        bitstream_access (&stream, &data, 8);
        test_fail_if (data != snid, "Wrong SNID");

        bitstream_access (&stream, &data, 8);
        test_fail_if (data != cnf.sta_tei, "Wrong TEI");

        bitstream_access (&stream, &data, 16);
        test_fail_if (data != cnf.lease_time_min, "Wrong Lease time");
    }
    test_end;
    bitstream_finalise (&stream);

    test_case_begin (test, "CC_ASSOC.CNF : Receive");

    mme = cp_msg_mme_read_header (&cp, buffer, 60, 0xA, (uint *) &data);
    cp_msg_cc_assoc_cnf_receive (&cp, mme, &cnf);

    test_begin (test, "Verify")
    {
        test_fail_if (mme->mmtype != CC_ASSOC_CNF, "Wrong MMtype");
        test_fail_if (cnf.result != CP_MSG_CC_ASSOC_CNF_RESULT_SUCCESS,
                      "Wrong result type");
        test_fail_if (cnf.nid != nid, "Wrong NID");
        test_fail_if (cnf.snid != snid , "Wrong SNID");
        test_fail_if (cnf.sta_tei != 0xB, "Wrong TEI");
        test_fail_if (cnf.lease_time_min != 10, "Wrong lease time");
    }
    test_end;

    slab_release (mme);
}

void
test_case_msg_cc_leave (void)
{
    cp_mme_peer_t peer;
    u64 data;
    cp_nid_t nid;
    cp_snid_t snid;
    cp_mme_rx_t *mme;
    uint reason;

    test_case_begin (test, "CC_LEAVE.REQ : Send");

    peer.mac = 0x23456789ABCDull;
    peer.vlan_tag = 0x0;
    peer.tei = 0x0;
    peer.all_sta = false;

    nid = 0x123456789ABCDull;
    snid = 0xf;

    reason = CP_MSG_CC_LEAVE_IND_REASON_TEI_LEASE_EXPIRED;
    cp_msg_cc_leave_req_send  (&cp, &peer, reason);

    expected.oda = peer.mac;
    expected.osa = own_mac_addr;
    expected.mmtype = CC_LEAVE_REQ;
    expected.fmi_inf = 0;
    expected.fmi_mi = 0;
    expected.fmi_ssn = 0;

    test_read_header (false);
    test_begin (test, "Verify")
    {
        bitstream_access (&stream, &data, 8);
        test_fail_if (data != reason,
                      "Wrong reason type");
    }
    test_end;
    bitstream_finalise (&stream);

    test_case_begin (test, "CC_LEAVE.REQ : Receive");

    mme = cp_msg_mme_read_header (&cp, buffer, 60, 0xA, (uint *) &data);
    cp_msg_cc_leave_req_receive (&cp, mme, &reason);

    test_begin (test, "Verify")
    {
        test_fail_if (mme->mmtype != CC_LEAVE_REQ, "Wrong MMtype");
        test_fail_if (reason != CP_MSG_CC_LEAVE_IND_REASON_TEI_LEASE_EXPIRED,
                      "Wrong request type");
    }
    test_end;

    slab_release (mme);

    test_case_begin (test, "CC_LEAVE.IND : SEND");

    cp_msg_cc_leave_ind_send (&cp, &peer, reason, nid);

    expected.oda = peer.mac;
    expected.osa = own_mac_addr;
    expected.mmtype = CC_LEAVE_IND;
    expected.fmi_inf = 0;
    expected.fmi_mi = 0;
    expected.fmi_ssn = 0;

    test_read_header (false);
    test_begin (test, "SEND")
    {
        bitstream_access (&stream, &data, 8);
        test_fail_if (data != CP_MSG_CC_LEAVE_IND_REASON_TEI_LEASE_EXPIRED,
                      "Wrong reason");

        bitstream_access (&stream, &data, 56);
        test_fail_if (data != nid, "Wrong NID");
    }
    test_end;
    bitstream_finalise (&stream);

    test_case_begin (test, "CC_LEAVE.IND : Receive");

    mme = cp_msg_mme_read_header (&cp, buffer, 60, 0xA, (uint *) &data);
    cp_msg_cc_leave_ind_receive (&cp, mme, &reason, &nid);

    test_begin (test, "Verify")
    {
        test_fail_if (mme->mmtype != CC_LEAVE_IND, "Wrong MMtype");
        test_fail_if (reason != CP_MSG_CC_LEAVE_IND_REASON_TEI_LEASE_EXPIRED,
                      "Wrong reason type");
        test_fail_if (nid != 0x123456789ABCDull,  "Wrong NID");
    }
    test_end;

    slab_release (mme);
}

void
test_case_msg_cc_set_tei_map (void)
{
    cp_mme_peer_t peer;
    cp_nid_t nid;
    cp_snid_t snid;
    cp_mme_tx_t *mme_tx;
    cp_mme_rx_t *mme_rx;
    uint mode;
    uint nb_sta;
    u64 data;
    cp_tei_t tei;
    mac_t mac;
    uint status;

    test_case_begin (test, "CC_SET_TEI_MAP.IND : Send");

    peer.mac = 0x23456789ABCDull;
    peer.vlan_tag = 0x0;
    peer.tei = 0x0;
    peer.all_sta = false;

    nid = 0x123456789ABCDull;
    snid = 0xf;

    mode = CP_MSG_CC_SET_TEI_MAP_IND_MODE_ADD;
    nb_sta = 1;

    mme_tx = cp_msg_cc_set_tei_map_ind_send_begin (&cp, &peer, mode, nb_sta);
    cp_msg_cc_set_tei_map_ind_send_sta (&cp, mme_tx, 0xA, own_mac_addr,
                            CP_MSG_CC_SET_TEI_MAP_IND_STATUS_ASSOCIATED);
    cp_msg_cc_set_tei_map_ind_send_end (&cp, mme_tx);

    expected.oda = peer.mac;
    expected.osa = own_mac_addr;
    expected.mmtype = CC_SET_TEI_MAP_IND;
    expected.fmi_inf = 0;
    expected.fmi_mi = 0;
    expected.fmi_ssn = 0;

    test_read_header (false);
    test_begin (test, "Verify")
    {
        bitstream_access (&stream, &data, 8);
        test_fail_if (data != mode, "Wrong mode");
        bitstream_access (&stream, &data, 8);
        test_fail_if (data != nb_sta, "Wrong number of entries");
        bitstream_access (&stream, &data, 8);
        test_fail_if (data != 0xA, "Wrong TEI");
        bitstream_access (&stream, &data, 48);
        test_fail_if (data != own_mac_addr, "Wrong Mac Address");
        bitstream_access (&stream, &data, 8);
        test_fail_if (data != CP_MSG_CC_SET_TEI_MAP_IND_STATUS_ASSOCIATED,
                      "Wrong status");
    }
    test_end
    bitstream_finalise (&stream);

    test_case_begin (test, "CC_SET_TEI_MAP.IND : Receive");

    peer.mac = 0x23456789ABCDull;
    peer.vlan_tag = 0x0;
    peer.tei = 0x0;
    peer.all_sta = false;

    nid = 0x123456789ABCDull;
    snid = 0xf;

    mode = CP_MSG_CC_SET_TEI_MAP_IND_MODE_ADD;
    nb_sta = 1;

    mme_rx = cp_msg_mme_read_header (&cp, buffer, 60, 0xA, (uint*) &data);
    cp_msg_cc_set_tei_map_ind_receive_begin (&cp, mme_rx, &mode,
                                                      &nb_sta);
    cp_msg_cc_set_tei_map_ind_receive_sta (&cp, mme_rx, &tei, &mac, &status);
    cp_msg_cc_set_tei_map_ind_receive_end (&cp, mme_rx);

    expected.mmtype = CC_SET_TEI_MAP_IND;

    test_read_header (false);
    test_begin (test, "Verify")
    {
        test_fail_if (mode != CP_MSG_CC_SET_TEI_MAP_IND_MODE_ADD,
                      "Wrong mode");
        test_fail_if (nb_sta != 1, "Wrong number of entries");
        test_fail_if (tei != 0xA, "Wrong TEI");
        test_fail_if (mac != own_mac_addr, "Wrong Mac Address");
        test_fail_if (status != CP_MSG_CC_SET_TEI_MAP_IND_STATUS_ASSOCIATED,
                      "Wrong status");
    }
    test_end
    bitstream_finalise (&stream);

    slab_release (mme_rx);
}

void
test_case_cc_relay (void)
{
    cp_mme_peer_t peer;
    cp_nid_t nid;
    cp_secu_protocol_run_t prun;
    cp_mme_tx_t *msg_tx;
    cp_mme_rx_t *msg_rx;
    uint fmi;
    uint length;

    test_case_begin (test, "CC_RELAY.REQ");

    peer.mac = 0x23456789ABCDull;
    peer.vlan_tag = 0x0;
    peer.tei = 0xA;
    peer.all_sta = false;

    nid = 0x123456789ABCDEull;

    prun.pid = 2;
    prun.pmn = 2;
    prun.prn = 2;
    prun.my_nonce = 0x12;
    prun.your_nonce = 0x13;

    msg_tx = cp_msg_cc_relay_req_send_begin (&cp, &peer, &prun,
                                             CP_MME_PEKS_SPC_NOT_EMBEDDED,
                                             MAC_BROADCAST, 0xFF);

    for (length = 100; length; length --)
    {
        bitstream_access (&msg_tx->bitstream, &length, 8);
    }
    cp_msg_cc_relay_send_finalise (&cp, msg_tx, 100);
    cp_msg_mme_send (&cp, msg_tx);

    msg_rx = cp_msg_mme_read_header (&cp, buffer, 100 + 19, 0x0, &fmi);
    cp_msg_cc_relay_receive (&cp, msg_rx, &length);

    test_begin (test, "verify")
    {
        test_fail_if (msg_rx->mmtype != CC_RELAY_REQ, "Wrong MME Type");
        test_fail_if (length != 100, "Wrong length");
        test_fail_if (msg_rx->relay.mac_fa != MAC_BROADCAST,
                      "Wrong mac address");
        test_fail_if (msg_rx->relay.ftei != 0xFF, "Wrong FTEI");
    }
    test_end;

    peer = msg_tx->peer;
    slab_release (msg_tx);

    test_case_begin (test, "CC_RELAY.IND");
    msg_tx = cp_msg_cc_relay_ind_send_begin (&cp, &peer, &prun,
                                             CP_MME_PEKS_SPC_NOT_EMBEDDED,
                                             0x3456789ABCDEull,
                                             0x3);
    for (length = 102; length; length --)
    {
        bitstream_access (&msg_tx->bitstream, &length, 8);
    }
    cp_msg_cc_relay_send_finalise (&cp, msg_tx, 102);
    cp_msg_mme_send (&cp, msg_tx);

    msg_rx = cp_msg_mme_read_header (&cp, buffer, 102 + 19, 0x0, &fmi);
    cp_msg_cc_relay_receive (&cp, msg_rx, &length);

    test_begin (test, "verify")
    {
        test_fail_if (msg_rx->mmtype != CC_RELAY_IND, "Wrong MME Type");
        test_fail_if (length != 102, "Wrong length");
        test_fail_if (msg_rx->relay.mac_fa != 0x3456789ABCDEull,
                      "Wrong mac address");
        test_fail_if (msg_rx->relay.ftei != 0x3, "Wrong FTEI");
    }
    test_end;

    slab_release (msg_tx);
}

int
main (void)
{
    cp_sta_own_data_t *own_data;

    cp.mac_config = &mac_config;
    test_init (test, 0, NULL);

    own_data = cp_sta_mgr_get_sta_own_data (&cp);
    cp_sta_own_data_set_tei (&cp, 0xA);
    cp_sta_own_data_set_mac_address (&cp, own_mac_addr);
    cp_sta_mgr_update_our_avln_nid (&cp, 0x123456789ABCDEFull);
    cp_sta_mgr_update_our_avln_snid (&cp, 0x2);

    test_case_msg_cc_who_ru ();
    test_case_msg_cc_assoc ();
    test_case_msg_cc_leave ();
    test_case_msg_cc_set_tei_map ();
    test_case_cc_relay ();

    test_case_begin (test, "Memory allocation");
    test_begin (test, "memory leaks")
    {
        test_fail_if (blk_check_memory () != true, "Memory leaks");
    }
    test_end;

    test_result (test);
    return test_nb_failed (test) == 0 ? 0 : 1;
}

u8 *
cp_cl_interf_get_buffer_tx (cp_t *ctx)
{
    dbg_assert (ctx);
    return buffer;
}

void
cp_cl_interf_add_buffer_tx (cp_t *ctx, u8 * buffer)
{
}

/**
 * Send a MME over the PWL or the HLE.
 * \param  ctx  the module context.
 * \param  mme  The MME to send.
 *
 */
void
cp_cl_interf_mme_send (cp_t *ctx, cp_mme_tx_t * mme)
{
    mme->p_mme = NULL;
}