summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/asn1/h248/h248.cnf
blob: f422429876a57de78a2781336a60d34ac6796712 (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
# h248.cnf
# H.248 conformation file

#.MODULE_IMPORT

#.EXPORTS

#.PDU

#.NO_EMIT
MtpAddress
PkgdName
ErrorCode
PropertyID
SignalName
SigParameterName
SigParamValue
EventName
EventParameterName
EventParamValue
ContextID
EventParamValueV1
SigParamValueV1

#.TYPE_RENAME
IndAudMediaDescriptor/streams			IndAudMediaDescriptorStreams
ActionRequest/contextId					ContextId
ActionReply/contextId					ContextId
StatisticsParameter/statName			StatName
StatisticsParameter/statValue			StatValue
PropertyParm/propertyName				PropertyName
EventParameter/extraInfo				EventPar_extraInfo
PropertyParm/extraInfo					PropParm_extraInfo
ContextRequest/iepscallind				Iepscallind_BOOL

#.FIELD_RENAME
IP4Address/address		iP4Address
IP6Address/address		iP6Address
ContextAttrAuditRequest/emergency	cAAREmergency
ContextAttrAuditRequest/priority	cAARPriority
SecondRequestedEvent/eventAction	secondaryEventAction
TerminationStateDescriptor/eventBufferControl	tSEventBufferControl
SecondEventsDescriptor/eventList	secondaryEventList
IndAudEventBufferDescriptor/eventName	iAEBDEventName
TerminationID/id			terminationId
IndAudStreamParms/localControlDescriptor iASPLocalControlDescriptor
IndAudStreamParms/localDescriptor	iASPLocalDescriptor
LocalControlDescriptor/propertyParms lCDpropertyParms
TerminationStateDescriptor/propertyParms tSDpropertyParms
MediaDescriptor/streams/oneStream	mediaDescriptorOneStream
MediaDescriptor/streams/multiStream	mediaDescriptorMultiStream
MediaDescriptor/streams/multiStream/_item	mediaDescriptorMultiStream_item
DomainName/name				domName
IndAudEventsDescriptor/pkgdName		iAEDPkgdName
IndAudLocalRemoteDescriptor/propGrps	iAPropertyGroup
IndAudLocalControlDescriptor/propertyParms	indAudPropertyParms
IndAudTerminationStateDescriptor/propertyParms	indAudPropertyParms
IndAudLocalControlDescriptor/reserveGroup	iALCDReserveGroup
IndAudLocalControlDescriptor/reserveValue	iALCDReserveValue
IndAudLocalControlDescriptor/streamMode		iALCDStreamMode
IndAudStreamDescriptor/streamParms		indAudStreamParms
IndAudMediaDescriptor/termStateDescr		indAudTerminationStateDescriptor
IndAudSignal/signalName				iASignalName
IndAudSeqSigList/signalList			iASignalList
IndAudSignalsDescriptor/signal			indAudSignal
IndAudSignalsDescriptor/seqSigList		indAudSeqSigList
IndAudTerminationStateDescriptor/serviceState	iATSDServiceState
IndAudStreamParms/remoteDescriptor		iASPRemoteDescriptor
PropertyParm/value				propertyParamValue
IndAudMediaDescriptor/streams			indAudMediaDescriptorStreams
AmmRequest/terminationID			terminationIDList
AmmsReply/terminationID			terminationIDList
AmmDescriptor/statisticsDescriptor	aDstatisticsDescriptor
AuditReturnParameter/statisticsDescriptor	aRPstatisticsDescriptor
StreamParms/statisticsDescriptor				sPstatisticsDescriptor
SubtractRequest/terminationID			terminationIDList
NotifyRequest/terminationID			terminationIDList
NotifyReply/terminationID			terminationIDList
ServiceChangeRequest/terminationID			terminationIDList
ServiceChangeReply/terminationID			terminationIDList
IndAudStatisticsDescriptor/statName		iAStatName
EventParameter/extraInfo				eventPar_extraInfo
PropertyParm/extraInfo					propParm_extraInfo
ContextRequest/iepscallind				iepscallind_BOOL
TransactionRequest/transactionId	transactionId
SegmentReply/transactionId			seg_rep_transactionId
TransactionReply/transactionId		trep_transactionId
TransactionPending/transactionId	tpend_transactionId
EventParameterV1/value		event_param_value
SigParameterV1/value		sig_param_value
AuditReplyV1/auditResult	audit_result

#.FIELD_ATTR
IP4Address/address                  ABBREV=iP4Address
IP6Address/address                  ABBREV=iP6Address
TransactionRequest/transactionId    ABBREV=transactionRequest.transactionId
SegmentReply/transactionId          ABBREV=segmentreply.transactionId
TransactionReply/transactionId      ABBREV=transactionreply.transactionId
TransactionPending/transactionId    ABBREV=transactionpending.transactionId
DomainName/name                     ABBREV=domainname
TerminationID/id                    ABBREV=terminationId
PropertyParm/value                  ABBREV=propertyParamValue
EventParameterV1/value              ABBREV=event_param_value
SigParameterV1/value                ABBREV=sig_param_value

#.FN_HDR Message
    curr_info.msg = gcp_msg(actx->pinfo,tvb_raw_offset(tvb),keep_persistent_data);
#.END

#.FN_FTR Message
    col_add_str(actx->pinfo->cinfo, COL_INFO, gcp_msg_to_str(curr_info.msg,actx->pinfo->pool,keep_persistent_data));

    if (keep_persistent_data)
        gcp_analyze_msg(h248_tree, actx->pinfo, tvb, curr_info.msg, &h248_arrel, &ei_h248_errored_command);
#.END

#.FN_BODY Message/version VAL_PTR = &h248_version
	%(DEFAULT_BODY)s
#.END

#.FN_BODY TransactionRequest/transactionId
    uint32_t trx_id = 0;
	offset = dissect_h248_trx_id(implicit_tag, actx->pinfo, tree, tvb, offset, &trx_id);
    curr_info.trx = gcp_trx(curr_info.msg, trx_id, GCP_TRX_REQUEST, actx->pinfo, keep_persistent_data);
    error_code = 0;
#.END

#.FN_BODY TransactionPending/transactionId
    uint32_t trx_id = 0;
	offset = dissect_h248_trx_id(implicit_tag, actx->pinfo, tree, tvb, offset, &trx_id);
    curr_info.trx = gcp_trx(curr_info.msg, trx_id, GCP_TRX_PENDING, actx->pinfo, keep_persistent_data);
    error_code = 0;

#.FN_BODY TransactionReply/transactionId
    uint32_t trx_id = 0;
	offset = dissect_h248_trx_id(implicit_tag, actx->pinfo, tree, tvb, offset, &trx_id);
    curr_info.trx = gcp_trx(curr_info.msg, trx_id, GCP_TRX_REPLY, actx->pinfo, keep_persistent_data);
    error_code = 0;

#.FN_BODY SegmentReply/transactionId
    uint32_t trx_id = 0;
	offset = dissect_h248_trx_id(implicit_tag, actx->pinfo, tree, tvb, offset, &trx_id);
    curr_info.trx = gcp_trx(curr_info.msg, trx_id, GCP_TRX_ACK, actx->pinfo, keep_persistent_data);
    error_code = 0;

#.FN_BODY ActionRequest/contextId
    uint32_t ctx_id = 0;
	offset = dissect_h248_ctx_id(implicit_tag, actx->pinfo, tree, tvb, offset, &ctx_id);
    curr_info.ctx = gcp_ctx(curr_info.msg,curr_info.trx,ctx_id,actx->pinfo,keep_persistent_data);
    curr_info.cmd = NULL;
    curr_info.term = NULL;
#.END


#.FN_FTR ActionReply
    if (!curr_info.cmd) {
	  curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_REPLY,offset,actx->pinfo,keep_persistent_data);
      H248_TAP();
	}
#.END

#.FN_HDR Command/addReq
	  curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_ADD_REQ,offset,actx->pinfo,keep_persistent_data);
      H248_TAP();
#.END

#.FN_FTR Command/addReq
      curr_info.cmd = NULL;
#.END

#.FN_HDR Command/moveReq
	  curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_MOVE_REQ,offset,actx->pinfo,keep_persistent_data);
      H248_TAP();

#.END

#.FN_FTR Command/moveReq
      curr_info.cmd = NULL;
#.END

#.FN_HDR Command/modReq
	  curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_MOD_REQ,offset,actx->pinfo,keep_persistent_data);
      H248_TAP();
#.END
#.FN_FTR Command/modReq
      curr_info.cmd = NULL;
#.END

#.FN_HDR Command/subtractReq
	  curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_SUB_REQ,offset,actx->pinfo,keep_persistent_data);
      H248_TAP();
#.END
#.FN_FTR Command/subtractReq
      curr_info.cmd = NULL;
#.END

#.FN_HDR Command/auditCapRequest
	  curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_AUDITCAP_REQ,offset,actx->pinfo,keep_persistent_data);
      H248_TAP();
#.END
#.FN_FTR Command/auditCapRequest
      curr_info.cmd = NULL;
#.END

#.FN_HDR Command/auditValueRequest
	  curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_AUDITVAL_REQ,offset,actx->pinfo,keep_persistent_data);
      H248_TAP();
#.END
#.FN_FTR Command/auditValueRequest
      curr_info.cmd = NULL;
#.END

#.FN_HDR Command/notifyReq
	  curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_NOTIFY_REQ,offset,actx->pinfo,keep_persistent_data);
      H248_TAP();
#.END
#.FN_FTR Command/notifyReq
      curr_info.cmd = NULL;
#.END

#.FN_HDR ServiceChangeRequest
      curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_SVCCHG_REQ,offset,actx->pinfo,keep_persistent_data);
      H248_TAP();
#.END
#.FN_FTR ServiceChangeRequest
      curr_info.cmd = NULL;
#.END

#.FN_HDR ContextRequest/topologyReq
      curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_TOPOLOGY_REQ,offset,actx->pinfo,keep_persistent_data);
      H248_TAP();
#.END
#.FN_FTR ContextRequest/topologyReq
      curr_info.cmd = NULL;
#.END

#.FN_HDR ActionRequest/contextAttrAuditReq
      curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_CTX_ATTR_AUDIT_REQ,offset,actx->pinfo,keep_persistent_data);
      H248_TAP();
#.END
#.FN_FTR ActionRequest/contextAttrAuditReq
      curr_info.cmd = NULL;
#.END

#.FN_HDR CommandReply/addReply
      curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_ADD_REPLY,offset,actx->pinfo,keep_persistent_data);
      H248_TAP();
#.END

#.FN_HDR CommandReply/moveReply
      curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_MOVE_REPLY,offset,actx->pinfo,keep_persistent_data);
      H248_TAP();
#.END

#.FN_HDR CommandReply/modReply
      curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_MOD_REPLY,offset,actx->pinfo,keep_persistent_data);
      H248_TAP();
#.END

#.FN_HDR CommandReply/subtractReply
      curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_SUB_REPLY,offset,actx->pinfo,keep_persistent_data);
      H248_TAP();
#.END

#.FN_HDR CommandReply/notifyReply
      curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_NOTIFY_REPLY,offset,actx->pinfo,keep_persistent_data);
      H248_TAP();
#.END

#.FN_HDR ServiceChangeReply
      curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_SVCCHG_REPLY,offset,actx->pinfo,keep_persistent_data);
      H248_TAP();
#.END

#.FN_HDR CommandReply/auditCapReply
      curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_AUDITCAP_REPLY,offset,actx->pinfo,keep_persistent_data);
      H248_TAP();
#.END

#.FN_BODY CommandReply/auditCapReply
/* h248v1 support */
	if(h248_version > 1) {
		%(DEFAULT_BODY)s
} else {
	/* call V1 of the dissector */
	offset = dissect_h248_AuditReplyV1(implicit_tag, tvb, offset, actx, tree, hf_index);
}
#.END

#.FN_HDR CommandReply/auditValueReply
      curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_AUDITVAL_REPLY,offset,actx->pinfo,keep_persistent_data);
      H248_TAP();
#.END

#.FN_BODY CommandReply/auditValueReply
/* h248v1 support */
	if(h248_version > 1) {
		%(DEFAULT_BODY)s
} else {
	/* call V1 of the dissector */
	offset = dissect_h248_AuditReplyV1(implicit_tag, tvb, offset, actx, tree, hf_index);
}
#.END

#.FN_BODY AuditReplyV1
/* h248v1 support */
	offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
		AuditReplyV1_sequence, hf_h248_auditValueReplyV1, ett_h248_AuditReplyV1);
#.END

#.FN_BODY ErrorDescriptor/errorCode
    offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index, &error_code);
    expert_add_info(actx->pinfo, actx->created_item, &ei_h248_errored_command);

    if (curr_info.cmd) {
        gcp_cmd_set_error(curr_info.cmd,error_code);
    } else if (curr_info.trx) {
        gcp_trx_set_error(curr_info.trx,error_code);
    }
#.END

#.FN_HDR TerminationID
    curr_info.term = wmem_new0(actx->pinfo->pool, gcp_term_t);
    wild_term = GCP_WILDCARD_NONE;
#.END

#.FN_BODY WildcardField
    tvbuff_t* new_tvb;
    offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, &new_tvb);
    tree = proto_item_add_subtree(actx->created_item,ett_wildcard);
    proto_tree_add_item(tree,hf_h248_term_wild_type,new_tvb,0,1,ENC_BIG_ENDIAN);
    proto_tree_add_item(tree,hf_h248_term_wild_level,new_tvb,0,1,ENC_BIG_ENDIAN);
    proto_tree_add_item(tree,hf_h248_term_wild_position,new_tvb,0,1,ENC_BIG_ENDIAN);

    wild_term = tvb_get_uint8(new_tvb,0) & 0x80 ? GCP_WILDCARD_CHOOSE : GCP_WILDCARD_ALL;
    /* limitation: assume only one wildcard is used */
    wild_card = tvb_get_uint8(new_tvb,0);

#.END

#.FN_BODY TerminationID/id
	tvbuff_t* new_tvb;
	h248_term_info_t term_info;

	term_info.wild_card = wild_card;
	term_info.str = NULL;

	offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, &new_tvb);

	if (new_tvb) {
		curr_info.term->len = tvb_reported_length(new_tvb);
		curr_info.term->type = 0; /* unknown */

		if (h248_term_handle) {
			call_dissector_with_data(h248_term_handle, new_tvb, actx->pinfo, tree, &term_info);
			wild_card = 0xFF;
		}

		if (curr_info.term->len) {
			curr_info.term->buffer = (uint8_t *)tvb_memdup(actx->pinfo->pool,new_tvb,0,curr_info.term->len);
			if(term_info.str){
				curr_info.term->str = wmem_strdup_printf(actx->pinfo->pool, "%s %s",
											bytes_to_str_punct(actx->pinfo->pool,curr_info.term->buffer,curr_info.term->len, 0),
											term_info.str);
			}else{
				curr_info.term->str = bytes_to_str_punct(actx->pinfo->pool,curr_info.term->buffer,curr_info.term->len, 0);
			}
		}


		curr_info.term = gcp_cmd_add_term(curr_info.msg, curr_info.trx, curr_info.cmd, curr_info.term, wild_term, actx->pinfo, keep_persistent_data);

	} else {
		curr_info.term->len = 0;
		curr_info.term->buffer = (uint8_t*)wmem_strdup(actx->pinfo->pool, "");
		curr_info.term->str = wmem_strdup(actx->pinfo->pool, "?");
	}
#.END

#.FN_BODY SCreasonValueOctetStr VAL_PTR = &parameter_tvb
 tvbuff_t	*parameter_tvb;
 %(DEFAULT_BODY)s

 if (!parameter_tvb)
	return offset;

 dissect_h248_ServiceChangeReasonStr(false, parameter_tvb, 0, actx, tree, hf_h248_serviceChangeReasonStr);
#.END

#.FN_BODY EventParameter
/* H248 v1 support */
	if (h248_version > 1) {
		%(DEFAULT_BODY)s
} else {
	offset = dissect_h248_EventParameterV1( implicit_tag, tvb, offset, actx, tree, hf_index);
}
#.END

#.FN_BODY SigParameter
/* H248 v1 support */
	if (h248_version > 1) {
		%(DEFAULT_BODY)s
} else {
	offset = dissect_h248_SigParameterV1( implicit_tag, tvb, offset, actx, tree, hf_index);
}
#.END

#.TYPE_ATTR
IP4Address/address  TYPE = FT_IPv4  DISPLAY = BASE_NONE  STRINGS = NULL
IP6Address/address  TYPE = FT_IPv6  DISPLAY = BASE_NONE  STRINGS = NULL
ActionRequest/contextId TYPE = FT_UINT32 DISPLAY = BASE_HEX STRINGS = NULL
ActionReply/contextId TYPE = FT_UINT32 DISPLAY = BASE_HEX STRINGS = NULL
ErrorDescriptor/errorCode TYPE = FT_UINT32 DISPLAY = BASE_DEC|BASE_EXT_STRING STRINGS = &h248_reasons_ext