2 * netsniff-ng - the packet sniffing beast
3 * By Daniel Borkmann <daniel@netsniff-ng.org>
4 * Copyright 2012 Daniel Borkmann <dborkma@tik.ee.ethz.ch>,
5 * Swiss federal institute of technology (ETH Zurich)
6 * Subject to the GPL, version 2.
9 /* yaac-func-prefix: yy */
20 #include <net/if_arp.h>
21 #include <netinet/in.h>
22 #include <linux/if_ether.h>
25 #include "trafgen_parser.tab.h"
26 #include "trafgen_conf.h"
27 #include "trafgen_proto.h"
28 #include "trafgen_l2.h"
29 #include "trafgen_l3.h"
30 #include "trafgen_l4.h"
37 #define YYERROR_VERBOSE 0
39 #define YYENABLE_NLS 1
40 #define YYLTYPE_IS_TRIVIAL 1
44 extern
int yylex(void);
45 extern
void yy_scan_string
(char *);
46 extern
void yylex_destroy
();
47 extern
void yyerror(const char *);
51 extern
struct packet
*packets
;
54 #define packet_last (plen - 1)
56 #define payload_last (packets[packet_last].len - 1)
58 extern
struct packet_dyn
*packet_dyn
;
61 #define packetd_last (dlen - 1)
63 #define packetdc_last (packet_dyn[packetd_last].clen - 1)
64 #define packetdr_last (packet_dyn[packetd_last].rlen - 1)
65 #define packetds_last (packet_dyn[packetd_last].slen - 1)
67 static int our_cpu
, min_cpu
= -1, max_cpu
= -1;
69 static struct proto_hdr
*hdr
;
71 static inline
int test_ignore
(void)
73 if
(min_cpu
< 0 && max_cpu
< 0)
75 else if
(max_cpu
>= our_cpu
&& min_cpu
<= our_cpu
)
81 static inline
void __init_new_packet_slot
(struct packet
*slot
)
87 static inline
void __init_new_counter_slot
(struct packet_dyn
*slot
)
93 static inline
void __init_new_randomizer_slot
(struct packet_dyn
*slot
)
99 static inline
void __init_new_csum_slot
(struct packet_dyn
*slot
)
105 static inline
void __setup_new_counter
(struct counter
*c
, uint8_t start
,
106 uint8_t stop
, uint8_t stepping
,
112 c
->val
= (type
== TYPE_INC
) ? start
: stop
;
113 c
->off
= payload_last
;
117 static inline
void __setup_new_randomizer
(struct randomizer
*r
)
119 r
->off
= payload_last
;
122 static inline
void __setup_new_csum16
(struct csum16
*s
, off_t from
, off_t to
,
125 s
->off
= payload_last
- 1;
131 static void realloc_packet
(void)
137 packets
= xrealloc
(packets
, plen
* sizeof
(*packets
));
139 __init_new_packet_slot
(&packets
[packet_last
]);
142 packet_dyn
= xrealloc
(packet_dyn
, dlen
* sizeof
(*packet_dyn
));
144 __init_new_counter_slot
(&packet_dyn
[packetd_last
]);
145 __init_new_randomizer_slot
(&packet_dyn
[packetd_last
]);
146 __init_new_csum_slot
(&packet_dyn
[packetd_last
]);
149 struct packet
*current_packet
(void)
151 return
&packets
[packet_last
];
154 static void set_byte
(uint8_t val
)
156 struct packet
*pkt
= &packets
[packet_last
];
162 pkt
->payload
= xrealloc
(pkt
->payload
, pkt
->len
);
163 pkt
->payload
[payload_last
] = val
;
166 static void set_multi_byte
(uint8_t *s
, size_t len
)
170 for
(i
= 0; i
< len
; ++i
)
174 void set_fill
(uint8_t val
, size_t len
)
177 struct packet
*pkt
= &packets
[packet_last
];
183 pkt
->payload
= xrealloc
(pkt
->payload
, pkt
->len
);
184 for
(i
= 0; i
< len
; ++i
)
185 pkt
->payload
[payload_last
- i
] = val
;
188 static void __set_csum16_dynamic
(size_t from
, size_t to
, enum csum which
)
190 struct packet
*pkt
= &packets
[packet_last
];
191 struct packet_dyn
*pktd
= &packet_dyn
[packetd_last
];
194 pkt
->payload
= xrealloc
(pkt
->payload
, pkt
->len
);
197 pktd
->csum
= xrealloc
(pktd
->csum
, pktd
->slen
* sizeof
(struct csum16
));
199 __setup_new_csum16
(&pktd
->csum
[packetds_last
], from
, to
, which
);
202 static void __set_csum16_static
(size_t from
, size_t to
, enum csum which __maybe_unused
)
204 struct packet
*pkt
= &packets
[packet_last
];
208 sum
= htons
(calc_csum
(pkt
->payload
+ from
, to
- from
));
209 psum
= (uint8_t *) &sum
;
215 static inline
bool is_dynamic_csum
(enum csum which
)
228 static void set_csum16
(size_t from
, size_t to
, enum csum which
)
230 struct packet
*pkt
= &packets
[packet_last
];
231 struct packet_dyn
*pktd
= &packet_dyn
[packetd_last
];
243 bug_on
(!(from
< to
));
245 if
(packet_dyn_has_elems
(pktd
) || to
>= pkt
->len || is_dynamic_csum
(which
))
246 __set_csum16_dynamic
(from
, to
, which
);
248 __set_csum16_static
(from
, to
, which
);
251 static void set_rnd
(size_t len
)
254 struct packet
*pkt
= &packets
[packet_last
];
260 pkt
->payload
= xrealloc
(pkt
->payload
, pkt
->len
);
261 for
(i
= 0; i
< len
; ++i
)
262 pkt
->payload
[payload_last
- i
] = (uint8_t) rand
();
265 static void set_sequential_inc
(uint8_t start
, size_t len
, uint8_t stepping
)
268 struct packet
*pkt
= &packets
[packet_last
];
274 pkt
->payload
= xrealloc
(pkt
->payload
, pkt
->len
);
275 for
(i
= 0; i
< len
; ++i
) {
276 off_t off
= len
- 1 - i
;
278 pkt
->payload
[payload_last
- off
] = start
;
283 static void set_sequential_dec
(uint8_t start
, size_t len
, uint8_t stepping
)
286 struct packet
*pkt
= &packets
[packet_last
];
292 pkt
->payload
= xrealloc
(pkt
->payload
, pkt
->len
);
293 for
(i
= 0; i
< len
; ++i
) {
294 int off
= len
- 1 - i
;
296 pkt
->payload
[payload_last
- off
] = start
;
301 static void set_dynamic_rnd
(void)
303 struct packet
*pkt
= &packets
[packet_last
];
304 struct packet_dyn
*pktd
= &packet_dyn
[packetd_last
];
310 pkt
->payload
= xrealloc
(pkt
->payload
, pkt
->len
);
313 pktd
->rnd
= xrealloc
(pktd
->rnd
, pktd
->rlen
* sizeof
(struct randomizer
));
315 __setup_new_randomizer
(&pktd
->rnd
[packetdr_last
]);
318 static void set_dynamic_incdec
(uint8_t start
, uint8_t stop
, uint8_t stepping
,
321 struct packet
*pkt
= &packets
[packet_last
];
322 struct packet_dyn
*pktd
= &packet_dyn
[packetd_last
];
328 pkt
->payload
= xrealloc
(pkt
->payload
, pkt
->len
);
331 pktd
->cnt
= xrealloc
(pktd
->cnt
, pktd
->clen
* sizeof
(struct counter
));
333 __setup_new_counter
(&pktd
->cnt
[packetdc_last
], start
, stop
, stepping
, type
);
336 static void proto_add
(enum proto_id pid
)
338 hdr
= proto_header_init
(pid
);
344 struct in_addr ip4_addr
;
345 long long int number
;
350 %token K_COMMENT K_FILL K_RND K_SEQINC K_SEQDEC K_DRND K_DINC K_DDEC K_WHITE
351 %token K_CPU K_CSUMIP K_CSUMUDP K_CSUMTCP K_CSUMUDP6 K_CSUMTCP6 K_CONST8 K_CONST16 K_CONST32 K_CONST64
353 %token K_DADDR K_SADDR K_ETYPE
354 %token K_OPER K_SHA K_SPA K_THA K_TPA K_REQUEST K_REPLY K_PTYPE K_HTYPE
355 %token K_PROT K_TTL K_DSCP K_ECN K_TOS K_LEN K_ID K_FLAGS K_FRAG K_IHL K_VER K_CSUM K_DF K_MF
356 %token K_SPORT K_DPORT
357 %token K_SEQ K_ACK_SEQ K_DOFF K_CWR K_ECE K_URG K_ACK K_PSH K_RST K_SYN K_FIN K_WINDOW K_URG_PTR
358 %token K_TPID K_TCI K_PCP K_DEI K_1Q K_1AD
359 %token K_LABEL K_TC K_LAST K_EXP
367 %token
',' '{' '}' '(' ')' '[' ']' ':' '-' '+' '*' '/' '%' '&' '|' '<' '>' '^'
369 %token number
string mac ip4_addr
371 %type
<number
> number expression
374 %type
<ip4_addr
> ip4_addr
376 %left
'-' '+' '*' '/' '%' '&' '|' '<' '>' '^'
383 | packets inline_comment
{ }
384 | packets K_WHITE
{ }
404 | delimiter_nowhite
{ }
412 : '{' noenforce_white payload noenforce_white
'}' {
413 min_cpu
= max_cpu
= -1;
415 proto_packet_finish
();
419 | K_CPU
'(' number cpu_delim number
')' ':' noenforce_white
'{' noenforce_white payload noenforce_white
'}' {
423 if
(min_cpu
> max_cpu
) {
430 proto_packet_finish
();
434 | K_CPU
'(' number
')' ':' noenforce_white
'{' noenforce_white payload noenforce_white
'}' {
435 min_cpu
= max_cpu
= $3;
437 proto_packet_finish
();
445 | payload elem_delimiter
{ }
449 : delimiter_nowhite
{ }
458 : number
{ set_byte
((uint8_t) $1); }
459 |
string { set_multi_byte
((uint8_t *) $1 + 1, strlen
($1) - 2); }
469 | proto
{ proto_header_finish
(hdr
); }
476 | expression
'+' expression
478 | expression
'-' expression
480 | expression
'*' expression
482 | expression
'/' expression
484 | expression
'%' expression
486 | expression
'&' expression
488 | expression
'|' expression
490 | expression
'^' expression
492 | expression
'<' '<' expression
494 | expression
'>' '>' expression
503 : K_FILL
'(' number delimiter number
')'
504 { set_fill
($3, $5); }
508 : K_CONST8
'(' expression
')'
509 { set_byte
((uint8_t) $3); }
510 | K_CONST16
'(' expression
')' {
511 uint16_t __c
= cpu_to_be16
((uint16_t) $3);
513 set_multi_byte
((uint8_t *) &__c
, sizeof
(__c
));
515 | K_CONST32
'(' expression
')' {
516 uint32_t __c
= cpu_to_be32
((uint32_t) $3);
518 set_multi_byte
((uint8_t *) &__c
, sizeof
(__c
));
520 | K_CONST64
'(' expression
')' {
521 uint64_t __c
= cpu_to_be64
((uint64_t) $3);
523 set_multi_byte
((uint8_t *) &__c
, sizeof
(__c
));
528 : K_RND
'(' number
')'
533 : K_CSUMIP
'(' number delimiter number
')'
534 { set_csum16
($3, $5, CSUM_IP
); }
535 | K_CSUMTCP
'(' number delimiter number
')'
536 { set_csum16
($3, $5, CSUM_TCP
); }
537 | K_CSUMUDP
'(' number delimiter number
')'
538 { set_csum16
($3, $5, CSUM_UDP
); }
539 | K_CSUMTCP6
'(' number delimiter number
')'
540 { set_csum16
($3, $5, CSUM_TCP6
); }
541 | K_CSUMUDP6
'(' number delimiter number
')'
542 { set_csum16
($3, $5, CSUM_UDP6
); }
546 : K_SEQINC
'(' number delimiter number
')'
547 { set_sequential_inc
($3, $5, 1); }
548 | K_SEQINC
'(' number delimiter number delimiter number
')'
549 { set_sequential_inc
($3, $5, $7); }
553 : K_SEQDEC
'(' number delimiter number
')'
554 { set_sequential_dec
($3, $5, 1); }
555 | K_SEQDEC
'(' number delimiter number delimiter number
')'
556 { set_sequential_dec
($3, $5, $7); }
561 { set_dynamic_rnd
(); }
562 | K_DRND
'(' number
')'
565 for
(i
= 0; i
< max
; ++i
)
571 : K_DINC
'(' number delimiter number
')'
572 { set_dynamic_incdec
($3, $5, 1, TYPE_INC
); }
573 | K_DINC
'(' number delimiter number delimiter number
')'
574 { set_dynamic_incdec
($3, $5, $7, TYPE_INC
); }
578 : K_DDEC
'(' number delimiter number
')'
579 { set_dynamic_incdec
($3, $5, 1, TYPE_DEC
); }
580 | K_DDEC
'(' number delimiter number delimiter number
')'
581 { set_dynamic_incdec
($3, $5, $7, TYPE_DEC
); }
595 : eth
'(' eth_param_list
')' { }
599 : K_ETH
{ proto_add
(PROTO_ETH
); }
605 | eth_field delimiter eth_param_list
{ }
614 : K_DADDR skip_white
'=' skip_white mac
615 { proto_field_set_bytes
(hdr
, ETH_DST_ADDR
, $5); }
616 | K_SADDR skip_white
'=' skip_white mac
617 { proto_field_set_bytes
(hdr
, ETH_SRC_ADDR
, $5); }
618 | eth_type skip_white
'=' skip_white number
619 { proto_field_set_be16
(hdr
, ETH_TYPE
, $5); }
623 : vlan
'(' vlan_param_list
')' { }
627 : K_VLAN
{ proto_add
(PROTO_VLAN
); }
633 | vlan_field delimiter vlan_param_list
{ }
642 : vlan_type skip_white
'=' skip_white number
643 { proto_field_set_be16
(hdr
, VLAN_TPID
, $5); }
645 { proto_field_set_be16
(hdr
, VLAN_TPID
, ETH_P_8021Q
); }
647 { proto_field_set_be16
(hdr
, VLAN_TPID
, ETH_P_8021AD
); }
648 | K_TCI skip_white
'=' skip_white number
649 { proto_field_set_be16
(hdr
, VLAN_TCI
, $5); }
650 | K_PCP skip_white
'=' skip_white number
651 { proto_field_set_be16
(hdr
, VLAN_PCP
, $5); }
652 | K_DEI skip_white
'=' skip_white number
653 { proto_field_set_be16
(hdr
, VLAN_DEI
, $5); }
654 | K_ID skip_white
'=' skip_white number
655 { proto_field_set_be16
(hdr
, VLAN_VID
, $5); }
659 : mpls
'(' mpls_param_list
')' { }
663 : K_MPLS
{ proto_add
(PROTO_MPLS
); }
669 | mpls_field delimiter mpls_param_list
{ }
678 : K_LABEL skip_white
'=' skip_white number
679 { proto_field_set_be32
(hdr
, MPLS_LABEL
, $5); }
680 | mpls_tc skip_white
'=' skip_white number
681 { proto_field_set_be32
(hdr
, MPLS_TC
, $5); }
682 | K_LAST skip_white
'=' skip_white number
683 { proto_field_set_be32
(hdr
, MPLS_LAST
, $5); }
684 | K_TTL skip_white
'=' skip_white number
685 { proto_field_set_be32
(hdr
, MPLS_TTL
, $5); }
689 : arp
'(' arp_param_list
')' { }
695 | arp_field delimiter arp_param_list
{ }
699 : K_OPER skip_white
'=' skip_white K_REQUEST
700 { proto_field_set_be16
(hdr
, ARP_OPER
, ARPOP_REQUEST
); }
701 | K_OPER skip_white
'=' skip_white K_REPLY
702 { proto_field_set_be16
(hdr
, ARP_OPER
, ARPOP_REPLY
); }
703 | K_OPER skip_white
'=' skip_white number
704 { proto_field_set_be16
(hdr
, ARP_OPER
, $5); }
706 { proto_field_set_be16
(hdr
, ARP_OPER
, ARPOP_REQUEST
); }
708 { proto_field_set_be16
(hdr
, ARP_OPER
, ARPOP_REPLY
); }
709 | K_HTYPE skip_white
'=' skip_white number
710 { proto_field_set_be16
(hdr
, ARP_HTYPE
, $5); }
711 | K_PTYPE skip_white
'=' skip_white number
712 { proto_field_set_be16
(hdr
, ARP_PTYPE
, $5); }
713 | K_SHA skip_white
'=' skip_white mac
714 { proto_field_set_bytes
(hdr
, ARP_SHA
, $5); }
715 | K_THA skip_white
'=' skip_white mac
716 { proto_field_set_bytes
(hdr
, ARP_THA
, $5); }
717 | K_SPA skip_white
'=' skip_white ip4_addr
718 { proto_field_set_u32
(hdr
, ARP_SPA
, $5.s_addr
); }
719 | K_TPA skip_white
'=' skip_white ip4_addr
720 { proto_field_set_u32
(hdr
, ARP_TPA
, $5.s_addr
); }
723 : K_ARP
{ proto_add
(PROTO_ARP
); }
727 : ip4
'(' ip4_param_list
')' { }
733 | ip4_field delimiter ip4_param_list
{ }
737 : K_VER skip_white
'=' skip_white number
738 { proto_field_set_u8
(hdr
, IP4_VER
, $5); }
739 | K_IHL skip_white
'=' skip_white number
740 { proto_field_set_u8
(hdr
, IP4_IHL
, $5); }
741 | K_DADDR skip_white
'=' skip_white ip4_addr
742 { proto_field_set_u32
(hdr
, IP4_DADDR
, $5.s_addr
); }
743 | K_SADDR skip_white
'=' skip_white ip4_addr
744 { proto_field_set_u32
(hdr
, IP4_SADDR
, $5.s_addr
); }
745 | K_PROT skip_white
'=' skip_white number
746 { proto_field_set_u8
(hdr
, IP4_PROTO
, $5); }
747 | K_TTL skip_white
'=' skip_white number
748 { proto_field_set_u8
(hdr
, IP4_TTL
, $5); }
749 | K_DSCP skip_white
'=' skip_white number
750 { proto_field_set_u8
(hdr
, IP4_DSCP
, $5); }
751 | K_ECN skip_white
'=' skip_white number
752 { proto_field_set_u8
(hdr
, IP4_ECN
, $5); }
753 | K_TOS skip_white
'=' skip_white number
754 { proto_field_set_u8
(hdr
, IP4_TOS
, $5); }
755 | K_LEN skip_white
'=' skip_white number
756 { proto_field_set_be16
(hdr
, IP4_LEN
, $5); }
757 | K_ID skip_white
'=' skip_white number
758 { proto_field_set_be16
(hdr
, IP4_ID
, $5); }
759 | K_FLAGS skip_white
'=' skip_white number
760 { proto_field_set_be16
(hdr
, IP4_FLAGS
, $5); }
761 | K_DF
{ proto_field_set_be16
(hdr
, IP4_DF
, 1); }
762 | K_MF
{ proto_field_set_be16
(hdr
, IP4_MF
, 1); }
763 | K_FRAG skip_white
'=' skip_white number
764 { proto_field_set_be16
(hdr
, IP4_FRAG_OFFS
, $5); }
765 | K_CSUM skip_white
'=' skip_white number
766 { proto_field_set_be16
(hdr
, IP4_CSUM
, $5); }
770 : K_IP4
{ proto_add
(PROTO_IP4
); }
774 : udp
'(' udp_param_list
')' { }
780 | udp_field delimiter udp_param_list
{ }
784 : K_SPORT skip_white
'=' skip_white number
785 { proto_field_set_be16
(hdr
, UDP_SPORT
, $5); }
786 | K_DPORT skip_white
'=' skip_white number
787 { proto_field_set_be16
(hdr
, UDP_DPORT
, $5); }
788 | K_LEN skip_white
'=' skip_white number
789 { proto_field_set_be16
(hdr
, UDP_LEN
, $5); }
790 | K_CSUM skip_white
'=' skip_white number
791 { proto_field_set_be16
(hdr
, UDP_CSUM
, $5); }
795 : K_UDP
{ proto_add
(PROTO_UDP
); }
799 : tcp
'(' tcp_param_list
')' { }
805 | tcp_field delimiter tcp_param_list
{ }
809 : K_SPORT skip_white
'=' skip_white number
810 { proto_field_set_be16
(hdr
, TCP_SPORT
, $5); }
811 | K_DPORT skip_white
'=' skip_white number
812 { proto_field_set_be16
(hdr
, TCP_DPORT
, $5); }
813 | K_SEQ skip_white
'=' skip_white number
814 { proto_field_set_be32
(hdr
, TCP_SEQ
, $5); }
815 | K_ACK_SEQ skip_white
'=' skip_white number
816 { proto_field_set_be32
(hdr
, TCP_ACK_SEQ
, $5); }
817 | K_DOFF skip_white
'=' skip_white number
818 { proto_field_set_be16
(hdr
, TCP_DOFF
, $5); }
819 | K_CWR
{ proto_field_set_be16
(hdr
, TCP_CWR
, 1); }
820 | K_ECE
{ proto_field_set_be16
(hdr
, TCP_ECE
, 1); }
821 | K_URG
{ proto_field_set_be16
(hdr
, TCP_URG
, 1); }
822 | K_ACK
{ proto_field_set_be16
(hdr
, TCP_ACK
, 1); }
823 | K_PSH
{ proto_field_set_be16
(hdr
, TCP_PSH
, 1); }
824 | K_RST
{ proto_field_set_be16
(hdr
, TCP_RST
, 1); }
825 | K_SYN
{ proto_field_set_be16
(hdr
, TCP_SYN
, 1); }
826 | K_FIN
{ proto_field_set_be16
(hdr
, TCP_FIN
, 1); }
827 | K_WINDOW skip_white
'=' skip_white number
828 { proto_field_set_be16
(hdr
, TCP_WINDOW
, $5); }
829 | K_CSUM skip_white
'=' skip_white number
830 { proto_field_set_be16
(hdr
, TCP_CSUM
, $5); }
831 | K_URG_PTR skip_white
'=' skip_white number
832 { proto_field_set_be16
(hdr
, TCP_URG_PTR
, $5); }
836 : K_TCP
{ proto_add
(PROTO_TCP
); }
841 static void finalize_packet
(void)
843 /* XXX hack ... we allocated one packet pointer too much */
848 static void dump_conf
(void)
852 for
(i
= 0; i
< plen
; ++i
) {
853 printf
("[%zu] pkt\n", i
);
854 printf
(" len %zu cnts %zu rnds %zu\n",
860 for
(j
= 0; j
< packets
[i
].len
; ++j
)
861 printf
("%02x ", packets
[i
].payload
[j
]);
864 for
(j
= 0; j
< packet_dyn
[i
].clen
; ++j
)
865 printf
(" cnt%zu [%u,%u], inc %u, off %jd type %s\n", j
,
866 packet_dyn
[i
].cnt
[j
].min
,
867 packet_dyn
[i
].cnt
[j
].max
,
868 packet_dyn
[i
].cnt
[j
].inc
,
869 (intmax_t)packet_dyn
[i
].cnt
[j
].off
,
870 packet_dyn
[i
].cnt
[j
].type
== TYPE_INC ?
873 for
(j
= 0; j
< packet_dyn
[i
].rlen
; ++j
)
874 printf
(" rnd%zu off %jd\n", j
,
875 (intmax_t)packet_dyn
[i
].rnd
[j
].off
);
879 void cleanup_packets
(void)
883 for
(i
= 0; i
< plen
; ++i
) {
884 if
(packets
[i
].len
> 0)
885 xfree
(packets
[i
].payload
);
890 for
(i
= 0; i
< dlen
; ++i
) {
891 free
(packet_dyn
[i
].cnt
);
892 free
(packet_dyn
[i
].rnd
);
898 void compile_packets
(char *file
, bool verbose
, unsigned int cpu
,
899 bool invoke_cpp
, char *const cpp_argv
[])
904 memset
(tmp_file
, 0, sizeof
(tmp_file
));
908 if
(cpp_exec
(file
, tmp_file
, sizeof
(tmp_file
), cpp_argv
)) {
909 fprintf
(stderr
, "Failed to invoke C preprocessor!\n");
915 if
(!strncmp
("-", file
, strlen
("-")))
918 yyin
= fopen
(file
, "r");
920 fprintf
(stderr
, "Cannot open %s: %s!\n", file
, strerror
(errno
));
929 if
(our_cpu
== 0 && verbose
)
934 if
(yyin
&& yyin
!= stdin
)
943 void compile_packets_str
(char *str
, bool verbose
, unsigned int cpu
)
955 if
(our_cpu
== 0 && verbose
)
966 void yyerror(const char *err
)
968 fprintf
(stderr
, "Syntax error at line %d, char '%s': %s\n", yylineno
, yytext
, err
);