mirror of
				https://github.com/brmlab/osmo-tetra.git
				synced 2025-10-31 07:24:01 +01:00 
			
		
		
		
	Add SNDCP PDU type name printing
This commit is contained in:
		
							parent
							
								
									2bca149dca
								
							
						
					
					
						commit
						5c14298646
					
				
					 4 changed files with 82 additions and 1 deletions
				
			
		|  | @ -9,7 +9,7 @@ all: conv_enc_test crc_test tetra-rx float_to_bits | ||||||
| libosmo-tetra-phy.a: phy/tetra_burst_sync.o phy/tetra_burst.o | libosmo-tetra-phy.a: phy/tetra_burst_sync.o phy/tetra_burst.o | ||||||
| 	$(AR) r $@ $^ | 	$(AR) r $@ $^ | ||||||
| 
 | 
 | ||||||
| libosmo-tetra-mac.a: lower_mac/tetra_conv_enc.o tetra_tdma.o lower_mac/tetra_scramb.o lower_mac/tetra_rm3014.o lower_mac/tetra_interleave.o lower_mac/crc_simple.o tetra_common.o lower_mac/viterbi.o lower_mac/viterbi_cch.o lower_mac/viterbi_tch.o lower_mac/tetra_lower_mac.o tetra_upper_mac.o tetra_mac_pdu.o tetra_mle_pdu.o tetra_mm_pdu.o tetra_cmce_pdu.o tetra_gsmtap.o | libosmo-tetra-mac.a: lower_mac/tetra_conv_enc.o tetra_tdma.o lower_mac/tetra_scramb.o lower_mac/tetra_rm3014.o lower_mac/tetra_interleave.o lower_mac/crc_simple.o tetra_common.o lower_mac/viterbi.o lower_mac/viterbi_cch.o lower_mac/viterbi_tch.o lower_mac/tetra_lower_mac.o tetra_upper_mac.o tetra_mac_pdu.o tetra_mle_pdu.o tetra_mm_pdu.o tetra_cmce_pdu.o tetra_sndcp_pdu.o tetra_gsmtap.o | ||||||
| 	$(AR) r $@ $^ | 	$(AR) r $@ $^ | ||||||
| 
 | 
 | ||||||
| float_to_bits: float_to_bits.o | float_to_bits: float_to_bits.o | ||||||
|  |  | ||||||
							
								
								
									
										48
									
								
								src/tetra_sndcp_pdu.c
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										48
									
								
								src/tetra_sndcp_pdu.c
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,48 @@ | ||||||
|  | /* Implementation of TETRA SNDCP 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_sndcp_pdu.h" | ||||||
|  | 
 | ||||||
|  | static const struct value_string sndcp_pdut_names[] = { | ||||||
|  | 	{ SNDCP_PDU_T_ACT_PDP_DEMAND,	"SN-ACTIVATE PDP DEMAND" }, | ||||||
|  | 	{ SNDCP_PDU_T_DEACT_PDP_ACC,	"SN-DEACTIVATE PDP ACCEPT" }, | ||||||
|  | 	{ SNDCP_PDU_T_DEACT_PDP_DEMAND, "SN-DEACTIVATE PDP DEMAND" }, | ||||||
|  | 	{ SNDCP_PDU_T_ACT_PDP_REJECT,	"SN-ACTIVATE PDP REJECT" }, | ||||||
|  | 	{ SNDCP_PDU_T_UNITDATA,		"SN-UNITDATA" }, | ||||||
|  | 	{ SNDCP_PDU_T_DATA,		"SN-DATA" }, | ||||||
|  | 	{ SNDCP_PDU_T_DATA_TX_REQ,	"SN-DATA TX REQUEST" }, | ||||||
|  | 	{ SNDCP_PDU_T_DATA_TX_RESP,	"SN-DATA TX RESPONSE" }, | ||||||
|  | 	{ SNDCP_PDU_T_END_OF_DATA,	"SN-END OF DATA" }, | ||||||
|  | 	{ SNDCP_PDU_T_RECONNECT,	"SN-RECONNECT" }, | ||||||
|  | 	{ SNDCP_PDU_T_PAGE_REQUEST,	"SN-PAGE REQUEST" }, | ||||||
|  | 	{ SNDCP_PDU_T_NOT_SUPPORTED,	"SN-NOT SUPPORTED" }, | ||||||
|  | 	{ SNDCP_PDU_T_DATA_PRIORITY,	"SN-DATA PRIORITY" }, | ||||||
|  | 	{ SNDCP_PDU_T_MODIFY,		"SN-MODIFY" }, | ||||||
|  | 	{ 0, NULL } | ||||||
|  | }; | ||||||
|  | 
 | ||||||
|  | const char *tetra_get_sndcp_pdut_name(uint8_t pdut, int uplink) | ||||||
|  | { | ||||||
|  | 	/* FIXME: uplink */ | ||||||
|  | 	return get_value_string(sndcp_pdut_names, pdut); | ||||||
|  | } | ||||||
							
								
								
									
										29
									
								
								src/tetra_sndcp_pdu.h
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								src/tetra_sndcp_pdu.h
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,29 @@ | ||||||
|  | #ifndef TETRA_SNDCP_PDU_H | ||||||
|  | #define TETRA_SNDCP_PDU_H | ||||||
|  | 
 | ||||||
|  | #include <stdint.h> | ||||||
|  | 
 | ||||||
|  | /* 28.115 */ | ||||||
|  | enum sndcp_pdu_type { | ||||||
|  | 	SNDCP_PDU_T_ACT_PDP_DEMAND	= 0x0, | ||||||
|  | 	SNDCP_PDU_T_DEACT_PDP_ACC	= 0x1, | ||||||
|  | 	SNDCP_PDU_T_DEACT_PDP_DEMAND	= 0x2, | ||||||
|  | 	SNDCP_PDU_T_ACT_PDP_REJECT	= 0x3, | ||||||
|  | 	SNDCP_PDU_T_UNITDATA		= 0x4, | ||||||
|  | 	SNDCP_PDU_T_DATA		= 0x5, | ||||||
|  | 	SNDCP_PDU_T_DATA_TX_REQ		= 0x6, | ||||||
|  | 	SNDCP_PDU_T_DATA_TX_RESP	= 0x7, | ||||||
|  | 	SNDCP_PDU_T_END_OF_DATA		= 0x8, | ||||||
|  | 	SNDCP_PDU_T_RECONNECT		= 0x9, | ||||||
|  | 	SNDCP_PDU_T_PAGE_REQUEST	= 0xa, | ||||||
|  | 	SNDCP_PDU_T_NOT_SUPPORTED	= 0xb, | ||||||
|  | 	SNDCP_PDU_T_DATA_PRIORITY	= 0xc, | ||||||
|  | 	SNDCP_PDU_T_MODIFY		= 0xd, | ||||||
|  | }; | ||||||
|  | 
 | ||||||
|  | #define SNDCP_PDU_T_ACT_PDP_ACCEPT	SNDCP_PDU_T_ACT_PDP_DEMAND | ||||||
|  | #define	SNDCP_PDU_T_PAGE_RESPONSE	SNDCP_PDU_T_PAGE_REQUEST | ||||||
|  | 
 | ||||||
|  | #endif /* TETRA_SNDCP_PDU_H */ | ||||||
|  | 
 | ||||||
|  | const char *tetra_get_sndcp_pdut_name(uint8_t pdut, int uplink); | ||||||
|  | @ -32,6 +32,7 @@ | ||||||
| #include "tetra_mle_pdu.h" | #include "tetra_mle_pdu.h" | ||||||
| #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_gsmtap.h" | #include "tetra_gsmtap.h" | ||||||
| 
 | 
 | ||||||
| static void rx_bcast(struct tetra_tmvsap_prim *tmvp) | static void rx_bcast(struct tetra_tmvsap_prim *tmvp) | ||||||
|  | @ -94,6 +95,9 @@ static int rx_tm_sdu(uint8_t *bits, unsigned int len) | ||||||
| 	case TMLE_PDISC_CMCE: | 	case TMLE_PDISC_CMCE: | ||||||
| 		printf(" %s", tetra_get_cmce_pdut_name(bits_to_uint(bits+3, 5), 0)); | 		printf(" %s", tetra_get_cmce_pdut_name(bits_to_uint(bits+3, 5), 0)); | ||||||
| 		break; | 		break; | ||||||
|  | 	case TMLE_PDISC_SNDCP: | ||||||
|  | 		printf(" %s", tetra_get_sndcp_pdut_name(bits_to_uint(bits+3, 4), 0)); | ||||||
|  | 		break; | ||||||
| 	default: | 	default: | ||||||
| 		break; | 		break; | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Harald Welte
						Harald Welte