aboutsummaryrefslogtreecommitdiffstats
path: root/asn1/rtse/rtse.cnf
blob: cc2144b7744ed0ee33d234351a49c0985fa95e0f (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
#.EXPORTS
RTORQapdu
RTOACapdu
RTORJapdu
RTABapdu
EXTERNALt

#.FN_BODY RTORJapdu/userDataRJ
	char *oid = NULL;

	switch(app_proto)  {
	case 1:		/* mts-transfer-protocol-1984 */
		oid = "applicationProtocol.1";
		break;
	case 12: 	/* mts-transfer-protocol */
		oid = "applicationProtocol.12";
		break;
	default:
		if(session && session->pres_ctx_id)
			oid = find_oid_by_pres_ctx_id(actx->pinfo, session->pres_ctx_id);
		break;
	}
	
	if(!oid) /* XXX: problem here is we haven't decoded the applicationProtocol yet - so we make assumptions! */
		oid = "applicationProtocol.12";

	if(oid) {
	  if((session = (struct SESSION_DATA_STRUCTURE*)(actx->pinfo->private_data)) != NULL)
		session->ros_op = (ROS_OP_BIND | ROS_OP_ERROR);

		offset = call_rtse_oid_callback(oid, tvb, offset, actx->pinfo, top_tree ? top_tree : tree);
	}

#.FN_BODY RTABapdu/userdataAB
/*XXX not implemented yet */

#.FN_BODY RTORQapdu

  if((session = (struct SESSION_DATA_STRUCTURE*)(actx->pinfo->private_data)) != NULL)
	session->ros_op = (ROS_OP_BIND | ROS_OP_ARGUMENT);
  open_request=TRUE;
  %(DEFAULT_BODY)s
  open_request=FALSE;

#.FN_BODY RTOACapdu

  if((session = (struct SESSION_DATA_STRUCTURE*)(actx->pinfo->private_data)) != NULL)
	session->ros_op = (ROS_OP_BIND | ROS_OP_RESULT);

  %(DEFAULT_BODY)s

#.FN_BODY ConnectionData/open

	char *oid = NULL;

	switch(app_proto)  {
	case 1:		/* mts-transfer-protocol-1984 */
		oid = "applicationProtocol.1";
		break;
	case 12: 	/* mts-transfer-protocol */
		oid = "applicationProtocol.12";
		break;
	default:
		if(session && session->pres_ctx_id)
			oid = find_oid_by_pres_ctx_id(actx->pinfo, session->pres_ctx_id);
		break;
	}
	
	if(!oid) /* XXX: problem here is we haven't decoded the applicationProtocol yet - so we make assumptions! */
		oid = "applicationProtocol.12";

	if(oid) {

		offset = call_rtse_oid_callback(oid, tvb, offset, actx->pinfo, top_tree ? top_tree : tree);
	}

	/* else XXX: need to flag we can't find the presentation context */

#.FN_BODY RTTRapdu
	tvbuff_t *next_tvb = NULL;

	offset = dissect_ber_octet_string(FALSE, actx, tree, tvb, offset, hf_index, &next_tvb);

	if(next_tvb) {

		/* XXX: we should check is this is an EXTERNAL first */

		/* ROS won't do this for us */
		if(session)
			session->ros_op = (ROS_OP_INVOKE | ROS_OP_ARGUMENT);

		offset = dissect_rtse_EXTERNALt(FALSE, next_tvb, 0, actx, tree, -1);

	}

#.FN_BODY EXTERNALt/_untag/indirect-reference
  char *oid;

  offset = dissect_ber_integer(FALSE, actx, tree, tvb, offset,
                hf_rtse_indirect_reference,
                &indir_ref);

  /* look up the indirect reference */
  if((oid = find_oid_by_pres_ctx_id(actx->pinfo, indir_ref)) != NULL) {
    object_identifier_id = ep_strdup_printf("%%s", oid);
  } else if (object_identifier_id) {
	*object_identifier_id = '\0';
  }
	

#.FN_BODY EXTERNALt/_untag/encoding/single-ASN1-type
  if (object_identifier_id) 
    offset=call_rtse_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, top_tree);


#.FN_BODY RTORQapdu/applicationProtocol

  offset = dissect_ber_integer(TRUE, actx, tree, tvb, offset, hf_index, &app_proto);

#.FN_BODY SessionConnectionIdentifier
  if(open_request && check_col(actx->pinfo->cinfo, COL_INFO))
    col_append_fstr(actx->pinfo->cinfo, COL_INFO, "Recover");
  %(DEFAULT_BODY)s

#.END
  
#.FN_BODY CallingSSuserReference/t61String  VAL_PTR=&string
  tvbuff_t *string = NULL;
  %(DEFAULT_BODY)s
  if(open_request && string && check_col(actx->pinfo->cinfo, COL_INFO))
    col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s", tvb_format_text(string, 0, tvb_length(string)));

#.FN_PARS CommonReference
  VAL_PTR=&string
#.FN_BODY CommonReference
  tvbuff_t *string = NULL;
  %(DEFAULT_BODY)s
  if(open_request && string && check_col(actx->pinfo->cinfo, COL_INFO))
    col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s", tvb_format_text(string, 0, tvb_length(string)));

#.END
  
#.FN_BODY CallingSSuserReference/octetString  VAL_PTR=&string
  tvbuff_t *string = NULL;
  %(DEFAULT_BODY)s
  if(open_request && string && check_col(actx->pinfo->cinfo, COL_INFO))
    col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s", tvb_format_text(string, 0, tvb_length(string)));

#.END