require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_NET_IF_L2TP_H_)) {
    eval 'sub _NET_IF_L2TP_H_ () {1;}' unless defined(&_NET_IF_L2TP_H_);
    require 'sys/queue.ph';
    require 'sys/ioccom.ph';
    if(defined(&_KERNEL)) {
	require 'sys/pserialize.ph';
	require 'sys/psref.ph';
	require 'sys/pslist.ph';
    }
    require 'net/if_ether.ph';
    require 'netinet/in.ph';
    eval 'sub SIOCSL2TPSESSION () { &_IOW(ord(\'i\'), 151, \'struct ifreq\');}' unless defined(&SIOCSL2TPSESSION);
    eval 'sub SIOCDL2TPSESSION () { &_IOW(ord(\'i\'), 152, \'struct ifreq\');}' unless defined(&SIOCDL2TPSESSION);
    eval 'sub SIOCSL2TPCOOKIE () { &_IOW(ord(\'i\'), 153, \'struct ifreq\');}' unless defined(&SIOCSL2TPCOOKIE);
    eval 'sub SIOCDL2TPCOOKIE () { &_IOW(ord(\'i\'), 154, \'struct ifreq\');}' unless defined(&SIOCDL2TPCOOKIE);
    eval 'sub SIOCSL2TPSTATE () { &_IOW(ord(\'i\'), 155, \'struct ifreq\');}' unless defined(&SIOCSL2TPSTATE);
    eval 'sub SIOCGL2TP () { &SIOCGIFGENERIC;}' unless defined(&SIOCGL2TP);
    eval 'sub L2TP_STATE_UP () {1;}' unless defined(&L2TP_STATE_UP);
    eval 'sub L2TP_STATE_DOWN () {0;}' unless defined(&L2TP_STATE_DOWN);
    eval 'sub L2TP_COOKIE_ON () {1;}' unless defined(&L2TP_COOKIE_ON);
    eval 'sub L2TP_COOKIE_OFF () {0;}' unless defined(&L2TP_COOKIE_OFF);
    if(defined(&_KERNEL)) {
	eval 'sub L2TP_ROUTE_TTL () {10;}' unless defined(&L2TP_ROUTE_TTL);
	eval 'sub L2TP_MTU () {(1280);}' unless defined(&L2TP_MTU);
	eval 'sub L2TP_MTU_MIN () {(1280);}' unless defined(&L2TP_MTU_MIN);
	eval 'sub L2TP_MTU_MAX () {(8192);}' unless defined(&L2TP_MTU_MAX);
	eval 'sub l2tp_putref_variant {
	    my($var,$psref) = @_;
    	    eval q({  &if ($var ==  &NULL) ;  &psref_release($psref,  ($var->{lv_psref}),  &lv_psref_class); });
	}' unless defined(&l2tp_putref_variant);
	eval 'sub l2tp_heldref_variant {
	    my($var) = @_;
    	    eval q({  &psref_held( ($var->{lv_psref}),  &lv_psref_class); });
	}' unless defined(&l2tp_heldref_variant);
	if(defined(&IP_TCPMSS)) {
	}
    }
}
1;
