* Routines for Universal Computer Protocol dissection
* Copyright 2001, Tom Uijldert <tom.uijldert@cmg.nl>
*
- * $Id: packet-ucp.c,v 1.5 2001/11/05 21:41:33 guy Exp $
+ * $Id: packet-ucp.c,v 1.14 2002/03/10 03:07:16 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
# include "snprintf.h"
#endif
-#include "packet.h"
+#include <epan/packet.h>
/* #include "packet-ucp.h" */ /* We autoregister */
/* Prototypes */
r_time.tm_min = 10 * (datestr[8] - '0') + (datestr[9] - '0');
if (datestr[10])
r_time.tm_sec = 10 * (datestr[10] - '0') + (datestr[11] - '0');
+ r_time.tm_isdst = -1;
return mktime(&r_time);
}
{
guint8 O_R; /* Request or response */
- if (!proto_is_protocol_enabled(proto_ucp))
- return FALSE; /* UCP was disabled */
-
/* This runs atop TCP, so we are guaranteed that there is at least one
byte in the tvbuff. */
if (tvb_get_guint8(tvb, 0) != UCP_STX)
OT = 10 * OT + (tvb_get_guint8(tvb, UCP_OT_OFFSET + 1) - '0');
/* Make entries in Protocol column and Info column on summary display */
- if (check_col(pinfo->fd, COL_PROTOCOL))
- col_set_str(pinfo->fd, COL_PROTOCOL, "UCP");
+ if (check_col(pinfo->cinfo, COL_PROTOCOL))
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "UCP");
- if (check_col(pinfo->fd, COL_INFO)) {
- col_clear(pinfo->fd, COL_INFO);
- col_append_fstr(pinfo->fd, COL_INFO, "%s (%s)",
+ if (check_col(pinfo->cinfo, COL_INFO)) {
+ col_clear(pinfo->cinfo, COL_INFO);
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s (%s)",
val_to_str(OT, vals_hdr_OT, "unknown operation"),
match_strval(O_R, vals_hdr_O_R));
if (result == UCP_SHORTENED)
- col_append_str(pinfo->fd, COL_INFO, " [short packet]");
+ col_append_str(pinfo->cinfo, COL_INFO, " [short packet]");
else if (result == UCP_INV_CHK)
- col_append_str(pinfo->fd, COL_INFO, " [checksum invalid]");
+ col_append_str(pinfo->cinfo, COL_INFO, " [checksum invalid]");
}
/* In the interest of speed, if "tree" is NULL, don't do any work not
if (tree) {
/* create display subtree for the protocol */
- ti = proto_tree_add_item(tree, proto_ucp, tvb, 0,
- tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_ucp, tvb, 0, -1, FALSE);
ucp_tree = proto_item_add_subtree(ti, ett_ucp);
/*
},
{ &hf_ucp_parm_NT,
{ "NT", "ucp.parm.NT",
- FT_STRING, BASE_NONE, NULL, 0x00,
+ FT_UINT8, BASE_DEC, VALS(vals_parm_NT), 0x00,
"Notification type.",
HFILL
}
void
proto_reg_handoff_ucp(void)
{
+ dissector_handle_t ucp_handle;
+
/*
* UCP can be spoken on any port so, when not on a specific port, try this
* one whenever TCP is spoken.
*/
heur_dissector_add("tcp", dissect_ucp_heur, proto_ucp);
+
/*
- * Also register as one that can be assigned to a TCP conversation.
+ * Also register as one that can be selected by a TCP port number.
*/
- conv_dissector_add("tcp", dissect_ucp, proto_ucp);
+ ucp_handle = create_dissector_handle(dissect_ucp, proto_ucp);
+ dissector_add_handle("tcp.port", ucp_handle);
}