diff options
author | Michael Mann <mmann78@netscape.net> | 2015-09-16 17:55:43 -0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2015-09-19 08:13:05 +0000 |
commit | 2758114e0af437b51727f12a497e30347bb2cf9a (patch) | |
tree | 2e2a68a3b32293854374de19f98ba0126ccbda2a /epan/dissectors/packet-ncp-int.h | |
parent | 7b7a7f198d9bd7e32cfb0f8296e28f9c698ead66 (diff) |
Some more ncp2222 improvements
Including:
1. Using ENC_BIG_ENDIAN and ENC_LITTLE_ENDIAN instead of self made macros
2. Creating an "expert info hook" so that fields can be parsed "in real time" and added as expert info instead of searching by field name and manually getting values. Most of the expert info is still under if (tree)s, but this is another step closer to removing all of the "manual labor" done that requires "special handling" of all tree functionality. Once the "manual labor" is removed, this dissector can behave like every other dissector and the if (tree)s can be removed with more abandon.
Change-Id: If2c6a4c723e12e070e68d6df2d492d4b5ac35123
Reviewed-on: https://code.wireshark.org/review/10555
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-ncp-int.h')
-rw-r--r-- | epan/dissectors/packet-ncp-int.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/epan/dissectors/packet-ncp-int.h b/epan/dissectors/packet-ncp-int.h index 27bfc9797e..816f467cac 100644 --- a/epan/dissectors/packet-ncp-int.h +++ b/epan/dissectors/packet-ncp-int.h @@ -29,6 +29,7 @@ #define __PACKET_NCP_INT_H__ #include <epan/expert.h> +#include <epan/ptvcursor.h> typedef struct _ptvc_record ptvc_record; typedef struct _sub_ptvc_record sub_ptvc_record; @@ -37,7 +38,7 @@ struct _ptvc_record { int *hf_ptr; gint length; const sub_ptvc_record *sub_ptvc_rec; - unsigned int endianness : 1; /* 0=BE, 1=LE */ + unsigned int endianness; unsigned int var_index : 2; unsigned int repeat_index : 2; unsigned int req_cond_index : 8; @@ -98,7 +99,10 @@ typedef struct { gint ncp_error_index; } error_equivalency; -typedef struct { +struct _ncp_record; +typedef void (ncp_expert_handler)(ptvcursor_t *ptvc, packet_info *pinfo, const struct _ncp_record *ncp_rec, gboolean request); + +typedef struct _ncp_record { guint8 func; guint8 subfunc; guint8 has_subfunc; @@ -110,6 +114,7 @@ typedef struct { const int *req_cond_indexes; unsigned int req_cond_size_type; const info_string_t *req_info_str; + ncp_expert_handler *expert_handler_func; } ncp_record; typedef struct { |