diff options
author | Bill Meier <wmeier@newsguy.com> | 2012-06-11 18:47:42 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2012-06-11 18:47:42 +0000 |
commit | 70cc6362fe8aa2fa21c4103c372309feef65b74b (patch) | |
tree | 9f7c5b21100ebc4d319d8549e7909d1cf4efcdf7 /epan/ip_opts.h | |
parent | afab63c34cd3c96513b8341e3595b0eeef41d2af (diff) |
Don't define value_string arrays in a .h file (included in multiple places).
Also:
- don't use val_to_str_const() with a "format" default string;
- rename 'opt_len_type' enumeration identifiers to be less generic.
svn path=/trunk/; revision=43210
Diffstat (limited to 'epan/ip_opts.h')
-rw-r--r-- | epan/ip_opts.h | 44 |
1 files changed, 10 insertions, 34 deletions
diff --git a/epan/ip_opts.h b/epan/ip_opts.h index 7fe4a31964..86ba329259 100644 --- a/epan/ip_opts.h +++ b/epan/ip_opts.h @@ -30,18 +30,18 @@ */ typedef enum { - NO_LENGTH, /**< option has no data, hence no length */ - FIXED_LENGTH, /**< option always has the same length */ - VARIABLE_LENGTH /**< option is variable-length - optlen is minimum */ + OPT_LEN_NO_LENGTH, /**< option has no data, hence no length */ + OPT_LEN_FIXED_LENGTH, /**< option always has the same length */ + OPT_LEN_VARIABLE_LENGTH /**< option is variable-length - optlen is minimum */ } opt_len_type; /** Member of table of IP or TCP options. */ typedef struct ip_tcp_opt { - int optcode; /**< code for option */ - const char *name; /**< name of option */ - int *subtree_index; /**< pointer to subtree index for option */ - opt_len_type len_type; /**< type of option length field */ - int optlen; /**< value length should be (minimum if VARIABLE) */ + int optcode; /**< code for option */ + const char *name; /**< name of option */ + int *subtree_index; /**< pointer to subtree index for option */ + opt_len_type len_type; /**< type of option length field */ + int optlen; /**< value length should be (minimum if VARIABLE) */ void (*dissect)(const struct ip_tcp_opt *, tvbuff_t *, int, @@ -63,31 +63,7 @@ extern void dissect_ip_tcp_options(tvbuff_t *, int, guint, #define QS_RATE_REQUEST 0 #define QS_RATE_REPORT 8 -static const value_string qs_func_vals[] = { - {QS_RATE_REQUEST, "Rate request"}, - {QS_RATE_REPORT, "Rate report"}, - {0, NULL} -}; - -static const value_string qs_rate_vals[] = { - { 0, "0 bit/s"}, - { 1, "80 Kbit/s"}, - { 2, "160 Kbit/s"}, - { 3, "320 Kbit/s"}, - { 4, "640 Kbit/s"}, - { 5, "1.28 Mbit/s"}, - { 6, "2.56 Mbit/s"}, - { 7, "5.12 Mbit/s"}, - { 8, "10.24 Mbit/s"}, - { 9, "20.48 Mbit/s"}, - {10, "40.96 Mbit/s"}, - {11, "81.92 Mbit/s"}, - {12, "163.84 Mbit/s"}, - {13, "327.68 Mbit/s"}, - {14, "655.36 Mbit/s"}, - {15, "1.31072 Gbit/s"}, - {0, NULL} -}; - +WS_VAR_IMPORT const value_string qs_func_vals[]; +WS_VAR_IMPORT value_string_ext qs_rate_vals_ext; #endif |