mirror of
https://github.com/brmlab/osmo-tetra.git
synced 2025-06-09 02:14:04 +02:00
upper mac: print MLE PDU type
This commit is contained in:
parent
ec02a9f038
commit
ba1ec17db6
3 changed files with 41 additions and 2 deletions
|
@ -27,7 +27,7 @@ static const struct value_string mle_pdisc_names[] = {
|
||||||
{ TMLE_PDISC_MM, "MM" },
|
{ TMLE_PDISC_MM, "MM" },
|
||||||
{ TMLE_PDISC_CMCE, "CMCE" },
|
{ TMLE_PDISC_CMCE, "CMCE" },
|
||||||
{ TMLE_PDISC_SNDCP, "SNDCP" },
|
{ TMLE_PDISC_SNDCP, "SNDCP" },
|
||||||
{ TMLE_PDUSC_MLE, "MLE" },
|
{ TMLE_PDISC_MLE, "MLE" },
|
||||||
{ TMLE_PDISC_MGMT, "MGMT" },
|
{ TMLE_PDISC_MGMT, "MGMT" },
|
||||||
{ TMLE_PDISC_TEST, "TEST" },
|
{ TMLE_PDISC_TEST, "TEST" },
|
||||||
{ 0, NULL }
|
{ 0, NULL }
|
||||||
|
@ -36,3 +36,19 @@ const char *tetra_get_mle_pdisc_name(uint8_t pdisc)
|
||||||
{
|
{
|
||||||
return get_value_string(mle_pdisc_names, 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);
|
||||||
|
}
|
||||||
|
|
|
@ -3,12 +3,31 @@
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
/* 18.5.20 */
|
||||||
|
enum tetra_mle_pdu_type_d {
|
||||||
|
TMLE_PDUT_D_NEW_CELL = 0,
|
||||||
|
TMLE_PDUT_D_PREPARE_FAIL = 1,
|
||||||
|
TMLE_PDUT_D_NWRK_BROADCAST = 2,
|
||||||
|
TMLE_PDUT_D_NWRK_BROADCAST_EXT = 3,
|
||||||
|
TMLE_PDUT_D_RESTORE_ACK = 4,
|
||||||
|
TMLE_PDUT_D_RESTORE_FAIL = 5,
|
||||||
|
TMLE_PDUT_D_CHANNEL_RESPONSE = 6
|
||||||
|
};
|
||||||
|
enum tetra_mle_pdu_type_u {
|
||||||
|
TMLE_PDUT_U_PREPARE = 0,
|
||||||
|
TMLE_PDUT_U_SECTOR_ADVICE = 2,
|
||||||
|
TMLE_PDUT_U_CHANNEL_ADVICE = 3,
|
||||||
|
TMLE_PDUT_U_RESTORE = 4,
|
||||||
|
TMLE_PDUT_U_CHANNEL_REQUEST = 6,
|
||||||
|
};
|
||||||
|
const char *tetra_get_mle_pdut_name(unsigned int pdut, int uplink);
|
||||||
|
|
||||||
/* 18.5.21 */
|
/* 18.5.21 */
|
||||||
enum tetra_mle_pdisc {
|
enum tetra_mle_pdisc {
|
||||||
TMLE_PDISC_MM = 1,
|
TMLE_PDISC_MM = 1,
|
||||||
TMLE_PDISC_CMCE = 2,
|
TMLE_PDISC_CMCE = 2,
|
||||||
TMLE_PDISC_SNDCP = 4,
|
TMLE_PDISC_SNDCP = 4,
|
||||||
TMLE_PDUSC_MLE = 5,
|
TMLE_PDISC_MLE = 5,
|
||||||
TMLE_PDISC_MGMT = 6,
|
TMLE_PDISC_MGMT = 6,
|
||||||
TMLE_PDISC_TEST = 7,
|
TMLE_PDISC_TEST = 7,
|
||||||
};
|
};
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
#include "tetra_mm_pdu.h"
|
#include "tetra_mm_pdu.h"
|
||||||
#include "tetra_cmce_pdu.h"
|
#include "tetra_cmce_pdu.h"
|
||||||
#include "tetra_sndcp_pdu.h"
|
#include "tetra_sndcp_pdu.h"
|
||||||
|
#include "tetra_mle_pdu.h"
|
||||||
#include "tetra_gsmtap.h"
|
#include "tetra_gsmtap.h"
|
||||||
|
|
||||||
static void rx_bcast(struct tetra_tmvsap_prim *tmvp)
|
static void rx_bcast(struct tetra_tmvsap_prim *tmvp)
|
||||||
|
@ -99,6 +100,9 @@ static int rx_tm_sdu(uint8_t *bits, unsigned int len)
|
||||||
case TMLE_PDISC_SNDCP:
|
case TMLE_PDISC_SNDCP:
|
||||||
printf(" %s", tetra_get_sndcp_pdut_name(bits_to_uint(bits+3, 4), 0));
|
printf(" %s", tetra_get_sndcp_pdut_name(bits_to_uint(bits+3, 4), 0));
|
||||||
break;
|
break;
|
||||||
|
case TMLE_PDISC_MLE:
|
||||||
|
printf(" %s", tetra_get_mle_pdut_name(bits_to_uint(bits+3, 3), 0));
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue