aboutsummaryrefslogtreecommitdiffstats
path: root/epan/sigcomp_state_hdlr.h
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2005-06-16 21:15:12 +0000
committerAnders Broman <anders.broman@ericsson.com>2005-06-16 21:15:12 +0000
commit681f2bbdef15c8dbceb85485ac94f77c5fdf8dbe (patch)
tree64938535511ba3e78f9aadf9ecf1ca57297b3a6d /epan/sigcomp_state_hdlr.h
parentf889a3ada35189c75880a723e2d0bca9b3b31cec (diff)
From Paul Ollis:
epan/sigcomp_state_hdlr.c epan/sigcomp_state_hdlr.h --------------------------------------------------- Function udvm_state_access: 1. Removed the state_vars_valid parameter. It is no longer used. 2. The function now correctly updates each of state_length, state_address and state_instruction with saved state value. [Previously this was only done for state referenced in the SigComp message header.] 3. Removed code that (incorrectly) read byte_copy_left from UDVM memory within the loop that writes the state to UDVM memory. 4. Removed the code that set the useful values in UDVM memory. This should only be done for state referenced in the SigComp message header. (The decompress_sigcomp_message function, sets the useful values.) epan/sigcomp-udvm.c epan/sigcomp-udvm.h --------------------------------------- Function decompress_sigcomp_message: 1. Added three new parameters; header_len, byte_code_state_len, byte_code_id_len. The byte_code_state_len and byte_code_id_len are used to set the useful values in UDVM memory. The header_len is required to calculate the cycles available for decompression. 2. Various minor corrections to spellings, etc in generated messages. 3. Reduced the number of lines of output for print_level_1. Now the execution trace shows the instruction name and parameter values on one line. [This was done because, we found that even at the lowest level of detail ethereal became unusably slow; running on a 500 MHz SPARC. This seems to be related to the number of lines produced by the SigComp trace, which can easily be over 1000 with the modified code.] 4. Removed the used of some floating point functions. In all cases they were unnecessary and could potentially cause the code to produce the wrong results on some platforms (although this is unlikely). 5. The useful values are now set correctly, using the new byte_code_state_len and byte_code_id_len parameters. 6. The message header length is now included in the calculation of maximum_UDVM_cycles. Previously, the calculation could underestimate the value, resulting in the (small) chance that some legitimate messages might fail to decompress. Note: The calculation might now slightly over-estimate the cycles but this is a reasonable thing to do. 7. Implemented the PUSH, POP, CALL and RETURN instructions. Note: The two SORT instructions and the CRC and SHA-1 instructions are still not implemented. 8. The COPY and COPY-LITERAL instructions now apply the byte-copying-rules to the source address as well as the destination address. 9. The COPY-LITERAL and COPY-OFFSET now correctly handle the destination operand. Previously, it was possible for the destination to be left at byte_copy_right when it should be left at byte_copy_left. 10. All three COPY instructions will now behave correctly if the source or destination start at byte_copy_right; i.e. they read/write to byte_copy_right, byte_copy_right+1, etc. Previously the parameters would wrap to byte_copy_left. 11. The COPY-OFFSET instruction now correctly calculates the source address for all values of offset. Previously a very large offset (greater than the circular buffer size) could cause the starting position to be mis-calculated. 12. Modulo 65536 arithmetic has been added in some places where it was missing. [Only when noticed, we have not been able to check all the code.] 13. Some redundant code was removed for the INPUT-BITS instruction. Also, INPUT-BITS (0, x, x) now correctly discards spare bits when the P-bit, has changed. 14. Corrected the cycles used calculation for the INPUT-BITS instruction. 15. Corrected some minor cases where the used_udvm_cycles was not incremented. [Not really a problem, but it allowed us to verify correctness with some of the SigComp torture tests.] 16. Removed some redundant code in INPUT-HUFFMAN (and reorganised some comments to keep them making sense). Function decomp_dispatch_get_bits: 1. This has been rewritten. The original version could not correctly handle requests for more than 8 bits. The new version is cleaner and correctly handles all cases. svn path=/trunk/; revision=14666
Diffstat (limited to 'epan/sigcomp_state_hdlr.h')
-rw-r--r--epan/sigcomp_state_hdlr.h90
1 files changed, 45 insertions, 45 deletions
diff --git a/epan/sigcomp_state_hdlr.h b/epan/sigcomp_state_hdlr.h
index f33e9a1483..29bf893145 100644
--- a/epan/sigcomp_state_hdlr.h
+++ b/epan/sigcomp_state_hdlr.h
@@ -1,45 +1,45 @@
-/* sigcomp_state_hdlr.c
- * Routines making up the State handler of the Univerasl Decompressor Virtual Machine (UDVM)
- * used for Signaling Compression (SigComp) dissection.
- * Copyright 2004, Anders Broman <anders.broman@ericsson.com>
- *
- * $Id: udvm.c 11445 2004-07-20 19:04:48Z etxrab $
- *
- * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@ethereal.com>
- * Copyright 1998 Gerald Combs
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- * References:
- * http://www.ietf.org/rfc/rfc3320.txt?number=3320
- * http://www.ietf.org/rfc/rfc3321.txt?number=3321
- * Useful links :
- * http://www.ietf.org/internet-drafts/draft-ietf-rohc-sigcomp-impl-guide-03.txt
- * http://www.ietf.org/internet-drafts/draft-ietf-rohc-sigcomp-sip-01.txt
- */
-
-#ifndef SIGCOMP_STATE_HDLR_H
-#define SIGCOMP_STATE_HDLR_H
-
-extern const value_string result_code_vals[];
-extern int udvm_state_access(tvbuff_t *tvb, proto_tree *tree,guint8 *buff,guint16 p_id_start, guint16 p_id_length, guint16 state_begin, guint16 *state_length,
- guint16 *state_address, guint16 state_instruction, gboolean state_vars_valid, gint hf_id);
-
-extern void udvm_state_create(guint8 *state_buff,guint8 *state_identifier_buff,guint16 p_id_length);
-extern void udvm_state_free(guint8 buff[],guint16 p_id_start,guint16 p_id_length);
-
-extern void sigcomp_init_udvm(void);
-#endif
-/* SIGCOMP_STATE_HDLR_H */
+/* sigcomp_state_hdlr.c
+ * Routines making up the State handler of the Univerasl Decompressor Virtual Machine (UDVM)
+ * used for Signaling Compression (SigComp) dissection.
+ * Copyright 2004, Anders Broman <anders.broman@ericsson.com>
+ *
+ * $Id: udvm.c 11445 2004-07-20 19:04:48Z etxrab $
+ *
+ * Ethereal - Network traffic analyzer
+ * By Gerald Combs <gerald@ethereal.com>
+ * Copyright 1998 Gerald Combs
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * References:
+ * http://www.ietf.org/rfc/rfc3320.txt?number=3320
+ * http://www.ietf.org/rfc/rfc3321.txt?number=3321
+ * Useful links :
+ * http://www.ietf.org/internet-drafts/draft-ietf-rohc-sigcomp-impl-guide-03.txt
+ * http://www.ietf.org/internet-drafts/draft-ietf-rohc-sigcomp-sip-01.txt
+ */
+
+#ifndef SIGCOMP_STATE_HDLR_H
+#define SIGCOMP_STATE_HDLR_H
+
+extern const value_string result_code_vals[];
+extern int udvm_state_access(tvbuff_t *tvb, proto_tree *tree,guint8 *buff,guint16 p_id_start, guint16 p_id_length, guint16 state_begin, guint16 *state_length,
+ guint16 *state_address, guint16 *state_instruction, gint hf_id);
+
+extern void udvm_state_create(guint8 *state_buff,guint8 *state_identifier_buff,guint16 p_id_length);
+extern void udvm_state_free(guint8 buff[],guint16 p_id_start,guint16 p_id_length);
+
+extern void sigcomp_init_udvm(void);
+#endif
+/* SIGCOMP_STATE_HDLR_H */