4 * We don't use input, so don't generate code for it.
9 * We don't use unput, so don't generate code for it.
15 /********************************************************************************
19 * Utility to convert an ASCII hexdump into a libpcap-format capture file
21 * (c) Copyright 2001 Ashok Narayanan <ashokn@cisco.com>
25 * Wireshark - Network traffic analyzer
26 * By Gerald Combs <gerald@wireshark.org>
27 * Copyright 1998 Gerald Combs
29 * This program is free software; you can redistribute it and/or
30 * modify it under the terms of the GNU General Public License
31 * as published by the Free Software Foundation; either version 2
32 * of the License, or (at your option) any later version.
34 * This program is distributed in the hope that it will be useful,
35 * but WITHOUT ANY WARRANTY; without even the implied warranty of
36 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
37 * GNU General Public License for more details.
39 * You should have received a copy of the GNU General Public License
40 * along with this program; if not, write to the Free Software
41 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
43 *******************************************************************************/
48 #include "text2pcap.h"
51 * Flex (v 2.5.35) uses this symbol to "exclude" unistd.h
54 #define YY_NO_UNISTD_H
58 /* disable Windows VC compiler warning "signed/unsigned mismatch" associated */
59 /* with YY_INPUT code generated by flex versions such as 2.5.35. */
60 #pragma warning (disable:4018)
66 directive #TEXT2PCAP.*
68 byte [0-9A-Fa-f][0-9A-Fa-f][ \t]
69 byte_eol [0-9A-Fa-f][0-9A-Fa-f]\r?\n
70 offset [0-9A-Fa-f]+[: \t]
71 offset_eol [0-9A-Fa-f]+\r?\n
78 {byte} { parse_token(T_BYTE, yytext); }
79 {byte_eol} { parse_token(T_BYTE, yytext); parse_token(T_EOL, NULL); }
80 {offset} { parse_token(T_OFFSET, yytext); }
81 {offset_eol} { parse_token(T_OFFSET, yytext); parse_token(T_EOL, NULL); }
82 {mailfwd}{offset} { parse_token(T_OFFSET, yytext+1); }
83 {eol} { parse_token(T_EOL, NULL); }
84 [ \t] ; /* ignore whitespace */
85 {directive} { parse_token(T_DIRECTIVE, yytext); }
86 {comment} ; /* ignore comments */
87 {text} { parse_token(T_TEXT, yytext); }