No need for read_new_line to return a packet offset.
[metze/wireshark/wip.git] / wiretap / iptrace.c
index f92241fefd07113fa4e3fbad14f867b4a540c52d..cba013b06bf5ac6530d33b7f3f2279065322e478 100644 (file)
@@ -24,7 +24,6 @@
 #include <string.h>
 #include "wtap-int.h"
 #include "file_wrappers.h"
-#include <wsutil/buffer.h>
 #include "atm.h"
 #include "iptrace.h"
 
@@ -179,17 +178,17 @@ iptrace_read_rec_1_0(FILE_T fh, struct wtap_pkthdr *phdr, Buffer *buf,
                /*
                 * Skip the padding.
                 */
-               if (!file_skip(fh, 3, err))
+               if (!wtap_read_bytes(fh, NULL, 3, err, err_info))
                        return FALSE;
        }
-       if (packet_size > WTAP_MAX_PACKET_SIZE) {
+       if (packet_size > WTAP_MAX_PACKET_SIZE_STANDARD) {
                /*
                 * Probably a corrupt capture file; don't blow up trying
                 * to allocate space for an immensely-large packet.
                 */
                *err = WTAP_ERR_BAD_FILE;
                *err_info = g_strdup_printf("iptrace: File has %u-byte packet, bigger than maximum of %u",
-                   packet_size, WTAP_MAX_PACKET_SIZE);
+                   packet_size, WTAP_MAX_PACKET_SIZE_STANDARD);
                return FALSE;
        }
 
@@ -372,17 +371,17 @@ iptrace_read_rec_2_0(FILE_T fh, struct wtap_pkthdr *phdr, Buffer *buf,
                /*
                 * Skip the padding.
                 */
-               if (!file_skip(fh, 3, err))
+               if (!wtap_read_bytes(fh, NULL, 3, err, err_info))
                        return FALSE;
        }
-       if (packet_size > WTAP_MAX_PACKET_SIZE) {
+       if (packet_size > WTAP_MAX_PACKET_SIZE_STANDARD) {
                /*
                 * Probably a corrupt capture file; don't blow up trying
                 * to allocate space for an immensely-large packet.
                 */
                *err = WTAP_ERR_BAD_FILE;
                *err_info = g_strdup_printf("iptrace: File has %u-byte packet, bigger than maximum of %u",
-                   packet_size, WTAP_MAX_PACKET_SIZE);
+                   packet_size, WTAP_MAX_PACKET_SIZE_STANDARD);
                return FALSE;
        }
 
@@ -604,3 +603,16 @@ wtap_encap_ift(unsigned int  ift)
                }
        }
 }
+
+/*
+ * Editor modelines  -  http://www.wireshark.org/tools/modelines.html
+ *
+ * Local variables:
+ * c-basic-offset: 8
+ * tab-width: 8
+ * indent-tabs-mode: t
+ * End:
+ *
+ * vi: set shiftwidth=8 tabstop=8 noexpandtab:
+ * :indentSize=8:tabSize=8:noTabs=false:
+ */