extcap: Tell utilities the wireshark version
[metze/wireshark/wip.git] / text2pcap.c
index aae921aad02daa944c46b813d1546d6d081ac045..a5cb5b263d8f0c3b66cbd6b3e03ebfec35ff7a91 100644 (file)
@@ -10,7 +10,7 @@
  * By Gerald Combs <gerald@wireshark.org>
  * Copyright 1998 Gerald Combs
  *
- * SPDX-License-Identifier: GPL-2.0+
+ * SPDX-License-Identifier: GPL-2.0-or-later
  *
  *******************************************************************************/
 
@@ -291,7 +291,7 @@ typedef struct {
 } hdr_ip_t;
 
 static hdr_ip_t HDR_IP = {0x45, 0, 0, 0x3412, 0, 0, 0xff, 0, 0,
-#ifdef WORDS_BIGENDIAN
+#if G_BYTE_ORDER == G_BIG_ENDIAN
 0x0a010101, 0x0a020202
 #else
 0x0101010a, 0x0202020a
@@ -299,7 +299,7 @@ static hdr_ip_t HDR_IP = {0x45, 0, 0, 0x3412, 0, 0, 0xff, 0, 0,
 };
 
 /* Fixed IP address values */
-#ifdef WORDS_BIGENDIAN
+#if G_BYTE_ORDER == G_BIG_ENDIAN
 #define IP_SRC 0x0a010101
 #define IP_DST 0x0a020202
 #else
@@ -1908,7 +1908,7 @@ main(int argc, char *argv[])
     curr_offset = header_length;
 
     text2pcap_in = input_file;
-    if (text2pcap_lex() == EXIT_SUCCESS) {
+    if (text2pcap_scan() == EXIT_SUCCESS) {
         if (write_current_packet(FALSE) != EXIT_SUCCESS)
             ret = EXIT_FAILURE;
     } else {
@@ -1923,7 +1923,6 @@ main(int argc, char *argv[])
                 bytes_written, (bytes_written == 1) ? "" : "s");
     }
 clean_exit:
-    text2pcap_lex_destroy();
     if (input_file) {
         fclose(input_file);
     }