前段开源框架188有多少个段1887什么玩意的

>> scanner.c - windows网络数据包截获开发包-wi
点击查看更多 ▼
点击收缩隐藏 ▲
scanner.c - windows网络数据包截获开发包-wi
源码下载: &
#define yy_create_buffer pcap__create_buffer
#define yy_delete_buffer pcap__delete_buffer
#define yy_scan_buffer pcap__scan_buffer
#define yy_scan_string pcap__scan_string
#define yy_scan_bytes pcap__scan_bytes
#define yy_flex_debug pcap__flex_debug
#define yy_init_buffer pcap__init_buffer
#define yy_flush_buffer pcap__flush_buffer
#define yy_load_buffer_state pcap__load_buffer_state
#define yy_switch_to_buffer pcap__switch_to_buffer
#define yyin pcap_in
#define yyleng pcap_leng
#define yylex pcap_lex
#define yyout pcap_out
#define yyrestart pcap_restart
#define yytext pcap_text
#define yywrap pcap_wrap
/* A lexical scanner generated by flex */
/* Scanner skeleton version:
* $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
#include &stdio.h&
/* cfront 1.2 defines &c_plusplus& instead of &__cplusplus& */
#ifdef c_plusplus
#ifndef __cplusplus
#define __cplusplus
#ifdef __cplusplus
#include &stdlib.h&
#include &unistd.h&
/* Use prototypes in function declarations. */
#define YY_USE_PROTOS
/* The &const& storage-class-modifier is valid. */
#define YY_USE_CONST
#else /* ! __cplusplus */
#if __STDC__
#define YY_USE_PROTOS
#define YY_USE_CONST
#endif /* __STDC__ */
#endif /* ! __cplusplus */
#ifdef __TURBOC__
#pragma warn -rch
#pragma warn -use
#include &io.h&
#include &stdlib.h&
#define YY_USE_CONST
#define YY_USE_PROTOS
#ifdef YY_USE_CONST
#define yyconst const
#define yyconst
#ifdef YY_USE_PROTOS
#define YY_PROTO(proto) proto
#define YY_PROTO(proto) ()
/* Returned upon end-of-file. */
#define YY_NULL 0
/* Promotes a possibly negative, possibly signed char to an unsigned
* integer for use as an array index.
If the signed char is negative,
* we want to instead treat it as an 8-bit unsigned char, hence the
* double cast.
#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
/* Enter a start condition.
This macro really ought to take a parameter,
* but we do it the disgusting crufty way forced on us by the ()-less
* definition of BEGIN.
#define BEGIN yy_start = 1 + 2 *
/* Translate the current start state into a value that can be later handed
* to BEGIN to return to the state.
The YYSTATE alias is for lex
* compatibility.
#define YY_START ((yy_start - 1) / 2)
#define YYSTATE YY_START
/* Action number for EOF rule of a given start state. */
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
/* Special action meaning &start processing a new file&. */
#define YY_NEW_FILE yyrestart( yyin )
#define YY_END_OF_BUFFER_CHAR 0
/* Size of default input buffer. */
#define YY_BUF_SIZE 16384
typedef struct yy_buffer_state *YY_BUFFER_STATE;
extern FILE *yyin, *
#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2
/* The funky do-while in the following #define is used to turn the definition
* int a single C statement (which needs a semi-colon terminator).
* avoids problems with code like:
if ( condition_holds )
yyless( 5 );
do_something_else();
* Prior to using the do-while the compiler would get upset at the
* &else& because it interpreted the &if& statement as being all
* done when it reached the ';' after the yyless() call.
/* Return all but the first 'n' matched characters back to the input stream. */
#define yyless(n) \
/* Undo effects of setting up yytext. */ \
*yy_cp = yy_hold_ \
YY_RESTORE_YY_MORE_OFFSET \
yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
YY_DO_BEFORE_ACTION; /* set up yytext again */ \
while ( 0 )
#define unput(c) yyunput( c, yytext_ptr )
/* The following is because we cannot portably get our hands on size_t
* (without autoconf's help, which isn't available because we want
* flex-generated scanners to compile on their own).
typedef unsigned int yy_size_t;
struct yy_buffer_state
FILE *yy_input_
char *yy_ch_
/* input buffer */
char *yy_buf_
/* current position in input buffer */
/* Size of input buffer in bytes, not including room for EOB
* characters.
yy_size_t yy_buf_
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
/* Whether we &own& the buffer - i.e., we know we created it,
* and can realloc() it to grow it, and should free() it to
* delete it.
int yy_is_our_
/* Whether this is an &interactive& if so, and
* if we're using stdio for input, then we want to use getc()
* instead of fread(), to make sure we stop fetching input after
* each newline.
int yy_is_
/* Whether we're considered to be at the beginning of a line.
* If so, '^' rules will be active on the next match, otherwise
int yy_at_
/* Whether to try to fill the input buffer when we reach the
* end of it.
int yy_fill_
int yy_buffer_
#define YY_BUFFER_NEW 0
#define YY_BUFFER_NORMAL 1
/* When an EOF's been seen but there's still some text to process
* then we mark the buffer as YY_EOF_PENDING, to indicate that we
* shouldn't try reading from the input source any more.
* still have a bunch of tokens to match, though, because of
* possible backing-up.
* When we actually see the EOF, we change the status to &new&
* (via yyrestart()), so that the user can continue scanning by
* just pointing yyin at a new input file.
#define YY_BUFFER_EOF_PENDING 2
static YY_BUFFER_STATE yy_current_buffer = 0;
/* We provide macros for accessing buffer states in case in the
* future we want to put the buffer states in a more general
* &scanner state&.
#define YY_CURRENT_BUFFER yy_current_buffer
/* yy_hold_char holds the character lost when yytext is formed. */
static char yy_hold_
static int yy_n_
/* number of characters read into yy_ch_buf */
/* Points to current character in buffer. */
static char *yy_c_buf_p = (char *) 0;
static int yy_init = 1;
/* whether we need to initialize */
static int yy_start = 0; /* start state number */
/* Flag which is used to allow yywrap()'s to do buffer switches
* instead of setting up a fresh yyin.
A bit of a hack ...
static int yy_did_buffer_switch_on_
void yyrestart YY_PROTO(( FILE *input_file ));
void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
void yy_load_buffer_state YY_PROTO(( void ));
YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
static void yy_flex_free YY_PROTO(( void * ));
#define yy_new_buffer yy_create_buffer
#define yy_set_interactive(is_interactive) \
if ( ! yy_current_buffer ) \
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
yy_current_buffer-&yy_is_interactive = is_ \
#define yy_set_bol(at_bol) \
if ( ! yy_current_buffer ) \
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
yy_current_buffer-&yy_at_bol = at_ \
#define YY_AT_BOL() (yy_current_buffer-&yy_at_bol)
typedef unsigned char YY_CHAR;
FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
typedef int yy_state_
extern char *
#define yytext_ptr yytext
static yy_state_type yy_get_previous_state YY_PROTO(( void ));
static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
static int yy_get_next_buffer YY_PROTO(( void ));
static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
/* Done after the current pattern has been matched and before the
* corresponding action - sets up yytext.
#define YY_DO_BEFORE_ACTION \
yytext_ptr = yy_ \
yyleng = (int) (yy_cp - yy_bp); \
yy_hold_char = *yy_ \
*yy_cp = '\0'; \
yy_c_buf_p = yy_
#define YY_NUM_RULES 67
#define YY_END_OF_BUFFER 68
static yyconst short int yy_accept[1056] =
static yyconst int yy_ec[256] =
static yyconst int yy_meta[47] =
static yyconst short int yy_base[1345] =
46, , , 3773,
108, 3744,
37, , 3718,
201, , 3773,
253, 3750,
300, , , 3773,
233, 3716,
168, 3725,
199, 3708,
126, , , ,
0, , 3773,
262, 3716,
0, , 3696,
114, 3665,
166, 3681,
0, , 3646,
0, , 3648,
341, 3667,
345, 3662,
187, 3645,
250, , 3637,
518, 3636,
0, , 3328,
0, , 3319,
499, 3332,
513, , 3329,
608, 3328,
644, 3331,
296, 3326,
0, , 3309,
853, 3317,
355, 3315,
528, 3303,
721, 1001,
617, 3298,
777, 3299,
788, 1037,
792, 1057,
838, 3280,
680, 3258,
703, , 3251,
736, 1113,
934, 3234,
969, 3232,
822, 1153,
828, , 1021,
, , , 1219,
870, , , 1363,
944, 3173,
, , , 1475,
857, , , , ,
949, 1567,
955, 1352,
0, , , , , 1984,
0, , , 2885,
0, , 1774,
0, , 2857,
0, , , 2333,
, , , , 2749,
0, , , , 2685,
0, , 2646,
0, , 2610,
0, , 2577,
0, , 2526,
0, , 2529,
0, , , , 3154,
0, , , , 3169,
, , , 3195,
0, , 2257,
0, , 2250,
0, , 2217,
0, , 2186,
991, 3612,
884, 3622,
856, 3624,
766, 3626,
724, 3628,
674, 3630,
562, 3640,
static yyconst short int yy_def[1345] =
1, , , , ,
19, , , , , 1056,
112, 1060,
19, , 1055,
168, 1064,
173, 1067,
, , , 1073,
223, 1055,
19, , 1055,
248, 1078,
254, , , 1055,
260, 1055,
262, , , , 1055,
272, 1085,
218, , , ,
297, 1093,
, , , 1095,
316, 1055,
318, 1097,
346, 1055,
348, 1104,
358, 1055,
360, , , , , 1055,
371, 1109,
329, 1110,
297, 1112,
306, 1113,
308, , 1116,
392, , , ,
401, , , , 1055,
412, , , ,
425, 1055,
19, , 1055,
442, , , 1055,
448, 1134,
453, 1055,
465, 1055,
480, 1055,
482, , , , 1140,
494, 1142,
507, 1148,
523, , , 1157,
, , , 1163,
560, 1055,
562, , , 1055,
568, 1172,
588, 1055,
590, , , , , 1055,
600, 1055,
602, , , , 1055,
615, 1055,
631, 1055,
633, , , ,
645, , 1199,
657, 1055,
664, , , 1207,
669, , , , ,
689, , , , , 1055,
701, , , , 1055,
713, , , 1227,
, , , 1055,
727, 1055,
738, 1234,
752, , , 1055,
, , , , 1055,
782, , , , 1055,
796, , 1255,
810, , , , , 1055,
826, , 1055,
842, , 1055,
, , , , 1055,
903, , , 1303,
0, , , 1055,
static yyconst short int yy_nxt[3820] =
142, 1045,
124, 1042,
108, 1033,
126, 1055,
128, 1055,
165, 1013,
165, 1055,
948, 1055,
165, 1055,
226, 1055,
249, 1008,
164, 1007,
245, 1055,
256, 1005,
175, 1055,
218, 1055,
224, 1055,
274, 1055,
274, 1055,
972, 1055,
292, 1055,
965, 1055,
299, 1055,
299, 1055,
889, 1055,
308, 1055,
317, 1055,
369, 1055,
373, 1055,
273, 1055,
383, 1055,
920, 1055,
911, 1055,
408, 1055,
408, 1055,
394, 1055,
394, 1055,
907, 1055,
399, 1055,
895, 1055,
403, 1055,
424, 1055,
889, 1055,
410, 1055,
452, 1055,
799, 1055,
519, 1055,
492, 1055,
464, 1055,
772, 1055,
506, 1055,
540, 1055,
765, 1055,
762, 1055,
509, 1055,
749, 1055,
542, 1055,
746, 1055,
542, 1055,
454, 1055,
743, 1055,
525, 1055,
256, 1055,
731, 1055,
536, 1055,
536, 1055,
720, 1055,
544, 1055,
548, 1055,
256, 1055,
621, 1055,
481, 1055,
616, 1055,
599, 1055,
697, , 1055,
421, 1055,
662, 1055,
418, 1055,
628, 1055,
630, 1055,
676, 1055,
680, 1055,
589, 1055,
601, 1055,
687, 1055,
691, 1055,
652, 1055,
630, 1055,
709, 1055,
661, 1055,
722, 1031,
724, 1009,
601, 1055,
848, 1055,
661, , 1001,
632, 1055,
753, , 1004,
755, , 1012,
679, , 1020,
818, 1023,
690, , 1028,
783, 1055,
702, , 1001,
714, , 1035,
646, , 1012,
823, , 1016,
758, 1055,
672, , 1020,
681, , 1024,
692, , 1028,
704, , 1044,
781, 1055,
716, 1035,
831, 1044,
863, 1055,
887, 1055,
900, 1055,
905, 1055,
783, 1055,
770, 1055,
962, 1055,
821, , 1006,
823, 1009,
435, 1030,
383, 1032,
435, , , 1004,
433, , 1012,
432, , 1016,
305, , , ,
301, 1040,
386, 1052,
377, 1040,
375, 1041,
331, 1046,
326, 1052,
3, , , , 1055,
, , , , 1055
static yyconst short int yy_chk[3820] =
226, 1332,
255, 1326,
108, 1325,
211, 1317,
107, 1316,
214, 1315,
333, 1314,
218, 1313,
221, 1312,
222, 1311,
216, 1307,
298, 1302,
349, 1293,
315, 1291,
262, 1290,
347, 1286,
297, 1285,
306, 1283,
353, 1282,
359, 1281,
352, 1279,
390, 1278,
440, 1276,
402, 1268,
413, 1267,
346, 1265,
414, 1264,
468, 1261,
483, 1260,
426, 1255,
360, 1250,
460, 1225,
462, 1222,
477, 1218,
427, 1217,
551, 1211,
572, 1209,
578, 1208,
496, 1203,
584, 1202,
509, 1201,
453, 1200,
524, 1195,
535, 1194,
536, 1193,
548, 1188,
555, 1165,
557, 1164,
559, 1162,
561, 1161,
582, 1160,
587, 1159,
589, 1157,
546, 1156,
594, 1152,
599, 1145,
560, 1140,
562, 1139,
610, 1121,
571, 1119,
574, 1112,
718, 1106,
748, 1096,
647, 1088,
590, 1087,
662, 1085,
602, 1084,
617, 1069,
722, 1045,
724, 1036,
633, 1029,
734, 1017,
651, 1013,
754, 1008,
758, 1005,
760, 1002,
701, , 1001,
713, , 1009,
727, , 1012,
729, , 1016,
735, , 1020,
738, , 1024,
741, , 1028,
744, , 1031,
747, 1035,
759, 1044,
388, 1000,
384, 1003,
974, , , , 1006,
378, , 1011,
376, , 1015,
363, , , ,
354, 1023,
337, 1043,
327, 1023,
322, 1027,
288, 1034,
280, , , ,
3, , , , ,
, , , , 1055
static yy_state_type yy_last_accepting_
static char *yy_last_accepting_
/* The intent behind this definition is that it'll catch
* any uses of REJECT which flex missed.
#define REJECT reject_used_but_not_detected
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
#line 1 &../libpcap/scanner.l&
#define INITIAL 0
#line 2 &../libpcap/scanner.l&
* Copyright (c) , , , ,
* The Regents of the University of California.
All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that: (1) source code distributions
* retain the above copyright notice and this paragraph in its entirety, (2)
* distributions including binary code include the above copyright notice and
* this paragraph in its entirety in the documentation or other materials
* provided with the distribution, and (3) all advertising materials mentioning
* features or use of this software display the following acknowledgement:
* ``This product includes software developed by the University of California,
* Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
* the University nor the names of its contributors may be used to endorse
* or promote products derived from this software without specific prior
* written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#ifndef lint
static const char rcsid[] =
&@(#) $Header: /tcpdump/master/libpcap/scanner.l,v 1.70
10:18:40 guy Exp $ (LBL)&;
#ifdef HAVE_CONFIG_H
#include &config.h&
#ifdef WIN32
#include &winsock2.h&
#include &sys/types.h&
#include &sys/time.h&
#endif /* WIN32 */
#include &ctype.h&
#include &unistd.h&
#include &string.h&
#include &pcap-int.h&
#include &gencode.h&
#include &pcap-namedb.h&
#ifdef INET6
#ifdef NEED_ADDRINFO_H
#include &addrinfo.h&
#ifndef WIN32
#include &netdb.h&
#include &sys/socket.h&
#include &bittypes.h&
#include &IP6_misc.h&
#include &tpipv6.h&
#endif /* WIN32 */
#endif /* NEED_ADDRINFO_H */
/* Workaround for AIX 4.3 */
#if !defined(AI_NUMERICHOST)
#define AI_NUMERICHOST 0x04
#endif /*INET6*/
#include &tokdefs.h&
#ifdef HAVE_OS_PROTO_H
#include &os-proto.h&
static int stoi(char *);
static inline int xdtoi(int);
#ifdef FLEX_SCANNER
#define YY_NO_UNPUT
static YY_BUFFER_STATE in_
static char *in_
#undef getc
#define getc(fp)
(*in_buffer == 0 ? EOF : *in_buffer++)
#define yylval pcap_lval
extern YYSTYPE
/* Macros after this point can all be overridden by user definitions in
* section 1.
#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
extern &C& int yywrap YY_PROTO(( void ));
extern int yywrap YY_PROTO(( void ));
#ifndef YY_NO_UNPUT
static void yyunput YY_PROTO(( int c, char *buf_ptr ));
#ifndef yytext_ptr
static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
#ifdef YY_NEED_STRLEN
static int yy_flex_strlen YY_PROTO(( yyconst char * ));
#ifndef YY_NO_INPUT
#ifdef __cplusplus
static int yyinput YY_PROTO(( void ));
static int input YY_PROTO(( void ));
#if YY_STACK_USED
static int yy_start_stack_ptr = 0;
static int yy_start_stack_depth = 0;
static int *yy_start_stack = 0;
#ifndef YY_NO_PUSH_STATE
static void yy_push_state YY_PROTO(( int new_state ));
#ifndef YY_NO_POP_STATE
static void yy_pop_state YY_PROTO(( void ));
#ifndef YY_NO_TOP_STATE
static int yy_top_state YY_PROTO(( void ));
#define YY_NO_PUSH_STATE 1
#define YY_NO_POP_STATE 1
#define YY_NO_TOP_STATE 1
#ifdef YY_MALLOC_DECL
YY_MALLOC_DECL
#if __STDC__
#ifndef __cplusplus
#include &stdlib.h&
/* Just try to get by without declaring the routines.
This will fail
* miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
* or sizeof(void*) != sizeof(int).
/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
#define YY_READ_BUF_SIZE 8192
/* Copy whatever the last rule matched to the standard output. */
#ifndef ECHO
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
/* Gets input and stuffs it into &buf&.
number of characters read, or YY_NULL,
* is returned in &result&.
#ifndef YY_INPUT
#define YY_INPUT(buf,result,max_size) \
if ( yy_current_buffer-&yy_is_interactive ) \
int c = '*', \
for ( n = 0; n & max_size && \
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) \
if ( c == '\n' ) \
buf[n++] = (char) \
if ( c == EOF && ferror( yyin ) ) \
YY_FATAL_ERROR( &input in flex scanner failed& ); \
result = \
else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
&& ferror( yyin ) ) \
YY_FATAL_ERROR( &input in flex scanner failed& );
/* No semi- correct usage is to write &yyterminate();& -
* we don't want an extra ';' after the &return& because that will cause
* some compilers to complain about unreachable statements.
#ifndef yyterminate
#define yyterminate() return YY_NULL
/* Number of entries by which start-condition stack grows. */
#ifndef YY_START_STACK_INCR
#define YY_START_STACK_INCR 25
/* Report a fatal error. */
#ifndef YY_FATAL_ERROR
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
/* Default declaration of generated scanner - a define so the user can
* easily add parameters.
#ifndef YY_DECL
#define YY_DECL int yylex YY_PROTO(( void ))
/* Code executed at the beginning of each rule, after yytext and yyleng
* have been set up.
#ifndef YY_USER_ACTION
#define YY_USER_ACTION
/* Code executed at the end of each rule. */
#ifndef YY_BREAK
#define YY_BREAK
#define YY_RULE_SETUP \
YY_USER_ACTION
register yy_state_type yy_current_
register char *yy_cp, *yy_
register int yy_
#line 178 &../libpcap/scanner.l&
if ( yy_init )
yy_init = 0;
#ifdef YY_USER_INIT
YY_USER_INIT;
if ( ! yy_start )
yy_start = 1; /* first start state */
if ( ! yyin )
if ( ! yyout )
if ( ! yy_current_buffer )
yy_current_buffer =
yy_create_buffer( yyin, YY_BUF_SIZE );
yy_load_buffer_state();
while ( 1 )
/* loops until end-of-file is reached */
yy_cp = yy_c_buf_p;
/* Support of yytext. */
*yy_cp = yy_hold_
/* yy_bp points to the position in yy_ch_buf of the start of
* the current run.
yy_bp = yy_
yy_current_state = yy_
register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
if ( yy_accept[yy_current_state] )
yy_last_accepting_state = yy_current_
yy_last_accepting_cpos = yy_
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state &= 1056 )
yy_c = yy_meta[(unsigned int) yy_c];
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
while ( yy_base[yy_current_state] != 3773 );
yy_find_action:
yy_act = yy_accept[yy_current_state];
if ( yy_act == 0 )
/* have to back up */
yy_cp = yy_last_accepting_
yy_current_state = yy_last_accepting_
yy_act = yy_accept[yy_current_state];
YY_DO_BEFORE_ACTION;
do_action: /* This label is used only to access EOF actions. */
switch ( yy_act )
/* beginning of action switch */
case 0: /* must back up */
/* undo the effects of YY_DO_BEFORE_ACTION */
*yy_cp = yy_hold_
yy_cp = yy_last_accepting_
yy_current_state = yy_last_accepting_
goto yy_find_
YY_RULE_SETUP
#line 179 &../libpcap/scanner.l&
return DST;
YY_RULE_SETUP
#line 180 &../libpcap/scanner.l&
return SRC;
YY_RULE_SETUP
#line 182 &../libpcap/scanner.l&
return LINK;
YY_RULE_SETUP
#line 183 &../libpcap/scanner.l&
return LINK;
YY_RULE_SETUP
#line 184 &../libpcap/scanner.l&
return ARP;
YY_RULE_SETUP
#line 185 &../libpcap/scanner.l&
return RARP;
YY_RULE_SETUP
#line 186 &../libpcap/scanner.l&
return IP;
YY_RULE_SETUP
#line 187 &../libpcap/scanner.l&
return TCP;
YY_RULE_SETUP
#line 188 &../libpcap/scanner.l&
return UDP;
YY_RULE_SETUP
#line 189 &../libpcap/scanner.l&
return ICMP;
YY_RULE_SETUP
#line 190 &../libpcap/scanner.l&
return IGMP;
YY_RULE_SETUP
#line 191 &../libpcap/scanner.l&
return IGRP;
YY_RULE_SETUP
#line 192 &../libpcap/scanner.l&
return PIM;
YY_RULE_SETUP
#line 194 &../libpcap/scanner.l&
return IPV6;
YY_RULE_SETUP
#line 195 &../libpcap/scanner.l&
return ICMPV6;
YY_RULE_SETUP
#line 196 &../libpcap/scanner.l&
return AH;
YY_RULE_SETUP
#line 197 &../libpcap/scanner.l&
return ESP;
YY_RULE_SETUP
#line 199 &../libpcap/scanner.l&
return ATALK;
YY_RULE_SETUP
#line 200 &../libpcap/scanner.l&
return AARP;
YY_RULE_SETUP
#line 201 &../libpcap/scanner.l&
return DECNET;
YY_RULE_SETUP
#line 202 &../libpcap/scanner.l&
return LAT;
YY_RULE_SETUP
#line 203 &../libpcap/scanner.l&
return SCA;
YY_RULE_SETUP
#line 204 &../libpcap/scanner.l&
return MOPRC;
YY_RULE_SETUP
#line 205 &../libpcap/scanner.l&
return MOPDL;
YY_RULE_SETUP
#line 207 &../libpcap/scanner.l&
return ISO;
YY_RULE_SETUP
#line 208 &../libpcap/scanner.l&
return ESIS;
YY_RULE_SETUP
#line 209 &../libpcap/scanner.l&
return ESIS;
YY_RULE_SETUP
#line 210 &../libpcap/scanner.l&
return ISIS;
YY_RULE_SETUP
#line 211 &../libpcap/scanner.l&
return ISIS;
YY_RULE_SETUP
#line 212 &../libpcap/scanner.l&
return CLNP;
YY_RULE_SETUP
#line 214 &../libpcap/scanner.l&
return HOST;
YY_RULE_SETUP
#line 215 &../libpcap/scanner.l&
return NET;
YY_RULE_SETUP
#line 216 &../libpcap/scanner.l&
return MASK;
YY_RULE_SETUP
#line 217 &../libpcap/scanner.l&
return PORT;
YY_RULE_SETUP
#line 218 &../libpcap/scanner.l&
return PROTO;
YY_RULE_SETUP
#line 219 &../libpcap/scanner.l&
#ifdef NO_PROTOCHAIN
bpf_error(&%s not supported&, yytext);
return PROTOCHAIN;
YY_RULE_SETUP
#line 227 &../libpcap/scanner.l&
return GATEWAY;
YY_RULE_SETUP
#line 229 &../libpcap/scanner.l&
return LESS;
YY_RULE_SETUP
#line 230 &../libpcap/scanner.l&
return GREATER;
YY_RULE_SETUP
#line 231 &../libpcap/scanner.l&
return CBYTE;
YY_RULE_SETUP
#line 232 &../libpcap/scanner.l&
return TK_BROADCAST;
YY_RULE_SETUP
#line 233 &../libpcap/scanner.l&
return TK_MULTICAST;
YY_RULE_SETUP
#line 235 &../libpcap/scanner.l&
return AND;
YY_RULE_SETUP
#line 236 &../libpcap/scanner.l&
return OR;
YY_RULE_SETUP
#line 237 &../libpcap/scanner.l&
return '!';
YY_RULE_SETUP
#line 239 &../libpcap/scanner.l&
return LEN;
YY_RULE_SETUP
#line 240 &../libpcap/scanner.l&
return INBOUND;
YY_RULE_SETUP
#line 241 &../libpcap/scanner.l&
return OUTBOUND;
YY_RULE_SETUP
#line 243 &../libpcap/scanner.l&
return VLAN;
YY_RULE_SETUP
#line 245 &../libpcap/scanner.l&
YY_RULE_SETUP
#line 246 &../libpcap/scanner.l&
return yytext[0];
YY_RULE_SETUP
#line 247 &../libpcap/scanner.l&
return GEQ;
YY_RULE_SETUP
#line 248 &../libpcap/scanner.l&
return LEQ;
YY_RULE_SETUP
#line 249 &../libpcap/scanner.l&
return NEQ;
YY_RULE_SETUP
#line 250 &../libpcap/scanner.l&
return '=';
YY_RULE_SETUP
#line 251 &../libpcap/scanner.l&
return LSH;
YY_RULE_SETUP
#line 252 &../libpcap/scanner.l&
return RSH;
YY_RULE_SETUP
#line 253 &../libpcap/scanner.l&
yylval.i = stoi((char *)yytext); return NUM;
YY_RULE_SETUP
#line 254 &../libpcap/scanner.l&
yylval.s = sdup((char *)yytext); return HID;
YY_RULE_SETUP
#line 256 &../libpcap/scanner.l&
yylval.e = pcap_ether_aton((char *)yytext);
return EID;
YY_RULE_SETUP
#line 258 &../libpcap/scanner.l&
#ifdef INET6
struct addrinfo hints, *
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_INET6;
hints.ai_flags = AI_NUMERICHOST;
if (getaddrinfo(yytext, NULL, &hints, &res))
bpf_error(&bogus IPv6 address %s&, yytext);
yylval.e = sdup((char *)yytext); return HID6;
bpf_error(&IPv6 address %s not supported&, yytext);
#endif /*INET6*/
YY_RULE_SETUP
#line 273 &../libpcap/scanner.l&
bpf_error(&bogus ethernet address %s&, yytext);
YY_RULE_SETUP
#line 274 &../libpcap/scanner.l&
yylval.s = sdup((char *)yytext); return ID;
YY_RULE_SETUP
#line 276 &../libpcap/scanner.l&
yylval.s = sdup((char *)yytext + 1); return ID;
YY_RULE_SETUP
#line 277 &../libpcap/scanner.l&
bpf_error(&illegal token: %s\n&, yytext);
YY_RULE_SETUP
#line 279 &../libpcap/scanner.l&
bpf_error(&illegal char '%c'&, *yytext);
YY_RULE_SETUP
#line 280 &../libpcap/scanner.l&
case YY_STATE_EOF(INITIAL):
yyterminate();
case YY_END_OF_BUFFER:
/* Amount of text matched not including the EOB char. */
int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
/* Undo the effects of YY_DO_BEFORE_ACTION. */
*yy_cp = yy_hold_
YY_RESTORE_YY_MORE_OFFSET
if ( yy_current_buffer-&yy_buffer_status == YY_BUFFER_NEW )
/* We're scanning a new file or input source.
* possible that this happened because the user
* just pointed yyin at a new source and called
* yylex().
If so, then we have to assure
* consistency between yy_current_buffer and our
* globals.
Here is the right place to do so, because
* this is the first action (other than possibly a
* back-up) that will match for the new input source.
yy_n_chars = yy_current_buffer-&yy_n_
yy_current_buffer-&yy_input_file =
yy_current_buffer-&yy_buffer_status = YY_BUFFER_NORMAL;
/* Note that here we test for yy_c_buf_p &&=& to the position
* of the first EOB in the buffer, since yy_c_buf_p will
* already have been incremented past the NUL character
* (since all states make transitions on EOB to the
* end-of-buffer state).
Contrast this with the test
* in input().
if ( yy_c_buf_p &= &yy_current_buffer-&yy_ch_buf[yy_n_chars] )
/* This was really a NUL. */
yy_state_type yy_next_
yy_c_buf_p = yytext_ptr + yy_amount_of_matched_
yy_current_state = yy_get_previous_state();
/* Okay, we're now positioned to make the NUL
* transition.
We couldn't have
* yy_get_previous_state() go ahead and do it
* for us because it doesn't know how to deal
* with the possibility of jamming (and we don't
* want to build jamming into it because then it
* will run more slowly).
yy_next_state = yy_try_NUL_trans( yy_current_state );
yy_bp = yytext_ptr + YY_MORE_ADJ;
if ( yy_next_state )
/* Consume the NUL. */
yy_cp = ++yy_c_buf_p;
yy_current_state = yy_next_
yy_cp = yy_c_buf_p;
goto yy_find_
else switch ( yy_get_next_buffer() )
case EOB_ACT_END_OF_FILE:
yy_did_buffer_switch_on_eof = 0;
if ( yywrap() )
/* Note: because we've taken care in
* yy_get_next_buffer() to have set up
* yytext, we can now set up
* yy_c_buf_p so that if some total
* hoser (like flex itself) wants to
* call the scanner after we return the
* YY_NULL, it'll still work - another
* YY_NULL will get returned.
yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
yy_act = YY_STATE_EOF(YY_START);
if ( ! yy_did_buffer_switch_on_eof )
YY_NEW_FILE;
case EOB_ACT_CONTINUE_SCAN:
yy_c_buf_p =
yytext_ptr + yy_amount_of_matched_
yy_current_state = yy_get_previous_state();
yy_cp = yy_c_buf_p;
yy_bp = yytext_ptr + YY_MORE_ADJ;
case EOB_ACT_LAST_MATCH:
yy_c_buf_p =
&yy_current_buffer-&yy_ch_buf[yy_n_chars];
yy_current_state = yy_get_previous_state();
yy_cp = yy_c_buf_p;
yy_bp = yytext_ptr + YY_MORE_ADJ;
goto yy_find_
YY_FATAL_ERROR(
&fatal flex scanner internal error--no action found& );
} /* end of action switch */
} /* end of scanning one token */
} /* end of yylex */
/* yy_get_next_buffer - try to read in a new buffer
* Returns a code representing an action:
* EOB_ACT_LAST_MATCH -
* EOB_ACT_CONTINUE_SCAN - continue scanning from current position
* EOB_ACT_END_OF_FILE - end of file
static int yy_get_next_buffer()
register char *dest = yy_current_buffer-&yy_ch_
register char *source = yytext_
register int number_to_move,
if ( yy_c_buf_p & &yy_current_buffer-&yy_ch_buf[yy_n_chars + 1] )
YY_FATAL_ERROR(
&fatal flex scanner internal error--end of buffer missed& );
if ( yy_current_buffer-&yy_fill_buffer == 0 )
/* Don't try to fill the buffer, so this is an EOF. */
if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
/* We matched a single character, the EOB, so
* treat this as a final EOF.
return EOB_ACT_END_OF_FILE;
/* We matched some text prior to the EOB, first
* process it.
return EOB_ACT_LAST_MATCH;
/* Try to read more data. */
/* First move last chars to start of buffer. */
number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
for ( i = 0; i & number_to_ ++i )
*(dest++) = *(source++);
if ( yy_current_buffer-&yy_buffer_status == YY_BUFFER_EOF_PENDING )
/* don't do the read, it's not guaranteed to return an EOF,
* just force an EOF
yy_current_buffer-&yy_n_chars = yy_n_chars = 0;
int num_to_read =
yy_current_buffer-&yy_buf_size - number_to_move - 1;
while ( num_to_read &= 0 )
/* Not enough room in the buffer - grow it. */
#ifdef YY_USES_REJECT
YY_FATAL_ERROR(
&input buffer overflow, can't enlarge buffer because scanner uses REJECT& );
/* just a shorter name for the current buffer */
YY_BUFFER_STATE b = yy_current_
int yy_c_buf_p_offset =
(int) (yy_c_buf_p - b-&yy_ch_buf);
if ( b-&yy_is_our_buffer )
int new_size = b-&yy_buf_size * 2;
if ( new_size &= 0 )
b-&yy_buf_size += b-&yy_buf_size / 8;
b-&yy_buf_size *= 2;
b-&yy_ch_buf = (char *)
/* Include room in for 2 EOB chars. */
yy_flex_realloc( (void *) b-&yy_ch_buf,
b-&yy_buf_size + 2 );
/* Can't grow it, we don't own it. */
b-&yy_ch_buf = 0;
if ( ! b-&yy_ch_buf )
YY_FATAL_ERROR(
&fatal error - scanner input buffer overflow& );
yy_c_buf_p = &b-&yy_ch_buf[yy_c_buf_p_offset];
num_to_read = yy_current_buffer-&yy_buf_size -
number_to_move - 1;
if ( num_to_read & YY_READ_BUF_SIZE )
num_to_read = YY_READ_BUF_SIZE;
/* Read in more data. */
YY_INPUT( (&yy_current_buffer-&yy_ch_buf[number_to_move]),
yy_n_chars, num_to_read );
yy_current_buffer-&yy_n_chars = yy_n_
if ( yy_n_chars == 0 )
if ( number_to_move == YY_MORE_ADJ )
ret_val = EOB_ACT_END_OF_FILE;
yyrestart( yyin );
ret_val = EOB_ACT_LAST_MATCH;
yy_current_buffer-&yy_buffer_status =
YY_BUFFER_EOF_PENDING;
ret_val = EOB_ACT_CONTINUE_SCAN;
yy_n_chars += number_to_
yy_current_buffer-&yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
yy_current_buffer-&yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
yytext_ptr = &yy_current_buffer-&yy_ch_buf[0];
return ret_
/* yy_get_previous_state - get the state just before the EOB char was reached */
static yy_state_type yy_get_previous_state()
register yy_state_type yy_current_
register char *yy_
yy_current_state = yy_
for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp & yy_c_buf_p; ++yy_cp )
register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
if ( yy_accept[yy_current_state] )
yy_last_accepting_state = yy_current_
yy_last_accepting_cpos = yy_
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state &= 1056 )
yy_c = yy_meta[(unsigned int) yy_c];
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
return yy_current_
/* yy_try_NUL_trans - try to make a transition on the NUL character
* synopsis
* next_state = yy_try_NUL_trans( current_state );
#ifdef YY_USE_PROTOS
static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
static yy_state_type yy_try_NUL_trans( yy_current_state )
yy_state_type yy_current_
register int yy_is_
register char *yy_cp = yy_c_buf_p;
register YY_CHAR yy_c = 1;
if ( yy_accept[yy_current_state] )
yy_last_accepting_state = yy_current_
yy_last_accepting_cpos = yy_
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state &= 1056 )
yy_c = yy_meta[(unsigned int) yy_c];
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
yy_is_jam = (yy_current_state == 1055);
return yy_is_jam ? 0 : yy_current_
#ifndef YY_NO_UNPUT
#ifdef YY_USE_PROTOS
static void yyunput( int c, register char *yy_bp )
static void yyunput( c, yy_bp )
register char *yy_
register char *yy_cp = yy_c_buf_p;
/* undo effects of setting up yytext */
*yy_cp = yy_hold_
if ( yy_cp & yy_current_buffer-&yy_ch_buf + 2 )
/* need to shift things up to make room */
/* +2 for EOB chars. */
register int number_to_move = yy_n_chars + 2;
register char *dest = &yy_current_buffer-&yy_ch_buf[
yy_current_buffer-&yy_buf_size + 2];
register char *source =
&yy_current_buffer-&yy_ch_buf[number_to_move];
while ( source & yy_current_buffer-&yy_ch_buf )
*--dest = *--
yy_cp += (int) (dest - source);
yy_bp += (int) (dest - source);
yy_current_buffer-&yy_n_chars =
yy_n_chars = yy_current_buffer-&yy_buf_
if ( yy_cp & yy_current_buffer-&yy_ch_buf + 2 )
YY_FATAL_ERROR( &flex scanner push-back overflow& );
*--yy_cp = (char)
yytext_ptr = yy_
yy_hold_char = *yy_
yy_c_buf_p = yy_
#endif /* ifndef YY_NO_UNPUT */
#ifdef __cplusplus
static int yyinput()
static int input()
*yy_c_buf_p = yy_hold_
if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
/* yy_c_buf_p now points to the character we want to return.
* If this occurs *before* the EOB characters, then it's a
* valid NUL; if not, then we've hit the end of the buffer.
if ( yy_c_buf_p & &yy_current_buffer-&yy_ch_buf[yy_n_chars] )
/* This was really a NUL. */
*yy_c_buf_p = '\0';
/* need more input */
int offset = yy_c_buf_p - yytext_
++yy_c_buf_p;
switch ( yy_get_next_buffer() )
case EOB_ACT_LAST_MATCH:
/* This happens because yy_g_n_b()
* sees that we've accumulated a
* token and flags that we need to
* try matching the token before
* proceeding.
But for input(),
* there's no matching to consider.
* So convert the EOB_ACT_LAST_MATCH
* to EOB_ACT_END_OF_FILE.
/* Reset buffer status. */
yyrestart( yyin );
/* fall through */
case EOB_ACT_END_OF_FILE:
if ( yywrap() )
return EOF;
if ( ! yy_did_buffer_switch_on_eof )
YY_NEW_FILE;
#ifdef __cplusplus
return yyinput();
return input();
case EOB_ACT_CONTINUE_SCAN:
yy_c_buf_p = yytext_ptr +
c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
*yy_c_buf_p = '\0'; /* preserve yytext */
yy_hold_char = *++yy_c_buf_p;
#ifdef YY_USE_PROTOS
void yyrestart( FILE *input_file )
void yyrestart( input_file )
FILE *input_
if ( ! yy_current_buffer )
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
yy_init_buffer( yy_current_buffer, input_file );
yy_load_buffer_state();
#ifdef YY_USE_PROTOS
void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
void yy_switch_to_buffer( new_buffer )
YY_BUFFER_STATE new_
if ( yy_current_buffer == new_buffer )
if ( yy_current_buffer )
/* Flush out information for old buffer. */
*yy_c_buf_p = yy_hold_
yy_current_buffer-&yy_buf_pos = yy_c_buf_p;
yy_current_buffer-&yy_n_chars = yy_n_
yy_current_buffer = new_
yy_load_buffer_state();
/* We don't actually know whether we did this switch during
* EOF (yywrap()) processing, but the only time this flag
* is looked at is after yywrap() is called, so it's safe
* to go ahead and always set it.
yy_did_buffer_switch_on_eof = 1;
#ifdef YY_USE_PROTOS
void yy_load_buffer_state( void )
void yy_load_buffer_state()
yy_n_chars = yy_current_buffer-&yy_n_
yytext_ptr = yy_c_buf_p = yy_current_buffer-&yy_buf_
yyin = yy_current_buffer-&yy_input_
yy_hold_char = *yy_c_buf_p;
#ifdef YY_USE_PROTOS
YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
YY_BUFFER_STATE yy_create_buffer( file, size )
YY_BUFFER_STATE
b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
if ( ! b )
YY_FATAL_ERROR( &out of dynamic memory in yy_create_buffer()& );
b-&yy_buf_size =
/* yy_ch_buf has to be 2 characters longer than the size given because
* we need to put in 2 end-of-buffer characters.
b-&yy_ch_buf = (char *) yy_flex_alloc( b-&yy_buf_size + 2 );
if ( ! b-&yy_ch_buf )
YY_FATAL_ERROR( &out of dynamic memory in yy_create_buffer()& );
b-&yy_is_our_buffer = 1;
yy_init_buffer( b, file );
#ifdef YY_USE_PROTOS
void yy_delete_buffer( YY_BUFFER_STATE b )
void yy_delete_buffer( b )
YY_BUFFER_STATE
if ( ! b )
if ( b == yy_current_buffer )
yy_current_buffer = (YY_BUFFER_STATE) 0;
if ( b-&yy_is_our_buffer )
yy_flex_free( (void *) b-&yy_ch_buf );
yy_flex_free( (void *) b );
#ifndef YY_ALWAYS_INTERACTIVE
#ifndef YY_NEVER_INTERACTIVE
extern int isatty YY_PROTO(( int ));
#ifdef YY_USE_PROTOS
void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
void yy_init_buffer( b, file )
YY_BUFFER_STATE
yy_flush_buffer( b );
b-&yy_input_file =
b-&yy_fill_buffer = 1;
#if YY_ALWAYS_INTERACTIVE
b-&yy_is_interactive = 1;
#if YY_NEVER_INTERACTIVE
b-&yy_is_interactive = 0;
b-&yy_is_interactive = file ? (isatty( fileno(file) ) & 0) : 0;
#ifdef YY_USE_PROTOS
void yy_flush_buffer( YY_BUFFER_STATE b )
void yy_flush_buffer( b )
YY_BUFFER_STATE
if ( ! b )
b-&yy_n_chars = 0;
/* We always need two end-of-buffer characters.
The first causes
* a transition to the end-of-buffer state.
The second causes
* a jam in that state.
b-&yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
b-&yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
b-&yy_buf_pos = &b-&yy_ch_buf[0];
b-&yy_at_bol = 1;
b-&yy_buffer_status = YY_BUFFER_NEW;
if ( b == yy_current_buffer )
yy_load_buffer_state();
#ifndef YY_NO_SCAN_BUFFER
#ifdef YY_USE_PROTOS
YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
YY_BUFFER_STATE yy_scan_buffer( base, size )
YY_BUFFER_STATE
if ( size & 2 ||
base[size-2] != YY_END_OF_BUFFER_CHAR ||
base[size-1] != YY_END_OF_BUFFER_CHAR )
/* They forgot to leave room for the EOB's. */
b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
if ( ! b )
YY_FATAL_ERROR( &out of dynamic memory in yy_scan_buffer()& );
b-&yy_buf_size = size - 2; /* &- 2& to take care of EOB's */
b-&yy_buf_pos = b-&yy_ch_buf =
b-&yy_is_our_buffer = 0;
b-&yy_input_file = 0;
b-&yy_n_chars = b-&yy_buf_
b-&yy_is_interactive = 0;
b-&yy_at_bol = 1;
b-&yy_fill_buffer = 0;
b-&yy_buffer_status = YY_BUFFER_NEW;
yy_switch_to_buffer( b );
#ifndef YY_NO_SCAN_STRING
#ifdef YY_USE_PROTOS
YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
YY_BUFFER_STATE yy_scan_string( yy_str )
yyconst char *yy_
for ( len = 0; yy_str[len]; ++len )
return yy_scan_bytes( yy_str, len );
#ifndef YY_NO_SCAN_BYTES
#ifdef YY_USE_PROTOS
YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
YY_BUFFER_STATE yy_scan_bytes( bytes, len )
yyconst char *
YY_BUFFER_STATE
/* Get memory for full buffer, including space for trailing EOB's. */
n = len + 2;
buf = (char *) yy_flex_alloc( n );
if ( ! buf )
YY_FATAL_ERROR( &out of dynamic memory in yy_scan_bytes()& );
for ( i = 0; i & ++i )
buf[i] = bytes[i];
buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
b = yy_scan_buffer( buf, n );
if ( ! b )
YY_FATAL_ERROR( &bad buffer in yy_scan_bytes()& );
/* It's okay to grow etc. this buffer, and we should throw it
* away when we're done.
b-&yy_is_our_buffer = 1;
#ifndef YY_NO_PUSH_STATE
#ifdef YY_USE_PROTOS
static void yy_push_state( int new_state )
static void yy_push_state( new_state )
if ( yy_start_stack_ptr &= yy_start_stack_depth )
yy_size_t new_
yy_start_stack_depth += YY_START_STACK_INCR;
new_size = yy_start_stack_depth * sizeof( int );
if ( ! yy_start_stack )
yy_start_stack = (int *) yy_flex_alloc( new_size );
yy_start_stack = (int *) yy_flex_realloc(
(void *) yy_start_stack, new_size );
if ( ! yy_start_stack )
YY_FATAL_ERROR(
&out of memory expanding start-condition stack& );
yy_start_stack[yy_start_stack_ptr++] = YY_START;
BEGIN(new_state);
#ifndef YY_NO_POP_STATE
static void yy_pop_state()
if ( --yy_start_stack_ptr & 0 )
YY_FATAL_ERROR( &start-condition stack underflow& );
BEGIN(yy_start_stack[yy_start_stack_ptr]);
#ifndef YY_NO_TOP_STATE
static int yy_top_state()
return yy_start_stack[yy_start_stack_ptr - 1];
#ifndef YY_EXIT_FAILURE
#define YY_EXIT_FAILURE 2
#ifdef YY_USE_PROTOS
static void yy_fatal_error( yyconst char msg[] )
static void yy_fatal_error( msg )
char msg[];
(void) fprintf( stderr, &%s\n&, msg );
exit( YY_EXIT_FAILURE );
/* Redefine yyless() so it works in section 3 code. */
#undef yyless
#define yyless(n) \
/* Undo effects of setting up yytext. */ \
yytext[yyleng] = yy_hold_ \
yy_c_buf_p = yytext + \
yy_hold_char = *yy_c_buf_p; \
*yy_c_buf_p = '\0'; \
yyleng = \
while ( 0 )
/* Internal utility routines. */
#ifndef yytext_ptr
#ifdef YY_USE_PROTOS
static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
static void yy_flex_strncpy( s1, s2, n )
yyconst char *s2;
for ( i = 0; i & ++i )
s1[i] = s2[i];
#ifdef YY_NEED_STRLEN
#ifdef YY_USE_PROTOS
static int yy_flex_strlen( yyconst char *s )
static int yy_flex_strlen( s )
yyconst char *s;
for ( n = 0; s[n]; ++n )
#ifdef YY_USE_PROTOS
static void *yy_flex_alloc( yy_size_t size )
static void *yy_flex_alloc( size )
return (void *) malloc( size );
#ifdef YY_USE_PROTOS
static void *yy_flex_realloc( void *ptr, yy_size_t size )
static void *yy_flex_realloc( ptr, size )
/* The cast to (char *) in the following accommodates both
* implementations that use char* generic pointers, and those
* that use void* generic pointers.
It works with the latter
* because both ANSI C and C++ allow castless assignment from
* any pointer type to void*, and deal with argument conversions
* as though doing an assignment.
return (void *) realloc( (char *) ptr, size );
#ifdef YY_USE_PROTOS
static void yy_flex_free( void *ptr )
static void yy_flex_free( ptr )
free( ptr );
#if YY_MAIN
int main()
#line 280 &../libpcap/scanner.l&
lex_init(buf)
#ifdef FLEX_SCANNER
in_buffer = yy_scan_string(buf);
in_buffer =
* Do any cleanup necessary after parsing.
lex_cleanup()
#ifdef FLEX_SCANNER
if (in_buffer != NULL)
yy_delete_buffer(in_buffer);
in_buffer = NULL;
* Also define a yywrap.
Note that if we're using flex, it will
* define a macro to map this identifier to pcap_wrap.
/* Hex digit to integer. */
static inline int
if (isdigit(c))
return c - '0';
else if (islower(c))
return c - 'a' + 10;
return c - 'A' + 10;
* Convert string to integer.
Just like atoi(), but checks for
* preceding 0x or 0 and uses hex or octal instead of decimal.
static int
int base = 10;
int n = 0;
if (*s == '0') {
if (s[1] == 'x' || s[1] == 'X') {
base = 16;
while (*s)
n = n * base + xdtoi(*s++);
源码下载: &
源码文件列表
温馨提示: 点击源码文件名可预览文件内容哦 ^_^
名称大小日期
&3.87 kB05-08-98 07:46
&47.42 kB06-01-01 23:13
&1.26 kB01-24-02 22:01
&Packet.lib6.70 kB03-02-02 15:56
&5.96 kB03-02-02 15:48
&11.27 kB03-02-02 15:45
&15.85 kB03-01-02 17:54
&Packet.def624.00 B02-21-02 17:40
&25.26 kB03-14-02 10:33
&558.00 B04-08-01 15:59
&Packet.dsp3.82 kB03-12-02 22:58
&Packet.dsw537.00 B08-15-99 10:09
&411.00 B02-28-02 11:05
&version.rc2.57 kB02-28-02 11:05
&3.11 kB02-01-02 07:11
&3.87 kB02-01-02 07:11
&1.99 kB02-01-02 07:11
&7.18 kB02-01-02 07:11
&1.13 kB02-28-02 10:06
&Ndis.mk4.17 kB02-01-02 07:11
&2.27 kB02-01-02 07:11
&NPF.def1.26 kB02-28-02 10:08
&NPF.rc1.27 kB02-28-02 08:38
&1.26 kB02-01-02 07:11
&19.53 kB02-01-02 07:11
&19.33 kB02-28-02 10:31
&9.18 kB02-28-02 10:28
&22.93 kB02-01-02 07:11
&7.72 kB02-28-02 10:30
&Vpacket.rc1.30 kB02-01-02 07:11
&3.08 kB02-01-02 07:11
&173.00 B08-13-01 16:37
&173.00 B08-13-01 16:36
&DIRS24.00 B08-13-99 12:25
&Packet.def557.00 B02-28-02 16:01
&38.10 kB03-14-02 10:35
&558.00 B05-31-01 10:00
&Packet.dsp3.85 kB02-28-02 11:06
&Packet.dsw539.00 B06-18-99 14:09
&411.00 B02-28-02 11:05
&version.rc2.57 kB02-28-02 11:05
&1.80 kB01-17-00 10:34
&267.00 B08-08-96 22:30
&NPF.RC2.54 kB02-28-02 17:26
&12.88 kB02-28-02 15:40
&35.46 kB03-19-02 18:02
&8.44 kB12-04-01 17:35
&14.26 kB02-28-02 18:12
&407.00 B02-25-02 14:30
&Sources299.00 B02-28-02 15:58
&4.11 kB08-27-01 11:39
&931.00 B05-28-01 13:09
&4.56 kB09-18-01 15:37
&aclocal.m420.57 kB09-19-00 05:56
&12.71 kB09-19-01 16:51
&11.32 kB09-14-01 11:35
&2.11 kB08-30-01 15:10
&4.96 kB08-30-01 15:13
&CHANGES11.30 kB01-10-01 05:10
&config.guess37.95 kB12-17-00 16:16
&config.h.in1.98 kB01-17-01 19:23
&config.sub26.51 kB12-17-00 16:16
&74.55 kB01-17-01 19:23
&5.88 kB01-17-01 19:21
&CREDITS1.17 kB01-18-01 05:06
&3.27 kB08-30-01 15:19
&3.12 kB10-22-00 06:15
&FILES669.00 B12-21-00 11:29
&64.28 kB11-13-01 10:38
&5.02 kB11-04-00 11:09
&50.53 kB09-18-01 11:08
&grammar.y7.93 kB08-30-01 16:24
&10.00 kB08-30-01 15:32
&INSTALL14.02 kB12-16-00 10:05
&install-sh5.45 kB10-08-99 01:46
&1.43 kB12-22-00 12:51
&1.37 kB10-11-00 06:02
&6.12 kB10-08-99 01:46
&1.73 kB10-08-99 01:46
&LICENSE873.00 B10-10-00 00:38
&1.97 kB01-14-01 22:26
&5.73 kB01-18-01 05:06
&mkdep2.29 kB10-08-99 01:46
&8.88 kB08-30-01 15:35
&1.34 kB10-28-00 11:30
&42.85 kB09-14-01 11:35
&9.89 kB10-28-00 02:01
&24.11 kB11-22-00 06:32
&4.88 kB10-12-00 05:54
&6.41 kB02-15-02 15:09
&35.30 kB01-18-01 04:59
&3.25 kB07-29-00 09:36
&5.76 kB10-28-00 02:01
&970.00 B10-08-99 01:46
&2.25 kB10-28-00 02:01
&9.11 kB10-28-00 02:01
&969.00 B10-08-99 01:46
&7.37 kB10-28-00 02:01
&7.77 kB10-28-00 02:01
&6.07 kB03-12-02 10:19
&pcap.311.80 kB01-18-01 05:42
&5.20 kB09-28-01 14:31
&6.56 kB02-21-02 15:38
&2.45 kB10-19-99 17:18
&2.77 kB07-13-00 08:24
&1.41 kB06-11-00 18:46
&3.05 kB12-01-00 08:47
&18.46 kB10-12-01 17:10
&116.90 kB09-18-01 11:08
&scanner.l8.00 kB08-30-01 16:29
&5.37 kB12-23-00 08:50
&nit_if.o.sparc5.09 kB10-08-99 01:46
&nit_if.o.sun34.17 kB10-08-99 01:46
&nit_if.o.sun4c.4.0.3c5.17 kB10-08-99 01:46
&1.53 kB12-16-00 10:05
&1.15 kB09-18-01 11:08
&VERSION4.00 B12-08-00 08:01
&4.67 kB07-24-01 17:56
&12.38 kB07-26-01 13:37
&3.03 kB06-28-98 06:53
&2.75 kB04-09-01 11:38
&1.75 kB10-30-99 04:11
&6.02 kB06-18-00 23:19
&1.17 kB03-27-00 09:28
&785.00 B03-09-01 13:04
&2.47 kB03-27-00 09:36
&8.17 kB08-31-01 14:33
&9.37 kB08-31-01 14:08
&11.36 kB09-20-00 17:16
&29.33 kB09-21-00 15:44
&3.25 kB11-29-96 06:33
&2.42 kB01-30-98 22:07
&5.82 kB07-17-01 11:30
&6.33 kB01-30-98 22:12
&7.11 kB09-19-01 16:58
&3.60 kB01-30-98 22:12
&2.46 kB11-29-96 06:02
&11.92 kB01-30-98 22:12
&2.06 kB11-29-96 06:02
&3.50 kB01-30-98 22:12
&8.65 kB07-17-01 11:30
&4.42 kB03-24-00 15:19
&6.18 kB07-17-01 11:30
&3.75 kB05-26-95 02:19
&4.03 kB04-09-01 13:50
&1.72 kB10-30-99 04:11
&&UNISTD.H&0.00 B09-05-98 11:25
&libpcap.exp5.08 kB09-18-01 14:58
&libpcap.lib8.64 kB09-18-01 14:58
&libpcap.def675.00 B09-17-01 17:05
&libpcap.dsp7.77 kB09-18-01 14:59
&libpcap.dsw537.00 B09-17-01 17:00
&2.13 kB03-24-00 15:19
&25.15 kB04-11-01 15:05
&1.38 kB05-19-99 10:20
&2.58 kB05-19-99 10:20
&3.84 kB03-27-00 08:27
&3.51 kB07-17-01 11:30
&2.51 kB09-14-01 11:35
&3.24 kB05-19-99 10:20
&2.43 kB09-14-01 11:35
&wpcap.lib9.61 kB03-14-02 10:40
&2.28 kB09-18-01 11:07
&WPCAP.DEF764.00 B09-17-01 16:46
&wpcap.dsp8.13 kB02-22-02 14:00
&WPCAP.DSW533.00 B10-31-00 13:05
&411.00 B02-22-02 13:59
&version.rc2.54 kB02-22-02 13:59
&3.05 kB09-14-01 11:35
Sponsored links
23 篇源代码 21 篇源代码 18 篇源代码 13 篇源代码 9 篇源代码
285 篇源代码 173 篇源代码 48 篇源代码 42 篇源代码 36 篇源代码
登录 CodeForge
还没有CodeForge账号?
Switch to the English version?
CF仔没有找到您要的代码,请去留下您的问题吧,可能会有大神帮助你哦!
该用户暂时未开通博客
请按 Ctrl+D 键添加到收藏夹。}

我要回帖

更多关于 188▲1887▲5551 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信