
# line 2 "iplang_y.y"
/*
 * Copyright (C) 1997-1998 by Darren Reed.
 *
 * Redistribution and use in source and binary forms are permitted
 * provided that this notice is preserved and due credit is given
 * to the original author and the contributors.
 *
 * $Id: iplang_y.y,v 2.0.2.18.2.10 1998/11/22 01:51:04 darrenr Exp $
 */
 
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#if !defined(__SVR4) && !defined(__svr4__)
#include <strings.h>
#else
#include <sys/byteorder.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/param.h>
#include <sys/time.h>
#include <stdlib.h>
#include <unistd.h>
#include <stddef.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/ip_icmp.h>
#ifndef	linux
#include <netinet/ip_var.h>
#endif
#include <netinet/tcp.h>
#include <netinet/udp.h>
#include <net/if.h>
#ifndef	linux
#include <netinet/if_ether.h>
#endif
#include <netdb.h>
#include <arpa/nameser.h>
#include <arpa/inet.h>
#include <resolv.h>
#include <ctype.h>
#include "ipsend.h"
#include "ip_compat.h"
#include "ipf.h"
#include "iplang.h"

#ifndef __NetBSD__
extern	struct ether_addr *ether_aton __P((char *));
#endif

extern	int	opts;
extern	struct ipopt_names ionames[];
extern	int	state, state, lineNum, token;
extern	int	yylineno;
extern	char	yytext[];
extern	FILE	*yyin;
int	yylex	__P((void));
#define	YYDEBUG 1
#if !defined(ultrix) && !defined(hpux)
int	yydebug = 1;
#else
extern	int	yydebug;
#endif

iface_t *iflist = NULL, **iftail = &iflist;
iface_t *cifp = NULL;
arp_t *arplist = NULL, **arptail = &arplist, *carp = NULL;
struct in_addr defrouter;
send_t	sending;
char	*sclass = NULL;
u_short	c_chksum __P((u_short *, u_int, u_long));
u_long	p_chksum __P((u_short *, u_int));

u_long	ipbuffer[67584/sizeof(u_long)];		/* 66K */
aniphdr_t	*aniphead = NULL, *canip = NULL, **aniptail = &aniphead;
ip_t		*ip = NULL;
udphdr_t	*udp = NULL;
tcphdr_t	*tcp = NULL;
icmphdr_t	*icmp = NULL;

struct statetoopt {
	int	sto_st;
	int	sto_op;
};

struct	in_addr getipv4addr __P((char *arg));
u_short	getportnum __P((char *, char *));
struct	ether_addr *geteaddr __P((char *, struct ether_addr *));
void	*new_header __P((int));
void	free_aniplist __P((void));
void	inc_anipheaders __P((int));
void	new_data __P((void));
void	set_datalen __P((char **));
void	set_datafile __P((char **));
void	set_data __P((char **));
void	new_packet __P((void));
void	set_ipv4proto __P((char **));
void	set_ipv4src __P((char **));
void	set_ipv4dst __P((char **));
void	set_ipv4off __P((char **));
void	set_ipv4v __P((char **));
void	set_ipv4hl __P((char **));
void	set_ipv4ttl __P((char **));
void	set_ipv4tos __P((char **));
void	set_ipv4id __P((char **));
void	set_ipv4sum __P((char **));
void	set_ipv4len __P((char **));
void	new_tcpheader __P((void));
void	set_tcpsport __P((char **));
void	set_tcpdport __P((char **));
void	set_tcpseq __P((char **));
void	set_tcpack __P((char **));
void	set_tcpoff __P((char **));
void	set_tcpurp __P((char **));
void	set_tcpwin __P((char **));
void	set_tcpsum __P((char **));
void	set_tcpflags __P((char **));
void	set_tcpopt __P((int, char **));
void	end_tcpopt __P((void));
void	new_udpheader __P((void));
void	set_udplen __P((char **));
void	set_udpsum __P((char **));
void	prep_packet __P((void));
void	packet_done __P((void));
void	new_interface __P((void));
void	check_interface __P((void));
void	set_ifname __P((char **));
void	set_ifmtu __P((int));
void	set_ifv4addr __P((char **));
void	set_ifeaddr __P((char **));
void	new_arp __P((void));
void	set_arpeaddr __P((char **));
void	set_arpv4addr __P((char **));
void	reset_send __P((void));
void	set_sendif __P((char **));
void	set_sendvia __P((char **));
void	set_defaultrouter __P((char **));
void	new_icmpheader __P((void));
void	set_icmpcode __P((int));
void	set_icmptype __P((int));
void	set_icmpcodetok __P((char **));
void	set_icmptypetok __P((char **));
void	set_icmpid __P((int));
void	set_icmpseq __P((int));
void	set_icmpotime __P((int));
void	set_icmprtime __P((int));
void	set_icmpttime __P((int));
void	set_icmpmtu __P((int));
void	set_redir __P((int, char **));
void	new_ipv4opt __P((void));
void	set_icmppprob __P((int));
void	add_ipopt __P((int, void *));
void	end_ipopt __P((void));
void	set_secclass __P((char **));
void	free_anipheader __P((void));
void	end_ipv4 __P((void));
void	end_icmp __P((void));
void	end_udp __P((void));
void	end_tcp __P((void));
void	end_data __P((void));
void	yyerror __P((char *));
void	iplang __P((FILE *));
int	yyparse __P((void));

# line 169 "iplang_y.y"
typedef union
#ifdef __cplusplus
	YYSTYPE
#endif
 {
	char	*str;
	int	num;
} YYSTYPE;
# define IL_NUMBER 257
# define IL_TOKEN 258
# define IL_HEXDIGIT 259
# define IL_COLON 260
# define IL_DOT 261
# define IL_EOF 262
# define IL_COMMENT 263
# define IL_INTERFACE 264
# define IL_IFNAME 265
# define IL_MTU 266
# define IL_EADDR 267
# define IL_IPV4 268
# define IL_V4PROTO 269
# define IL_V4SRC 270
# define IL_V4DST 271
# define IL_V4OFF 272
# define IL_V4V 273
# define IL_V4HL 274
# define IL_V4TTL 275
# define IL_V4TOS 276
# define IL_V4SUM 277
# define IL_V4LEN 278
# define IL_V4OPT 279
# define IL_V4ID 280
# define IL_TCP 281
# define IL_SPORT 282
# define IL_DPORT 283
# define IL_TCPFL 284
# define IL_TCPSEQ 285
# define IL_TCPACK 286
# define IL_TCPOFF 287
# define IL_TCPWIN 288
# define IL_TCPSUM 289
# define IL_TCPURP 290
# define IL_TCPOPT 291
# define IL_TCPO_NOP 292
# define IL_TCPO_EOL 293
# define IL_TCPO_MSS 294
# define IL_TCPO_WSCALE 295
# define IL_TCPO_TS 296
# define IL_UDP 297
# define IL_UDPLEN 298
# define IL_UDPSUM 299
# define IL_ICMP 300
# define IL_ICMPTYPE 301
# define IL_ICMPCODE 302
# define IL_SEND 303
# define IL_VIA 304
# define IL_ARP 305
# define IL_DEFROUTER 306
# define IL_SUM 307
# define IL_OFF 308
# define IL_LEN 309
# define IL_V4ADDR 310
# define IL_OPT 311
# define IL_DATA 312
# define IL_DLEN 313
# define IL_DVALUE 314
# define IL_DFILE 315
# define IL_IPO_NOP 316
# define IL_IPO_RR 317
# define IL_IPO_ZSU 318
# define IL_IPO_MTUP 319
# define IL_IPO_MTUR 320
# define IL_IPO_EOL 321
# define IL_IPO_TS 322
# define IL_IPO_TR 323
# define IL_IPO_SEC 324
# define IL_IPO_LSRR 325
# define IL_IPO_ESEC 326
# define IL_IPO_SATID 327
# define IL_IPO_SSRR 328
# define IL_IPO_ADDEXT 329
# define IL_IPO_VISA 330
# define IL_IPO_IMITD 331
# define IL_IPO_EIP 332
# define IL_IPO_FINN 333
# define IL_IPO_SECCLASS 334
# define IL_IPO_CIPSO 335
# define IL_IPO_ENCODE 336
# define IL_IPS_RESERV4 337
# define IL_IPS_TOPSECRET 338
# define IL_IPS_SECRET 339
# define IL_IPS_RESERV3 340
# define IL_IPS_CONFID 341
# define IL_IPS_UNCLASS 342
# define IL_IPS_RESERV2 343
# define IL_IPS_RESERV1 344
# define IL_ICMP_ECHOREPLY 345
# define IL_ICMP_UNREACH 346
# define IL_ICMP_UNREACH_NET 347
# define IL_ICMP_UNREACH_HOST 348
# define IL_ICMP_UNREACH_PROTOCOL 349
# define IL_ICMP_UNREACH_PORT 350
# define IL_ICMP_UNREACH_NEEDFRAG 351
# define IL_ICMP_UNREACH_SRCFAIL 352
# define IL_ICMP_UNREACH_NET_UNKNOWN 353
# define IL_ICMP_UNREACH_HOST_UNKNOWN 354
# define IL_ICMP_UNREACH_ISOLATED 355
# define IL_ICMP_UNREACH_NET_PROHIB 356
# define IL_ICMP_UNREACH_HOST_PROHIB 357
# define IL_ICMP_UNREACH_TOSNET 358
# define IL_ICMP_UNREACH_TOSHOST 359
# define IL_ICMP_UNREACH_FILTER_PROHIB 360
# define IL_ICMP_UNREACH_HOST_PRECEDENCE 361
# define IL_ICMP_UNREACH_PRECEDENCE_CUTOFF 362
# define IL_ICMP_SOURCEQUENCH 363
# define IL_ICMP_REDIRECT 364
# define IL_ICMP_REDIRECT_NET 365
# define IL_ICMP_REDIRECT_HOST 366
# define IL_ICMP_REDIRECT_TOSNET 367
# define IL_ICMP_REDIRECT_TOSHOST 368
# define IL_ICMP_ECHO 369
# define IL_ICMP_ROUTERADVERT 370
# define IL_ICMP_ROUTERSOLICIT 371
# define IL_ICMP_TIMXCEED 372
# define IL_ICMP_TIMXCEED_INTRANS 373
# define IL_ICMP_TIMXCEED_REASS 374
# define IL_ICMP_PARAMPROB 375
# define IL_ICMP_PARAMPROB_OPTABSENT 376
# define IL_ICMP_TSTAMP 377
# define IL_ICMP_TSTAMPREPLY 378
# define IL_ICMP_IREQ 379
# define IL_ICMP_IREQREPLY 380
# define IL_ICMP_MASKREQ 381
# define IL_ICMP_MASKREPLY 382
# define IL_ICMP_SEQ 383
# define IL_ICMP_ID 384
# define IL_ICMP_OTIME 385
# define IL_ICMP_RTIME 386
# define IL_ICMP_TTIME 387

#ifdef __STDC__
#include <stdlib.h>
#include <string.h>
#else
#include <malloc.h>
#include <memory.h>
#endif

#include <values.h>

#ifdef __cplusplus

#ifndef yyerror
	void yyerror(const char *);
#endif

#ifndef yylex
#ifdef __EXTERN_C__
	extern "C" { int yylex(void); }
#else
	int yylex(void);
#endif
#endif
	int yyparse(void);

#endif
#define yyclearin yychar = -1
#define yyerrok yyerrflag = 0
extern int yychar;
extern int yyerrflag;
YYSTYPE yylval;
YYSTYPE yyval;
typedef int yytabelem;
#ifndef YYMAXDEPTH
#define YYMAXDEPTH 150
#endif
#if YYMAXDEPTH > 0
int yy_yys[YYMAXDEPTH], *yys = yy_yys;
YYSTYPE yy_yyv[YYMAXDEPTH], *yyv = yy_yyv;
#else	/* user does initial allocation */
int *yys;
YYSTYPE *yyv;
#endif
static int yymaxdepth = YYMAXDEPTH;
# define YYERRCODE 256

# line 564 "iplang_y.y"


struct	statetoopt	toipopts[] = {
	{ IL_IPO_NOP,		IPOPT_NOP },
	{ IL_IPO_RR,		IPOPT_RR },
	{ IL_IPO_ZSU,		IPOPT_ZSU },
	{ IL_IPO_MTUP,		IPOPT_MTUP },
	{ IL_IPO_MTUR,		IPOPT_MTUR },
	{ IL_IPO_ENCODE,	IPOPT_ENCODE },
	{ IL_IPO_TS,		IPOPT_TS },
	{ IL_IPO_TR,		IPOPT_TR },
	{ IL_IPO_SEC,		IPOPT_SECURITY },
	{ IL_IPO_SECCLASS,	IPOPT_SECURITY },
	{ IL_IPO_LSRR,		IPOPT_LSRR },
	{ IL_IPO_ESEC,		IPOPT_E_SEC },
	{ IL_IPO_CIPSO,		IPOPT_CIPSO },
	{ IL_IPO_SATID,		IPOPT_SATID },
	{ IL_IPO_SSRR,		IPOPT_SSRR },
	{ IL_IPO_ADDEXT,	IPOPT_ADDEXT },
	{ IL_IPO_VISA,		IPOPT_VISA },
	{ IL_IPO_IMITD,		IPOPT_IMITD },
	{ IL_IPO_EIP,		IPOPT_EIP },
	{ IL_IPO_FINN,		IPOPT_FINN },
	{ 0, 0 }
};

struct	statetoopt	tosecopts[] = {
	{ IL_IPS_RESERV4,	IPSO_CLASS_RES4 },
	{ IL_IPS_TOPSECRET,	IPSO_CLASS_TOPS },
	{ IL_IPS_SECRET,	IPSO_CLASS_SECR },
	{ IL_IPS_RESERV3,	IPSO_CLASS_RES3 },
	{ IL_IPS_CONFID,	IPSO_CLASS_CONF },
	{ IL_IPS_UNCLASS,	IPSO_CLASS_UNCL },
	{ IL_IPS_RESERV2,	IPSO_CLASS_RES2 },
	{ IL_IPS_RESERV1,	IPSO_CLASS_RES1 },
	{ 0, 0 }
};

#ifdef	bsdi
struct ether_addr *
ether_aton(s)
	char *s;   
{
	static struct ether_addr n;
	u_int i[6];

	if (sscanf(s, " %x:%x:%x:%x:%x:%x ", &i[0], &i[1],
	    &i[2], &i[3], &i[4], &i[5]) == 6) {
		n.ether_addr_octet[0] = (u_char)i[0];
		n.ether_addr_octet[1] = (u_char)i[1];
		n.ether_addr_octet[2] = (u_char)i[2];
		n.ether_addr_octet[3] = (u_char)i[3];
		n.ether_addr_octet[4] = (u_char)i[4];
		n.ether_addr_octet[5] = (u_char)i[5];
		return &n;
	}
	return NULL;
}
#endif


struct in_addr getipv4addr(arg)
char *arg;
{
	struct hostent *hp;
	struct in_addr in;

	in.s_addr = 0xffffffff;

	if ((hp = gethostbyname(arg)))
		bcopy(hp->h_addr, &in.s_addr, sizeof(struct in_addr));
	else
		in.s_addr = inet_addr(arg);
	return in;
}


u_short getportnum(pr, name)
char *pr, *name;
{
	struct servent *sp;

	if (!(sp = getservbyname(name, pr)))
		return htons(atoi(name));
	return sp->s_port;
}


struct ether_addr *geteaddr(arg, buf)
char *arg;
struct ether_addr *buf;
{
	struct ether_addr *e;

#if !defined(hpux) && !defined(linux)
	e = ether_aton(arg);
	if (!e)
		fprintf(stderr, "Invalid ethernet address: %s\n", arg);
	else
# ifdef	__FreeBSD__
		bcopy(e->octet, buf->octet, sizeof(e->octet));
# else
		bcopy(e->ether_addr_octet, buf->ether_addr_octet,
		      sizeof(e->ether_addr_octet));
# endif
	return e;
#else
	return NULL;
#endif
}


void *new_header(type)
int type;
{
	aniphdr_t *aip, *oip = canip;
	int	sz = 0;

	aip = (aniphdr_t *)calloc(1, sizeof(*aip));
	*aniptail = aip;
	aniptail = &aip->ah_next;
	aip->ah_p = type;
	aip->ah_prev = oip;
	canip = aip;

	if (type == IPPROTO_UDP)
		sz = sizeof(udphdr_t);
	else if (type == IPPROTO_TCP)
		sz = sizeof(tcphdr_t);
	else if (type == IPPROTO_ICMP)
		sz = sizeof(icmphdr_t);
	else if (type == IPPROTO_IP)
		sz = sizeof(ip_t);

	if (oip)
		canip->ah_data = oip->ah_data + oip->ah_len;
	else
		canip->ah_data = (char *)ipbuffer;

	/*
	 * Increase the size fields in all wrapping headers.
	 */
	for (aip = aniphead; aip; aip = aip->ah_next) {
		aip->ah_len += sz;
		if (aip->ah_p == IPPROTO_IP)
			aip->ah_ip->ip_len += sz;
		else if (aip->ah_p == IPPROTO_UDP)
			aip->ah_udp->uh_ulen += sz;
	}
	return (void *)canip->ah_data;
}


void free_aniplist()
{
	aniphdr_t *aip, **aipp = &aniphead;

	while ((aip = *aipp)) {
		*aipp = aip->ah_next;
		free(aip);
	}
	aniptail = &aniphead;
}


void inc_anipheaders(inc)
int inc;
{
	aniphdr_t *aip;

	for (aip = aniphead; aip; aip = aip->ah_next) {
		aip->ah_len += inc;
		if (aip->ah_p == IPPROTO_IP)
			aip->ah_ip->ip_len += inc;
		else if (aip->ah_p == IPPROTO_UDP)
			aip->ah_udp->uh_ulen += inc;
	}
}


void new_data()
{
	(void) new_header(-1);
	canip->ah_len = 0;
}


void set_datalen(arg)
char **arg;
{
	int	len;

	len = strtol(*arg, NULL, 0);
	inc_anipheaders(len);
	free(*arg);
	*arg = NULL;
}


void set_data(arg)
char **arg;
{
	u_char *s = (u_char *)*arg, *t = (u_char *)canip->ah_data, c;
	int len = 0, todo = 0, quote = 0, val = 0;

	while ((c = *s++)) {
		if (todo) {
			if (isdigit(c)) {
				todo--;
				if (c > '7') {
					fprintf(stderr, "octal with %c!\n", c);
					break;
				}
				val <<= 3;
				val |= (c - '0');
			}
			if (!isdigit(c) || !todo) {
				*t++ = (u_char)(val & 0xff);
				todo = 0;
			}
			if (todo)
				continue;
		}
		if (quote) {
			if (isdigit(c)) {
				todo = 2;
				if (c > '7') {
					fprintf(stderr, "octal with %c!\n", c);
					break;
				}
				val = (c - '0');
			} else {
				switch (c)
				{
				case '\"' :
					*t++ = '\"';
					break;
				case '\\' :
					*t++ = '\\';
					break;
				case 'n' :
					*t++ = '\n';
					break;
				case 'r' :
					*t++ = '\r';
					break;
				case 't' :
					*t++ = '\t';
					break;
				}
			}
			quote = 0;
			continue;
		}

		if (c == '\\')
			quote = 1;
		else
			*t++ = c;
	}
	if (todo)
		*t++ = (u_char)(val & 0xff);
	if (quote)
		*t++ = '\\';
	len = t - (u_char *)canip->ah_data;
	inc_anipheaders(len - canip->ah_len);
	canip->ah_len = len;
}


void set_datafile(arg)
char **arg;
{
	struct stat sb;
	char *file = *arg;
	int fd, len;

	if ((fd = open(file, O_RDONLY)) == -1) {
		perror("open");
		exit(-1);
	}

	if (fstat(fd, &sb) == -1) {
		perror("fstat");
		exit(-1);
	}

	if ((sb.st_size + aniphead->ah_len ) > 65535) {
		fprintf(stderr, "data file %s too big to include.\n", file);
		close(fd);
		return;
	}
	if ((len = read(fd, canip->ah_data, sb.st_size)) == -1) {
		perror("read");
		close(fd);
		return;
	}
	inc_anipheaders(len);
	canip->ah_len += len;
	close(fd);
}


void new_packet()
{
	static	u_short	id = 0;

	if (!aniphead)
		bzero((char *)ipbuffer, sizeof(ipbuffer));

	ip = (ip_t *)new_header(IPPROTO_IP);
	ip->ip_v = IPVERSION;
	ip->ip_hl = sizeof(ip_t) >> 2;
	ip->ip_len = sizeof(ip_t);
	ip->ip_ttl = 63;
	ip->ip_id = htons(id++);
}


void set_ipv4proto(arg)
char **arg;
{
	struct protoent *pr;

	if ((pr = getprotobyname(*arg)))
		ip->ip_p = pr->p_proto;
	else
		if (!(ip->ip_p = atoi(*arg)))
			fprintf(stderr, "unknown protocol %s\n", *arg);
	free(*arg);
	*arg = NULL;
}


void set_ipv4src(arg)
char **arg;
{
	ip->ip_src = getipv4addr(*arg);
	free(*arg);
	*arg = NULL;
}


void set_ipv4dst(arg)
char **arg;
{
	ip->ip_dst = getipv4addr(*arg);
	free(*arg);
	*arg = NULL;
}


void set_ipv4off(arg)
char **arg;
{
	ip->ip_off = htons(strtol(*arg, NULL, 0));
	free(*arg);
	*arg = NULL;
}


void set_ipv4v(arg)
char **arg;
{
	ip->ip_v = strtol(*arg, NULL, 0);
	free(*arg);
	*arg = NULL;
}


void set_ipv4hl(arg)
char **arg;
{
	int newhl, inc;

	newhl = strtol(*arg, NULL, 0);
	inc = (newhl - ip->ip_hl) << 2;
	ip->ip_len += inc;
	ip->ip_hl = newhl;
	canip->ah_len += inc;
	free(*arg);
	*arg = NULL;
}


void set_ipv4ttl(arg)
char **arg;
{
	ip->ip_ttl = strtol(*arg, NULL, 0);
	free(*arg);
	*arg = NULL;
}


void set_ipv4tos(arg)
char **arg;
{
	ip->ip_tos = strtol(*arg, NULL, 0);
	free(*arg);
	*arg = NULL;
}


void set_ipv4id(arg)
char **arg;
{
	ip->ip_id = htons(strtol(*arg, NULL, 0));
	free(*arg);
	*arg = NULL;
}


void set_ipv4sum(arg)
char **arg;
{
	ip->ip_sum = strtol(*arg, NULL, 0);
	free(*arg);
	*arg = NULL;
}


void set_ipv4len(arg)
char **arg;
{
	int len;

	len = strtol(*arg, NULL, 0);
	inc_anipheaders(len - ip->ip_len);
	ip->ip_len = len;
	free(*arg);
	*arg = NULL;
}


void new_tcpheader()
{

	if ((ip->ip_p) && (ip->ip_p != IPPROTO_TCP)) {
		fprintf(stderr, "protocol %d specified with TCP!\n", ip->ip_p);
		return;
	}
	ip->ip_p = IPPROTO_TCP;

	tcp = (tcphdr_t *)new_header(IPPROTO_TCP);
	tcp->th_win = htons(4096);
	tcp->th_off = sizeof(*tcp) >> 2;
}


void set_tcpsport(arg)
char **arg;
{
	u_short *port;
	char *pr;

	if (ip->ip_p == IPPROTO_UDP) {
		port = &udp->uh_sport;
		pr = "udp";
	} else {
		port = &tcp->th_sport;
		pr = "udp";
	}

	*port = getportnum(pr, *arg);
	free(*arg);
	*arg = NULL;
}


void set_tcpdport(arg)
char **arg;
{
	u_short *port;
	char *pr;

	if (ip->ip_p == IPPROTO_UDP) {
		port = &udp->uh_dport;
		pr = "udp";
	} else {
		port = &tcp->th_dport;
		pr = "udp";
	}

	*port = getportnum(pr, *arg);
	free(*arg);
	*arg = NULL;
}


void set_tcpseq(arg)
char **arg;
{
	tcp->th_seq = htonl(strtol(*arg, NULL, 0));
	free(*arg);
	*arg = NULL;
}


void set_tcpack(arg)
char **arg;
{
	tcp->th_ack = htonl(strtol(*arg, NULL, 0));
	free(*arg);
	*arg = NULL;
}


void set_tcpoff(arg)
char **arg;
{
	int	off;

	off = strtol(*arg, NULL, 0);
	inc_anipheaders((off - tcp->th_off) << 2);
	tcp->th_off = off;
	free(*arg);
	*arg = NULL;
}


void set_tcpurp(arg)
char **arg;
{
	tcp->th_urp = htons(strtol(*arg, NULL, 0));
	free(*arg);
	*arg = NULL;
}


void set_tcpwin(arg)
char **arg;
{
	tcp->th_win = htons(strtol(*arg, NULL, 0));
	free(*arg);
	*arg = NULL;
}


void set_tcpsum(arg)
char **arg;
{
	tcp->th_sum = strtol(*arg, NULL, 0);
	free(*arg);
	*arg = NULL;
}


void set_tcpflags(arg)
char **arg;
{
	static	char	flags[] = "ASURPF";
	static	int	flagv[] = { TH_ACK, TH_SYN, TH_URG, TH_RST, TH_PUSH,
				    TH_FIN } ;
	char *s, *t;

	for (s = *arg; *s; s++)
		if (!(t = strchr(flags, *s))) {
			if (s - *arg) {
				fprintf(stderr, "unknown TCP flag %c\n", *s);
				break;
			}
			tcp->th_flags = strtol(*arg, NULL, 0);
			break;
		} else
			tcp->th_flags |= flagv[t - flags];
	free(*arg);
	*arg = NULL;
}


void set_tcpopt(state, arg)
int state;
char **arg;
{
	u_char *s;
	int val, len, val2, pad, optval;

	if (arg && *arg)
		val = atoi(*arg);
	else
		val = 0;

	s = (u_char *)tcp + sizeof(*tcp) + canip->ah_optlen;
	switch (state)
	{
	case IL_TCPO_EOL :
		optval = 0;
		len = 1;
		break;
	case IL_TCPO_NOP :
		optval = 1;
		len = 1;
		break;
	case IL_TCPO_MSS :
		optval = 2;
		len = 4;
		break;
	case IL_TCPO_WSCALE :
		optval = 3;
		len = 3;
		break;
	case IL_TCPO_TS :
		optval = 8;
		len = 10;
		break;
	default :
		optval = 0;
		len = 0;
		break;
	}

	if (len > 1) {
		/*
		 * prepend padding - if required.
		 */
		if (len & 3)
			for (pad = 4 - (len & 3); pad; pad--) {
				*s++ = 1;
				canip->ah_optlen++;
			}
		/*
		 * build tcp option
		 */
		*s++ = (u_char)optval;
		*s++ = (u_char)len;
		if (len > 2) {
			if (len == 3) {		/* 1 byte - char */
				*s++ = (u_char)val;
			} else if (len == 4) {	/* 2 bytes - short */
				*s++ = (u_char)((val >> 8) & 0xff);
				*s++ = (u_char)(val & 0xff);
			} else if (len >= 6) {	/* 4 bytes - long */
				val2 = htonl(val);
				bcopy((char *)&val2, s, 4);
			}
			s += (len - 2);
		}
	} else
		*s++ = (u_char)optval;

	canip->ah_lastopt = optval;
	canip->ah_optlen += len;

	if (arg && *arg) {
		free(*arg);
		*arg = NULL;
	}
}


void end_tcpopt()
{
	int pad;
	char *s = (char *)tcp;

	s += sizeof(*tcp) + canip->ah_optlen;
	/*
	 * pad out so that we have a multiple of 4 bytes in size fo the
	 * options.  make sure last byte is EOL.
	 */
	if (canip->ah_optlen & 3) {
		if (canip->ah_lastopt != 1) {
			for (pad = 3 - (canip->ah_optlen & 3); pad; pad--) {
				*s++ = 1;
				canip->ah_optlen++;
			}
			canip->ah_optlen++;
		} else {
			s -= 1;

			for (pad = 3 - (canip->ah_optlen & 3); pad; pad--) {
				*s++ = 1;
				canip->ah_optlen++;
			}
		}
		*s++ = 0;
	}
	tcp->th_off = (sizeof(*tcp) + canip->ah_optlen) >> 2;
	inc_anipheaders(canip->ah_optlen);
}


void new_udpheader()
{
	if ((ip->ip_p) && (ip->ip_p != IPPROTO_UDP)) {
		fprintf(stderr, "protocol %d specified with UDP!\n", ip->ip_p);
		return;
	}
	ip->ip_p = IPPROTO_UDP;

	udp = (udphdr_t *)new_header(IPPROTO_UDP);
	udp->uh_ulen = sizeof(*udp);
}


void set_udplen(arg)
char **arg;
{
	int len;

	len = strtol(*arg, NULL, 0);
	inc_anipheaders(len - udp->uh_ulen);
	udp->uh_ulen = len;
	free(*arg);
	*arg = NULL;
}


void set_udpsum(arg)
char **arg;
{
	udp->uh_sum = strtol(*arg, NULL, 0);
	free(*arg);
	*arg = NULL;
}


void prep_packet()
{
	iface_t *ifp;
	struct in_addr gwip;

	ifp = sending.snd_if;
	if (!ifp) {
		fprintf(stderr, "no interface defined for sending!\n");
		return;
	}
	if (ifp->if_fd == -1)
		ifp->if_fd = initdevice(ifp->if_name, 0, 5);
	gwip = sending.snd_gw;
	if (!gwip.s_addr)
		gwip = aniphead->ah_ip->ip_dst;
	(void) send_ip(ifp->if_fd, ifp->if_MTU, (ip_t *)ipbuffer, gwip, 2);
}


void packet_done()
{
	char    outline[80];
	int     i, j, k;
	u_char  *s = (u_char *)ipbuffer, *t = (u_char *)outline;

	if (opts & OPT_VERBOSE) {
		ip->ip_len = htons(ip->ip_len);
		for (i = ntohs(ip->ip_len), j = 0; i; i--, j++, s++) {
			if (j && !(j & 0xf)) {
				*t++ = '\n';
				*t = '\0';
				fputs(outline, stdout);
				fflush(stdout);
				t = (u_char *)outline;
				*t = '\0';
			}
			sprintf((char *)t, "%02x", *s & 0xff);
			t += 2;
			if (!((j + 1) & 0xf)) {
				s -= 15;
				sprintf((char *)t, "	");
				t += 8;
				for (k = 16; k; k--, s++)
					*t++ = (isprint(*s) ? *s : '.');
				s--;
			}

			if ((j + 1) & 0xf)
				*t++ = ' ';;
		}

		if (j & 0xf) {
			for (k = 16 - (j & 0xf); k; k--) {
				*t++ = ' ';
				*t++ = ' ';
				*t++ = ' ';
			}
			sprintf((char *)t, "       ");
			t += 7;
			s -= j & 0xf;
			for (k = j & 0xf; k; k--, s++)
				*t++ = (isprint(*s) ? *s : '.');
			*t++ = '\n';
			*t = '\0';
		}
		fputs(outline, stdout);
		fflush(stdout);
		ip->ip_len = ntohs(ip->ip_len);
	}

	prep_packet();
	free_aniplist();
}


void new_interface()
{
	cifp = (iface_t *)calloc(1, sizeof(iface_t));
	*iftail = cifp;
	iftail = &cifp->if_next;
	cifp->if_fd = -1;
}


void check_interface()
{
	if (!cifp->if_name || !*cifp->if_name)
		fprintf(stderr, "No interface name given!\n");
	if (!cifp->if_MTU || !*cifp->if_name)
		fprintf(stderr, "Interface %s has an MTU of 0!\n",
			cifp->if_name);
}


void set_ifname(arg)
char **arg;
{
	cifp->if_name = *arg;
	*arg = NULL;
}


void set_ifmtu(arg)
int arg;
{
	cifp->if_MTU = arg;
}


void set_ifv4addr(arg)
char **arg;
{
	cifp->if_addr = getipv4addr(*arg);
	free(*arg);
	*arg = NULL;
}


void set_ifeaddr(arg)
char **arg;
{
	(void) geteaddr(*arg, &cifp->if_eaddr);
	free(*arg);
	*arg = NULL;
}


void new_arp()
{
	carp = (arp_t *)calloc(1, sizeof(arp_t));
	*arptail = carp;
	arptail = &carp->arp_next;
}


void set_arpeaddr(arg)
char **arg;
{
	(void) geteaddr(*arg, &carp->arp_eaddr);
	free(*arg);
	*arg = NULL;
}


void set_arpv4addr(arg)
char **arg;
{
	carp->arp_addr = getipv4addr(*arg);
	free(*arg);
	*arg = NULL;
}


int arp_getipv4(ip, addr)
char *ip;
char *addr;
{
	arp_t *a;

	for (a = arplist; a; a = a->arp_next)
		if (!bcmp(ip, (char *)&a->arp_addr, 4)) {
			bcopy((char *)&a->arp_eaddr, addr, 6);
			return 0;
		}
	return -1;
}


void reset_send()
{
	sending.snd_if = iflist;
	sending.snd_gw = defrouter;
}


void set_sendif(arg)
char **arg;
{
	iface_t	*ifp;

	for (ifp = iflist; ifp; ifp = ifp->if_next)
		if (ifp->if_name && !strcmp(ifp->if_name, *arg))
			break;
	sending.snd_if = ifp;
	if (!ifp)
		fprintf(stderr, "couldn't find interface %s\n", *arg);
	free(*arg);
	*arg = NULL;
}


void set_sendvia(arg)
char **arg;
{
	sending.snd_gw = getipv4addr(*arg);
	free(*arg);
	*arg = NULL;
}


void set_defaultrouter(arg)
char **arg;
{
	defrouter = getipv4addr(*arg);
	free(*arg);
	*arg = NULL;
}


void new_icmpheader()
{
	if ((ip->ip_p) && (ip->ip_p != IPPROTO_ICMP)) {
		fprintf(stderr, "protocol %d specified with ICMP!\n",
			ip->ip_p);
		return;
	}
	ip->ip_p = IPPROTO_ICMP;
	icmp = (icmphdr_t *)new_header(IPPROTO_ICMP);
}


void set_icmpcode(code)
int code;
{
	icmp->icmp_code = code;
}


void set_icmptype(type)
int type;
{
	icmp->icmp_type = type;
}


static	char	*icmpcodes[] = {
	"net-unr", "host-unr", "proto-unr", "port-unr", "needfrag", "srcfail",
	"net-unk", "host-unk", "isolate", "net-prohib", "host-prohib",
	"net-tos", "host-tos", NULL };

void set_icmpcodetok(code)
char **code;
{
	char	*s;
	int	i;

	for (i = 0; (s = icmpcodes[i]); i++)
		if (!strcmp(s, *code)) {
			icmp->icmp_code = i;
			break;
		}
	if (!s)
		fprintf(stderr, "unknown ICMP code %s\n", *code);
	free(*code);
	*code = NULL;
}


static	char	*icmptypes[] = {
	"echorep", (char *)NULL, (char *)NULL, "unreach", "squench",
	"redir", (char *)NULL, (char *)NULL, "echo", (char *)NULL,
	(char *)NULL, "timex", "paramprob", "timest", "timestrep",
	"inforeq", "inforep", "maskreq", "maskrep", "END"
};

void set_icmptypetok(type)
char **type;
{
	char	*s;
	int	i, done = 0;

	for (i = 0; !(s = icmptypes[i]) || strcmp(s, "END"); i++)
		if (s && !strcmp(s, *type)) {
			icmp->icmp_type = i;
			done = 1;
			break;
		}
	if (!done)
		fprintf(stderr, "unknown ICMP type %s\n", *type);
	free(*type);
	*type = NULL;
}


void set_icmpid(arg)
int arg;
{
	icmp->icmp_id = htons(arg);
}


void set_icmpseq(arg)
int arg;
{
	icmp->icmp_seq = htons(arg);
}


void set_icmpotime(arg)
int arg;
{
	icmp->icmp_otime = htonl(arg);
}


void set_icmprtime(arg)
int arg;
{
	icmp->icmp_rtime = htonl(arg);
}


void set_icmpttime(arg)
int arg;
{
	icmp->icmp_ttime = htonl(arg);
}


void set_icmpmtu(arg)
int arg;
{
#if	BSD >= 199306
	icmp->icmp_nextmtu = htons(arg);
#endif
}


void set_redir(redir, arg)
int redir;
char **arg;
{
	icmp->icmp_code = redir;
	icmp->icmp_gwaddr = getipv4addr(*arg);
	free(*arg);
	*arg = NULL;
}


void set_icmppprob(num)
int num;
{
	icmp->icmp_pptr = num;
}


void new_ipv4opt()
{
	new_header(-2);
}


void add_ipopt(state, ptr)
int state;
void *ptr;
{
	struct ipopt_names *io;
	struct statetoopt *sto;
	char numbuf[16], *arg, **param = ptr;
	int inc, hlen;

	if (state == IL_IPO_RR || state == IL_IPO_SATID) {
		if (param)
			sprintf(numbuf, "%d", *(int *)param);
		else
			strcpy(numbuf, "0");
		arg = numbuf;
	} else
		arg = param ? *param : NULL;

	if (canip->ah_next) {
		fprintf(stderr, "cannot specify options after data body\n");
		return;
	}
	for (sto = toipopts; sto->sto_st; sto++)
		if (sto->sto_st == state)
			break;
	if (!sto || !sto->sto_st) {
		fprintf(stderr, "No mapping for state %d to IP option\n",
			state);
		return;
	}

	hlen = sizeof(ip_t) + canip->ah_optlen;
	for (io = ionames; io->on_name; io++)
		if (io->on_value == sto->sto_op)
			break;
	canip->ah_lastopt = io->on_value;

	if (io->on_name) {
		inc = addipopt((char *)ip + hlen, io, hlen - sizeof(ip_t),arg);
		if (inc > 0) {
			while (inc & 3) {
				((char *)ip)[sizeof(*ip) + inc] = IPOPT_NOP;
				canip->ah_lastopt = IPOPT_NOP;
				inc++;
			}
			hlen += inc;
		}
	}

	canip->ah_optlen = hlen - sizeof(ip_t);

	if (state != IL_IPO_RR && state != IL_IPO_SATID)
		if (param && *param) {
			free(*param);
			*param = NULL;
		}
	sclass = NULL;
}


void end_ipopt()
{
	int pad;
	char *s, *buf = (char *)ip;

	/*
	 * pad out so that we have a multiple of 4 bytes in size fo the
	 * options.  make sure last byte is EOL.
	 */
	if (canip->ah_lastopt == IPOPT_NOP) {
		buf[sizeof(*ip) + canip->ah_optlen - 1] = IPOPT_EOL;
	} else if (canip->ah_lastopt != IPOPT_EOL) {
		s = buf + sizeof(*ip) + canip->ah_optlen;

		for (pad = 3 - (canip->ah_optlen & 3); pad; pad--) {
			*s++ = IPOPT_NOP;
			*s = IPOPT_EOL;
			canip->ah_optlen++;
		}
		canip->ah_optlen++;
	} else {
		s = buf + sizeof(*ip) + canip->ah_optlen - 1;

		for (pad = 3 - (canip->ah_optlen & 3); pad; pad--) {
			*s++ = IPOPT_NOP;
			*s = IPOPT_EOL;
			canip->ah_optlen++;
		}
	}
	ip->ip_hl = (sizeof(*ip) + canip->ah_optlen) >> 2;
	inc_anipheaders(canip->ah_optlen);
	free_anipheader();
}


void set_secclass(arg)
char **arg;
{
	sclass = *arg;
	*arg = NULL;
}


void free_anipheader()
{
	aniphdr_t *aip;

	aip = canip;
	if ((canip = aip->ah_prev)) {
		canip->ah_next = NULL;
		aniptail = &canip->ah_next;
	}

	if (canip)
		free(aip);
}


void end_ipv4()
{
	aniphdr_t *aip;

	ip->ip_sum = 0;
	ip->ip_len = htons(ip->ip_len);
	ip->ip_sum = chksum((u_short *)ip, ip->ip_hl << 2);
	ip->ip_len = ntohs(ip->ip_len);
	free_anipheader();
	for (aip = aniphead, ip = NULL; aip; aip = aip->ah_next)
		if (aip->ah_p == IPPROTO_IP)
			ip = aip->ah_ip;
}


void end_icmp()
{
	aniphdr_t *aip;

	icmp->icmp_cksum = 0;
	icmp->icmp_cksum = chksum((u_short *)icmp, canip->ah_len);
	free_anipheader();
	for (aip = aniphead, icmp = NULL; aip; aip = aip->ah_next)
		if (aip->ah_p == IPPROTO_ICMP)
			icmp = aip->ah_icmp;
}


void end_udp()
{
	u_long	sum;
	aniphdr_t *aip;
	ip_t	iptmp;

	bzero((char *)&iptmp, sizeof(iptmp));
	iptmp.ip_p = ip->ip_p;
	iptmp.ip_src = ip->ip_src;
	iptmp.ip_dst = ip->ip_dst;
	iptmp.ip_len = htons(ip->ip_len - (ip->ip_hl << 2));
	sum = p_chksum((u_short *)&iptmp, (u_int)sizeof(iptmp));
	udp->uh_ulen = htons(udp->uh_ulen);
	udp->uh_sum = c_chksum((u_short *)udp, (u_int)ntohs(iptmp.ip_len), sum);
	free_anipheader();
	for (aip = aniphead, udp = NULL; aip; aip = aip->ah_next)
		if (aip->ah_p == IPPROTO_UDP)
			udp = aip->ah_udp;
}


void end_tcp()
{
	u_long	sum;
	aniphdr_t *aip;
	ip_t	iptmp;

	bzero((char *)&iptmp, sizeof(iptmp));
	iptmp.ip_p = ip->ip_p;
	iptmp.ip_src = ip->ip_src;
	iptmp.ip_dst = ip->ip_dst;
	iptmp.ip_len = htons(ip->ip_len - (ip->ip_hl << 2));
	sum = p_chksum((u_short *)&iptmp, (u_int)sizeof(iptmp));
	tcp->th_sum = 0;
	tcp->th_sum = c_chksum((u_short *)tcp, (u_int)ntohs(iptmp.ip_len), sum);
	free_anipheader();
	for (aip = aniphead, tcp = NULL; aip; aip = aip->ah_next)
		if (aip->ah_p == IPPROTO_TCP)
			tcp = aip->ah_tcp;
}


void end_data()
{
	free_anipheader();
}


void iplang(fp)
FILE *fp;
{
	yyin = fp;

	yydebug = (opts & OPT_DEBUG) ? 1 : 0;

	while (!feof(fp))
		yyparse();
}


u_short	c_chksum(buf, len, init)
u_short	*buf;
u_int	len;
u_long	init;
{
	u_long	sum = init;
	int	nwords = len >> 1;
 
	for(; nwords > 0; nwords--)
		sum += *buf++;
	sum = (sum>>16) + (sum & 0xffff);
	sum += (sum >>16);
	return (~sum);
}


u_long	p_chksum(buf,len)
u_short	*buf;
u_int	len;
{
	u_long	sum = 0;
	int	nwords = len >> 1;
 
	for(; nwords > 0; nwords--)
		sum += *buf++;
	return sum;
}
static const yytabelem yyexca[] ={
-1, 1,
	0, -1,
	-2, 0,
	};
# define YYNPROD 200
# define YYLAST 422
static const yytabelem yyact[]={

   229,   333,   301,   295,   296,   166,   329,    66,   325,   303,
   304,   305,   306,   307,   308,   309,   310,   311,   312,   313,
   314,   315,   316,   317,   318,   320,   321,   322,   323,   288,
   158,   159,   160,   257,    75,    39,    70,   113,   114,   115,
   116,   117,    24,   119,   120,   121,   123,   124,   126,   127,
   128,   129,   130,   131,   132,   122,   125,   118,     2,    69,
    36,    73,    74,    79,   155,    77,    78,   103,    25,    81,
    82,    29,    30,    32,    40,    85,    86,    87,    88,    89,
    90,    91,    92,    93,    94,    95,    17,   214,   230,   175,
   176,   177,   178,   179,   180,   181,   182,   287,    72,    63,
   165,   106,   156,    35,   286,   216,   231,    61,   133,   146,
   247,   220,   218,   219,   221,    64,    31,   228,    65,   222,
   223,   224,   225,   226,   227,   249,   250,   251,   252,   253,
    66,    17,    45,    46,    47,    48,    49,    50,    52,    53,
    54,    55,    62,    51,    63,   292,    44,   164,   383,   375,
   360,   343,   340,   183,   339,   330,   282,   187,   232,   211,
    64,   205,   193,    65,   161,    83,   195,   196,   197,   198,
   199,   200,   201,   202,   203,    66,    36,     8,    17,   207,
   208,   209,   210,    67,   342,   276,   104,   280,   234,   235,
   236,    63,   136,   137,   144,   138,   139,   140,   142,   143,
   141,   145,    17,    39,    57,   274,   271,    64,     3,    14,
    65,   268,   279,    17,    14,    63,   149,   150,    17,    35,
   265,    57,    66,   204,   263,   258,    23,   102,   100,    98,
    96,    64,   151,   152,    65,    26,    21,    20,   384,   382,
   381,   380,    40,   194,   379,   135,    66,   148,    16,   277,
    15,    12,   377,    16,   376,    15,    12,   206,   371,   370,
   233,   335,   336,   337,   327,   328,   327,   328,   111,   275,
   272,   369,   368,   365,   186,   269,    57,   324,    57,   285,
   284,   135,   281,   278,   266,   273,   270,   291,   264,   259,
    22,   267,   262,   261,   148,   260,    25,   255,    72,   107,
   254,   212,   246,   245,   244,   299,   243,   242,   241,   240,
   239,   238,    57,   348,   237,   192,   191,   190,   189,   188,
   185,   184,   173,   172,   171,    57,   170,   169,   168,   167,
   163,   110,    57,   366,   367,   109,   108,   105,    41,    42,
    38,   372,   373,   374,   157,    34,   174,   112,   378,   341,
   361,   362,   363,   364,   331,   332,    27,   289,   290,   283,
   319,   302,   344,   345,   346,   347,   338,   349,   350,   351,
   352,   353,   354,   355,   356,   357,   358,   359,    80,    76,
   298,   162,   334,    84,     1,    68,   326,    18,    19,   300,
   297,   294,   217,   215,   256,   213,   154,   153,   147,   248,
   134,    56,    43,    13,   101,    60,    99,    59,    97,    58,
   293,    33,    10,    37,    11,    28,     9,     7,     6,     5,
     4,    71 };
static const yytabelem yypact[]={

   -55,-10000000,   -55,   -55,-10000000,-10000000,-10000000,-10000000,-10000000,   114,
   113,   167,  -190,   112,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,
  -194,  -207,  -230,-10000000,-10000000,   279,  -137,    58,  -194,  -190,
  -159,  -190,  -190,   -91,-10000000,  -190,  -190,   -62,-10000000,  -190,
  -190,-10000000,    40,  -137,-10000000,  -190,  -190,  -190,  -190,  -190,
  -190,  -190,  -190,  -190,  -190,  -190,   107,-10000000,   106,   105,
   104,    63,-10000000,-10000000,-10000000,-10000000,-10000000,   278,-10000000,-10000000,
-10000000,    42,-10000000,-10000000,-10000000,   277,-10000000,-10000000,-10000000,   276,
-10000000,-10000000,-10000000,   272,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,
-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,  -279,-10000000,   -90,-10000000,
   -66,-10000000,  -237,-10000000,  -283,-10000000,-10000000,-10000000,-10000000,-10000000,
-10000000,    39,  -279,   271,    41,   270,   269,   268,   267,   265,
   264,   263,  -248,  -190,   262,   261,    41,  -190,   260,   259,
   258,   257,   256,    37,   -90,-10000000,  -190,  -190,  -190,  -190,
  -190,  -190,  -190,  -190,  -190,   100,    36,   -66,-10000000,  -190,
  -190,  -190,  -190,    34,  -182,  -258,    33,  -283,  -190,  -190,
  -190,   255,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,
-10000000,-10000000,-10000000,-10000000,-10000000,   252,   251,   250,   249,   248,
   247,   245,   244,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,
-10000000,-10000000,-10000000,   243,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,
-10000000,-10000000,-10000000,-10000000,  -167,   241,-10000000,-10000000,-10000000,-10000000,
-10000000,   238,-10000000,  -269,   166,-10000000,   236,-10000000,   234,   233,
   165,   161,   232,   152,   227,   147,   226,   146,   126,   224,
    89,    64,   223,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,
-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,    31,  -167,   221,
   220,    38,    38,    38,-10000000,-10000000,-10000000,  -190,-10000000,-10000000,
-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,  -370,-10000000,-10000000,-10000000,
-10000000,-10000000,  -305,-10000000,-10000000,  -190,-10000000,  -374,-10000000,  -338,
  -340,-10000000,   218,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,
-10000000,-10000000,  -117,  -119,    30,   -50,   -50,  -124,    63,    29,
    27,    61,    26,   -50,   -50,   -50,   -50,  -159,   -50,   -50,
   -50,   -50,   -50,   -50,   -50,   -50,   -50,   -50,   -50,    25,
  -190,  -190,  -190,  -190,-10000000,   214,-10000000,  -159,  -159,   213,
   212,-10000000,-10000000,   200,   199,  -159,  -159,  -159,    24,   195,
   193,-10000000,  -159,   185,-10000000,-10000000,-10000000,-10000000,   182,-10000000,
-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,
   181,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,
-10000000,-10000000,-10000000,-10000000,-10000000,   180,-10000000,-10000000,    23,-10000000,
-10000000,-10000000,-10000000,   179,-10000000 };
static const yytabelem yypgo[]={

     0,     5,   421,   147,    29,   104,   384,    58,   420,   419,
   418,   417,   177,   416,   356,   415,   414,   413,   340,   412,
   411,   345,   146,   409,   408,   407,   406,   405,   404,   107,
    67,   403,   339,   402,   401,   268,   108,   400,   110,   399,
   109,   398,   397,   396,   395,   394,   145,   393,   392,   391,
   390,   389,   386,   382,   361,   360,   349,   347,   346,   102,
   344 };
static const yytabelem yyr1[]={

     0,     6,     6,     6,     6,     7,     7,     7,     7,     7,
     8,    13,    14,    14,    15,    15,    15,    15,    10,    10,
    16,    17,    17,    18,    18,     9,    19,    20,    20,    21,
    21,    11,    22,    22,    22,    22,    22,    12,    31,    32,
    32,    32,    33,    33,    33,    33,    33,    33,    33,    33,
    33,    33,    33,    33,    23,    24,    36,    36,    36,    37,
    37,    37,    37,    37,    37,    37,    37,    37,    37,    38,
    38,    39,    39,    39,    39,    39,    25,    26,    40,    40,
    40,    41,    41,    41,    41,    27,    28,    42,    42,    43,
    43,    45,    44,    44,    44,    44,    44,    44,    44,    44,
    44,    44,    44,    44,    44,    44,    44,    44,    44,    44,
    44,    44,    44,    44,    44,    46,    46,    52,    52,    50,
    50,    53,    53,    53,    47,    47,    54,    54,    54,    54,
    54,    54,    54,    54,    54,    54,    54,    54,    54,    54,
    54,    54,    48,    48,    55,    55,    55,    55,    55,    49,
    49,    51,    51,    56,    34,    35,    35,    57,    57,    57,
    57,    57,    57,    57,    57,    57,    57,    57,    57,    57,
    57,    57,    57,    57,    57,    57,    57,    58,    58,    58,
    58,    58,    58,    58,    58,    29,    30,    59,    59,    60,
    60,    60,     4,     5,     5,     1,     3,     3,     2,     2 };
static const yytabelem yyr2[]={

     0,     2,     4,     2,     4,     2,     2,     2,     2,     2,
    11,     3,     2,     4,     5,     5,     5,     5,    11,     5,
     3,     2,     4,     5,     5,    10,     3,     2,     4,     5,
     5,     5,     2,     4,     4,     4,     4,    11,     3,     2,
     4,     2,     5,     5,     5,     5,     5,     5,     5,     5,
     5,     5,     5,    11,     3,     9,     2,     4,     2,     5,
     5,     5,     5,     5,     5,     5,     5,     5,    11,     0,
     4,     5,     5,     5,     5,     5,     3,     9,     2,     4,
     2,     5,     5,     5,     5,     3,     9,     2,     4,     4,
     6,     5,     5,    10,     2,     5,     2,     5,     5,     5,
    10,     5,    10,     5,     5,    10,     5,     5,    12,     5,
     5,    10,     5,    10,     5,     0,     4,     5,     5,     0,
     6,     5,     5,     5,     2,    10,     4,     4,     4,     4,
     7,     4,     4,     4,     4,     4,     4,     4,     4,     4,
     4,     4,     2,    10,     0,     5,     5,     5,     5,     4,
     4,     2,     4,     9,     3,     0,     4,     5,     5,     5,
     5,     5,     5,     5,     5,     5,     5,     5,     5,     5,
     5,     5,     5,     5,     5,     5,     5,     5,     5,     5,
     5,     5,     5,     5,     5,     3,     9,     2,     4,     5,
     5,     5,     4,     3,     2,     4,     3,     2,     2,     4 };
static const yytabelem yychk[]={

-10000000,    -6,    -7,   263,    -8,    -9,   -10,   -11,   -12,   -13,
   -19,   -16,   306,   -31,   264,   305,   303,   268,    -6,    -6,
   123,   123,   123,    59,    -4,   258,   123,   -14,   -15,   265,
   266,   310,   267,   -20,   -21,   310,   267,   -17,   -18,   265,
   304,    59,   -32,   -33,   -22,   269,   270,   271,   272,   273,
   274,   280,   275,   276,   277,   278,   -34,   -12,   -23,   -25,
   -27,   -29,   279,   281,   297,   300,   312,   125,   -14,    -4,
    -1,    -2,   257,    -4,    -4,   125,   -21,    -4,    -4,   125,
   -18,    -4,    -4,   125,   -32,    -4,    -4,    -4,    -4,    -4,
    -4,    -4,    -4,    -4,    -4,    -4,   123,   -24,   123,   -26,
   123,   -28,   123,   -30,   123,    59,    59,   257,    59,    59,
    59,   -35,   -57,   316,   317,   318,   319,   320,   336,   322,
   323,   324,   334,   325,   326,   335,   327,   328,   329,   330,
   331,   332,   333,   -36,   -37,   -22,   282,   283,   285,   286,
   287,   290,   288,   289,   284,   291,   -40,   -41,   -22,   282,
   283,   298,   299,   -42,   -43,   301,   -59,   -60,   313,   314,
   315,   125,   -35,    59,    -3,    59,    -1,    59,    59,    59,
    59,    59,    59,    59,   -58,   337,   338,   339,   340,   341,
   342,   343,   344,    -4,    59,    59,    -3,    -4,    59,    59,
    59,    59,    59,   125,   -36,    -4,    -4,    -4,    -4,    -4,
    -4,    -4,    -4,    -4,   123,   125,   -40,    -4,    -4,    -4,
    -4,   125,   -22,   -44,   345,   -47,   363,   -48,   370,   371,
   369,   372,   377,   378,   379,   380,   381,   382,   375,   258,
   346,   364,   125,   -59,    -4,    -4,    -4,    59,    59,    59,
    59,    59,    59,    59,    59,    59,    59,   -38,   -39,   292,
   293,   294,   295,   296,    59,    59,   -45,   302,    59,   123,
    59,    59,    59,    59,   123,    59,   123,    59,    59,   123,
    59,    59,   123,    59,    59,   123,    59,   123,    59,   123,
   123,    59,   125,   -38,    59,    59,    -5,    59,    -4,    -5,
    -5,    -4,   -46,   -46,   -49,   373,   374,   -50,   -29,    -4,
   -51,   376,   -54,   347,   348,   349,   350,   351,   352,   353,
   354,   355,   356,   357,   358,   359,   360,   361,   362,   -55,
   365,   366,   367,   368,    59,   125,   -52,   383,   384,   125,
   125,    -7,    -7,   125,   -53,   385,   386,   387,   -30,   125,
   125,   -56,   123,   125,    -7,    -7,    -7,    -7,    -1,    -7,
    -7,    -7,    -7,    -7,    -7,    -7,    -7,    -7,    -7,    -7,
   125,    -4,    -4,    -4,    -4,    59,    -1,    -1,    59,    59,
    59,    59,    -1,    -1,    -1,   125,    59,    59,    -1,    59,
    59,    59,    59,   125,    59 };
static const yytabelem yydef[]={

     0,    -2,     1,     3,     5,     6,     7,     8,     9,     0,
     0,     0,     0,     0,    11,    26,    20,    38,     2,     4,
     0,     0,     0,    19,    31,     0,     0,     0,    12,     0,
     0,     0,     0,     0,    27,     0,     0,     0,    21,     0,
     0,   192,     0,    39,    41,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,    32,     0,     0,
     0,     0,   154,    54,    76,    85,   185,     0,    13,    14,
    15,     0,   198,    16,    17,     0,    28,    29,    30,     0,
    22,    23,    24,     0,    40,    42,    43,    44,    45,    46,
    47,    48,    49,    50,    51,    52,   155,    33,     0,    34,
     0,    35,     0,    36,     0,    10,   195,   199,    25,    18,
    37,     0,   155,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,    56,    58,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,    78,    80,     0,
     0,     0,     0,     0,    87,     0,     0,   187,     0,     0,
     0,     0,   156,   157,   158,   196,   197,   159,   160,   161,
   162,   163,   164,   165,   166,     0,     0,     0,     0,     0,
     0,     0,     0,   167,   168,   169,   170,   171,   172,   173,
   174,   175,   176,     0,    57,    59,    60,    61,    62,    63,
    64,    65,    66,    67,    69,     0,    79,    81,    82,    83,
    84,     0,    88,    89,     0,    94,     0,    96,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
   124,   142,     0,   188,   189,   190,   191,    53,   177,   178,
   179,   180,   181,   182,   183,   184,    55,     0,    69,     0,
     0,     0,     0,     0,    77,    86,    90,     0,    92,   115,
    95,    97,    98,    99,   115,   101,     0,   103,   104,   119,
   106,   107,     0,   109,   110,     0,   112,     0,   114,     0,
   144,   186,     0,    70,    71,    72,    73,   193,   194,    74,
    75,    91,     0,     0,     0,     0,     0,     0,     0,     0,
     0,   151,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,    68,     0,   116,     0,     0,     0,
     0,   149,   150,     0,     0,     0,     0,     0,     0,     0,
     0,   152,     0,     0,   126,   127,   128,   129,     0,   131,
   132,   133,   134,   135,   136,   137,   138,   139,   140,   141,
     0,   145,   146,   147,   148,    93,   117,   118,   100,   102,
   105,   120,   121,   122,   123,     0,   111,   113,     0,   125,
   130,   143,   108,     0,   153 };
typedef struct
#ifdef __cplusplus
	yytoktype
#endif
{ char *t_name; int t_val; } yytoktype;
#ifndef YYDEBUG
#	define YYDEBUG	0	/* don't allow debugging */
#endif

#if YYDEBUG

yytoktype yytoks[] =
{
	"IL_NUMBER",	257,
	"IL_TOKEN",	258,
	"IL_HEXDIGIT",	259,
	"IL_COLON",	260,
	"IL_DOT",	261,
	"IL_EOF",	262,
	"IL_COMMENT",	263,
	"IL_INTERFACE",	264,
	"IL_IFNAME",	265,
	"IL_MTU",	266,
	"IL_EADDR",	267,
	"IL_IPV4",	268,
	"IL_V4PROTO",	269,
	"IL_V4SRC",	270,
	"IL_V4DST",	271,
	"IL_V4OFF",	272,
	"IL_V4V",	273,
	"IL_V4HL",	274,
	"IL_V4TTL",	275,
	"IL_V4TOS",	276,
	"IL_V4SUM",	277,
	"IL_V4LEN",	278,
	"IL_V4OPT",	279,
	"IL_V4ID",	280,
	"IL_TCP",	281,
	"IL_SPORT",	282,
	"IL_DPORT",	283,
	"IL_TCPFL",	284,
	"IL_TCPSEQ",	285,
	"IL_TCPACK",	286,
	"IL_TCPOFF",	287,
	"IL_TCPWIN",	288,
	"IL_TCPSUM",	289,
	"IL_TCPURP",	290,
	"IL_TCPOPT",	291,
	"IL_TCPO_NOP",	292,
	"IL_TCPO_EOL",	293,
	"IL_TCPO_MSS",	294,
	"IL_TCPO_WSCALE",	295,
	"IL_TCPO_TS",	296,
	"IL_UDP",	297,
	"IL_UDPLEN",	298,
	"IL_UDPSUM",	299,
	"IL_ICMP",	300,
	"IL_ICMPTYPE",	301,
	"IL_ICMPCODE",	302,
	"IL_SEND",	303,
	"IL_VIA",	304,
	"IL_ARP",	305,
	"IL_DEFROUTER",	306,
	"IL_SUM",	307,
	"IL_OFF",	308,
	"IL_LEN",	309,
	"IL_V4ADDR",	310,
	"IL_OPT",	311,
	"IL_DATA",	312,
	"IL_DLEN",	313,
	"IL_DVALUE",	314,
	"IL_DFILE",	315,
	"IL_IPO_NOP",	316,
	"IL_IPO_RR",	317,
	"IL_IPO_ZSU",	318,
	"IL_IPO_MTUP",	319,
	"IL_IPO_MTUR",	320,
	"IL_IPO_EOL",	321,
	"IL_IPO_TS",	322,
	"IL_IPO_TR",	323,
	"IL_IPO_SEC",	324,
	"IL_IPO_LSRR",	325,
	"IL_IPO_ESEC",	326,
	"IL_IPO_SATID",	327,
	"IL_IPO_SSRR",	328,
	"IL_IPO_ADDEXT",	329,
	"IL_IPO_VISA",	330,
	"IL_IPO_IMITD",	331,
	"IL_IPO_EIP",	332,
	"IL_IPO_FINN",	333,
	"IL_IPO_SECCLASS",	334,
	"IL_IPO_CIPSO",	335,
	"IL_IPO_ENCODE",	336,
	"IL_IPS_RESERV4",	337,
	"IL_IPS_TOPSECRET",	338,
	"IL_IPS_SECRET",	339,
	"IL_IPS_RESERV3",	340,
	"IL_IPS_CONFID",	341,
	"IL_IPS_UNCLASS",	342,
	"IL_IPS_RESERV2",	343,
	"IL_IPS_RESERV1",	344,
	"IL_ICMP_ECHOREPLY",	345,
	"IL_ICMP_UNREACH",	346,
	"IL_ICMP_UNREACH_NET",	347,
	"IL_ICMP_UNREACH_HOST",	348,
	"IL_ICMP_UNREACH_PROTOCOL",	349,
	"IL_ICMP_UNREACH_PORT",	350,
	"IL_ICMP_UNREACH_NEEDFRAG",	351,
	"IL_ICMP_UNREACH_SRCFAIL",	352,
	"IL_ICMP_UNREACH_NET_UNKNOWN",	353,
	"IL_ICMP_UNREACH_HOST_UNKNOWN",	354,
	"IL_ICMP_UNREACH_ISOLATED",	355,
	"IL_ICMP_UNREACH_NET_PROHIB",	356,
	"IL_ICMP_UNREACH_HOST_PROHIB",	357,
	"IL_ICMP_UNREACH_TOSNET",	358,
	"IL_ICMP_UNREACH_TOSHOST",	359,
	"IL_ICMP_UNREACH_FILTER_PROHIB",	360,
	"IL_ICMP_UNREACH_HOST_PRECEDENCE",	361,
	"IL_ICMP_UNREACH_PRECEDENCE_CUTOFF",	362,
	"IL_ICMP_SOURCEQUENCH",	363,
	"IL_ICMP_REDIRECT",	364,
	"IL_ICMP_REDIRECT_NET",	365,
	"IL_ICMP_REDIRECT_HOST",	366,
	"IL_ICMP_REDIRECT_TOSNET",	367,
	"IL_ICMP_REDIRECT_TOSHOST",	368,
	"IL_ICMP_ECHO",	369,
	"IL_ICMP_ROUTERADVERT",	370,
	"IL_ICMP_ROUTERSOLICIT",	371,
	"IL_ICMP_TIMXCEED",	372,
	"IL_ICMP_TIMXCEED_INTRANS",	373,
	"IL_ICMP_TIMXCEED_REASS",	374,
	"IL_ICMP_PARAMPROB",	375,
	"IL_ICMP_PARAMPROB_OPTABSENT",	376,
	"IL_ICMP_TSTAMP",	377,
	"IL_ICMP_TSTAMPREPLY",	378,
	"IL_ICMP_IREQ",	379,
	"IL_ICMP_IREQREPLY",	380,
	"IL_ICMP_MASKREQ",	381,
	"IL_ICMP_MASKREPLY",	382,
	"IL_ICMP_SEQ",	383,
	"IL_ICMP_ID",	384,
	"IL_ICMP_OTIME",	385,
	"IL_ICMP_RTIME",	386,
	"IL_ICMP_TTIME",	387,
	"-unknown-",	-1	/* ends search */
};

char * yyreds[] =
{
	"-no such reduction-",
	"file : line",
	"file : line file",
	"file : IL_COMMENT",
	"file : IL_COMMENT file",
	"line : iface",
	"line : arp",
	"line : send",
	"line : defrouter",
	"line : ipline",
	"iface : ifhdr '{' ifaceopts '}' ';'",
	"ifhdr : IL_INTERFACE",
	"ifaceopts : ifaceopt",
	"ifaceopts : ifaceopt ifaceopts",
	"ifaceopt : IL_IFNAME token",
	"ifaceopt : IL_MTU number",
	"ifaceopt : IL_V4ADDR token",
	"ifaceopt : IL_EADDR token",
	"send : sendhdr '{' sendbody '}' ';'",
	"send : sendhdr ';'",
	"sendhdr : IL_SEND",
	"sendbody : sendopt",
	"sendbody : sendbody sendopt",
	"sendopt : IL_IFNAME token",
	"sendopt : IL_VIA token",
	"arp : arphdr '{' arpbody '}' ';'",
	"arphdr : IL_ARP",
	"arpbody : arpopt",
	"arpbody : arpbody arpopt",
	"arpopt : IL_V4ADDR token",
	"arpopt : IL_EADDR token",
	"defrouter : IL_DEFROUTER token",
	"bodyline : ipline",
	"bodyline : tcp tcpline",
	"bodyline : udp udpline",
	"bodyline : icmp icmpline",
	"bodyline : data dataline",
	"ipline : ipv4 '{' ipv4body '}' ';'",
	"ipv4 : IL_IPV4",
	"ipv4body : ipv4type",
	"ipv4body : ipv4type ipv4body",
	"ipv4body : bodyline",
	"ipv4type : IL_V4PROTO token",
	"ipv4type : IL_V4SRC token",
	"ipv4type : IL_V4DST token",
	"ipv4type : IL_V4OFF token",
	"ipv4type : IL_V4V token",
	"ipv4type : IL_V4HL token",
	"ipv4type : IL_V4ID token",
	"ipv4type : IL_V4TTL token",
	"ipv4type : IL_V4TOS token",
	"ipv4type : IL_V4SUM token",
	"ipv4type : IL_V4LEN token",
	"ipv4type : ipv4opt '{' ipv4optlist '}' ';'",
	"tcp : IL_TCP",
	"tcpline : '{' tcpheader '}' ';'",
	"tcpheader : tcpbody",
	"tcpheader : tcpbody tcpheader",
	"tcpheader : bodyline",
	"tcpbody : IL_SPORT token",
	"tcpbody : IL_DPORT token",
	"tcpbody : IL_TCPSEQ token",
	"tcpbody : IL_TCPACK token",
	"tcpbody : IL_TCPOFF token",
	"tcpbody : IL_TCPURP token",
	"tcpbody : IL_TCPWIN token",
	"tcpbody : IL_TCPSUM token",
	"tcpbody : IL_TCPFL token",
	"tcpbody : IL_TCPOPT '{' tcpopts '}' ';'",
	"tcpopts : /* empty */",
	"tcpopts : tcpopt tcpopts",
	"tcpopt : IL_TCPO_NOP ';'",
	"tcpopt : IL_TCPO_EOL ';'",
	"tcpopt : IL_TCPO_MSS optoken",
	"tcpopt : IL_TCPO_WSCALE optoken",
	"tcpopt : IL_TCPO_TS optoken",
	"udp : IL_UDP",
	"udpline : '{' udpheader '}' ';'",
	"udpheader : udpbody",
	"udpheader : udpbody udpheader",
	"udpheader : bodyline",
	"udpbody : IL_SPORT token",
	"udpbody : IL_DPORT token",
	"udpbody : IL_UDPLEN token",
	"udpbody : IL_UDPSUM token",
	"icmp : IL_ICMP",
	"icmpline : '{' icmpbody '}' ';'",
	"icmpbody : icmpheader",
	"icmpbody : icmpheader bodyline",
	"icmpheader : IL_ICMPTYPE icmptype",
	"icmpheader : IL_ICMPTYPE icmptype icmpcode",
	"icmpcode : IL_ICMPCODE token",
	"icmptype : IL_ICMP_ECHOREPLY ';'",
	"icmptype : IL_ICMP_ECHOREPLY '{' icmpechoopts '}' ';'",
	"icmptype : unreach",
	"icmptype : IL_ICMP_SOURCEQUENCH ';'",
	"icmptype : redirect",
	"icmptype : IL_ICMP_ROUTERADVERT ';'",
	"icmptype : IL_ICMP_ROUTERSOLICIT ';'",
	"icmptype : IL_ICMP_ECHO ';'",
	"icmptype : IL_ICMP_ECHO '{' icmpechoopts '}' ';'",
	"icmptype : IL_ICMP_TIMXCEED ';'",
	"icmptype : IL_ICMP_TIMXCEED '{' exceed '}' ';'",
	"icmptype : IL_ICMP_TSTAMP ';'",
	"icmptype : IL_ICMP_TSTAMPREPLY ';'",
	"icmptype : IL_ICMP_TSTAMPREPLY '{' icmptsopts '}' ';'",
	"icmptype : IL_ICMP_IREQ ';'",
	"icmptype : IL_ICMP_IREQREPLY ';'",
	"icmptype : IL_ICMP_IREQREPLY '{' data dataline '}' ';'",
	"icmptype : IL_ICMP_MASKREQ ';'",
	"icmptype : IL_ICMP_MASKREPLY ';'",
	"icmptype : IL_ICMP_MASKREPLY '{' token '}' ';'",
	"icmptype : IL_ICMP_PARAMPROB ';'",
	"icmptype : IL_ICMP_PARAMPROB '{' paramprob '}' ';'",
	"icmptype : IL_TOKEN ';'",
	"icmpechoopts : /* empty */",
	"icmpechoopts : icmpechoopts icmpecho",
	"icmpecho : IL_ICMP_SEQ number",
	"icmpecho : IL_ICMP_ID number",
	"icmptsopts : /* empty */",
	"icmptsopts : icmptsopts icmpts ';'",
	"icmpts : IL_ICMP_OTIME number",
	"icmpts : IL_ICMP_RTIME number",
	"icmpts : IL_ICMP_TTIME number",
	"unreach : IL_ICMP_UNREACH",
	"unreach : IL_ICMP_UNREACH '{' unreachopts '}' ';'",
	"unreachopts : IL_ICMP_UNREACH_NET line",
	"unreachopts : IL_ICMP_UNREACH_HOST line",
	"unreachopts : IL_ICMP_UNREACH_PROTOCOL line",
	"unreachopts : IL_ICMP_UNREACH_PORT line",
	"unreachopts : IL_ICMP_UNREACH_NEEDFRAG number ';'",
	"unreachopts : IL_ICMP_UNREACH_SRCFAIL line",
	"unreachopts : IL_ICMP_UNREACH_NET_UNKNOWN line",
	"unreachopts : IL_ICMP_UNREACH_HOST_UNKNOWN line",
	"unreachopts : IL_ICMP_UNREACH_ISOLATED line",
	"unreachopts : IL_ICMP_UNREACH_NET_PROHIB line",
	"unreachopts : IL_ICMP_UNREACH_HOST_PROHIB line",
	"unreachopts : IL_ICMP_UNREACH_TOSNET line",
	"unreachopts : IL_ICMP_UNREACH_TOSHOST line",
	"unreachopts : IL_ICMP_UNREACH_FILTER_PROHIB line",
	"unreachopts : IL_ICMP_UNREACH_HOST_PRECEDENCE line",
	"unreachopts : IL_ICMP_UNREACH_PRECEDENCE_CUTOFF line",
	"redirect : IL_ICMP_REDIRECT",
	"redirect : IL_ICMP_REDIRECT '{' redirectopts '}' ';'",
	"redirectopts : /* empty */",
	"redirectopts : IL_ICMP_REDIRECT_NET token",
	"redirectopts : IL_ICMP_REDIRECT_HOST token",
	"redirectopts : IL_ICMP_REDIRECT_TOSNET token",
	"redirectopts : IL_ICMP_REDIRECT_TOSHOST token",
	"exceed : IL_ICMP_TIMXCEED_INTRANS line",
	"exceed : IL_ICMP_TIMXCEED_REASS line",
	"paramprob : IL_ICMP_PARAMPROB_OPTABSENT",
	"paramprob : IL_ICMP_PARAMPROB_OPTABSENT paraprobarg",
	"paraprobarg : '{' number '}' ';'",
	"ipv4opt : IL_V4OPT",
	"ipv4optlist : /* empty */",
	"ipv4optlist : ipv4opts ipv4optlist",
	"ipv4opts : IL_IPO_NOP ';'",
	"ipv4opts : IL_IPO_RR optnumber",
	"ipv4opts : IL_IPO_ZSU ';'",
	"ipv4opts : IL_IPO_MTUP ';'",
	"ipv4opts : IL_IPO_MTUR ';'",
	"ipv4opts : IL_IPO_ENCODE ';'",
	"ipv4opts : IL_IPO_TS ';'",
	"ipv4opts : IL_IPO_TR ';'",
	"ipv4opts : IL_IPO_SEC ';'",
	"ipv4opts : IL_IPO_SECCLASS secclass",
	"ipv4opts : IL_IPO_LSRR token",
	"ipv4opts : IL_IPO_ESEC ';'",
	"ipv4opts : IL_IPO_CIPSO ';'",
	"ipv4opts : IL_IPO_SATID optnumber",
	"ipv4opts : IL_IPO_SSRR token",
	"ipv4opts : IL_IPO_ADDEXT ';'",
	"ipv4opts : IL_IPO_VISA ';'",
	"ipv4opts : IL_IPO_IMITD ';'",
	"ipv4opts : IL_IPO_EIP ';'",
	"ipv4opts : IL_IPO_FINN ';'",
	"secclass : IL_IPS_RESERV4 ';'",
	"secclass : IL_IPS_TOPSECRET ';'",
	"secclass : IL_IPS_SECRET ';'",
	"secclass : IL_IPS_RESERV3 ';'",
	"secclass : IL_IPS_CONFID ';'",
	"secclass : IL_IPS_UNCLASS ';'",
	"secclass : IL_IPS_RESERV2 ';'",
	"secclass : IL_IPS_RESERV1 ';'",
	"data : IL_DATA",
	"dataline : '{' databody '}' ';'",
	"databody : dataopts",
	"databody : dataopts databody",
	"dataopts : IL_DLEN token",
	"dataopts : IL_DVALUE token",
	"dataopts : IL_DFILE token",
	"token : IL_TOKEN ';'",
	"optoken : ';'",
	"optoken : token",
	"number : digits ';'",
	"optnumber : ';'",
	"optnumber : number",
	"digits : IL_NUMBER",
	"digits : digits IL_NUMBER",
};
#endif /* YYDEBUG */
# line	1 "/os/usr/ccs/bin/yaccpar"
/*
 * Copyright (c) 1993 by Sun Microsystems, Inc.
 */

#pragma ident	"@(#)yaccpar	6.14	97/01/16 SMI"

/*
** Skeleton parser driver for yacc output
*/

/*
** yacc user known macros and defines
*/
#define YYERROR		goto yyerrlab
#define YYACCEPT	return(0)
#define YYABORT		return(1)
#define YYBACKUP( newtoken, newvalue )\
{\
	if ( yychar >= 0 || ( yyr2[ yytmp ] >> 1 ) != 1 )\
	{\
		yyerror( "syntax error - cannot backup" );\
		goto yyerrlab;\
	}\
	yychar = newtoken;\
	yystate = *yyps;\
	yylval = newvalue;\
	goto yynewstate;\
}
#define YYRECOVERING()	(!!yyerrflag)
#define YYNEW(type)	malloc(sizeof(type) * yynewmax)
#define YYCOPY(to, from, type) \
	(type *) memcpy(to, (char *) from, yymaxdepth * sizeof (type))
#define YYENLARGE( from, type) \
	(type *) realloc((char *) from, yynewmax * sizeof(type))
#ifndef YYDEBUG
#	define YYDEBUG	1	/* make debugging available */
#endif

/*
** user known globals
*/
int yydebug;			/* set to 1 to get debugging */

/*
** driver internal defines
*/
#define YYFLAG		(-10000000)

/*
** global variables used by the parser
*/
YYSTYPE *yypv;			/* top of value stack */
int *yyps;			/* top of state stack */

int yystate;			/* current state */
int yytmp;			/* extra var (lasts between blocks) */

int yynerrs;			/* number of errors */
int yyerrflag;			/* error recovery flag */
int yychar;			/* current input token number */



#ifdef YYNMBCHARS
#define YYLEX()		yycvtok(yylex())
/*
** yycvtok - return a token if i is a wchar_t value that exceeds 255.
**	If i<255, i itself is the token.  If i>255 but the neither 
**	of the 30th or 31st bit is on, i is already a token.
*/
#if defined(__STDC__) || defined(__cplusplus)
int yycvtok(int i)
#else
int yycvtok(i) int i;
#endif
{
	int first = 0;
	int last = YYNMBCHARS - 1;
	int mid;
	wchar_t j;

	if(i&0x60000000){/*Must convert to a token. */
		if( yymbchars[last].character < i ){
			return i;/*Giving up*/
		}
		while ((last>=first)&&(first>=0)) {/*Binary search loop*/
			mid = (first+last)/2;
			j = yymbchars[mid].character;
			if( j==i ){/*Found*/ 
				return yymbchars[mid].tvalue;
			}else if( j<i ){
				first = mid + 1;
			}else{
				last = mid -1;
			}
		}
		/*No entry in the table.*/
		return i;/* Giving up.*/
	}else{/* i is already a token. */
		return i;
	}
}
#else/*!YYNMBCHARS*/
#define YYLEX()		yylex()
#endif/*!YYNMBCHARS*/

/*
** yyparse - return 0 if worked, 1 if syntax error not recovered from
*/
#if defined(__STDC__) || defined(__cplusplus)
int yyparse(void)
#else
int yyparse()
#endif
{
	register YYSTYPE *yypvt = 0;	/* top of value stack for $vars */

#if defined(__cplusplus) || defined(lint)
/*
	hacks to please C++ and lint - goto's inside
	switch should never be executed
*/
	static int __yaccpar_lint_hack__ = 0;
	switch (__yaccpar_lint_hack__)
	{
		case 1: goto yyerrlab;
		case 2: goto yynewstate;
	}
#endif

	/*
	** Initialize externals - yyparse may be called more than once
	*/
	yypv = &yyv[-1];
	yyps = &yys[-1];
	yystate = 0;
	yytmp = 0;
	yynerrs = 0;
	yyerrflag = 0;
	yychar = -1;

#if YYMAXDEPTH <= 0
	if (yymaxdepth <= 0)
	{
		if ((yymaxdepth = YYEXPAND(0)) <= 0)
		{
			yyerror("yacc initialization error");
			YYABORT;
		}
	}
#endif

	{
		register YYSTYPE *yy_pv;	/* top of value stack */
		register int *yy_ps;		/* top of state stack */
		register int yy_state;		/* current state */
		register int  yy_n;		/* internal state number info */
	goto yystack;	/* moved from 6 lines above to here to please C++ */

		/*
		** get globals into registers.
		** branch to here only if YYBACKUP was called.
		*/
	yynewstate:
		yy_pv = yypv;
		yy_ps = yyps;
		yy_state = yystate;
		goto yy_newstate;

		/*
		** get globals into registers.
		** either we just started, or we just finished a reduction
		*/
	yystack:
		yy_pv = yypv;
		yy_ps = yyps;
		yy_state = yystate;

		/*
		** top of for (;;) loop while no reductions done
		*/
	yy_stack:
		/*
		** put a state and value onto the stacks
		*/
#if YYDEBUG
		/*
		** if debugging, look up token value in list of value vs.
		** name pairs.  0 and negative (-1) are special values.
		** Note: linear search is used since time is not a real
		** consideration while debugging.
		*/
		if ( yydebug )
		{
			register int yy_i;

			printf( "State %d, token ", yy_state );
			if ( yychar == 0 )
				printf( "end-of-file\n" );
			else if ( yychar < 0 )
				printf( "-none-\n" );
			else
			{
				for ( yy_i = 0; yytoks[yy_i].t_val >= 0;
					yy_i++ )
				{
					if ( yytoks[yy_i].t_val == yychar )
						break;
				}
				printf( "%s\n", yytoks[yy_i].t_name );
			}
		}
#endif /* YYDEBUG */
		if ( ++yy_ps >= &yys[ yymaxdepth ] )	/* room on stack? */
		{
			/*
			** reallocate and recover.  Note that pointers
			** have to be reset, or bad things will happen
			*/
			int yyps_index = (yy_ps - yys);
			int yypv_index = (yy_pv - yyv);
			int yypvt_index = (yypvt - yyv);
			int yynewmax;
#ifdef YYEXPAND
			yynewmax = YYEXPAND(yymaxdepth);
#else
			yynewmax = 2 * yymaxdepth;	/* double table size */
			if (yymaxdepth == YYMAXDEPTH)	/* first time growth */
			{
				char *newyys = (char *)YYNEW(int);
				char *newyyv = (char *)YYNEW(YYSTYPE);
				if (newyys != 0 && newyyv != 0)
				{
					yys = YYCOPY(newyys, yys, int);
					yyv = YYCOPY(newyyv, yyv, YYSTYPE);
				}
				else
					yynewmax = 0;	/* failed */
			}
			else				/* not first time */
			{
				yys = YYENLARGE(yys, int);
				yyv = YYENLARGE(yyv, YYSTYPE);
				if (yys == 0 || yyv == 0)
					yynewmax = 0;	/* failed */
			}
#endif
			if (yynewmax <= yymaxdepth)	/* tables not expanded */
			{
				yyerror( "yacc stack overflow" );
				YYABORT;
			}
			yymaxdepth = yynewmax;

			yy_ps = yys + yyps_index;
			yy_pv = yyv + yypv_index;
			yypvt = yyv + yypvt_index;
		}
		*yy_ps = yy_state;
		*++yy_pv = yyval;

		/*
		** we have a new state - find out what to do
		*/
	yy_newstate:
		if ( ( yy_n = yypact[ yy_state ] ) <= YYFLAG )
			goto yydefault;		/* simple state */
#if YYDEBUG
		/*
		** if debugging, need to mark whether new token grabbed
		*/
		yytmp = yychar < 0;
#endif
		if ( ( yychar < 0 ) && ( ( yychar = YYLEX() ) < 0 ) )
			yychar = 0;		/* reached EOF */
#if YYDEBUG
		if ( yydebug && yytmp )
		{
			register int yy_i;

			printf( "Received token " );
			if ( yychar == 0 )
				printf( "end-of-file\n" );
			else if ( yychar < 0 )
				printf( "-none-\n" );
			else
			{
				for ( yy_i = 0; yytoks[yy_i].t_val >= 0;
					yy_i++ )
				{
					if ( yytoks[yy_i].t_val == yychar )
						break;
				}
				printf( "%s\n", yytoks[yy_i].t_name );
			}
		}
#endif /* YYDEBUG */
		if ( ( ( yy_n += yychar ) < 0 ) || ( yy_n >= YYLAST ) )
			goto yydefault;
		if ( yychk[ yy_n = yyact[ yy_n ] ] == yychar )	/*valid shift*/
		{
			yychar = -1;
			yyval = yylval;
			yy_state = yy_n;
			if ( yyerrflag > 0 )
				yyerrflag--;
			goto yy_stack;
		}

	yydefault:
		if ( ( yy_n = yydef[ yy_state ] ) == -2 )
		{
#if YYDEBUG
			yytmp = yychar < 0;
#endif
			if ( ( yychar < 0 ) && ( ( yychar = YYLEX() ) < 0 ) )
				yychar = 0;		/* reached EOF */
#if YYDEBUG
			if ( yydebug && yytmp )
			{
				register int yy_i;

				printf( "Received token " );
				if ( yychar == 0 )
					printf( "end-of-file\n" );
				else if ( yychar < 0 )
					printf( "-none-\n" );
				else
				{
					for ( yy_i = 0;
						yytoks[yy_i].t_val >= 0;
						yy_i++ )
					{
						if ( yytoks[yy_i].t_val
							== yychar )
						{
							break;
						}
					}
					printf( "%s\n", yytoks[yy_i].t_name );
				}
			}
#endif /* YYDEBUG */
			/*
			** look through exception table
			*/
			{
				register const int *yyxi = yyexca;

				while ( ( *yyxi != -1 ) ||
					( yyxi[1] != yy_state ) )
				{
					yyxi += 2;
				}
				while ( ( *(yyxi += 2) >= 0 ) &&
					( *yyxi != yychar ) )
					;
				if ( ( yy_n = yyxi[1] ) < 0 )
					YYACCEPT;
			}
		}

		/*
		** check for syntax error
		*/
		if ( yy_n == 0 )	/* have an error */
		{
			/* no worry about speed here! */
			switch ( yyerrflag )
			{
			case 0:		/* new error */
				yyerror( "syntax error" );
				goto skip_init;
			yyerrlab:
				/*
				** get globals into registers.
				** we have a user generated syntax type error
				*/
				yy_pv = yypv;
				yy_ps = yyps;
				yy_state = yystate;
			skip_init:
				yynerrs++;
				/* FALLTHRU */
			case 1:
			case 2:		/* incompletely recovered error */
					/* try again... */
				yyerrflag = 3;
				/*
				** find state where "error" is a legal
				** shift action
				*/
				while ( yy_ps >= yys )
				{
					yy_n = yypact[ *yy_ps ] + YYERRCODE;
					if ( yy_n >= 0 && yy_n < YYLAST &&
						yychk[yyact[yy_n]] == YYERRCODE)					{
						/*
						** simulate shift of "error"
						*/
						yy_state = yyact[ yy_n ];
						goto yy_stack;
					}
					/*
					** current state has no shift on
					** "error", pop stack
					*/
#if YYDEBUG
#	define _POP_ "Error recovery pops state %d, uncovers state %d\n"
					if ( yydebug )
						printf( _POP_, *yy_ps,
							yy_ps[-1] );
#	undef _POP_
#endif
					yy_ps--;
					yy_pv--;
				}
				/*
				** there is no state on stack with "error" as
				** a valid shift.  give up.
				*/
				YYABORT;
			case 3:		/* no shift yet; eat a token */
#if YYDEBUG
				/*
				** if debugging, look up token in list of
				** pairs.  0 and negative shouldn't occur,
				** but since timing doesn't matter when
				** debugging, it doesn't hurt to leave the
				** tests here.
				*/
				if ( yydebug )
				{
					register int yy_i;

					printf( "Error recovery discards " );
					if ( yychar == 0 )
						printf( "token end-of-file\n" );
					else if ( yychar < 0 )
						printf( "token -none-\n" );
					else
					{
						for ( yy_i = 0;
							yytoks[yy_i].t_val >= 0;
							yy_i++ )
						{
							if ( yytoks[yy_i].t_val
								== yychar )
							{
								break;
							}
						}
						printf( "token %s\n",
							yytoks[yy_i].t_name );
					}
				}
#endif /* YYDEBUG */
				if ( yychar == 0 )	/* reached EOF. quit */
					YYABORT;
				yychar = -1;
				goto yy_newstate;
			}
		}/* end if ( yy_n == 0 ) */
		/*
		** reduction by production yy_n
		** put stack tops, etc. so things right after switch
		*/
#if YYDEBUG
		/*
		** if debugging, print the string that is the user's
		** specification of the reduction which is just about
		** to be done.
		*/
		if ( yydebug )
			printf( "Reduce by (%d) \"%s\"\n",
				yy_n, yyreds[ yy_n ] );
#endif
		yytmp = yy_n;			/* value to switch over */
		yypvt = yy_pv;			/* $vars top of value stack */
		/*
		** Look in goto table for next state
		** Sorry about using yy_state here as temporary
		** register variable, but why not, if it works...
		** If yyr2[ yy_n ] doesn't have the low order bit
		** set, then there is no action to be done for
		** this reduction.  So, no saving & unsaving of
		** registers done.  The only difference between the
		** code just after the if and the body of the if is
		** the goto yy_stack in the body.  This way the test
		** can be made before the choice of what to do is needed.
		*/
		{
			/* length of production doubled with extra bit */
			register int yy_len = yyr2[ yy_n ];

			if ( !( yy_len & 01 ) )
			{
				yy_len >>= 1;
				yyval = ( yy_pv -= yy_len )[1];	/* $$ = $1 */
				yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] +
					*( yy_ps -= yy_len ) + 1;
				if ( yy_state >= YYLAST ||
					yychk[ yy_state =
					yyact[ yy_state ] ] != -yy_n )
				{
					yy_state = yyact[ yypgo[ yy_n ] ];
				}
				goto yy_stack;
			}
			yy_len >>= 1;
			yyval = ( yy_pv -= yy_len )[1];	/* $$ = $1 */
			yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] +
				*( yy_ps -= yy_len ) + 1;
			if ( yy_state >= YYLAST ||
				yychk[ yy_state = yyact[ yy_state ] ] != -yy_n )
			{
				yy_state = yyact[ yypgo[ yy_n ] ];
			}
		}
					/* save until reenter driver code */
		yystate = yy_state;
		yyps = yy_ps;
		yypv = yy_pv;
	}
	/*
	** code supplied by user is placed in this switch
	*/
	switch( yytmp )
	{
		
case 10:
# line 228 "iplang_y.y"
{ check_interface(); } break;
case 11:
# line 231 "iplang_y.y"
{ new_interface(); } break;
case 14:
# line 240 "iplang_y.y"
{ set_ifname(&yypvt[-0].str); } break;
case 15:
# line 241 "iplang_y.y"
{ set_ifmtu(yypvt[-0].num); } break;
case 16:
# line 242 "iplang_y.y"
{ set_ifv4addr(&yypvt[-0].str); } break;
case 17:
# line 243 "iplang_y.y"
{ set_ifeaddr(&yypvt[-0].str); } break;
case 18:
# line 246 "iplang_y.y"
{ packet_done(); } break;
case 19:
# line 247 "iplang_y.y"
{ packet_done(); } break;
case 20:
# line 251 "iplang_y.y"
{ reset_send(); } break;
case 23:
# line 260 "iplang_y.y"
{ set_sendif(&yypvt[-0].str); } break;
case 24:
# line 261 "iplang_y.y"
{ set_sendvia(&yypvt[-0].str); } break;
case 26:
# line 267 "iplang_y.y"
{ new_arp(); } break;
case 29:
# line 275 "iplang_y.y"
{ set_arpv4addr(&yypvt[-0].str); } break;
case 30:
# line 276 "iplang_y.y"
{ set_arpeaddr(&yypvt[-0].str); } break;
case 31:
# line 280 "iplang_y.y"
{ set_defaultrouter(&yypvt[-0].str); } break;
case 37:
# line 291 "iplang_y.y"
{ end_ipv4(); } break;
case 38:
# line 294 "iplang_y.y"
{ new_packet(); } break;
case 42:
# line 303 "iplang_y.y"
{ set_ipv4proto(&yypvt[-0].str); } break;
case 43:
# line 304 "iplang_y.y"
{ set_ipv4src(&yypvt[-0].str); } break;
case 44:
# line 305 "iplang_y.y"
{ set_ipv4dst(&yypvt[-0].str); } break;
case 45:
# line 306 "iplang_y.y"
{ set_ipv4off(&yypvt[-0].str); } break;
case 46:
# line 307 "iplang_y.y"
{ set_ipv4v(&yypvt[-0].str); } break;
case 47:
# line 308 "iplang_y.y"
{ set_ipv4hl(&yypvt[-0].str); } break;
case 48:
# line 309 "iplang_y.y"
{ set_ipv4id(&yypvt[-0].str); } break;
case 49:
# line 310 "iplang_y.y"
{ set_ipv4ttl(&yypvt[-0].str); } break;
case 50:
# line 311 "iplang_y.y"
{ set_ipv4tos(&yypvt[-0].str); } break;
case 51:
# line 312 "iplang_y.y"
{ set_ipv4sum(&yypvt[-0].str); } break;
case 52:
# line 313 "iplang_y.y"
{ set_ipv4len(&yypvt[-0].str); } break;
case 53:
# line 314 "iplang_y.y"
{ end_ipopt(); } break;
case 54:
# line 317 "iplang_y.y"
{ new_tcpheader(); } break;
case 55:
# line 321 "iplang_y.y"
{ end_tcp(); } break;
case 59:
# line 331 "iplang_y.y"
{ set_tcpsport(&yypvt[-0].str); } break;
case 60:
# line 332 "iplang_y.y"
{ set_tcpdport(&yypvt[-0].str); } break;
case 61:
# line 333 "iplang_y.y"
{ set_tcpseq(&yypvt[-0].str); } break;
case 62:
# line 334 "iplang_y.y"
{ set_tcpack(&yypvt[-0].str); } break;
case 63:
# line 335 "iplang_y.y"
{ set_tcpoff(&yypvt[-0].str); } break;
case 64:
# line 336 "iplang_y.y"
{ set_tcpurp(&yypvt[-0].str); } break;
case 65:
# line 337 "iplang_y.y"
{ set_tcpwin(&yypvt[-0].str); } break;
case 66:
# line 338 "iplang_y.y"
{ set_tcpsum(&yypvt[-0].str); } break;
case 67:
# line 339 "iplang_y.y"
{ set_tcpflags(&yypvt[-0].str); } break;
case 68:
# line 340 "iplang_y.y"
{ end_tcpopt(); } break;
case 71:
# line 347 "iplang_y.y"
{ set_tcpopt(IL_TCPO_NOP, NULL); } break;
case 72:
# line 348 "iplang_y.y"
{ set_tcpopt(IL_TCPO_EOL, NULL); } break;
case 73:
# line 349 "iplang_y.y"
{ set_tcpopt(IL_TCPO_MSS,&yypvt[-0].str);} break;
case 74:
# line 350 "iplang_y.y"
{ set_tcpopt(IL_TCPO_WSCALE,&yypvt[-0].str);} break;
case 75:
# line 351 "iplang_y.y"
{ set_tcpopt(IL_TCPO_TS, &yypvt[-0].str);} break;
case 76:
# line 354 "iplang_y.y"
{ new_udpheader(); } break;
case 77:
# line 358 "iplang_y.y"
{ end_udp(); } break;
case 81:
# line 369 "iplang_y.y"
{ set_tcpsport(&yypvt[-0].str); } break;
case 82:
# line 370 "iplang_y.y"
{ set_tcpdport(&yypvt[-0].str); } break;
case 83:
# line 371 "iplang_y.y"
{ set_udplen(&yypvt[-0].str); } break;
case 84:
# line 372 "iplang_y.y"
{ set_udpsum(&yypvt[-0].str); } break;
case 85:
# line 375 "iplang_y.y"
{ new_icmpheader(); } break;
case 86:
# line 379 "iplang_y.y"
{ end_icmp(); } break;
case 91:
# line 393 "iplang_y.y"
{ set_icmpcodetok(&yypvt[-0].str); } break;
case 92:
# line 397 "iplang_y.y"
{ set_icmptype(ICMP_ECHOREPLY); } break;
case 95:
# line 400 "iplang_y.y"
{ set_icmptype(ICMP_SOURCEQUENCH); } break;
case 97:
# line 402 "iplang_y.y"
{ set_icmptype(ICMP_ROUTERADVERT); } break;
case 98:
# line 403 "iplang_y.y"
{ set_icmptype(ICMP_ROUTERSOLICIT); } break;
case 99:
# line 404 "iplang_y.y"
{ set_icmptype(ICMP_ECHO); } break;
case 101:
# line 406 "iplang_y.y"
{ set_icmptype(ICMP_TIMXCEED); } break;
case 103:
# line 408 "iplang_y.y"
{ set_icmptype(ICMP_TSTAMP); } break;
case 104:
# line 409 "iplang_y.y"
{ set_icmptype(ICMP_TSTAMPREPLY); } break;
case 106:
# line 411 "iplang_y.y"
{ set_icmptype(ICMP_IREQ); } break;
case 107:
# line 412 "iplang_y.y"
{ set_icmptype(ICMP_IREQREPLY); } break;
case 109:
# line 414 "iplang_y.y"
{ set_icmptype(ICMP_MASKREQ); } break;
case 110:
# line 415 "iplang_y.y"
{ set_icmptype(ICMP_MASKREPLY); } break;
case 112:
# line 417 "iplang_y.y"
{ set_icmptype(ICMP_PARAMPROB); } break;
case 114:
# line 419 "iplang_y.y"
{ set_icmptypetok(&yypvt[-1].str); } break;
case 117:
# line 427 "iplang_y.y"
{ set_icmpseq(yypvt[-0].num); } break;
case 118:
# line 428 "iplang_y.y"
{ set_icmpid(yypvt[-0].num); } break;
case 121:
# line 435 "iplang_y.y"
{ set_icmpotime(yypvt[-0].num); } break;
case 122:
# line 436 "iplang_y.y"
{ set_icmprtime(yypvt[-0].num); } break;
case 123:
# line 437 "iplang_y.y"
{ set_icmpttime(yypvt[-0].num); } break;
case 130:
# line 450 "iplang_y.y"
{ set_icmpmtu(yypvt[-1].num); } break;
case 145:
# line 470 "iplang_y.y"
{ set_redir(0, &yypvt[-0].str); } break;
case 146:
# line 471 "iplang_y.y"
{ set_redir(1, &yypvt[-0].str); } break;
case 147:
# line 472 "iplang_y.y"
{ set_redir(2, &yypvt[-0].str); } break;
case 148:
# line 473 "iplang_y.y"
{ set_redir(3, &yypvt[-0].str); } break;
case 153:
# line 486 "iplang_y.y"
{ set_icmppprob(yypvt[-2].num); } break;
case 154:
# line 489 "iplang_y.y"
{ new_ipv4opt(); } break;
case 157:
# line 497 "iplang_y.y"
{ add_ipopt(IL_IPO_NOP, NULL); } break;
case 158:
# line 498 "iplang_y.y"
{ add_ipopt(IL_IPO_RR, &yypvt[-0].num); } break;
case 159:
# line 499 "iplang_y.y"
{ add_ipopt(IL_IPO_ZSU, NULL); } break;
case 160:
# line 500 "iplang_y.y"
{ add_ipopt(IL_IPO_MTUP, NULL); } break;
case 161:
# line 501 "iplang_y.y"
{ add_ipopt(IL_IPO_MTUR, NULL); } break;
case 162:
# line 502 "iplang_y.y"
{ add_ipopt(IL_IPO_ENCODE, NULL); } break;
case 163:
# line 503 "iplang_y.y"
{ add_ipopt(IL_IPO_TS, NULL); } break;
case 164:
# line 504 "iplang_y.y"
{ add_ipopt(IL_IPO_TR, NULL); } break;
case 165:
# line 505 "iplang_y.y"
{ add_ipopt(IL_IPO_SEC, NULL); } break;
case 166:
# line 506 "iplang_y.y"
{ add_ipopt(IL_IPO_SECCLASS, sclass); } break;
case 167:
# line 507 "iplang_y.y"
{ add_ipopt(IL_IPO_LSRR,&yypvt[-0].str); } break;
case 168:
# line 508 "iplang_y.y"
{ add_ipopt(IL_IPO_ESEC, NULL); } break;
case 169:
# line 509 "iplang_y.y"
{ add_ipopt(IL_IPO_CIPSO, NULL); } break;
case 170:
# line 510 "iplang_y.y"
{ add_ipopt(IL_IPO_SATID,&yypvt[-0].num);} break;
case 171:
# line 511 "iplang_y.y"
{ add_ipopt(IL_IPO_SSRR,&yypvt[-0].str); } break;
case 172:
# line 512 "iplang_y.y"
{ add_ipopt(IL_IPO_ADDEXT, NULL); } break;
case 173:
# line 513 "iplang_y.y"
{ add_ipopt(IL_IPO_VISA, NULL); } break;
case 174:
# line 514 "iplang_y.y"
{ add_ipopt(IL_IPO_IMITD, NULL); } break;
case 175:
# line 515 "iplang_y.y"
{ add_ipopt(IL_IPO_EIP, NULL); } break;
case 176:
# line 516 "iplang_y.y"
{ add_ipopt(IL_IPO_FINN, NULL); } break;
case 177:
# line 520 "iplang_y.y"
{ set_secclass(&yypvt[-1].str); } break;
case 178:
# line 521 "iplang_y.y"
{ set_secclass(&yypvt[-1].str); } break;
case 179:
# line 522 "iplang_y.y"
{ set_secclass(&yypvt[-1].str); } break;
case 180:
# line 523 "iplang_y.y"
{ set_secclass(&yypvt[-1].str); } break;
case 181:
# line 524 "iplang_y.y"
{ set_secclass(&yypvt[-1].str); } break;
case 182:
# line 525 "iplang_y.y"
{ set_secclass(&yypvt[-1].str); } break;
case 183:
# line 526 "iplang_y.y"
{ set_secclass(&yypvt[-1].str); } break;
case 184:
# line 527 "iplang_y.y"
{ set_secclass(&yypvt[-1].str); } break;
case 185:
# line 530 "iplang_y.y"
{ new_data(); } break;
case 186:
# line 534 "iplang_y.y"
{ end_data(); } break;
case 189:
# line 542 "iplang_y.y"
{ set_datalen(&yypvt[-0].str); } break;
case 190:
# line 543 "iplang_y.y"
{ set_data(&yypvt[-0].str); } break;
case 191:
# line 544 "iplang_y.y"
{ set_datafile(&yypvt[-0].str); } break;
case 193:
# line 550 "iplang_y.y"
{ yyval.str = ""; } break;
case 196:
# line 557 "iplang_y.y"
{ yyval.num = 0; } break;
# line	531 "/os/usr/ccs/bin/yaccpar"
	}
	goto yystack;		/* reset registers in driver code */
}

