epan/dissectors/pidl/ C99 drsuapi
[wireshark-sm.git] / epan / dissectors / asn1 / rrc / rrc.cnf
blobcae29ba95930ecb714d027536098f0856cfd29cf
1 # rrc.cnf
2 # rrc conformation file
3 # Copyright 2006 Anders Broman
5 #.OPT
6 PER
7 UNALIGNED
8 PROTO_ROOT_NAME    proto_rrc
9 #.END
11 #.USE_VALS_EXT
12 AverageRLC-BufferPayload
13 DL-DCCH-MessageType
14 DL-TS-ChannelisationCode-VHCR
15 EstablishmentCause
16 E-DCH-MAC-d-FlowRetransTimer
17 HARQMemorySize
18 CommonEDCHSystemInfo/modeSpecificInfo/tdd/tdd128/ccch-transmission-Info/harq-retransmission-timer
19 MBMS-AccessProbabilityFactor
20 PNBSCH-Allocation-r4/numberOfRepetitionsPerSFNPeriod
21 RadioFrequencyBandFDD3
22 E-PUCH-Info/modeSpecificInfo/tdd128/retransTimerForSchedInfo
23 E-PUCH-Info-TDD128/retransTimerForSchedInfo
24 ReceivedMessageType
25 RLC-BuffersPayload
26 SCCPCH-ChannelisationCode-VHCR
27 SFN-SFN-Drift
28 SIBSb-TypeAndTag
29 SIB-Type
30 SIB-TypeAndTag
31 SIB-TypeAndTag2
32 TDD768-PICH-CCode
33 TDD-PRACH-CCode-LCR-r4
34 TimerPoll
35 TimerPollProhibit
36 TimerStatusProhibit
37 TrafficVolumeThreshold
38 U-RNTI-Group
39 UL-DCCH-MessageType
40 UL-TS-ChannelisationCode
41 UL-TS-ChannelisationCode-VHCR
42 MinimumTEBS-threshold
43 UE-DTX-Cycle2-2ms-Secondary
44 SIB-Type2
45 WLANThreshBackhaulRate
47 #.EXPORTS
48 InterRATHandoverInfo
49 InterRATHandoverInfo_PDU
50 ToTargetRNC-Container_PDU
51 TargetRNC-ToSourceRNC-Container_PDU
52 HandoverToUTRANCommand_PDU
53 SysInfoType1_PDU
54 SysInfoType2_PDU
55 SysInfoType3_PDU
56 SysInfoType4_PDU
57 SysInfoType5_PDU
58 SysInfoType6_PDU
59 SysInfoType7_PDU
60 SysInfoType11_PDU
61 SysInfoType12_PDU
62 SysInfoType13_PDU
63 SysInfoType13-1_PDU
64 SysInfoType13-2_PDU
65 SysInfoType13-3_PDU
66 SysInfoType13-4_PDU
67 SysInfoType14_PDU
68 SysInfoType15_PDU
69 SysInfoType15-1_PDU
70 SysInfoType15-2_PDU
71 SysInfoType15-3_PDU
72 SysInfoType15-4_PDU
73 SysInfoType16_PDU
74 SysInfoType17_PDU
75 SysInfoType18_PDU
76 SysInfoType19_PDU
77 SysInfoTypeSB1_PDU
78 SysInfoTypeSB2_PDU
79 MasterInformationBlock_PDU
80 MeasurementReport_PDU
82 #.OMIT_ASSIGNMENT
83 # Omit System-Information-Container for now it messes up the
84 # MasterInformationBlock       @si.mib
85 # :
86 # for some reason
87 UE-RadioAccessCapability-v890ext
88 UE-RadioAccessCapability-va60ext
89 UL-PhysChCapabilityFDD-r6
90 GSMCellGroupingList
91 UE-Positioning-GANSS-Data
92 GANSSDecipheringKeys
93 GSM-CellID
94 RRCConnectionRelease-CCCH-va40ext-IEs
95 MeasuredResultsList-vd20ext
96 #.END
98 #.PDU
100 DL-DCCH-Message              @dl.dcch
101 UL-DCCH-Message              @ul.dcch
102 DL-CCCH-Message              @dl.ccch
103 UL-CCCH-Message              @ul.ccch
104 PCCH-Message                 @pcch
105 DL-SHCCH-Message             @dl.shcch
106 UL-SHCCH-Message             @ul.shcch
107 BCCH-FACH-Message            @bcch.fach
108 BCCH-BCH-Message             @bcch.bch
109 BCCH-BCH2-Message            @bcch.bch2
110 MCCH-Message                 @mcch
111 MSCH-Message                 @msch
112 SystemInformation-BCH        @sysinfo
113 SystemInformation2-BCH       @sysinfo2
114 System-Information-Container @sysinfo.cont
115 MasterInformationBlock       @si.mib
116 MeasurementReport
117 SysInfoType1                 @si.sib1
118 SysInfoType2                 @si.sib2
119 SysInfoType3                 @si.sib3
120 SysInfoType4                 @si.sib4
121 SysInfoType5                 @si.sib5
122 SysInfoType5bis              @si.sib5bis
123 SysInfoType6                 @si.sib6
124 SysInfoType7                 @si.sib7
125 SysInfoType8                 @si.sib8
126 SysInfoType9                 @si.sib9
127 SysInfoType10                @si.sib10
128 SysInfoType11                @si.sib11
129 SysInfoType11bis             @si.sib11bis
130 SysInfoType11ter             @si.sib11ter
131 SysInfoType12                @si.sib12
132 SysInfoType13                @si.sib13
133 SysInfoType13-1              @si.sib13-1
134 SysInfoType13-2              @si.sib13-2
135 SysInfoType13-3              @si.sib13-3
136 SysInfoType13-4              @si.sib13-4
137 SysInfoType14                @si.sib14
138 SysInfoType15                @si.sib15
139 SysInfoType15bis             @si.sib15bis
140 SysInfoType15-1              @si.sib15-1
141 SysInfoType15-1bis           @si.sib15-1bis
142 SysInfoType15-1ter           @si.sib15-1ter
143 SysInfoType15-2              @si.sib15-2
144 SysInfoType15-2bis           @si.sib15-2bis
145 SysInfoType15-2ter           @si.sib15-2ter
146 SysInfoType15-3              @si.sib15-3
147 SysInfoType15-3bis           @si.sib15-3bis
148 SysInfoType15-4              @si.sib15-4
149 SysInfoType15-5              @si.sib15-5
150 SysInfoType15-6              @si.sib15-6
151 SysInfoType15-7              @si.sib15-7
152 SysInfoType15-8              @si.sib15-8
153 SysInfoType16                @si.sib16
154 SysInfoType17                @si.sib17
155 SysInfoType18                @si.sib18
156 SysInfoType19                @si.sib19
157 SysInfoType20                @si.sib20
158 SysInfoType21                @si.sib21
159 SysInfoType22                @si.sib22
160 SysInfoType23                @si.sib23
161 SysInfoType24                @si.sib24
162 SysInfoType25                @si.sib25
163 SysInfoTypeSB1               @si.sb1
164 SysInfoTypeSB2               @si.sb2
165 SysInfoTypeSB3               @si.sb3
166 HandoverToUTRANCommand       @irat.ho_to_utran_cmd
167 InterRATHandoverInfo         @irat.irat_ho_info
168 UE-RadioAccessCapabilityInfo @ue_radio_access_cap_info
169 ToTargetRNC-Container        @s_to_trnc_cont
170 TargetRNC-ToSourceRNC-Container @t_to_srnc_cont
172 #.FIELD_RENAME
173 HandoverFromUTRANCommand-GSM-r3-IEs/gsm-message/gsm-MessageList gsm-MessageList-r3
174 HandoverFromUTRANCommand-GSM-r6-IEs/gsm-message/gsm-MessageList gsm-MessageList-r6
175 HandoverFromUTRANFailure/interRATMessage/gsm/gsm-MessageList gsm-MessageList-gsm
177 HandoverFromUTRANCommand-GSM-r3-IEs/gsm-message/single-GSM-Message single-GSM-Message-r3
178 HandoverFromUTRANCommand-GSM-r6-IEs/gsm-message/single-GSM-Message single-GSM-Message-r6
180 #.END
182 #.FN_BODY NAS-Message VAL_PTR = &nas_message_tvb
183   tvbuff_t *nas_message_tvb=NULL;
185 %(DEFAULT_BODY)s
187     if (nas_message_tvb && gsm_a_dtap_handle) {
188       proto_tree *nas_tree = rrc_nas_in_root_tree ? proto_tree_get_root(tree) : tree;
189       call_dissector(gsm_a_dtap_handle,nas_message_tvb,%(ACTX)s->pinfo, nas_tree);
190     }
192 #.FN_BODY InterRATHandoverInfo/ue-CapabilityContainer/present VAL_PTR = &ue_radio_access_cap_info_tvb
193   tvbuff_t *ue_radio_access_cap_info_tvb=NULL;
195 %(DEFAULT_BODY)s
197   if (ue_radio_access_cap_info_tvb)
198     call_dissector(rrc_ue_radio_access_cap_info_handle,ue_radio_access_cap_info_tvb,%(ACTX)s->pinfo, tree);
200 #.END
202 #.FN_BODY ActiveSetUpdate
203   col_append_str(actx->pinfo->cinfo, COL_INFO, "ActiveSetUpdate");
204 %(DEFAULT_BODY)s
206 #.FN_BODY ActiveSetUpdateComplete
207   col_append_str(actx->pinfo->cinfo, COL_INFO, "ActiveSetUpdateComplete");
208 %(DEFAULT_BODY)s
210 #.FN_BODY ActiveSetUpdateFailure
211   col_append_str(actx->pinfo->cinfo, COL_INFO, "ActiveSetUpdateFailure");
212 %(DEFAULT_BODY)s
214 #.FN_BODY AssistanceDataDelivery
215   col_append_str(actx->pinfo->cinfo, COL_INFO, "AssistanceDataDelivery");
216 %(DEFAULT_BODY)s
218 #.FN_BODY CellChangeOrderFromUTRAN
219   col_append_str(actx->pinfo->cinfo, COL_INFO, "CellChangeOrderFromUTRAN");
220 %(DEFAULT_BODY)s
222 #.FN_BODY CellChangeOrderFromUTRANFailure
223   col_append_str(actx->pinfo->cinfo, COL_INFO, "CellChangeOrderFromUTRANFailure");
224 %(DEFAULT_BODY)s
226 #.FN_BODY CellUpdate
227   col_append_str(actx->pinfo->cinfo, COL_INFO, "CellUpdate");
228 %(DEFAULT_BODY)s
230 #.FN_BODY CellUpdateFDD-r11
231   col_append_str(actx->pinfo->cinfo, COL_INFO, "CellUpdateFDD-r11");
232 %(DEFAULT_BODY)s
234 #.FN_BODY CellUpdateConfirm-CCCH
235   fp_info  *fpinf = NULL;
236   rlc_info *rlcinf = NULL;
237   uint32_t u_rnti;
238   col_append_str(actx->pinfo->cinfo, COL_INFO, "CellUpdateConfirm-CCCH");
239 %(DEFAULT_BODY)s
240   if(PINFO_FD_VISITED(actx->pinfo)) {
241     return offset;
242   }
244   fpinf = (fp_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_fp, 0);
245   rlcinf = (rlc_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_umts_rlc, 0);
247   /*If FP info or RLC info is missing , skip all this*/
248   if(fpinf == NULL || rlcinf == NULL){
249       return offset;
250   }
252   /* If UE is moving to CELL_DCH we need to map it's U-RNTI to the new CRNC context in NBAP */
253   if (private_data_get_rrc_state_indicator(actx) == RRC_UE_STATE_CELL_DCH) {
254     u_rnti = private_data_get_current_u_rnti(actx);
255     rrc_try_map_urnti_to_crncc(u_rnti, actx);
256   }
258 #.FN_BODY CellUpdateConfirm
259   fp_info  *fpinf = NULL;
260   rlc_info *rlcinf = NULL;
261   uint32_t u_rnti;
262   col_append_str(actx->pinfo->cinfo, COL_INFO, "CellUpdateConfirm");
263 %(DEFAULT_BODY)s
264   if(PINFO_FD_VISITED(actx->pinfo)) {
265     return offset;
266   }
268   fpinf = (fp_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_fp, 0);
269   rlcinf = (rlc_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_umts_rlc, 0);
271   /*If FP info or RLC info is missing , skip all this*/
272   if(fpinf == NULL || rlcinf == NULL){
273       return offset;
274   }
276   /* If UE is moving to CELL_DCH we need to map it's U-RNTI to the new CRNC context in NBAP */
277   if (private_data_get_rrc_state_indicator(actx) == RRC_UE_STATE_CELL_DCH) {
278     u_rnti = rlcinf->ueid[fpinf->cur_tb]; /* Hopefully a U-RNTI, might be C-RNTI */
279     rrc_try_map_urnti_to_crncc(u_rnti, actx);
280   }
282 #.FN_BODY CounterCheck
283   col_append_str(actx->pinfo->cinfo, COL_INFO, "CounterCheck");
284 %(DEFAULT_BODY)s
286 #.FN_BODY CounterCheckResponse
287   col_append_str(actx->pinfo->cinfo, COL_INFO, "CounterCheckResponse");
288 %(DEFAULT_BODY)s
290 #.FN_BODY DownlinkDirectTransfer
291   col_append_str(actx->pinfo->cinfo, COL_INFO, "DownlinkDirectTransfer");
292 %(DEFAULT_BODY)s
294 #.FN_BODY ETWSPrimaryNotificationWithSecurity
295   col_append_str(actx->pinfo->cinfo, COL_INFO, "ETWSPrimaryNotificationWithSecurity");
296 %(DEFAULT_BODY)s
298 #.FN_BODY HandoverToUTRANComplete
299   col_append_str(actx->pinfo->cinfo, COL_INFO, "HandoverToUTRANComplete");
300 %(DEFAULT_BODY)s
302 #.FN_BODY InitialDirectTransfer
303   col_append_str(actx->pinfo->cinfo, COL_INFO, "InitialDirectTransfer");
304 %(DEFAULT_BODY)s
306 #.FN_BODY HandoverFromUTRANCommand-EUTRA
307   col_append_str(actx->pinfo->cinfo, COL_INFO, "HandoverFromUTRANCommand-EUTRA");
308 %(DEFAULT_BODY)s
310 #.FN_BODY HandoverFromUTRANCommand-GERANIu
311   col_append_str(actx->pinfo->cinfo, COL_INFO, "HandoverFromUTRANCommand-GERANIu");
312 %(DEFAULT_BODY)s
314 #.FN_BODY HandoverFromUTRANCommand-GSM
315   col_append_str(actx->pinfo->cinfo, COL_INFO, "HandoverFromUTRANCommand-GSM");
316 %(DEFAULT_BODY)s
318 #.FN_BODY HandoverFromUTRANCommand-CDMA2000
319   col_append_str(actx->pinfo->cinfo, COL_INFO, "HandoverFromUTRANCommand-CDMA2000");
320 %(DEFAULT_BODY)s
322 #.FN_BODY HandoverFromUTRANFailure
323   col_append_str(actx->pinfo->cinfo, COL_INFO, "HandoverFromUTRANFailure");
324 %(DEFAULT_BODY)s
326 #.FN_BODY LoggingMeasurementConfiguration
327   col_append_str(actx->pinfo->cinfo, COL_INFO, "LoggingMeasurementConfiguration");
328 %(DEFAULT_BODY)s
330 #.FN_BODY MBMSAccessInformation
331   col_append_str(actx->pinfo->cinfo, COL_INFO, "MBMSAccessInformation");
332 %(DEFAULT_BODY)s
334 #.FN_BODY MBMSCommonPTMRBInformation
335   col_append_str(actx->pinfo->cinfo, COL_INFO, "MBMSCommonPTMRBInformation");
336 %(DEFAULT_BODY)s
338 #.FN_BODY MBMSCurrentCellPTMRBInformation
339   col_append_str(actx->pinfo->cinfo, COL_INFO, "MBMSCurrentCellPTMRBInformation");
340 %(DEFAULT_BODY)s
342 #.FN_BODY MBMSGeneralInformation
343   col_append_str(actx->pinfo->cinfo, COL_INFO, "MBMSGeneralInformation");
344 %(DEFAULT_BODY)s
346 #.FN_BODY MBMSModificationRequest
347   col_append_str(actx->pinfo->cinfo, COL_INFO, "MBMSModificationRequest");
348 %(DEFAULT_BODY)s
350 #.FN_BODY MBMSModifiedServicesInformation
351   col_append_str(actx->pinfo->cinfo, COL_INFO, "MBMSModifiedServicesInformation");
352 %(DEFAULT_BODY)s
354 #.FN_BODY MBMSNeighbouringCellPTMRBInformation
355   col_append_str(actx->pinfo->cinfo, COL_INFO, "MBMSNeighbouringCellPTMRBInformation");
356 %(DEFAULT_BODY)s
358 #.FN_BODY MBMSSchedulingInformation
359   col_append_str(actx->pinfo->cinfo, COL_INFO, "MBMSSchedulingInformation");
360 %(DEFAULT_BODY)s
362 #.FN_BODY MBMSUnmodifiedServicesInformation
363   col_append_str(actx->pinfo->cinfo, COL_INFO, "MBMSUnmodifiedServicesInformation");
364 %(DEFAULT_BODY)s
366 #.FN_BODY MeasurementControl
367   col_append_str(actx->pinfo->cinfo, COL_INFO, "MeasurementControl");
368 %(DEFAULT_BODY)s
370 #.FN_BODY MeasurementControlFailure
371   col_append_str(actx->pinfo->cinfo, COL_INFO, "MeasurementControlFailure");
372 %(DEFAULT_BODY)s
374 #.FN_BODY MeasurementReport
375   col_append_str(actx->pinfo->cinfo, COL_INFO, "MeasurementReport");
376 %(DEFAULT_BODY)s
378 #.FN_BODY PagingType1
379   col_append_str(actx->pinfo->cinfo, COL_INFO, "PagingType1");
380 %(DEFAULT_BODY)s
382 #.FN_BODY PagingType2
383   col_append_str(actx->pinfo->cinfo, COL_INFO, "PagingType2");
384 %(DEFAULT_BODY)s
386 #.FN_BODY PhysicalChannelReconfiguration
387   fp_info  *fpinf = NULL;
388   rlc_info *rlcinf = NULL;
389   uint32_t u_rnti;
390   col_append_str(actx->pinfo->cinfo, COL_INFO, "PhysicalChannelReconfiguration");
391 %(DEFAULT_BODY)s
392   if(PINFO_FD_VISITED(actx->pinfo)) {
393     return offset;
394   }
396   fpinf = (fp_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_fp, 0);
397   rlcinf = (rlc_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_umts_rlc, 0);
399   /*If FP info or RLC info is missing , skip all this*/
400   if(fpinf == NULL || rlcinf == NULL){
401       return offset;
402   }
404   /* If we receive this message on FACH and UE is moving to CELL_DCH */
405   /* we need to map it's U-RNTI to the new CRNC context in NBAP */
406   if (fpinf->channel == CHANNEL_FACH_FDD && private_data_get_rrc_state_indicator(actx) == RRC_UE_STATE_CELL_DCH) {
407     u_rnti = rlcinf->ueid[fpinf->cur_tb]; /* Hopefully a U-RNTI, might be C-RNTI */
408     rrc_try_map_urnti_to_crncc(u_rnti, actx);
409   }
411 #.FN_BODY PhysicalChannelReconfigurationComplete
412   col_append_str(actx->pinfo->cinfo, COL_INFO, "PhysicalChannelReconfigurationComplete");
413 %(DEFAULT_BODY)s
415 #.FN_BODY PhysicalChannelReconfigurationFailure
416   col_append_str(actx->pinfo->cinfo, COL_INFO, "PhysicalChannelReconfigurationFailure");
417 %(DEFAULT_BODY)s
419 #.FN_BODY PhysicalSharedChannelAllocation
420   col_append_str(actx->pinfo->cinfo, COL_INFO, "PhysicalSharedChannelAllocation");
421 %(DEFAULT_BODY)s
423 #.FN_BODY PUSCHCapacityRequest
424   col_append_str(actx->pinfo->cinfo, COL_INFO, "PUSCHCapacityRequest");
425 %(DEFAULT_BODY)s
427 #.FN_BODY RadioBearerReconfiguration
428   fp_info  *fpinf = NULL;
429   rlc_info *rlcinf = NULL;
430   uint32_t u_rnti;
431   col_append_str(actx->pinfo->cinfo, COL_INFO, "RadioBearerReconfiguration");
432 %(DEFAULT_BODY)s
433   if(PINFO_FD_VISITED(actx->pinfo)) {
434     return offset;
435   }
437   fpinf = (fp_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_fp, 0);
438   rlcinf = (rlc_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_umts_rlc, 0);
440   /*If FP info or RLC info is missing , skip all this*/
441   if(fpinf == NULL || rlcinf == NULL){
442       return offset;
443   }
445   /* If we receive this message on FACH and UE is moving to CELL_DCH */
446   /* we need to map it's U-RNTI to the new CRNC context in NBAP */
447   if (fpinf->channel == CHANNEL_FACH_FDD && private_data_get_rrc_state_indicator(actx) == RRC_UE_STATE_CELL_DCH) {
448     u_rnti = rlcinf->ueid[fpinf->cur_tb]; /* Hopefully a U-RNTI, might be C-RNTI */
449     rrc_try_map_urnti_to_crncc(u_rnti, actx);
450   }
452 #.FN_BODY RadioBearerReconfigurationComplete
453   col_append_str(actx->pinfo->cinfo, COL_INFO, "RadioBearerReconfigurationComplete");
454 %(DEFAULT_BODY)s
456 #.FN_BODY RadioBearerReconfigurationFailure
457   col_append_str(actx->pinfo->cinfo, COL_INFO, "RadioBearerReconfigurationFailure");
458 %(DEFAULT_BODY)s
460 #.FN_BODY RadioBearerRelease
461   col_append_str(actx->pinfo->cinfo, COL_INFO, "RadioBearerRelease");
462 %(DEFAULT_BODY)s
464 #.FN_BODY RadioBearerReleaseComplete
465   col_append_str(actx->pinfo->cinfo, COL_INFO, "RadioBearerReleaseComplete");
466 %(DEFAULT_BODY)s
468 #.FN_BODY RadioBearerReleaseFailure
469   col_append_str(actx->pinfo->cinfo, COL_INFO, "RadioBearerReleaseFailure");
470 %(DEFAULT_BODY)s
472 #.FN_BODY RadioBearerSetup
473   col_append_str(actx->pinfo->cinfo, COL_INFO, "RadioBearerSetup");
474 %(DEFAULT_BODY)s
476 #.FN_BODY RadioBearerSetupComplete
477   col_append_str(actx->pinfo->cinfo, COL_INFO, "RadioBearerSetupComplete");
478 %(DEFAULT_BODY)s
480 #.FN_BODY RadioBearerSetupFailure
481   col_append_str(actx->pinfo->cinfo, COL_INFO, "RadioBearerSetupFailure");
482 %(DEFAULT_BODY)s
484 #.FN_BODY RRCConnectionReject
485   col_append_str(actx->pinfo->cinfo, COL_INFO, "RRCConnectionReject");
486 %(DEFAULT_BODY)s
488 #.FN_BODY RRCConnectionRelease
489   col_append_str(actx->pinfo->cinfo, COL_INFO, "RRCConnectionRelease");
490 %(DEFAULT_BODY)s
492 #.FN_BODY RRCConnectionRelease-CCCH
493   col_append_str(actx->pinfo->cinfo, COL_INFO, "RRCConnectionRelease-CCCH");
494 %(DEFAULT_BODY)s
496 #.FN_BODY RRCConnectionReleaseComplete
497   col_append_str(actx->pinfo->cinfo, COL_INFO, "RRCConnectionReleaseComplete");
498 %(DEFAULT_BODY)s
500 #.FN_BODY RRCConnectionRequest
501   col_append_str(actx->pinfo->cinfo, COL_INFO, "RRCConnectionRequest");
502 %(DEFAULT_BODY)s
504 #.FN_BODY RRCConnectionSetup
505   uint32_t new_u_rnti;
506   col_append_str(actx->pinfo->cinfo, COL_INFO, "RRCConnectionSetup");
507 %(DEFAULT_BODY)s
508   if (PINFO_FD_VISITED(actx->pinfo)) {
509     return offset;
510   }
512   /* Trying to map the U-RNTI assigned to the user to CRNC Context from NBAP*/
513   new_u_rnti = private_data_get_new_u_rnti(actx);
514   rrc_try_map_urnti_to_crncc(new_u_rnti, actx);
516 #.FN_BODY RRCConnectionSetupComplete
517   col_append_str(actx->pinfo->cinfo, COL_INFO, "RRCConnectionSetupComplete");
518 %(DEFAULT_BODY)s
520 #.FN_BODY RRCStatus
521   col_append_str(actx->pinfo->cinfo, COL_INFO, "RRCStatus");
522 %(DEFAULT_BODY)s
524 #.FN_BODY SecurityModeCommand
525   fp_info            *fpinf;
526   rlc_info           *rlcinf;
527   rrc_ciphering_info *ciphering_info = NULL;
528   uint8_t             direction;
529   col_append_str(actx->pinfo->cinfo, COL_INFO, "SecurityModeCommand");
531   fpinf = (fp_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_fp, 0);
532   rlcinf = (rlc_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_umts_rlc, 0);
534   /*If FP info or RLC info is missing , skip all this*/
535   if(fpinf != NULL && rlcinf != NULL){
536     ciphering_info = get_or_create_cipher_info(fpinf, rlcinf);
537     private_data_set_ciphering_info(actx, ciphering_info);
538   }
539 %(DEFAULT_BODY)s
540   if( ciphering_info != NULL ){
541     direction = P2P_DIR_DL; /* Security Mode Command is from the RNC, direction is always downlink */
542     ciphering_info->setup_frame[direction] = actx->pinfo->num;
543   }
545 #.FN_BODY SecurityModeComplete
546   fp_info            *fpinf;
547   rlc_info           *rlcinf;
548   rrc_ciphering_info *ciphering_info = NULL;
549   uint8_t             direction;
550   col_append_str(actx->pinfo->cinfo, COL_INFO, "SecurityModeComplete");
552   fpinf = (fp_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_fp, 0);
553   rlcinf = (rlc_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_umts_rlc, 0);
555   /*If FP info or RLC info is missing , skip all this*/
556   if(fpinf != NULL || rlcinf != NULL){
557     ciphering_info = get_or_create_cipher_info(fpinf, rlcinf);
558     private_data_set_ciphering_info(actx, ciphering_info);
559   }
561 %(DEFAULT_BODY)s
562   if( ciphering_info != NULL ){
563     direction = P2P_DIR_UL; /* Security Mode Complete is from the UE, direction is always uplink */
564     ciphering_info->setup_frame[direction] = actx->pinfo->num;
565   }
568 #.FN_BODY SecurityModeFailure
569   col_append_str(actx->pinfo->cinfo, COL_INFO, "SecurityModeFailure");
570 %(DEFAULT_BODY)s
572 #.FN_BODY SignallingConnectionRelease
573   col_append_str(actx->pinfo->cinfo, COL_INFO, "SignallingConnectionRelease");
574 %(DEFAULT_BODY)s
576 #.FN_BODY SignallingConnectionReleaseIndication
577   col_append_str(actx->pinfo->cinfo, COL_INFO, "SignallingConnectionReleaseIndication");
578 %(DEFAULT_BODY)s
580 #.FN_BODY SystemInformation-BCH
581   col_append_str(actx->pinfo->cinfo, COL_INFO, "SystemInformation-BCH");
582 %(DEFAULT_BODY)s
584 #.FN_BODY SystemInformation-FACH
585   col_append_str(actx->pinfo->cinfo, COL_INFO, "SystemInformation-FACH");
586 %(DEFAULT_BODY)s
588 #.FN_BODY SystemInformationChangeIndication
589   col_append_str(actx->pinfo->cinfo, COL_INFO, "SystemInformationChangeIndication");
590 %(DEFAULT_BODY)s
592 #.FN_BODY TransportChannelReconfiguration
593   fp_info  *fpinf = NULL;
594   rlc_info *rlcinf = NULL;
595   uint32_t u_rnti;
596   col_append_str(actx->pinfo->cinfo, COL_INFO, "TransportChannelReconfiguration");
597 %(DEFAULT_BODY)s
598   if(PINFO_FD_VISITED(actx->pinfo)) {
599     return offset;
600   }
602   fpinf = (fp_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_fp, 0);
603   rlcinf = (rlc_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_umts_rlc, 0);
605   /*If FP info or RLC info is missing , skip all this*/
606   if(fpinf == NULL || rlcinf == NULL){
607       return offset;
608   }
610   /* If we receive this message on FACH and UE is moving to CELL_DCH */
611   /* we need to map it's U-RNTI to the new CRNC context in NBAP */
612   if (fpinf->channel == CHANNEL_FACH_FDD && private_data_get_rrc_state_indicator(actx) == RRC_UE_STATE_CELL_DCH) {
613     u_rnti = rlcinf->ueid[fpinf->cur_tb]; /* Hopefully a U-RNTI, might be C-RNTI */
614     rrc_try_map_urnti_to_crncc(u_rnti, actx);
615   }
617 #.FN_BODY TransportChannelReconfigurationComplete
618   col_append_str(actx->pinfo->cinfo, COL_INFO, "TransportChannelReconfigurationComplete");
619 %(DEFAULT_BODY)s
621 #.FN_BODY TransportChannelReconfigurationFailure
622   col_append_str(actx->pinfo->cinfo, COL_INFO, "TransportChannelReconfigurationFailure");
623 %(DEFAULT_BODY)s
625 #.FN_BODY TransportFormatCombinationControl
626   col_append_str(actx->pinfo->cinfo, COL_INFO, "TransportFormatCombinationControl");
627 %(DEFAULT_BODY)s
629 #.FN_BODY TransportFormatCombinationControlFailure
630   col_append_str(actx->pinfo->cinfo, COL_INFO, "TransportFormatCombinationControlFailure");
631 %(DEFAULT_BODY)s
633 #.FN_BODY UECapabilityEnquiry
634   col_append_str(actx->pinfo->cinfo, COL_INFO, "UECapabilityEnquiry");
635 %(DEFAULT_BODY)s
637 #.FN_BODY UECapabilityInformation
638   col_append_str(actx->pinfo->cinfo, COL_INFO, "UECapabilityInformation");
639 %(DEFAULT_BODY)s
641 #.FN_BODY UECapabilityInformationConfirm
642   col_append_str(actx->pinfo->cinfo, COL_INFO, "UECapabilityInformationConfirm");
643 %(DEFAULT_BODY)s
645 #.FN_BODY UEInformationRequest
646   col_append_str(actx->pinfo->cinfo, COL_INFO, "UEInformationRequest");
647 %(DEFAULT_BODY)s
649 #.FN_BODY UEInformationResponse
650   col_append_str(actx->pinfo->cinfo, COL_INFO, "UEInformationResponse");
651 %(DEFAULT_BODY)s
653 #.FN_BODY UplinkDirectTransfer
654   col_append_str(actx->pinfo->cinfo, COL_INFO, "UplinkDirectTransfer");
655 %(DEFAULT_BODY)s
657 #.FN_BODY UplinkPhysicalChannelControl
658   col_append_str(actx->pinfo->cinfo, COL_INFO, "UplinkPhysicalChannelControl");
659 %(DEFAULT_BODY)s
661 #.FN_BODY URAUpdate
662   col_append_str(actx->pinfo->cinfo, COL_INFO, "URAUpdate");
663 %(DEFAULT_BODY)s
665 #.FN_BODY URAUpdateConfirm
666   col_append_str(actx->pinfo->cinfo, COL_INFO, "URAUpdateConfirm");
667 %(DEFAULT_BODY)s
669 #.FN_BODY URAUpdateConfirm-CCCH
670   col_append_str(actx->pinfo->cinfo, COL_INFO, "URAUpdateConfirm-CCCH");
671 %(DEFAULT_BODY)s
673 #.FN_BODY UTRANMobilityInformation
674   col_append_str(actx->pinfo->cinfo, COL_INFO, "UTRANMobilityInformation");
675 %(DEFAULT_BODY)s
677 #.FN_BODY UTRANMobilityInformationConfirm
678   col_append_str(actx->pinfo->cinfo, COL_INFO, "UTRANMobilityInformationConfirm");
679 %(DEFAULT_BODY)s
681 #.FN_BODY UTRANMobilityInformationFailure
682   col_append_str(actx->pinfo->cinfo, COL_INFO, "UTRANMobilityInformationFailure");
683 %(DEFAULT_BODY)s
685 #.FN_BODY TargetRNC-ToSourceRNC-Container/dL-DCCHmessage VAL_PTR = &dl_dcch_message_tvb
686   tvbuff_t *dl_dcch_message_tvb=NULL;
688 %(DEFAULT_BODY)s
690   if (dl_dcch_message_tvb)
691     call_dissector(rrc_dl_dcch_handle,dl_dcch_message_tvb,%(ACTX)s->pinfo, proto_tree_get_root(tree));
693 #.FN_BODY GSM-MessageList/_item VAL_PTR = &gsm_messagelist_tvb
694   tvbuff_t *gsm_messagelist_tvb=NULL;
696 %(DEFAULT_BODY)s
698   if (gsm_messagelist_tvb && gsm_a_dtap_handle)
699     call_dissector(gsm_a_dtap_handle,gsm_messagelist_tvb,actx->pinfo, tree);
701 #.FN_BODY HandoverFromUTRANCommand-GSM-r3-IEs/gsm-message/single-GSM-Message single-GSM-Message-r3
702   tvbuff_t *gsm_message_tvb=NULL;
703   unsigned bits_remaining, whole_octets_remaining;
705 %(DEFAULT_BODY)s
707   bits_remaining = 8*tvb_reported_length(tvb) - offset;
708   whole_octets_remaining = bits_remaining / 8;
710   gsm_message_tvb = tvb_new_octet_aligned(tvb, offset, 8*whole_octets_remaining);
712   if (gsm_message_tvb) {
713     add_new_data_source(actx->pinfo,gsm_message_tvb,"GSM Message(aligned)");
714     call_dissector(gsm_a_dtap_handle,gsm_message_tvb,actx->pinfo, tree);
715   }
716 #.FN_BODY HandoverFromUTRANCommand-GSM-r6-IEs/gsm-message/single-GSM-Message single-GSM-Message-r6
717   tvbuff_t *gsm_message_tvb=NULL;
718   unsigned bits_remaining, whole_octets_remaining;
720 %(DEFAULT_BODY)s
722   bits_remaining = 8*tvb_reported_length(tvb) - offset;
723   whole_octets_remaining = bits_remaining / 8;
725   gsm_message_tvb = tvb_new_octet_aligned(tvb, offset, 8*whole_octets_remaining);
727   if (gsm_message_tvb && gsm_a_dtap_handle) {
728     add_new_data_source(actx->pinfo,gsm_message_tvb,"GSM Message(aligned)");
729     call_dissector(gsm_a_dtap_handle,gsm_message_tvb,actx->pinfo, tree);
730   }
732 #.FN_BODY GERAN-SystemInfoBlock VAL_PTR = &parameter_tvb
733   tvbuff_t *parameter_tvb=NULL;
735 %(DEFAULT_BODY)s
736   if (parameter_tvb){
737     uint8_t byte = tvb_get_uint8(parameter_tvb, 0);
738     if (byte == 0x06) {
739       if (gsm_a_dtap_handle) {
740         call_dissector(gsm_a_dtap_handle, parameter_tvb, actx->pinfo, tree);
741       }
742     } else {
743       if (gsm_rlcmac_dl_handle) {
744         call_dissector(gsm_rlcmac_dl_handle, parameter_tvb, actx->pinfo, tree);
745       }
746     }
747   }
749 #.FN_BODY GSM-Classmark2 VAL_PTR = &parameter_tvb
750   tvbuff_t *parameter_tvb=NULL;
752 %(DEFAULT_BODY)s
753   if (parameter_tvb){
754     de_ms_cm_2(parameter_tvb, tree, actx->pinfo, 2, tvb_get_uint8(parameter_tvb,1), NULL, 0);
755   }
757 #.FN_BODY GSM-Classmark3 VAL_PTR = &parameter_tvb
758   tvbuff_t *parameter_tvb=NULL;
760 %(DEFAULT_BODY)s
761   if (parameter_tvb){
762     de_ms_cm_3(parameter_tvb, tree, actx->pinfo, 0, tvb_reported_length(parameter_tvb), NULL, 0);
763   }
765 #.FN_BODY GSM-MS-RadioAccessCapability VAL_PTR = &parameter_tvb
766   tvbuff_t *parameter_tvb=NULL;
768 %(DEFAULT_BODY)s
769   if (parameter_tvb){
770     de_gmm_ms_radio_acc_cap(parameter_tvb, tree, actx->pinfo, 0, tvb_reported_length(parameter_tvb), NULL, 0);
771   }
773 #.FN_BODY InterRATHandoverInfoWithInterRATCapabilities-r3-IEs/interRATHandoverInfo VAL_PTR = &parameter_tvb
774   tvbuff_t *parameter_tvb=NULL;
776 %(DEFAULT_BODY)s
777   if (parameter_tvb){
778     dissect_rrc_InterRATHandoverInfo_PDU(parameter_tvb, actx->pinfo, tree, NULL);
779   }
781 #.FN_BODY EUTRA-RadioAccessCapability/ue-EUTRA-Capability VAL_PTR = &ue_eutra_cap_tvb
782   tvbuff_t *ue_eutra_cap_tvb = NULL;
783 %(DEFAULT_BODY)s
784   if (ue_eutra_cap_tvb && lte_rrc_ue_eutra_cap_handle)
785     call_dissector(lte_rrc_ue_eutra_cap_handle, ue_eutra_cap_tvb, actx->pinfo, tree);
787 #.FN_BODY HandoverFromUTRANCommand-EUTRA-r8-IEs/eutra-Message VAL_PTR = &eutra_message_tvb
788   tvbuff_t *eutra_message_tvb = NULL;
789 %(DEFAULT_BODY)s
790   if (eutra_message_tvb && lte_rrc_dl_dcch_handle)
791     call_dissector(lte_rrc_dl_dcch_handle, eutra_message_tvb, actx->pinfo, tree);
793 #.FN_BODY HandoverFromUTRANCommand-EUTRA-r11-IEs/eutra-Message VAL_PTR = &eutra_message_tvb
794   tvbuff_t *eutra_message_tvb = NULL;
795 %(DEFAULT_BODY)s
796   if (eutra_message_tvb && lte_rrc_dl_dcch_handle)
797     call_dissector(lte_rrc_dl_dcch_handle, eutra_message_tvb, actx->pinfo, tree);
799 #.FN_BODY HandoverFromUtranFailure-v860ext-IEs/eutra-Message VAL_PTR = &eutra_message_tvb
800   tvbuff_t *eutra_message_tvb = NULL;
801 %(DEFAULT_BODY)s
802   if (eutra_message_tvb && lte_rrc_dl_dcch_handle)
803     call_dissector(lte_rrc_dl_dcch_handle, eutra_message_tvb, actx->pinfo, tree);
805 #.FN_BODY MultiModeRAT-Capability-v860ext/eutraFeatureGroupIndicators VAL_PTR = &eutraFeatureGroupIndicators_tvb
806   tvbuff_t *eutraFeatureGroupIndicators_tvb=NULL;
807 %(DEFAULT_BODY)s
808   if(eutraFeatureGroupIndicators_tvb){
809     /* Dissect eutraFeatureGroupIndicators */
810     proto_tree *subtree;
811     int curr_bit_offset = 0;
812     subtree = proto_item_add_subtree(actx->created_item, ett_rrc_eutraFeatureGroupIndicators);
813     proto_tree_add_bits_item(subtree, hf_rrc_eutra_feat_group_ind_1, eutraFeatureGroupIndicators_tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
814     curr_bit_offset++;
815     proto_tree_add_bits_item(subtree, hf_rrc_eutra_feat_group_ind_2, eutraFeatureGroupIndicators_tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
816     curr_bit_offset++;
817     proto_tree_add_bits_item(subtree, hf_rrc_eutra_feat_group_ind_3, eutraFeatureGroupIndicators_tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
818     curr_bit_offset++;
819     proto_tree_add_bits_item(subtree, hf_rrc_eutra_feat_group_ind_4, eutraFeatureGroupIndicators_tvb, curr_bit_offset, 1, ENC_BIG_ENDIAN);
822 #.FN_BODY PLMN-Identity
823   wmem_strbuf_t* mcc_mnc_strbuf;
824   wmem_strbuf_t* mcc_strbuf;
825   uint32_t string_len;
826   char* mcc_mnc_string;
827   tvbuff_t* mcc_mnc_tvb;
829   /* Reset the digits string in the private data struct */
830   /* Maximal length: 7 = 3 digits MCC + 3 digits MNC + trailing '\0' */
831   mcc_mnc_strbuf = wmem_strbuf_new_sized(actx->pinfo->pool,7);
832   private_data_set_digits_strbuf(actx, mcc_mnc_strbuf);
833   /* Reset parsing failure flag*/
834   private_data_set_digits_strbuf_parsing_failed_flag(actx, false);
835 %(DEFAULT_BODY)s
836   private_data_set_digits_strbuf(actx, NULL);
837   /* Check for parsing errors */
838   if(private_data_get_digits_strbuf_parsing_failed_flag(actx)) {
839     return offset;
840   }
842   /* Extracting the string collected in the strbuf */
843   string_len = (uint32_t)wmem_strbuf_get_len(mcc_mnc_strbuf);
844   mcc_mnc_string = wmem_strbuf_finalize(mcc_mnc_strbuf);
846   if(string_len >= 3)
847   {
848     /* 3 MCC digits were found, keep for later in case MCC is missing in other PLMN ids*/
849     mcc_strbuf = wmem_strbuf_new_sized(actx->pinfo->pool,4);
850     wmem_strbuf_append_c(mcc_strbuf,mcc_mnc_string[0]);
851     wmem_strbuf_append_c(mcc_strbuf,mcc_mnc_string[1]);
852     wmem_strbuf_append_c(mcc_strbuf,mcc_mnc_string[2]);
853     wmem_strbuf_append_c(mcc_strbuf,'\0');
854     private_data_set_last_mcc_strbuf(actx,mcc_strbuf);
855   }
857   /* Creating TVB from extracted string*/
858   mcc_mnc_tvb = tvb_new_child_real_data(tvb, (uint8_t*)mcc_mnc_string, string_len, string_len);
859   add_new_data_source(actx->pinfo, mcc_mnc_tvb, "MCC-MNC");
861   /* Calling E.212 */
862   dissect_e212_mcc_mnc_in_utf8_address(mcc_mnc_tvb, actx->pinfo, tree, 0);
864 #.FN_BODY PLMN-IdentityWithOptionalMCC-r6
865   wmem_strbuf_t* mcc_mnc_strbuf;
866   wmem_strbuf_t* temp_strbuf;
867   wmem_strbuf_t* last_mcc_strbuf;
868   uint32_t string_len;
869   char* mcc_mnc_string;
870   tvbuff_t* mcc_mnc_tvb;
872   /* Reset the digits string in the private data struct */
873   /* Maximal length: 7 = 3 digits MCC + 3 digits MNC + trailing '\0' */
874   mcc_mnc_strbuf = wmem_strbuf_new_sized(actx->pinfo->pool,7);
875   private_data_set_digits_strbuf(actx, mcc_mnc_strbuf);
876   /* Reset parsing failure flag*/
877   private_data_set_digits_strbuf_parsing_failed_flag(actx, false);
878 %(DEFAULT_BODY)s
879   private_data_set_digits_strbuf(actx, NULL);
880   /* Check for parsing errors */
881   if(private_data_get_digits_strbuf_parsing_failed_flag(actx)) {
882     return offset;
883   }
885   /* Extracting the string collected in the strbuf */
886   string_len = (uint32_t)wmem_strbuf_get_len(mcc_mnc_strbuf);
887   mcc_mnc_string = wmem_strbuf_finalize(mcc_mnc_strbuf);
888   if (string_len > 3) {
889       /* 3 MCC digits and at least 1 MNC digit were found, keep MCC for later
890          in case it's missing in other PLMN ids*/
891     temp_strbuf = wmem_strbuf_new_sized(actx->pinfo->pool,4);
892     wmem_strbuf_append_c(temp_strbuf,mcc_mnc_string[0]);
893     wmem_strbuf_append_c(temp_strbuf,mcc_mnc_string[1]);
894     wmem_strbuf_append_c(temp_strbuf,mcc_mnc_string[2]);
895     wmem_strbuf_append_c(temp_strbuf,'\0');
896     private_data_set_last_mcc_strbuf(actx,temp_strbuf);
897   }
898   else {
899       /* mcc_mnc_strbuf Probably only has 3/2 digits of MNC */
900       /* Try to fill MCC form "last MCC" if we have it stored */
901       last_mcc_strbuf = private_data_get_last_mcc_strbuf(actx);
902       if(last_mcc_strbuf)
903       {
904         /* Concat MCC and MNC in temp buffer */
905         temp_strbuf = wmem_strbuf_new_sized(actx->pinfo->pool,7);
906         wmem_strbuf_append_printf(temp_strbuf,"%%s",wmem_strbuf_get_str(last_mcc_strbuf));
907         wmem_strbuf_append_printf(temp_strbuf,"%%s",mcc_mnc_string);
908         /* Update length of recovered MCC-MNC pair */
909         string_len = (uint32_t)wmem_strbuf_get_len(temp_strbuf);
910         mcc_mnc_string = wmem_strbuf_finalize(temp_strbuf);
911       }
912   }
914   if (string_len >= 5) {
915     /* optional MCC was present (or restored above), we can call E.212 dissector */
917     /* Creating TVB from extracted string*/
918     mcc_mnc_tvb = tvb_new_child_real_data(tvb, (uint8_t*)mcc_mnc_string, string_len, string_len);
919     add_new_data_source(actx->pinfo, mcc_mnc_tvb, "MCC-MNC");
921     /* Calling E.212 */
922     dissect_e212_mcc_mnc_in_utf8_address(mcc_mnc_tvb, actx->pinfo, tree, 0);
923   }
925 #.FN_BODY IMSI-GSM-MAP
926   wmem_strbuf_t* imsi_strbuf;
927   uint32_t string_len;
928   char* imsi_string;
929   tvbuff_t* imsi_tvb;
931   /* Reset the digits string in the private data struct */
932   imsi_strbuf = wmem_strbuf_new_sized(actx->pinfo->pool,16);
933   private_data_set_digits_strbuf(actx, imsi_strbuf);
934   /* Reset parsing failure flag*/
935   private_data_set_digits_strbuf_parsing_failed_flag(actx, false);
936 %(DEFAULT_BODY)s
937   private_data_set_digits_strbuf(actx, NULL);
938   /* Check for parsing errors */
939   if(private_data_get_digits_strbuf_parsing_failed_flag(actx)) {
940     return offset;
941   }
943   /* Extracting the string collected in the strbuf */
944   string_len = (uint32_t)wmem_strbuf_get_len(imsi_strbuf);
945   imsi_string = wmem_strbuf_finalize(imsi_strbuf);
947   /* Creating TVB from extracted string*/
948   imsi_tvb = tvb_new_child_real_data(tvb, (uint8_t*)imsi_string, string_len, string_len);
949   add_new_data_source(actx->pinfo, imsi_tvb, "IMSI");
951   /* Calling E.212 */
952   dissect_e212_utf8_imsi(imsi_tvb,actx->pinfo,tree,0,string_len);
954 #.FN_BODY Digit VAL_PTR = &digit
955   uint32_t digit;
956   wmem_strbuf_t* digits_strbuf; /* The string of either an IMSI or a MCC-MNC pair */
957 %(DEFAULT_BODY)s
959   if(private_data_get_digits_strbuf_parsing_failed_flag(actx)) {
960     return offset;
961   }
963   digits_strbuf = private_data_get_digits_strbuf(actx);
964   if (digits_strbuf) {
965     char digit_char;
967     if(digit > 9) {
968       private_data_set_digits_strbuf_parsing_failed_flag(actx, true);
969       return offset;
970     }
972     /* Converting to the matching char */
973     digit_char = (char)(digit + '0');
975     /* Appending to the digits string */
976     wmem_strbuf_append_c(digits_strbuf, digit_char);
977   }
979 #.FN_BODY CompleteSIBshort
980   private_data_set_curr_sib_segment_type(actx,RRC_SIB_SEG_COMP);
981 %(DEFAULT_BODY)s
982   private_data_set_curr_sib_segment_type(actx,RRC_SIB_SEG_NO_SEGMENT); /* Resetting value */
984 #.FN_BODY SIB-Type VAL_PTR = &sib_type
985   uint32_t sib_type;
986 %(DEFAULT_BODY)s
987   private_data_set_curr_sib_type(actx,sib_type);
989 #.FN_BODY SIB-Data-variable VAL_PTR = &sib_data_tvb
990   tvbuff_t *sib_data_tvb;
991   uint32_t sib_type;
992   proto_tree *subtree;
993   uint32_t seg_type;
995 %(DEFAULT_BODY)s
997   seg_type = (uint32_t)private_data_get_curr_sib_segment_type(actx);
998   if(seg_type != RRC_SIB_SEG_COMP) {
999       /* TODO: The Dissector only handles 'complete SIBs' right now.
1000        * Reassembly logic should be implemented, taking into acocunt that
1001        * different fragments might arrive in different frames.
1002        */
1003       return offset;
1004   }
1006   /* This is a complete SIB - Call handler according to previous SIB-Type field*/
1007   subtree = proto_item_add_subtree(actx->created_item, ett_rrc_sib_data_var);
1008   sib_type = private_data_get_curr_sib_type(actx);
1009   col_set_fence(actx->pinfo->cinfo, COL_INFO);
1010   col_append_str(actx->pinfo->cinfo, COL_INFO," (");
1011   switch(sib_type){
1012     case 0:
1013       /* mIB */
1014       dissect_rrc_MasterInformationBlock_PDU(sib_data_tvb, actx->pinfo, subtree, NULL);
1015       break;
1016     case 1:
1017       dissect_rrc_SysInfoType1_PDU(sib_data_tvb, actx->pinfo, subtree, NULL);
1018       break;
1019     case 2:
1020       dissect_rrc_SysInfoType2_PDU(sib_data_tvb, actx->pinfo, subtree, NULL);
1021       break;
1022     case 3:
1023       dissect_rrc_SysInfoType3_PDU(sib_data_tvb, actx->pinfo, subtree, NULL);
1024       break;
1025     case 4:
1026       dissect_rrc_SysInfoType4_PDU(sib_data_tvb, actx->pinfo, subtree, NULL);
1027       break;
1028     case 5:
1029       dissect_rrc_SysInfoType5_PDU(sib_data_tvb, actx->pinfo, subtree, NULL);
1030       break;
1031     case 6:
1032       dissect_rrc_SysInfoType6_PDU(sib_data_tvb, actx->pinfo, subtree, NULL);
1033       break;
1034     case 7:
1035       dissect_rrc_SysInfoType7_PDU(sib_data_tvb, actx->pinfo, subtree, NULL);
1036       break;
1037     case 11:
1038       dissect_rrc_SysInfoType11_PDU(sib_data_tvb, actx->pinfo, subtree, NULL);
1039       break;
1040     case 12:
1041       dissect_rrc_SysInfoType12_PDU(sib_data_tvb, actx->pinfo, subtree, NULL);
1042       break;
1043     case 13:
1044       dissect_rrc_SysInfoType13_PDU(sib_data_tvb, actx->pinfo, subtree, NULL);
1045       break;
1046     case 14:
1047       /* SIB-Type: systemInformationBlockType13-1 */
1048       dissect_rrc_SysInfoType13_1_PDU(sib_data_tvb, actx->pinfo, subtree, NULL);
1049       break;
1050     case 15:
1051       /* SIB-Type: systemInformationBlockType13-2 */
1052       dissect_rrc_SysInfoType13_2_PDU(sib_data_tvb, actx->pinfo, subtree, NULL);
1053       break;
1054     case 16:
1055       /* SIB-Type: systemInformationBlockType13-3 */
1056       dissect_rrc_SysInfoType13_3_PDU(sib_data_tvb, actx->pinfo, subtree, NULL);
1057       break;
1058     case 17:
1059       /* SIB-Type: systemInformationBlockType13-4 */
1060       dissect_rrc_SysInfoType13_4_PDU(sib_data_tvb, actx->pinfo, subtree, NULL);
1061       break;
1062     case 18:
1063       /* SIB-Type: systemInformationBlockType14 */
1064       dissect_rrc_SysInfoType14_PDU(sib_data_tvb, actx->pinfo, subtree, NULL);
1065       break;
1066     case 19:
1067       /* SIB-Type: systemInformationBlockType15 */
1068       dissect_rrc_SysInfoType15_PDU(sib_data_tvb, actx->pinfo, subtree, NULL);
1069       break;
1070     case 20:
1071       /* SIB-Type: systemInformationBlockType15-1 */
1072       dissect_rrc_SysInfoType15_1_PDU(sib_data_tvb, actx->pinfo, subtree, NULL);
1073       break;
1074     case 21:
1075       /* SIB-Type: systemInformationBlockType15-2 */
1076       dissect_rrc_SysInfoType15_2_PDU(sib_data_tvb, actx->pinfo, subtree, NULL);
1077       break;
1078     case 22:
1079       /* SIB-Type: systemInformationBlockType15-3 */
1080       dissect_rrc_SysInfoType15_3_PDU(sib_data_tvb, actx->pinfo, subtree, NULL);
1081       break;
1082     case 23:
1083       /* SIB-Type: systemInformationBlockType16 */
1084       dissect_rrc_SysInfoType16_PDU(sib_data_tvb, actx->pinfo, subtree, NULL);
1085       break;
1086     case 24:
1087       /* SIB-Type: systemInformationBlockType17 */
1088       dissect_rrc_SysInfoType17_PDU(sib_data_tvb, actx->pinfo, subtree, NULL);
1089       break;
1090     case 25:
1091       /* SIB-Type: systemInformationBlockType15-4 */
1092       dissect_rrc_SysInfoType15_4_PDU(sib_data_tvb, actx->pinfo, subtree, NULL);
1093       break;
1094     case 26:
1095       /* SIB-Type: systemInformationBlockType18 */
1096       dissect_rrc_SysInfoType18_PDU(sib_data_tvb, actx->pinfo, subtree, NULL);
1097       break;
1098     case 27:
1099       /* SIB-Type: schedulingBlock1 */
1100       dissect_rrc_SysInfoTypeSB1_PDU(sib_data_tvb, actx->pinfo, subtree, NULL);
1101       break;
1102     case 28:
1103       /* SIB-Type: schedulingBlock2 */
1104       dissect_rrc_SysInfoTypeSB2_PDU(sib_data_tvb, actx->pinfo, subtree, NULL);
1105       break;
1106     default:
1107       break;
1108     }
1110   col_append_str(actx->pinfo->cinfo, COL_INFO,")");
1111   col_set_fence(actx->pinfo->cinfo, COL_INFO);
1113 #.FN_BODY RSR-VCC-Info/ims-Information VAL_PTR = &imsInformation_tvb
1114   tvbuff_t *imsInformation_tvb=NULL;
1115 %(DEFAULT_BODY)s
1116   if(imsInformation_tvb){
1117     /* Dissect ims-Information
1118        Decoding specified in TS 124 237 V11.4.0 Annex D.5.3.3 ATGW transfer details
1119      */
1120     proto_tree *subtree;
1121     int curr_offset = 0;
1122     uint32_t atgw_trans_det_cont;
1123     subtree = proto_item_add_subtree(actx->created_item, ett_rrc_ims_info);
1124     proto_tree_add_item_ret_uint(subtree, hf_rrc_ims_info_atgw_trans_det_cont_type, imsInformation_tvb, curr_offset, 1, ENC_BIG_ENDIAN, &atgw_trans_det_cont);
1125     curr_offset++;
1126     switch (atgw_trans_det_cont) {
1127       case 0:
1128         proto_tree_add_item(subtree, hf_rrc_ims_info_atgw_udp_port, imsInformation_tvb, curr_offset, 2, ENC_BIG_ENDIAN);
1129         curr_offset+=2;
1130         proto_tree_add_item(subtree, hf_rrc_ims_info_atgw_ipv4, imsInformation_tvb, curr_offset, 4, ENC_BIG_ENDIAN);
1131         break;
1132       case 1:
1133         proto_tree_add_item(subtree, hf_rrc_ims_info_atgw_udp_port, imsInformation_tvb, curr_offset, 2, ENC_BIG_ENDIAN);
1134         curr_offset+=2;
1135         proto_tree_add_item(subtree, hf_rrc_ims_info_atgw_ipv6, imsInformation_tvb, curr_offset, 16, ENC_NA);
1136         break;
1137       default:
1138       break;
1139     }
1142 #.TYPE_ATTR
1143 HNBName TYPE=FT_STRING DISPLAY=BASE_NONE
1145 #.FN_BODY HNBName VAL_PTR = &hnbname_tvb HF_INDEX = -1
1146   tvbuff_t *hnbname_tvb = NULL;
1148 %(DEFAULT_BODY)s
1149   actx->created_item = proto_tree_add_item(tree, hf_index, hnbname_tvb, 0, -1, ENC_UTF_8|ENC_NA);
1151 #.FN_BODY CN-DomainIdentity VAL_PTR = &nas_sys_info
1152   uint32_t nas_sys_info;
1153 %(DEFAULT_BODY)s
1154   col_append_fstr(actx->pinfo->cinfo, COL_INFO, "(%%s)",
1155                   val_to_str_const(nas_sys_info,rrc_CN_DomainIdentity_vals, "Unknown"));
1156   nas_sys_info++; /* CS = 0, PS = 1 but the enum defines 0 as Unknown and CS = 1, PS = 2 */
1157   private_data_set_cn_domain(actx, (enum nas_sys_info_gsm_map) nas_sys_info);
1159 #.FN_BODY CN-InformationInfo/cn-CommonGSM-MAP-NAS-SysInfo
1160   private_data_set_cn_domain(actx, RRC_NAS_SYS_INFO_CN_COMMON);
1161 %(DEFAULT_BODY)s
1163 #.FN_BODY CN-InformationInfo-r6/cn-CommonGSM-MAP-NAS-SysInfo
1164   private_data_set_cn_domain(actx, RRC_NAS_SYS_INFO_CN_COMMON);
1165 %(DEFAULT_BODY)s
1167 #.FN_BODY CN-InformationInfoFull/cn-CommonGSM-MAP-NAS-SysInfo
1168   private_data_set_cn_domain(actx, RRC_NAS_SYS_INFO_CN_COMMON);
1169 %(DEFAULT_BODY)s
1171 #.FN_BODY SysInfoType1/cn-CommonGSM-MAP-NAS-SysInfo
1172   private_data_set_cn_domain(actx, RRC_NAS_SYS_INFO_CN_COMMON);
1173 %(DEFAULT_BODY)s
1175 #.FN_BODY NAS-SystemInformationGSM-MAP VAL_PTR = &nas_sys_info_gsm_map_tvb
1176   tvbuff_t *nas_sys_info_gsm_map_tvb = NULL;
1177   uint32_t length;
1178   enum nas_sys_info_gsm_map cn_domain;
1179   proto_tree *subtree;
1181 %(DEFAULT_BODY)s
1182   length = tvb_reported_length(nas_sys_info_gsm_map_tvb);
1183   if (length) {
1184     cn_domain = private_data_get_cn_domain(actx);
1185     switch (cn_domain) {
1186       case RRC_NAS_SYS_INFO_CN_COMMON:
1187         subtree = proto_tree_add_subtree(tree, nas_sys_info_gsm_map_tvb, 0, length,
1188                   ett_rrc_cn_CommonGSM_MAP_NAS_SysInfo, NULL, "CN Common GSM-MAP NAS system information");
1189         de_cn_common_gsm_map_nas_sys_info(nas_sys_info_gsm_map_tvb, subtree, actx->pinfo, 0, length, NULL, 0);
1190         break;
1191       case RRC_NAS_SYS_INFO_CS:
1192         subtree = proto_tree_add_subtree(tree, nas_sys_info_gsm_map_tvb, 0, length,
1193                   ett_rrc_cn_CommonGSM_MAP_NAS_SysInfo, NULL, "CS domain specific system information");
1194         de_cs_domain_spec_sys_info(nas_sys_info_gsm_map_tvb, subtree, actx->pinfo, 0, length, NULL, 0);
1195         break;
1196       case RRC_NAS_SYS_INFO_PS:
1197         subtree = proto_tree_add_subtree(tree, nas_sys_info_gsm_map_tvb, 0, length,
1198                   ett_rrc_cn_CommonGSM_MAP_NAS_SysInfo, NULL, "PS domain specific system information");
1199         de_ps_domain_spec_sys_info(nas_sys_info_gsm_map_tvb, subtree, actx->pinfo, 0, length, NULL, 0);
1200         break;
1201       default:
1202         break;
1203     }
1204     private_data_set_cn_domain(actx, RRC_NAS_SYS_UNKNOWN);
1205   }
1207 #.FN_BODY SRNC-Identity VAL_PTR = &s_rnc_id_tvb
1208   tvbuff_t * s_rnc_id_tvb = NULL;
1209 %(DEFAULT_BODY)s
1210   if (s_rnc_id_tvb) {
1211       private_data_set_s_rnc_id(actx, tvb_get_ntohs(s_rnc_id_tvb, 0) >> 4);
1212   }
1214 #.FN_BODY S-RNTI VAL_PTR = &s_rnti_tvb
1215   tvbuff_t * s_rnti_tvb  = NULL;
1216 %(DEFAULT_BODY)s
1217   if (s_rnti_tvb) {
1218       private_data_set_s_rnti(actx, tvb_get_ntoh24(s_rnti_tvb, 0) >> 4);
1219   }
1221 #.FN_BODY U-RNTI
1222   private_data_set_s_rnc_id(actx, 0);
1223   private_data_set_s_rnti(actx, 0);
1224   uint32_t s_rnc_id;
1225   uint32_t s_rnti;
1226   uint32_t u_rnti_value;
1227   uint32_t original_offset;
1228   proto_item *ti;
1229   uint32_t item_len;
1230   proto_tree *sub_tree;
1231   bool is_new_urnti;
1232   int generated_field_hf;
1233   original_offset = offset;
1234 %(DEFAULT_BODY)s
1236   /* Reconstructing the U-RNTI from the parsed components */
1237   s_rnc_id = private_data_get_s_rnc_id(actx);
1238   s_rnti = private_data_get_s_rnti(actx);
1239   u_rnti_value = (s_rnc_id << 20) | s_rnti;
1241   /* Distinguishing between new allocated U-RNTIs and previously used ones */
1242   /* hf_rrc_u_RNTI is for current U-RNTI, any other hf is for new U-RNTI */
1243   is_new_urnti = hf_index != hf_rrc_u_RNTI;
1244   if (is_new_urnti) {
1245     private_data_set_new_u_rnti(actx, u_rnti_value);
1246     generated_field_hf = hf_urnti_new;
1247   }
1248   else {
1249     private_data_set_current_u_rnti(actx, u_rnti_value);
1250     generated_field_hf = hf_urnti_current;
1251   }
1253   /* Adding a "Current U-RNTI" or "New U-RNTI" as generated field */
1254   sub_tree = proto_item_get_subtree(actx->created_item);
1255   item_len = proto_item_get_len(actx->created_item);
1256   ti = proto_tree_add_uint(sub_tree, generated_field_hf, tvb, original_offset/8, item_len, u_rnti_value);
1257   proto_item_set_generated(ti);
1258   ti = proto_tree_add_uint(sub_tree, hf_urnti, tvb, original_offset/8, item_len, u_rnti_value);
1259   proto_item_set_hidden(ti);
1261   private_data_set_s_rnc_id(actx, 0);
1262   private_data_set_s_rnti(actx, 0);
1264 #.FN_BODY C-RNTI VAL_PTR = &c_rnti_tvb
1265   fp_info *fpinf = NULL;
1266   umts_mac_info *macinf = NULL;
1267   rlc_info *rlcinf = NULL;
1268   conversation_t   *p_conv;
1269   umts_fp_conversation_info_t *umts_fp_conversation_info = NULL;
1270   fp_fach_channel_info_t *fp_fach_channel_info = NULL;
1271   tvbuff_t * c_rnti_tvb = NULL;
1272   uint16_t c_rnti = 0;
1273   uint32_t u_rnti = 0;
1274   fp_crnti_allocation_info_t *fp_crnti_allocation_info = NULL;
1275 %(DEFAULT_BODY)s
1276   if (!c_rnti_tvb)
1277     return offset;
1279   if(tvb_reported_length(c_rnti_tvb)>=2){
1280     c_rnti = tvb_get_ntohs(c_rnti_tvb,0);
1281   }
1283   if(PINFO_FD_VISITED(actx->pinfo)) /* Frame was already checked*/
1284     return offset;
1286   /* Trying to figure where to get the U-RNTI from Either from an ASN.1 field (if this is CCCH) or RLC's attached info (if this is DCCH) */
1287   fpinf = (fp_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_fp, 0);
1288   macinf = (umts_mac_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_umts_mac, 0);
1289   rlcinf = (rlc_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_umts_rlc, 0);
1290   if (fpinf && macinf && rlcinf) {
1291     switch(macinf->content[fpinf->cur_tb]){
1292       case MAC_CONTENT_DCCH:
1293         u_rnti = rlcinf->ueid[fpinf->cur_tb];
1294         break;
1295       case MAC_CONTENT_CCCH:
1296       default:
1297         u_rnti = private_data_get_current_u_rnti(actx);
1298         break;
1299     }
1300   }
1301   else {
1302     /* Either FP, MAC or RLC info is missing - looking for ASN.1 field as last resort*/
1303     u_rnti = private_data_get_current_u_rnti(actx);
1304   }
1306   if(u_rnti == 0 || c_rnti == 0) /* U-RNTI missing or failed to parse C-RNTI */
1307     return offset;
1309   /* Both U-RNTI and C-RNTI present - storing the match*/
1310   fp_crnti_allocation_info = wmem_new(wmem_file_scope(), fp_crnti_allocation_info_t);
1311   fp_crnti_allocation_info->urnti = u_rnti;
1312   fp_crnti_allocation_info->alloc_frame_number = actx->pinfo->num;
1313   fp_crnti_allocation_info->global_retrieval_count = 0;
1315   /* Finding FP conversation info */
1316   p_conv = (conversation_t *)find_conversation(actx->pinfo->num, &actx->pinfo->net_dst, &actx->pinfo->net_src,
1317       conversation_pt_to_conversation_type(actx->pinfo->ptype),
1318       actx->pinfo->destport, actx->pinfo->srcport, NO_ADDR_B);
1320   /* If the current FP channel is FACH, Adding the C-RNTI / U-RNTI match to the FACH's RNTIs map*/
1321   if (p_conv != NULL) {
1322       umts_fp_conversation_info = (umts_fp_conversation_info_t *)conversation_get_proto_data(p_conv, proto_fp);
1323       if (umts_fp_conversation_info && umts_fp_conversation_info->channel == CHANNEL_FACH_FDD) {
1324           fp_fach_channel_info = (fp_fach_channel_info_t *)umts_fp_conversation_info->channel_specific_info;
1325           if(fp_fach_channel_info) {
1326               wmem_tree_insert32(fp_fach_channel_info->crnti_to_urnti_map, c_rnti, (void *)fp_crnti_allocation_info);
1327           }
1328       }
1329   }
1331   /* Also adding the C-RNTI / U-RNTI match to the global RNTIs map for the RACH channel */
1332   wmem_tree_insert32(rrc_global_urnti_crnti_map, c_rnti, (void *)fp_crnti_allocation_info);
1334 #.FN_BODY UL-ScramblingCode VAL_PTR = &scrambling_code
1335 uint32_t scrambling_code;
1336 %(DEFAULT_BODY)s
1337 private_data_set_scrambling_code(actx,scrambling_code);
1339 #.FN_BODY RRC-StateIndicator VAL_PTR = &state_dec
1340 int32_t state_dec = -1;
1341 %(DEFAULT_BODY)s
1342 if(state_dec >= 0 && state_dec <= 3) {
1343   state_dec++; /* Encoded values are 0-based, Values in the enum are 1-based*/
1344   private_data_set_rrc_state_indicator(actx,(enum rrc_ue_state)state_dec);
1347 #.FN_BODY CellIdentity VAL_PTR = &cell_id_tvb
1348   tvbuff_t * cell_id_tvb = NULL;
1349   proto_item *temp_ti;
1350   proto_tree *cell_identity_tree;
1352 %(DEFAULT_BODY)s
1353   if(cell_id_tvb != NULL) {
1354       cell_identity_tree = proto_item_add_subtree(actx->created_item, ett_rrc_cellIdentity);
1355       temp_ti = proto_tree_add_bits_item(cell_identity_tree, hf_rrc_cellIdentity_rnc_id,cell_id_tvb, 0, 12, ENC_BIG_ENDIAN);
1356       proto_item_set_generated(temp_ti);
1357       temp_ti = proto_tree_add_bits_item(cell_identity_tree, hf_rrc_cellIdentity_c_id, cell_id_tvb, 12, 16, ENC_BIG_ENDIAN);
1358       proto_item_set_generated(temp_ti);
1359   }
1361 #.FN_BODY DL-TransportChannelType-r5 VAL_PTR = &type
1362 /*Here we try to figure out which HS-DSCH channels are multiplexed*/
1363     unsigned *flowd_p;
1364     unsigned *cur_val=NULL;
1365     struct rrc_info *rrcinf;
1366     fp_info *fpinf;
1368     %(DEFAULT_BODY)s
1370     /*TODO: This should probably be done better*/
1371     if(type == 4){    /*If this is type HS-DSCH*/
1372         num_chans_per_flow[flowd]++;
1374         if(num_chans_per_flow[flowd] > 1 ){
1375             rrcinf = (rrc_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_rrc, 0);
1376             fpinf = (fp_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_fp, 0);
1377             if((rrcinf == NULL) || (fpinf == NULL) || (rrcinf->hrnti[fpinf->cur_tb] == 0)){
1378                 expert_add_info(actx->pinfo, actx->created_item, &ei_rrc_no_hrnti);
1379             }
1380             else{
1381                 /*If it doesn't exists, insert it*/
1382                 if( (cur_val=(int *)g_tree_lookup(hsdsch_muxed_flows, GUINT_TO_POINTER((unsigned)rrcinf->hrnti[fpinf->cur_tb]))) == NULL ){
1384                     flowd_p = g_new0(unsigned, 1);
1385                     *flowd_p = (1U<<flowd);    /*Set the bit to mark it as true*/
1386                     g_tree_insert(hsdsch_muxed_flows, GUINT_TO_POINTER((unsigned)rrcinf->hrnti[fpinf->cur_tb]), flowd_p);
1388                 }else{
1389                     *cur_val = (1U<<flowd) | *cur_val;
1391                 }
1392             }
1394         }
1396     }
1398 #.FN_BODY DL-TransportChannelType-r7 VAL_PTR = &type
1399 /*Here we try to figure out which HS-DSCH channels are multiplexed*/
1400     unsigned *flowd_p;
1401     unsigned *cur_val=NULL;
1402     struct rrc_info *rrcinf;
1403     fp_info *fpinf;
1405     %(DEFAULT_BODY)s
1407     /*TODO: This should probably be done better*/
1408     if(type == 4){    /*If this is type HS-DSCH*/
1409         num_chans_per_flow[flowd]++;
1412         if(num_chans_per_flow[flowd] > 1 ){
1413             rrcinf = (rrc_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_rrc, 0);
1414             fpinf = (fp_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_fp, 0);
1415             if((rrcinf == NULL) || (fpinf == NULL) || (rrcinf->hrnti[fpinf->cur_tb] == 0)){
1416                 expert_add_info(actx->pinfo, actx->created_item, &ei_rrc_no_hrnti);
1417             }
1418             else{
1419                 /*If it doesn't exists, insert it*/
1420                 if( (cur_val=(int *)g_tree_lookup(hsdsch_muxed_flows, GUINT_TO_POINTER((unsigned)rrcinf->hrnti[fpinf->cur_tb]))) == NULL ){
1422                     flowd_p = g_new0(unsigned, 1);
1423                     *flowd_p = (1U<<flowd);    /* Set the bit to mark it as true*/
1424                     g_tree_insert(hsdsch_muxed_flows, GUINT_TO_POINTER((unsigned)rrcinf->hrnti[fpinf->cur_tb]), flowd_p);
1426                 }else{
1427                     *cur_val = (1U<<flowd) | *cur_val;
1429                 }
1430             }
1432         }
1434     }
1436 #.FN_BODY MAC-d-FlowIdentity VAL_PTR = &flowd
1437 %(DEFAULT_BODY)s
1439 #.FN_BODY H-RNTI VAL_PTR = &hrnti_tvb
1440   tvbuff_t *hrnti_tvb;
1441   struct rrc_info *rrcinf;
1442   fp_info *fpinf;
1443 %(DEFAULT_BODY)s
1445 #.FN_FTR H-RNTI
1446   rrcinf = (struct rrc_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_rrc, 0);
1447   fpinf = (fp_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_fp, 0);
1448   if (fpinf) {
1449     if (!rrcinf) {
1450       rrcinf = wmem_new0(wmem_file_scope(), struct rrc_info);
1451       p_add_proto_data(wmem_file_scope(), actx->pinfo, proto_rrc, 0, rrcinf);
1452     }
1453     rrcinf->hrnti[fpinf->cur_tb] = tvb_get_ntohs(hrnti_tvb, 0);
1454   }
1456 #.FN_BODY START-Value VAL_PTR = &start_val
1457   tvbuff_t * start_val;
1458   fp_info       *fpinf;
1459   rlc_info      *rlcinf;
1460   rrc_ciphering_info * ciphering_info;
1461   uint32_t * start;
1462   enum nas_sys_info_gsm_map cn_domain;
1464 %(DEFAULT_BODY)s
1466   /*We base this map on User Identity from RLC*/
1467   fpinf = (fp_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_fp, 0);
1468   rlcinf = (rlc_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_umts_rlc, 0);
1470   /*If FP info or RLC info is missing , skip all this*/
1471   if(fpinf == NULL || rlcinf == NULL){
1472       return offset;
1473   }
1474   /*Retrieve the start value for the two ciphering domains*/
1475   cn_domain = private_data_get_cn_domain(actx);
1476   switch(cn_domain){
1477     case RRC_NAS_SYS_INFO_CS:
1478       /*
1479       ws_warning("Not implemented");
1480       */
1481       break;
1482     case RRC_NAS_SYS_INFO_PS:
1484       /*Find the entry for the UE ID(taken from RLC)*/
1485       ciphering_info = get_or_create_cipher_info(fpinf, rlcinf);
1486       private_data_set_ciphering_info(actx, ciphering_info);
1488       /*Retrieve and store the value*/
1489       if(ciphering_info && ciphering_info->start_ps) {
1490         start = g_new(uint32_t,1);
1491         *start = tvb_get_bits32(start_val,0,20,ENC_BIG_ENDIAN);
1492         /*Insert the value based on current frame num since this might vary over time*/
1493         g_tree_insert(ciphering_info->start_ps, GUINT_TO_POINTER(actx->pinfo->num), start);
1494       }
1495       break;
1496     default:
1497       break;
1498   }
1499   private_data_set_cn_domain(actx, RRC_NAS_SYS_UNKNOWN);
1501 #.FN_BODY RB-ActivationTimeInfo
1502   fp_info            *fpinf;
1503   rlc_info           *rlcinf;
1504   rrc_ciphering_info *ciphering_info;
1505   uint32_t rbid;
1506   uint32_t rlc_ciphering_sqn;
1507   uint32_t direction;
1509   fpinf = (fp_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_fp, 0);
1510   rlcinf = (rlc_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_umts_rlc, 0);
1512 %(DEFAULT_BODY)s
1514   /*If FP info or RLC info is missing , skip all this*/
1515   if(fpinf == NULL || rlcinf == NULL){
1516     return offset;
1517   }
1519   ciphering_info = private_data_get_ciphering_info(actx);
1520   if( ciphering_info == NULL ){
1521     return offset;
1522   }
1524   rbid = private_data_get_rbid(actx);
1525   rlc_ciphering_sqn = private_data_get_rlc_ciphering_sqn(actx);
1526   direction = fpinf->is_uplink ? P2P_DIR_UL : P2P_DIR_DL;
1527   /*Set the ciphering activation frame information*/
1528   ciphering_info->seq_no[rbid][direction] = rlc_ciphering_sqn;
1531 #.FN_BODY RB-Identity VAL_PTR = &rbid
1532 uint32_t rbid;
1533 %(DEFAULT_BODY)s
1534 private_data_set_rbid(actx, rbid);
1537 #.FN_BODY RLC-SequenceNumber VAL_PTR = &rlc_ciphering_sqn
1538 uint32_t rlc_ciphering_sqn;
1539 %(DEFAULT_BODY)s
1540 private_data_set_rlc_ciphering_sqn(actx, rlc_ciphering_sqn);
1542 #.FN_BODY CipheringAlgorithm VAL_PTR = &ciphering_algo
1543   rrc_ciphering_info *ciphering_info;
1544   int32_t ciphering_algo;
1546 %(DEFAULT_BODY)s
1548   ciphering_info = private_data_get_ciphering_info(actx);
1549   if (ciphering_info == NULL) {
1550     return offset;
1551   }
1552   ciphering_info->ciphering_algorithm = ciphering_algo;
1554 #.FN_BODY CipheringAlgorithm-r7 VAL_PTR = &ciphering_algo
1555   rrc_ciphering_info *ciphering_info;
1556   int32_t ciphering_algo;
1558 %(DEFAULT_BODY)s
1560   ciphering_info = private_data_get_ciphering_info(actx);
1561   if (ciphering_info == NULL) {
1562     return offset;
1563   }
1564   ciphering_info->ciphering_algorithm = ciphering_algo;
1566 #.FN_BODY IntegrityProtectionAlgorithm VAL_PTR = &integrity_algo
1567   rrc_ciphering_info *ciphering_info;
1568   int32_t integrity_algo;
1570 %(DEFAULT_BODY)s
1572   ciphering_info = private_data_get_ciphering_info(actx);
1573   if (ciphering_info == NULL) {
1574     return offset;
1575   }
1576   ciphering_info->integrity_algorithm = integrity_algo;
1578 #.FN_BODY IntegrityProtectionAlgorithm-r7 VAL_PTR = &integrity_algo
1579   rrc_ciphering_info *ciphering_info;
1580   int32_t integrity_algo;
1582 %(DEFAULT_BODY)s
1584   ciphering_info = private_data_get_ciphering_info(actx);
1585   if (ciphering_info == NULL) {
1586     return offset;
1587   }
1588   ciphering_info->integrity_algorithm = integrity_algo;
1590 #.FN_BODY DL-DCCH-MessageType VAL_PTR = &msg_type
1591 %(DEFAULT_BODY)s
1593 #.FN_BODY DL-DCCH-Message
1594 %(DEFAULT_BODY)s
1596 #.FN_BODY HandoverToUTRANCommand
1597 %(DEFAULT_BODY)s
1599 #.FN_BODY UE-SecurityInformation
1600   private_data_set_cn_domain(actx, RRC_NAS_SYS_INFO_CS);
1601 %(DEFAULT_BODY)s
1603 #.FN_BODY UE-SecurityInformation2
1604   private_data_set_cn_domain(actx, RRC_NAS_SYS_INFO_PS);
1605 %(DEFAULT_BODY)s
1607 #.FN_BODY ReleaseCause VAL_PTR=&value
1608   uint32_t value;
1609 %(DEFAULT_BODY)s
1610   col_append_fstr(actx->pinfo->cinfo, COL_INFO, " [cause=%%s]",
1611                   val_to_str_const(value, rrc_ReleaseCause_vals, "Unknown"));
1613 #.FN_BODY MasterInformationBlock
1614   col_append_str(actx->pinfo->cinfo, COL_INFO, "MasterInformationBlock");
1615 %(DEFAULT_BODY)s
1617 #.FN_BODY SysInfoType1
1618   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 1");
1619 %(DEFAULT_BODY)s
1621 #.FN_BODY SysInfoType2
1622   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 2");
1623 %(DEFAULT_BODY)s
1625 #.FN_BODY SysInfoType3
1626   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 3");
1627 %(DEFAULT_BODY)s
1629 #.FN_BODY SysInfoType4
1630   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 4");
1631 %(DEFAULT_BODY)s
1633 #.FN_BODY SysInfoType5
1634   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 5");
1635 %(DEFAULT_BODY)s
1637 #.FN_BODY SysInfoType5bis
1638   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 5bis");
1639 %(DEFAULT_BODY)s
1641 #.FN_BODY SysInfoType6
1642   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 6");
1643 %(DEFAULT_BODY)s
1645 #.FN_BODY SysInfoType7
1646   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 7");
1647 %(DEFAULT_BODY)s
1649 #.FN_BODY SysInfoType11
1650   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 11");
1651 %(DEFAULT_BODY)s
1653 #.FN_BODY SysInfoType11bis
1654   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 11bis");
1655 %(DEFAULT_BODY)s
1657 #.FN_BODY SysInfoType11ter
1658   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 11ter");
1659 %(DEFAULT_BODY)s
1661 #.FN_BODY SysInfoType12
1662   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 12");
1663 %(DEFAULT_BODY)s
1665 #.FN_BODY SysInfoType13
1666   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 13");
1667 %(DEFAULT_BODY)s
1669 #.FN_BODY SysInfoType13-1
1670   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 13.1");
1671 %(DEFAULT_BODY)s
1673 #.FN_BODY SysInfoType13-2
1674   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 13.2");
1675 %(DEFAULT_BODY)s
1677 #.FN_BODY SysInfoType13-3
1678   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 13.3");
1679 %(DEFAULT_BODY)s
1681 #.FN_BODY SysInfoType13-4
1682   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 13.4");
1683 %(DEFAULT_BODY)s
1685 #.FN_BODY SysInfoType14
1686   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 14");
1687 %(DEFAULT_BODY)s
1689 #.FN_BODY SysInfoType15
1690   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 15");
1691 %(DEFAULT_BODY)s
1693 #.FN_BODY SysInfoType15bis
1694   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 15bis");
1695 %(DEFAULT_BODY)s
1697 #.FN_BODY SysInfoType15-1
1698   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 15.1");
1699 %(DEFAULT_BODY)s
1701 #.FN_BODY SysInfoType15-1bis
1702   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 15.1bis");
1703 %(DEFAULT_BODY)s
1705 #.FN_BODY SysInfoType15-1ter
1706   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 15.1ter");
1707 %(DEFAULT_BODY)s
1709 #.FN_BODY SysInfoType15-2
1710   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 15.2");
1711 %(DEFAULT_BODY)s
1713 #.FN_BODY SysInfoType15-2bis
1714   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 15.2bis");
1715 %(DEFAULT_BODY)s
1717 #.FN_BODY SysInfoType15-2ter
1718   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 15.2ter");
1719 %(DEFAULT_BODY)s
1721 #.FN_BODY SysInfoType15-3
1722   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 15.3");
1723 %(DEFAULT_BODY)s
1725 #.FN_BODY SysInfoType15-3bis
1726   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 15.3bis");
1727 %(DEFAULT_BODY)s
1729 #.FN_BODY SysInfoType15-4
1730   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 15.4");
1731 %(DEFAULT_BODY)s
1733 #.FN_BODY SysInfoType15-5
1734   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 15.5");
1735 %(DEFAULT_BODY)s
1737 #.FN_BODY SysInfoType15-6
1738   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 15.6");
1739 %(DEFAULT_BODY)s
1741 #.FN_BODY SysInfoType15-7
1742   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 15.7");
1743 %(DEFAULT_BODY)s
1745 #.FN_BODY SysInfoType15-8
1746   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 15.8");
1747 %(DEFAULT_BODY)s
1749 #.FN_BODY SysInfoType16
1750   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 16");
1751 %(DEFAULT_BODY)s
1753 #.FN_BODY SysInfoType17
1754   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 17");
1755 %(DEFAULT_BODY)s
1757 #.FN_BODY SysInfoType18
1758   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 18");
1759 %(DEFAULT_BODY)s
1761 #.FN_BODY SysInfoType19
1762   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 19");
1763 %(DEFAULT_BODY)s
1765 #.FN_BODY SysInfoType20
1766   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 20");
1767 %(DEFAULT_BODY)s
1769 #.FN_BODY SysInfoType21
1770   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 21");
1771 %(DEFAULT_BODY)s
1773 #.FN_BODY SysInfoType22
1774   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 22");
1775 %(DEFAULT_BODY)s
1777 #.FN_BODY SysInfoType23
1778   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 23");
1779 %(DEFAULT_BODY)s
1781 #.FN_BODY SysInfoType24
1782   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 24");
1783 %(DEFAULT_BODY)s
1785 #.FN_BODY SysInfoType25
1786   col_append_str(actx->pinfo->cinfo, COL_INFO, "SysInfoType 25");
1787 %(DEFAULT_BODY)s
1789 #.FN_BODY SysInfoTypeSB1
1790   col_append_str(actx->pinfo->cinfo, COL_INFO, "Scheduling Block 1");
1791 %(DEFAULT_BODY)s
1793 #.FN_BODY SysInfoTypeSB2
1794   col_append_str(actx->pinfo->cinfo, COL_INFO, "Scheduling Block 2");
1795 %(DEFAULT_BODY)s
1797 #.FN_BODY SysInfoTypeSB3
1798   col_append_str(actx->pinfo->cinfo, COL_INFO, "Scheduling Block 3");
1799 %(DEFAULT_BODY)s
1801 #.END