require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_NET_IF_GRE_H_)) {
    eval 'sub _NET_IF_GRE_H_ () {1;}' unless defined(&_NET_IF_GRE_H_);
    require 'sys/ioccom.ph';
    require 'sys/evcnt.ph';
    require 'sys/queue.ph';
    require 'sys/mutex.ph';
    require 'sys/condvar.ph';
    require 'sys/malloc.ph';
    require 'sys/mallocvar.ph';
    if(defined(&_KERNEL)) {
	require 'sys/pcq.ph';
	eval("sub GRE_S_IDLE () { 0; }") unless defined(&GRE_S_IDLE);
	eval("sub GRE_S_IOCTL () { 1; }") unless defined(&GRE_S_IOCTL);
	eval("sub GRE_S_DIE () { 2; }") unless defined(&GRE_S_DIE);
	eval("sub GRE_M_NONE () { 0; }") unless defined(&GRE_M_NONE);
	eval("sub GRE_M_SETFP () { 1; }") unless defined(&GRE_M_SETFP);
	eval("sub GRE_M_DELFP () { 2; }") unless defined(&GRE_M_DELFP);
	eval("sub GRE_M_STOP () { 3; }") unless defined(&GRE_M_STOP);
	eval("sub GRE_M_OK () { 4; }") unless defined(&GRE_M_OK);
	eval("sub GRE_M_ERR () { 5; }") unless defined(&GRE_M_ERR);
	eval 'sub GRE_CP () {0x8000;}' unless defined(&GRE_CP);
	eval 'sub GRE_RP () {0x4000;}' unless defined(&GRE_RP);
	eval 'sub GRE_KP () {0x2000;}' unless defined(&GRE_KP);
	eval 'sub GRE_SP () {0x1000;}' unless defined(&GRE_SP);
	eval 'sub GRE_SS () {0x800;}' unless defined(&GRE_SS);
	eval 'sub GRE_TTL () {30;}' unless defined(&GRE_TTL);
    }
    eval 'sub GRESADDRS () { &_IOW(ord(\'i\'), 101, \'struct ifreq\');}' unless defined(&GRESADDRS);
    eval 'sub GRESADDRD () { &_IOW(ord(\'i\'), 102, \'struct ifreq\');}' unless defined(&GRESADDRD);
    eval 'sub GREGADDRS () { &_IOWR(ord(\'i\'), 103, \'struct ifreq\');}' unless defined(&GREGADDRS);
    eval 'sub GREGADDRD () { &_IOWR(ord(\'i\'), 104, \'struct ifreq\');}' unless defined(&GREGADDRD);
    eval 'sub GRESPROTO () { &_IOW(ord(\'i\'), 105, \'struct ifreq\');}' unless defined(&GRESPROTO);
    eval 'sub GREGPROTO () { &_IOWR(ord(\'i\'), 106, \'struct ifreq\');}' unless defined(&GREGPROTO);
    eval 'sub GRESSOCK () { &_IOW(ord(\'i\'), 107, \'struct ifreq\');}' unless defined(&GRESSOCK);
    eval 'sub GREDSOCK () { &_IOW(ord(\'i\'), 108, \'struct ifreq\');}' unless defined(&GREDSOCK);
}
1;
