aboutsummaryrefslogtreecommitdiffstats
path: root/src/tetra_mle_pdu.c
blob: e138503cf6708db3ee5134788fecc8c0051d75d2 (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
/* Implementation of TETRA MLE PDU parsing */

/* (C) 2011 by Harald Welte <laforge@gnumonks.org>
 * All Rights Reserved
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#include <unistd.h>
#include <osmocom/core/utils.h>

#include "tetra_mle_pdu.h"

static const struct value_string mle_pdisc_names[] = {
	{ TMLE_PDISC_MM,	"MM" },
	{ TMLE_PDISC_CMCE,	"CMCE" },
	{ TMLE_PDISC_SNDCP,	"SNDCP" },
	{ TMLE_PDISC_MLE,	"MLE" },
	{ TMLE_PDISC_MGMT,	"MGMT" },
	{ TMLE_PDISC_TEST,	"TEST" },
	{ 0, NULL }
};
const char *tetra_get_mle_pdisc_name(uint8_t pdisc)
{
	return get_value_string(mle_pdisc_names, pdisc);
}

static const struct value_string mle_pdut_d_names[] = {
	{ TMLE_PDUT_D_NEW_CELL,		"D-NEW CELL" },
	{ TMLE_PDUT_D_PREPARE_FAIL,	"D-PREPARE FAIL" },
	{ TMLE_PDUT_D_NWRK_BROADCAST,	"D-NWRK BROADCAST" },
	{ TMLE_PDUT_D_NWRK_BROADCAST_EXT, "D-NWRK BROADCAST EXT" },
	{ TMLE_PDUT_D_RESTORE_ACK,	"D-RESTORE ACK" },
	{ TMLE_PDUT_D_RESTORE_FAIL,	"D-RESTORE FAIL" },
	{ TMLE_PDUT_D_CHANNEL_RESPONSE,	"D-CHANNEL RESPONSE" },
	{ 0, NULL }
};
const char *tetra_get_mle_pdut_name(unsigned int pdut, int uplink)
{
	/* FIXME: uplink */
	return get_value_string(mle_pdut_d_names, pdut);
}