Frame numbers are unsigned.
[obnox/wireshark/wip.git] / packet-ucp.c
index 30390af2b4dc2e6fd9d2058f41e0e09dcbdf74c0..2042505f734fd9c6ab2a34811ed2a85526f2a617 100644 (file)
@@ -2,7 +2,7 @@
  * 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      */
 
@@ -676,7 +664,7 @@ ucp_mktime(char *datestr)
     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');
@@ -734,7 +722,7 @@ ucp_handle_int(proto_tree *tree, tvbuff_t *tvb, int field, int *offset)
     guint       intval = 0;
     int                 tmpoff = *offset;
     int                 idx = 0;
+
     while ((strval[idx++] = tvb_get_guint8(tvb, tmpoff++)) != '/')
        ;
     if (idx > 1) {
@@ -774,7 +762,7 @@ ucp_handle_data(proto_tree *tree, tvbuff_t *tvb, int field, int *offset)
 
     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;
@@ -798,9 +786,7 @@ ucp_handle_data(proto_tree *tree, tvbuff_t *tvb, int field, int *offset)
 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) {
@@ -1556,7 +1542,7 @@ dissect_ucp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        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)
@@ -1660,6 +1646,9 @@ dissect_ucp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        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;