aboutsummaryrefslogtreecommitdiffstats
path: root/asn1/h248/h248.cnf
blob: e445a30c9581125cc6108999353b9cdfcaa617e7 (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
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
# h248.cnf
# H.248 conformation file

# $Id$

#.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


#.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,keep_persistent_data));
        
    if (keep_persistent_data)
        gcp_analyze_msg(h248_tree, actx->pinfo, h248_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
    guint32 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, keep_persistent_data);
    error_code = 0;
#.END

#.FN_BODY TransactionPending/transactionId
    guint32 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, keep_persistent_data);
    error_code = 0;

#.FN_BODY TransactionReply/transactionId		
    guint32 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, keep_persistent_data);
    error_code = 0;

#.FN_BODY SegmentReply/transactionId
    guint32 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, keep_persistent_data);
    error_code = 0;

#.FN_BODY ActionRequest/contextId
    guint32 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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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);
    }
    
    return offset;
#.END

#.FN_HDR TerminationID
    curr_info.term = wmem_new0(wmem_packet_scope(), 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_guint8(new_tvb,0) & 0x80 ? GCP_WILDCARD_CHOOSE : GCP_WILDCARD_ALL;
    /* limitation: assume only one wildcard is used */
    wild_card = tvb_get_guint8(new_tvb,0);
    
#.END

#.FN_BODY TerminationID/id
	tvbuff_t* new_tvb;
	offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, &new_tvb);
	
	if (new_tvb) {
		curr_info.term->len = tvb_length(new_tvb);
		curr_info.term->type = 0; /* unknown */

		if (curr_info.term->len) {
			curr_info.term->buffer = (guint8 *)tvb_memdup(wmem_packet_scope(),new_tvb,0,curr_info.term->len);
			curr_info.term->str = bytes_to_ep_str(curr_info.term->buffer,curr_info.term->len);
		}

		curr_info.term = gcp_cmd_add_term(curr_info.msg, curr_info.trx, curr_info.cmd, curr_info.term, wild_term, keep_persistent_data);

		if (h248_term_handle) {
			call_dissector_with_data(h248_term_handle, new_tvb, actx->pinfo, tree, &wild_card);
			wild_card = 0xFF;		
		}
	} else {
		curr_info.term->len = 0;
		curr_info.term->buffer = (guint8*)wmem_strdup(wmem_packet_scope(), "");
		curr_info.term->str = wmem_strdup(wmem_packet_scope(), "?");
	}
#.END

#.FN_BODY SCreasonValue
/* H248 v1 support */
	if ( h248_version > 1 ) {	
		/* Not V1, so call "standard" function */
%(DEFAULT_BODY)s	
} else {
	/* V1 so Value == octet string */
	offset = dissect_h248_ValueV1( implicit_tag, tvb, offset, actx, tree, hf_index);
};
	
#.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_HDR ValueV1
	guint8 i;
	guint32 len;
#.END

#.FN_BODY ValueV1
/* check tvb to verify all values ascii or not.  If so, output string, else hex */
	len=tvb_length_remaining(tvb, offset);
	if ( curr_info.par && curr_info.par->dissector) {
		curr_info.par->dissector(tree, /*next_*/tvb, actx->pinfo, *(curr_info.par->hfid), &curr_info, curr_info.par->data);
	} else {
		/* if no registered dissector create output */
		for( i=0;i<len;i++) {
			if(!isascii(tvb_get_guint8(tvb, offset+i)) || tvb_get_guint8(tvb, offset+i) == 0) {
				/* not ascii or NULL character so do string as hex string */
				proto_tree_add_text(tree, tvb, offset, len,"%s: 0x%s", 
					(proto_registrar_get_nth(hf_index))->name,
					tvb_bytes_to_ep_str(tvb, 0, len));
				return len;
			};
		};
		/* if here, then string is ascii */
		proto_tree_add_text(tree, tvb, offset, len,"%s: %s", 
					(proto_registrar_get_nth(hf_index))->name,
					tvb_format_text(tvb, 0, len));
	}
	offset = len;
	
#.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