Handle ignored files more flexible. This also fixes the newest files
[metze/wireshark/wip.git] / packet-rx.c
index 9c95ce418c9a9becaba883d77d4492a07e6553a3..e9040b170cde4c06199e63d147d75bd4d4c7dff7 100644 (file)
@@ -4,7 +4,7 @@
  * Based on routines from tcpdump patches by
  *   Ken Hornstein <kenh@cmf.nrl.navy.mil>
  *
- * $Id: packet-rx.c,v 1.32 2002/02/01 16:37:18 nneul Exp $
+ * $Id: packet-rx.c,v 1.37 2002/08/28 21:00:30 jmayer Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
 
 #include <stdio.h>
 
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
-#ifdef HAVE_NETINET_IN_H
-# include <netinet/in.h>
-#endif
-
 #include <string.h>
 #include <glib.h>
 #include <epan/packet.h>
@@ -71,6 +63,7 @@ static const value_string rx_flags[] = {
        { RX_LAST_PACKET,       "last-pckt" },
        { RX_MORE_PACKETS,      "more-pckts" },
        { RX_FREE_PACKET,       "free-pckt" },
+       { RX_SLOW_START_OR_JUMBO, "slow-start/jumbogram" },
        { 0,                    NULL }
 };
 
@@ -78,11 +71,12 @@ static const value_string rx_reason[] = {
        { RX_ACK_REQUESTED,             "Ack Requested"         },
        { RX_ACK_DUPLICATE,             "Duplicate Packet"      },
        { RX_ACK_OUT_OF_SEQUENCE,       "Out Of Sequence"       },
-       { RX_ACK_EXEEDS_WINDOW,         "Exceeds Window"        },      
+       { RX_ACK_EXEEDS_WINDOW,         "Exceeds Window"        },
        { RX_ACK_NOSPACE,               "No Space"              },
        { RX_ACK_PING,                  "Ping"                  },
        { RX_ACK_PING_RESPONSE,         "Ping Response"         },
        { RX_ACK_DELAY,                 "Delay"                 },
+       { RX_ACK_IDLE,                  "Idle"                  },
        { 0,                            NULL                    }
 };
 
@@ -146,7 +140,7 @@ static gint ett_rx_abort = -1;
 static dissector_handle_t afs_handle;
 
 static int
-dissect_rx_response_encrypted(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int offset)
+dissect_rx_response_encrypted(tvbuff_t *tvb, proto_tree *parent_tree, int offset)
 {
        proto_tree *tree;
        proto_item *item;
@@ -162,7 +156,7 @@ dissect_rx_response_encrypted(tvbuff_t *tvb, packet_info *pinfo, proto_tree *par
                nstime_t ts;
                ts.secs = tvb_get_ntohl(tvb, offset);
                ts.nsecs = 0;
-               
+
                proto_tree_add_time(tree, hf_rx_epoch, tvb,
                        offset, 4, &ts);
                offset += 4;
@@ -194,11 +188,11 @@ dissect_rx_response_encrypted(tvbuff_t *tvb, packet_info *pinfo, proto_tree *par
        /* level : 4 bytes */
        proto_tree_add_item(tree, hf_rx_level, tvb, offset, 4, FALSE);
        offset += 4;
-       
-       proto_item_set_len(item, offset-old_offset);    
+
+       proto_item_set_len(item, offset-old_offset);
        return offset;
 }
-       
+
 
 static int
 dissect_rx_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int offset, guint32 seq, guint32 callnumber)
@@ -235,23 +229,23 @@ dissect_rx_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
                offset += 4;
 
                /* encrypted : struct */
-               offset = dissect_rx_response_encrypted(tvb, pinfo, tree, offset);
+               offset = dissect_rx_response_encrypted(tvb, tree, offset);
 
                /* kvno */
                proto_tree_add_item(tree, hf_rx_kvno, tvb, offset, 4, FALSE);
                offset += 4;
-               
+
                /* ticket_len */
                tl = tvb_get_ntohl(tvb, offset);
                proto_tree_add_uint(tree, hf_rx_ticket_len, tvb,
                        offset, 4, tl);
                offset += 4;
-       
+
                proto_tree_add_item(tree, hf_rx_ticket, tvb, offset, tl, FALSE);
-               offset += tl;   
+               offset += tl;
        }
 
-       proto_item_set_len(item, offset-old_offset);    
+       proto_item_set_len(item, offset-old_offset);
        return offset;
 }
 
@@ -282,8 +276,8 @@ dissect_rx_abort(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int
        /* kvno */
        proto_tree_add_item(tree, hf_rx_abortcode, tvb, offset, 4, FALSE);
        offset += 4;
-               
-       proto_item_set_len(item, offset-old_offset);    
+
+       proto_item_set_len(item, offset-old_offset);
        return offset;
 }
 
@@ -326,7 +320,7 @@ dissect_rx_challenge(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
                offset += 4;
        }
 
-       proto_item_set_len(item, offset-old_offset);    
+       proto_item_set_len(item, offset-old_offset);
        return offset;
 }
 
@@ -359,20 +353,20 @@ dissect_rx_acks(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int
        /* bufferspace: 2 bytes*/
        proto_tree_add_item(tree, hf_rx_bufferspace, tvb, offset, 2, FALSE);
        offset += 2;
-       
+
        /* maxskew: 2 bytes*/
        proto_tree_add_item(tree, hf_rx_maxskew, tvb, offset, 2, FALSE);
        offset += 2;
-       
+
        /* first packet: 4 bytes*/
        proto_tree_add_item(tree, hf_rx_first_packet, tvb, offset, 4, FALSE);
        offset += 4;
-       
+
        /* prev packet: 4 bytes*/
        proto_tree_add_item(tree, hf_rx_prev_packet, tvb, offset, 4, FALSE);
        offset += 4;
 
-       /* serial : 4 bytes */  
+       /* serial : 4 bytes */
        proto_tree_add_item(tree, hf_rx_serial, tvb, offset, 4, FALSE);
        offset += 4;
 
@@ -424,7 +418,7 @@ dissect_rx_acks(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int
                }
        }
 
-       proto_item_set_len(item, offset-old_offset);    
+       proto_item_set_len(item, offset-old_offset);
        return offset;
 }
 
@@ -474,7 +468,7 @@ dissect_rx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
        if (check_col(pinfo->cinfo, COL_INFO))
                col_clear(pinfo->cinfo, COL_INFO);
 
-       item = proto_tree_add_protocol_format(parent_tree, proto_rx, tvb, 
+       item = proto_tree_add_protocol_format(parent_tree, proto_rx, tvb,
                offset, 28, "RX Protocol");
        tree = proto_item_add_subtree(item, ett_rx);
 
@@ -483,7 +477,7 @@ dissect_rx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
                nstime_t ts;;
                ts.secs = tvb_get_ntohl(tvb, offset);
                ts.nsecs = 0;
-               
+
                proto_tree_add_time(tree, hf_rx_epoch, tvb,
                        offset, 4, &ts);
                offset += 4;
@@ -548,10 +542,10 @@ dissect_rx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
 
        switch (type) {
        case RX_PACKET_TYPE_ACK:
-               /*dissect_rx_acks(tvb, pinfo, parent_tree, offset, 
+               /*dissect_rx_acks(tvb, pinfo, parent_tree, offset,
                        cant create it in a parallell tree, then ett seasrch
                        wont work */
-               dissect_rx_acks(tvb, pinfo, tree, offset, 
+               dissect_rx_acks(tvb, pinfo, tree, offset,
                        seq, callnumber);
                break;
        case RX_PACKET_TYPE_ACKALL: