lexer.l (55505) | lexer.l (62638) |
---|---|
1/* $KAME$ */ 2 |
|
1/* 2 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 12 unchanged lines hidden (view full) --- 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * | 3/* 4 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 1. Redistributions of source code must retain the above copyright --- 12 unchanged lines hidden (view full) --- 23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 * SUCH DAMAGE. 30 * |
29 * $FreeBSD: head/usr.sbin/rrenumd/lexer.l 55505 2000-01-06 12:40:54Z shin $ | 31 * $FreeBSD: head/usr.sbin/rrenumd/lexer.l 62638 2000-07-05 11:12:53Z kris $ |
30 */ 31 32%{ 33#include <sys/param.h> 34#include <sys/ioctl.h> 35#include <sys/socket.h> 36 37#include <string.h> 38 39#include <net/if.h> | 32 */ 33 34%{ 35#include <sys/param.h> 36#include <sys/ioctl.h> 37#include <sys/socket.h> 38 39#include <string.h> 40 41#include <net/if.h> |
42#if defined(__FreeBSD__) && __FreeBSD__ >= 3 |
|
40#include <net/if_var.h> | 43#include <net/if_var.h> |
44#endif /* __FreeBSD__ >= 3 */ |
|
41 42#include <netinet/in.h> 43#include <netinet/in_var.h> 44#include <netinet/icmp6.h> | 45 46#include <netinet/in.h> 47#include <netinet/in_var.h> 48#include <netinet/icmp6.h> |
49 50#include <arpa/inet.h> 51 |
|
45#include "y.tab.h" 46 47int lineno = 1; 48 | 52#include "y.tab.h" 53 54int lineno = 1; 55 |
49#define LINEBUF_SIZE 1000 | 56#define LINEBUF_SIZE 1000 |
50char linebuf[LINEBUF_SIZE]; 51%} 52 53/* common section */ 54nl \n 55ws [ \t]+ 56digit [0-9] 57letter [0-9A-Za-z] --- 146 unchanged lines hidden (view full) --- 204 yylval.cs.len = yyleng; 205 return DECSTRING; 206 } 207{name} { 208 yylval.cs.cp = yytext; 209 yylval.cs.len = yyleng; 210 return NAME; 211 } | 57char linebuf[LINEBUF_SIZE]; 58%} 59 60/* common section */ 61nl \n 62ws [ \t]+ 63digit [0-9] 64letter [0-9A-Za-z] --- 146 unchanged lines hidden (view full) --- 211 yylval.cs.len = yyleng; 212 return DECSTRING; 213 } 214{name} { 215 yylval.cs.cp = yytext; 216 yylval.cs.len = yyleng; 217 return NAME; 218 } |
219{ipv4addr} { 220 memset(&yylval.addr4, 0, sizeof(struct in_addr)); 221 if (inet_pton(AF_INET, yytext, 222 &yylval.addr4) == 1) { 223 return IPV4ADDR; 224 } else { 225 return ERROR; 226 } 227 } |
|
212{ipv6addr} { 213 memset(&yylval.addr6, 0, sizeof(struct in6_addr)); 214 if (inet_pton(AF_INET6, yytext, 215 &yylval.addr6) == 1) { 216 return IPV6ADDR; 217 } else { 218 return ERROR; 219 } --- 29 unchanged lines hidden --- | 228{ipv6addr} { 229 memset(&yylval.addr6, 0, sizeof(struct in6_addr)); 230 if (inet_pton(AF_INET6, yytext, 231 &yylval.addr6) == 1) { 232 return IPV6ADDR; 233 } else { 234 return ERROR; 235 } --- 29 unchanged lines hidden --- |