* Routines for Universal Computer Protocol dissection
* Copyright 2001, Tom Uijldert <tom.uijldert@cmg.nl>
*
- * $Id: packet-ucp.c,v 1.15 2002/04/11 09:10:47 guy Exp $
+ * $Id: packet-ucp.c,v 1.19 2002/08/28 21:00:36 jmayer Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
#include <ctype.h>
#include <time.h>
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
-#ifdef HAVE_NETINET_IN_H
-# include <netinet/in.h>
-#endif
-
#include <glib.h>
-#ifdef NEED_SNPRINTF_H
-# include "snprintf.h"
-#endif
-
#include <epan/packet.h>
/* #include "packet-ucp.h" */ /* We autoregister */
r_time.tm_mday = 10 * (datestr[0] - '0') + (datestr[1] - '0');
r_time.tm_mon = (10 * (datestr[2] - '0') + (datestr[3] - '0')) - 1;
r_time.tm_year = 10 * (datestr[4] - '0') + (datestr[5] - '0');
- if (r_time.tm_year < 90)
+ if (r_time.tm_year < 90)
r_time.tm_year += 100;
r_time.tm_hour = 10 * (datestr[6] - '0') + (datestr[7] - '0');
r_time.tm_min = 10 * (datestr[8] - '0') + (datestr[9] - '0');
guint intval = 0;
int tmpoff = *offset;
int idx = 0;
-
+
while ((strval[idx++] = tvb_get_guint8(tvb, tmpoff++)) != '/')
;
if (idx > 1) {
while (tvb_get_guint8(tvb, tmpoff++) != '/')
;
- if ((tmpoff - *offset) > 1)
+ if ((tmpoff - *offset) > 1)
proto_tree_add_item(tree, field, tvb, *offset,
tmpoff - *offset - 1, FALSE);
*offset = tmpoff;
static void
ucp_handle_mt(proto_tree *tree, tvbuff_t *tvb, int *offset)
{
- char strval[BUFSIZ];
guint intval;
- int idx;
intval = ucp_handle_byte(tree, tvb, hf_ucp_parm_MT, offset);
switch (intval) {
return FALSE;
/*
- * Try getting the operation-type and whether it's a request/response
+ * Try getting the operation-type and whether it's a request/response
*/
O_R = tvb_get_guint8(tvb, UCP_O_R_OFFSET);
if (match_strval(O_R, vals_hdr_O_R) == NULL)
sub_tree = proto_item_add_subtree(sub_ti, ett_sub);
switch (OT) {
+ case 0:
+ O_R == 'O' ? add_00O(sub_tree,tmp_tvb) : add_00R(sub_tree,tmp_tvb);
+ break;
case 1:
O_R == 'O' ? add_01O(sub_tree,tmp_tvb) : add_01R(sub_tree,tmp_tvb);
break;