diff options
author | Anders Broman <anders.broman@ericsson.com> | 2005-06-03 06:35:44 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2005-06-03 06:35:44 +0000 |
commit | f01b2b6197392f785fea4352b244b6be0bb5095d (patch) | |
tree | 95985a60201e35ec17276d4353e8524010f493b0 /epan | |
parent | 52e6e313ed3128d578d1779d3a4ddbe0ec228b42 (diff) |
From Mike Duigou:
A few doxygen updates and an improved section on
writing dissectors that don't use tcp_dissect_pdus().
svn path=/trunk/; revision=14537
Diffstat (limited to 'epan')
-rw-r--r-- | epan/address.h | 2 | ||||
-rw-r--r-- | epan/packet.h | 43 | ||||
-rw-r--r-- | epan/packet_info.h | 5 |
3 files changed, 36 insertions, 14 deletions
diff --git a/epan/address.h b/epan/address.h index 4d7b753f63..424f0578a8 100644 --- a/epan/address.h +++ b/epan/address.h @@ -119,7 +119,7 @@ typedef enum { /* Types of circuit IDs Ethereal knows about. */ typedef enum { - CT_NONE, /* no port number */ + CT_NONE, /* no circuit type */ CT_DLCI, /* Frame Relay DLCI */ CT_ISDN, /* ISDN channel number */ CT_X25, /* X.25 logical channel number */ diff --git a/epan/packet.h b/epan/packet.h index eed4554b53..5dbce73c70 100644 --- a/epan/packet.h +++ b/epan/packet.h @@ -117,17 +117,27 @@ typedef void (*dissector_t)(tvbuff_t *, packet_info *, proto_tree *); /* * Dissector that returns: * - * the amount of data in the protocol's PDU, if it was able to + * The amount of data in the protocol's PDU, if it was able to * dissect all the data; * * 0, if the tvbuff doesn't contain a PDU for that protocol; * - * the negative of the amount of additional data needed, if + * The negative of the amount of additional data needed, if * we need more data (e.g., from subsequent TCP segments) to * dissect the entire PDU. */ typedef int (*new_dissector_t)(tvbuff_t *, packet_info *, proto_tree *); +/** Type of a heuristic dissector, used in heur_dissector_add(). + * + * @param tvb the tv_buff with the (remaining) packet data + * @param pinfo the packet info of this packet (additional info) + * @param tree the protocol tree to be build or NULL + * @return TRUE if the packet was recognized by the sub-dissector (stop dissection here) + */ +typedef gboolean (*heur_dissector_t)(tvbuff_t *tvb, packet_info *pinfo, + proto_tree *tree); + typedef void (*DATFunc) (gchar *table_name, ftenum_t selector_type, gpointer key, gpointer value, gpointer user_data); typedef void (*DATFunc_handle) (gchar *table_name, gpointer value, @@ -257,16 +267,6 @@ extern void register_heur_dissector_list(const char *name, extern gboolean dissector_try_heuristic(heur_dissector_list_t sub_dissectors, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); -/** Type of a heuristic dissector, used in heur_dissector_add(). - * - * @param tvb the tv_buff with the (remaining) packet data - * @param pinfo the packet info of this packet (additional info) - * @param tree the protocol tree to be build or NULL - * @return TRUE if the packet was recognized by the sub-dissector (stop dissection here) - */ -typedef gboolean (*heur_dissector_t)(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree); - /** Add a sub-dissector to a heuristic dissector list. * Call this in the proto_handoff function of the sub-dissector. * @@ -300,11 +300,30 @@ extern dissector_handle_t new_create_dissector_handle(new_dissector_t dissector, /* Call a dissector through a handle and if no dissector was found * pass if over to the "data" dissector instead. + * + * @param handle The dissector to call. + * @param tvb The buffer to dissect. + * @param pinfo Packet Info. + * @param tree The protocol tree. + * @return If the protocol for that handle isn't enabled call the data + * dissector. Otherwise, if the handle refers to a new-style + * dissector, call the dissector and return its return value, otherwise call + * it and return the length of the tvbuff pointed to by the argument. */ extern int call_dissector(dissector_handle_t handle, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); + /* Call a dissector through a handle but if no dissector was found * just return 0 and do not call the "data" dissector instead. + * + * @param handle The dissector to call. + * @param tvb The buffer to dissect. + * @param pinfo Packet Info. + * @param tree The protocol tree. + * @return If the protocol for that handle isn't enabled, return 0 without + * calling the dissector. Otherwise, if the handle refers to a new-style + * dissector, call the dissector and return its return value, otherwise call + * it and return the length of the tvbuff pointed to by the argument. */ extern int call_dissector_only(dissector_handle_t handle, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); diff --git a/epan/packet_info.h b/epan/packet_info.h index da5d17ac2e..bca15bd917 100644 --- a/epan/packet_info.h +++ b/epan/packet_info.h @@ -114,7 +114,10 @@ typedef struct _packet_info { int iplen; int iphdrlen; - int p2p_dir; + int p2p_dir; /* Packet was captured as an + outbound (P2P_DIR_SENT) + inbound (P2P_DIR_RECV) + unknown (P2P_DIR_UNKNOWN) */ guint16 oxid; /* next 2 fields reqd to identify fibre */ guint16 rxid; /* channel conversations */ guint8 r_ctl; /* R_CTL field in Fibre Channel Protocol */ |