static void dissect_msproxy_request(tvbuff_t *tvb,
	proto_tree *tree, hash_entry_t *conv_info) {

	int offset = 0;
	int cmd;

	if ( tree) {
		proto_tree_add_item( tree, hf_msproxy_client_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
		offset += 4;

		proto_tree_add_item( tree, hf_msproxy_version, tvb, offset, 4, ENC_LITTLE_ENDIAN);
		offset += 4;

		proto_tree_add_item( tree, hf_msproxy_server_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
		offset += 4;

		proto_tree_add_item( tree, hf_msproxy_server_ack, tvb, offset, 1, ENC_LITTLE_ENDIAN);
		offset += 4;

		proto_tree_add_item( tree, hf_msproxy_seq_num, tvb, offset, 1, ENC_LITTLE_ENDIAN);
		offset += 8;

		proto_tree_add_item( tree, hf_msproxy_rwsp_signature, tvb, offset, 4, ENC_NA|ENC_ASCII);
		offset += 12;
	}
	else 			/* no tree */
		offset += 36;

	cmd = tvb_get_ntohs( tvb, offset);

	if ( tree)
		proto_tree_add_uint_format( tree, hf_msproxy_cmd, tvb, offset, 2,
			cmd, "Command: %s (0x%02x)",
			get_msproxy_cmd_name( cmd, FROM_CLIENT),
			cmd);

	offset += 2;

	switch (cmd){
		case MSPROXY_AUTH:
			dissect_auth( tvb, offset, tree);
			break;

		case MSPROXY_BIND:
			dissect_bind( tvb, offset, tree, conv_info);
			break;

		case MSPROXY_UDP_BIND_REQ:
			dissect_udp_bind( tvb, offset, tree, conv_info);
			break;

		case MSPROXY_AUTH_2:	/*$$ this is probably wrong place for this */
		case MSPROXY_TCP_BIND:
			dissect_tcp_bind( tvb, offset, tree, conv_info);
			break;

		case MSPROXY_RESOLVE:
			dissect_request_resolve( tvb, offset, tree);
			break;

		case MSPROXY_CONNECT:
		case MSPROXY_LISTEN:
			dissect_request_connect( tvb, offset, tree,
				conv_info);
			break;

		case MSPROXY_BINDINFO_ACK:
			dissect_bind_info_ack( tvb, offset, tree);
			break;

		case MSPROXY_HELLO:
		case MSPROXY_HELLO_2:
			dissect_msproxy_request_1( tvb, offset, tree);
			break;

		case  MSPROXY_UDPASSOCIATE:
			dissect_udp_assoc( tvb, offset, tree, conv_info);
			break;
		default:
			if ( tree)
				proto_tree_add_text( tree, tvb, offset, 0,
					"Unhandled request command (report this, please)");
	}
}
Beispiel #2
0
static void dissect_msproxy_request(tvbuff_t *tvb,
                                    proto_tree *tree, hash_entry_t *conv_info) {

    int offset = 0;
    int cmd;

    if ( tree) {
        proto_tree_add_text( tree, tvb, offset, 4, "Client id: 0x%0x",
                             tvb_get_letohl( tvb, offset));
        offset += 4;

        proto_tree_add_text( tree, tvb, offset, 4, "Version: 0x%04x",
                             tvb_get_letohl( tvb, offset));
        offset += 4;

        proto_tree_add_text( tree, tvb, offset, 4, "Server id: 0x%0x",
                             tvb_get_letohl( tvb, offset));
        offset += 4;

        proto_tree_add_text( tree, tvb, offset, 1, "Server ack: %u",
                             tvb_get_guint8( tvb, offset));
        offset += 4;

        proto_tree_add_text( tree, tvb, offset, 1, "Sequence Number: %u",
                             tvb_get_guint8( tvb, offset));
        offset += 8;

        proto_tree_add_text( tree, tvb, offset, 4, "RWSP signature: %.4s",
                             tvb_get_ptr( tvb, offset, 4));
        offset += 12;
    }
    else 			/* no tree */
        offset += 36;

    cmd = tvb_get_ntohs( tvb, offset);

    if ( tree)
        proto_tree_add_uint_format( tree, hf_msproxy_cmd, tvb, offset, 2,
                                    cmd, "Command: 0x%02x (%s)", cmd,
                                    get_msproxy_cmd_name( cmd, FROM_CLIENT));

    offset += 2;

    switch (cmd) {
    case MSPROXY_AUTH:
        dissect_auth( tvb, offset, tree);
        break;

    case MSPROXY_BIND:
        dissect_bind( tvb, offset, tree, conv_info);
        break;

    case MSPROXY_UDP_BIND_REQ:
        dissect_udp_bind( tvb, offset, tree, conv_info);
        break;

    case MSPROXY_AUTH_2:	/*$$ this is probably wrong place for this */
    case MSPROXY_TCP_BIND:
        dissect_tcp_bind( tvb, offset, tree, conv_info);
        break;

    case MSPROXY_RESOLVE:
        dissect_request_resolve( tvb, offset, tree);
        break;

    case MSPROXY_CONNECT:
    case MSPROXY_LISTEN:
        dissect_request_connect( tvb, offset, tree,
                                 conv_info);
        break;

    case MSPROXY_BINDINFO_ACK:
        dissect_bind_info_ack( tvb, offset, tree);
        break;

    case MSPROXY_HELLO:
    case MSPROXY_HELLO_2:
        dissect_msproxy_request_1( tvb, offset, tree);
        break;

    case  MSPROXY_UDPASSOCIATE:
        dissect_udp_assoc( tvb, offset, tree, conv_info);
        break;
    default:
        if ( tree)
            proto_tree_add_text( tree, tvb, offset, 0,
                                 "Unhandled request command (report this, please)");
    }
}