(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-dcc.c) |
| |
| 212 | | | dissect_dcc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) |
| 213 | | | { |
| 214 | | | proto_tree *dcc_tree, *dcc_optree, *dcc_opnumtree, *ti; |
| 215 | | | proto_tree *dcc_tracetree; |
| 216 | | | proto_item *hidden_item; |
| 217 | | | int offset = 0; |
| 218 | | | int client_is_le = 0; |
| 219 | | | int op = 0; |
| 220 | | | int i, is_response; |
| 221 | | | |
| 222 | | | if (pinfo->srcport != DCC_PORT && pinfo->destport != DCC_PORT) { |
Event 1:
Skipping " if". pinfo->srcport != 6277 evaluates to false.
hide
|
|
| 223 | | | |
| 224 | | | return FALSE; |
| 225 | | | } |
| 226 | | | |
| 227 | | | |
| 228 | | | if ( tvb_length(tvb) < sizeof(DCC_HDR) ) { |
Event 2:
Skipping " if". tvb_length(...) < sizeof( DCC_HDR ) evaluates to false.
hide
|
|
| 229 | | | |
| 230 | | | return FALSE; |
| 231 | | | } |
| 232 | | | |
| 233 | [+] | | if (check_col(pinfo->cinfo, COL_PROTOCOL)) |
 |
| 234 | | | col_set_str(pinfo->cinfo, COL_PROTOCOL, "DCC"); |
| 235 | | | |
| 236 | | | offset = 0; |
| 237 | | | is_response = pinfo->srcport == DCC_PORT; |
Event 5:
pinfo->srcport == 6277 evaluates to true.
hide
|
|
| 238 | | | |
| 239 | [+] | | if (check_col(pinfo->cinfo, COL_INFO)) { |
 |
| 240 | | | col_add_fstr(pinfo->cinfo, COL_INFO, |
| 241 | | | "%s: %s", |
| 242 | | | is_response ? "Response" : "Request", |
| 243 | | | val_to_str(tvb_get_guint8(tvb, offset+3), |
| 244 | | | dcc_op_vals, "Unknown Op: %u") |
| 245 | | | ); |
| 246 | | | } |
| 247 | | | |
| 248 | | | if (tree) { |
Event 8:
Taking true branch. tree evaluates to true.
hide
|
|
| 249 | | | ti = proto_tree_add_item(tree, proto_dcc, tvb, offset, -1, |
| 250 | [+] | | FALSE); |
 |
| 251 | | | dcc_tree = proto_item_add_subtree(ti, ett_dcc); |
| 252 | | | |
| 253 | | | proto_tree_add_item(dcc_tree, hf_dcc_len, tvb, |
| 254 | | | offset, 2, FALSE); |
| 255 | | | |
| 256 | | | if ( tvb_length(tvb) < tvb_get_ntohs(tvb, offset)) { |
Event 14:
Taking true branch. tvb_length(...) < tvb_get_ntohs(...) evaluates to true.
hide
|
|
| 257 | | | |
| 258 | | | proto_tree_add_text(dcc_tree, tvb, offset, 2, "Error - packet is shorter than claims!"); |
| 259 | | | } |
| 260 | | | offset += 2; |
| 261 | | | |
| 262 | | | proto_tree_add_item(dcc_tree, hf_dcc_pkt_vers, tvb, |
| 263 | | | offset, 1, FALSE); |
| 264 | | | offset += 1; |
| 265 | | | |
| 266 | [+] | | op = tvb_get_guint8(tvb, offset); |
 |
| 267 | | | proto_tree_add_item(dcc_tree, hf_dcc_op, tvb, |
| 268 | | | offset, 1, FALSE); |
| 269 | | | offset += 1; |
| 270 | | | |
| 271 | | | proto_tree_add_item(dcc_tree, hf_dcc_clientid, tvb, |
| 272 | | | offset, 4, FALSE); |
| 273 | | | offset += 4; |
| 274 | | | |
| 275 | | | ti = proto_tree_add_text(dcc_tree, tvb, offset, -1, "Operation Numbers (Opaque to Server)"); |
| 276 | | | dcc_opnumtree = proto_item_add_subtree(ti, ett_dcc_opnums); |
| 277 | | | |
| 278 | | | |
| 279 | | | |
| 280 | | | |
| 281 | | | |
| 282 | | | |
| 283 | | | |
| 284 | | | |
| 285 | | | client_is_le = ( (tvb_get_guint8(tvb, offset+4) | tvb_get_guint8(tvb, offset+4)) && |
Event 19:
tvb_get_guint8(...) | tvb_get_guint8(...) evaluates to true.
hide
|
|
| 286 | | | (tvb_get_guint8(tvb, offset+8) | tvb_get_guint8(tvb, offset+9)) && |
Event 20:
tvb_get_guint8(...) | tvb_get_guint8(...) evaluates to false.
hide
|
|
| 287 | | | (tvb_get_guint8(tvb, offset+12) | tvb_get_guint8(tvb, offset+13)) ); |
| 288 | | | |
| 289 | | | proto_tree_add_item(dcc_opnumtree, hf_dcc_opnums_host, tvb, |
| 290 | | | offset, 4, client_is_le); |
| 291 | | | offset += 4; |
| 292 | | | |
| 293 | | | proto_tree_add_item(dcc_opnumtree, hf_dcc_opnums_pid, tvb, |
| 294 | [+] | | offset, 4, client_is_le); |
 |
| 295 | | | offset += 4; |
| 296 | | | |
| 297 | | | proto_tree_add_item(dcc_opnumtree, hf_dcc_opnums_report, tvb, |
| 298 | | | offset, 4, client_is_le); |
| 299 | | | offset += 4; |
| 300 | | | |
| 301 | | | proto_tree_add_item(dcc_opnumtree, hf_dcc_opnums_retrans, tvb, |
| 302 | [+] | | offset, 4, client_is_le); |
 |
| 303 | | | offset += 4; |
| 304 | | | |
| 305 | | | ti = proto_tree_add_text(dcc_tree, tvb, offset, -1, "Operation: %s", |
| 306 | | | val_to_str(op, dcc_op_vals, "Unknown Op: %u")); |
| 307 | | | dcc_optree = proto_item_add_subtree(ti, ett_dcc_op); |
| 308 | | | |
| 309 | | | switch(op) { |
Event 35:
op evaluates to 5.
hide
|
|
| 310 | | | case DCC_OP_NOP: |
| 311 | | | D_SIGNATURE();
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-dcc.c |
| |
84 | #define D_SIGNATURE() \ |
85 | proto_tree_add_item(dcc_optree, hf_dcc_signature, tvb, \ |
86 | offset, sizeof(DCC_SIGNATURE), FALSE); \ |
87 | offset += sizeof(DCC_SIGNATURE); |
| |
|
| 312 | | | break; |
| 313 | | | |
| 314 | | | case DCC_OP_REPORT: |
| 315 | | | D_TARGET();
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-dcc.c |
| |
109 | #define D_TARGET() \ |
110 | hidden_item = proto_tree_add_item(dcc_tree, hf_dcc_target, tvb, \ |
111 | offset, sizeof(DCC_TGTS), FALSE); \ |
112 | PROTO_ITEM_SET_HIDDEN(hidden_item); \ |
113 | proto_tree_add_text(dcc_optree, tvb, offset, sizeof(DCC_TGTS), "%s", \ |
114 | val_to_str(tvb_get_ntohl(tvb,offset), dcc_target_vals, "Targets (%u)")); \ |
115 | offset += sizeof(DCC_TGTS); \ |
116 | |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
319 | #define PROTO_ITEM_SET_HIDDEN(proto_item) \ |
320 | ((proto_item) ? FI_SET_FLAG((proto_item)->finfo, FI_HIDDEN) : 0) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
246 | #define FI_SET_FLAG(fi, flag) (fi->flags = fi->flags | flag) |
| |
|
| 316 | | | for (i=0; i<=DCC_QUERY_MAX && |
| 317 | | | tvb_bytes_exist(tvb, offset+sizeof(DCC_SIGNATURE),1); i++) |
| 318 | | | { |
| 319 | | | D_CHECKSUM();
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-dcc.c |
| |
126 | #define D_CHECKSUM() { \ |
127 | proto_tree *cktree, *ckti; \ |
128 | ckti = proto_tree_add_text(dcc_optree, tvb, offset, sizeof(DCC_CK), \ |
129 | "Checksum - %s", val_to_str(tvb_get_guint8(tvb,offset), \ |
130 | dcc_cktype_vals, \ |
131 | "Unknown Type: %u")); \ |
132 | cktree = proto_item_add_subtree(ckti, ett_dcc_ck); \ |
133 | proto_tree_add_item(cktree, hf_dcc_ck_type, tvb, offset, 1, FALSE); \ |
134 | offset += 1; \ |
135 | proto_tree_add_item(cktree, hf_dcc_ck_len, tvb, offset, 1, FALSE); \ |
136 | offset += 1; \ |
137 | proto_tree_add_item(cktree, hf_dcc_ck_sum, tvb, offset, \ |
138 | sizeof(DCC_SUM), FALSE); \ |
139 | offset += sizeof(DCC_SUM); \ |
140 | } |
| |
|
| 320 | | | } |
| 321 | | | D_SIGNATURE();
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-dcc.c |
| |
84 | #define D_SIGNATURE() \ |
85 | proto_tree_add_item(dcc_optree, hf_dcc_signature, tvb, \ |
86 | offset, sizeof(DCC_SIGNATURE), FALSE); \ |
87 | offset += sizeof(DCC_SIGNATURE); |
| |
|
| 322 | | | break; |
| 323 | | | |
| 324 | | | case DCC_OP_QUERY_RESP: |
| 325 | | | for (i=0; i<=DCC_QUERY_MAX && |
| 326 | | | tvb_bytes_exist(tvb, offset+sizeof(DCC_SIGNATURE),1); i++) |
| 327 | | | { |
| 328 | | | D_TARGET();
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-dcc.c |
| |
109 | #define D_TARGET() \ |
110 | hidden_item = proto_tree_add_item(dcc_tree, hf_dcc_target, tvb, \ |
111 | offset, sizeof(DCC_TGTS), FALSE); \ |
112 | PROTO_ITEM_SET_HIDDEN(hidden_item); \ |
113 | proto_tree_add_text(dcc_optree, tvb, offset, sizeof(DCC_TGTS), "%s", \ |
114 | val_to_str(tvb_get_ntohl(tvb,offset), dcc_target_vals, "Targets (%u)")); \ |
115 | offset += sizeof(DCC_TGTS); \ |
116 | |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
319 | #define PROTO_ITEM_SET_HIDDEN(proto_item) \ |
320 | ((proto_item) ? FI_SET_FLAG((proto_item)->finfo, FI_HIDDEN) : 0) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
246 | #define FI_SET_FLAG(fi, flag) (fi->flags = fi->flags | flag) |
| |
|
| 329 | | | } |
| 330 | | | D_SIGNATURE();
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-dcc.c |
| |
84 | #define D_SIGNATURE() \ |
85 | proto_tree_add_item(dcc_optree, hf_dcc_signature, tvb, \ |
86 | offset, sizeof(DCC_SIGNATURE), FALSE); \ |
87 | offset += sizeof(DCC_SIGNATURE); |
| |
|
| 331 | | | break; |
| 332 | | | |
| 333 | | | case DCC_OP_ADMN: |
| 334 | | | if ( is_response ) |
Event 36:
Taking true branch. is_response evaluates to true.
hide
|
|
| 335 | | | { |
| 336 | [+] | | int left_local = tvb_length_remaining(tvb, offset) - |
 |
| 337 | | | sizeof(DCC_SIGNATURE); |
| 338 | | | if ( left_local == sizeof(DCC_ADMN_RESP_CLIENTS) ) |
Event 48:
Taking false branch. left_local == sizeof( DCC_ADMN_RESP_CLIENTS ) evaluates to false.
hide
|
|
| 339 | | | { |
| 340 | | | D_LABEL("Addr", 16);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-dcc.c |
| |
89 | #define D_LABEL(label,len) \ |
90 | proto_tree_add_text(dcc_optree, tvb, offset, len, label); \ |
91 | offset += len; |
| |
|
| 341 | | | D_LABEL("Id", sizeof(DCC_CLNT_ID));
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-dcc.c |
| |
89 | #define D_LABEL(label,len) \ |
90 | proto_tree_add_text(dcc_optree, tvb, offset, len, label); \ |
91 | offset += len; |
| |
|
| 342 | | | D_LABEL("Last Used", 4);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-dcc.c |
| |
89 | #define D_LABEL(label,len) \ |
90 | proto_tree_add_text(dcc_optree, tvb, offset, len, label); \ |
91 | offset += len; |
| |
|
| 343 | | | D_LABEL("Requests", 4);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-dcc.c |
| |
89 | #define D_LABEL(label,len) \ |
90 | proto_tree_add_text(dcc_optree, tvb, offset, len, label); \ |
91 | offset += len; |
| |
|
| 344 | | | } |
| 345 | | | else |
| 346 | | | { |
| 347 | [+][+][+] | | D_TEXT("Response Text", sizeof(DCC_SIGNATURE));
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-dcc.c |
| |
93 | #define D_TEXT(label, endpad) { \ |
94 | int next_offset,linelen,left; \ |
95 | const char *line; \ |
96 | while (tvb_offset_exists(tvb, offset+endpad)) { \ |
97 | left = tvb_length_remaining(tvb,offset) - endpad; \ |
98 | linelen = tvb_find_line_end(tvb, offset, left, &next_offset, \ |
99 | FALSE); \ |
100 | line = tvb_get_ptr(tvb, offset, linelen); \ |
101 | proto_tree_add_text(dcc_optree, tvb, offset, \ |
102 | next_offset - offset, "%s: %s", \ |
103 | label, tvb_format_text(tvb, offset, next_offset - offset)); \ |
104 | offset = next_offset; \ |
105 | } \ |
106 | } |
| |
|
 |
 |
 |
| |