require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_NET_IF_TOKEN_H_)) {
    eval 'sub _NET_IF_TOKEN_H_ () {1;}' unless defined(&_NET_IF_TOKEN_H_);
    eval 'sub ISO88025_ADDR_LEN () {6;}' unless defined(&ISO88025_ADDR_LEN);
    eval 'sub TOKEN_MAX_BRIDGE () {8;}' unless defined(&TOKEN_MAX_BRIDGE);
    eval 'sub TOKEN_AC () {0x10;}' unless defined(&TOKEN_AC);
    eval 'sub TOKEN_FC () {0x40;}' unless defined(&TOKEN_FC);
    eval 'sub TOKEN_RI_PRESENT () {0x80;}' unless defined(&TOKEN_RI_PRESENT);
    eval 'sub TOKEN_RCF_LEN_MASK () {0x1f00;}' unless defined(&TOKEN_RCF_LEN_MASK);
    eval 'sub TOKEN_RCF_BROADCAST_MASK () {0xe000;}' unless defined(&TOKEN_RCF_BROADCAST_MASK);
    eval 'sub TOKEN_RCF_BROADCAST_ALL () {0x8000;}' unless defined(&TOKEN_RCF_BROADCAST_ALL);
    eval 'sub TOKEN_RCF_BROADCAST_SINGLE () {0xc000;}' unless defined(&TOKEN_RCF_BROADCAST_SINGLE);
    eval 'sub TOKEN_RCF_FRAME0 () {0x;}' unless defined(&TOKEN_RCF_FRAME0);
    eval 'sub TOKEN_RCF_FRAME1 () {0x10;}' unless defined(&TOKEN_RCF_FRAME1);
    eval 'sub TOKEN_RCF_FRAME2 () {0x20;}' unless defined(&TOKEN_RCF_FRAME2);
    eval 'sub TOKEN_RCF_FRAME3 () {0x30;}' unless defined(&TOKEN_RCF_FRAME3);
    eval 'sub TOKEN_RCF_FRAME4 () {0x40;}' unless defined(&TOKEN_RCF_FRAME4);
    eval 'sub TOKEN_RCF_FRAME5 () {0x50;}' unless defined(&TOKEN_RCF_FRAME5);
    eval 'sub TOKEN_RCF_FRAME6 () {0x60;}' unless defined(&TOKEN_RCF_FRAME6);
    eval 'sub TOKEN_RCF_FRAME7 () {0x70;}' unless defined(&TOKEN_RCF_FRAME7);
    eval 'sub TOKEN_RCF_FRAME_MASK () {0x70;}' unless defined(&TOKEN_RCF_FRAME_MASK);
    eval 'sub TOKEN_RCF_DIRECTION () {0x80;}' unless defined(&TOKEN_RCF_DIRECTION);
    eval 'sub IPMTU_4MBIT_MAX () {4464;}' unless defined(&IPMTU_4MBIT_MAX);
    eval 'sub IPMTU_16MBIT_MAX () {8188;}' unless defined(&IPMTU_16MBIT_MAX);
    eval 'sub ISO88025_MTU () {2002;}' unless defined(&ISO88025_MTU);
    eval 'sub TOKEN_RIF {
        my($x) = @_;
	    eval q(( (($x) + 1)));
    }' unless defined(&TOKEN_RIF);
    eval 'sub M_TRHSTART {
        my($m) = @_;
	    eval q(( &ALIGN((($m)-> &m_flags &  &M_EXT ? ($m)-> ($m_ext->{ext_buf}) : ($m)-> $m_pktdat[0]) + $sizeof{\'struct token_header\'}) - $sizeof{\'struct token_header\'}));
    }' unless defined(&M_TRHSTART);
    if(defined( &_KERNEL)) {
	eval 'sub tokenbroadcastaddr () { &etherbroadcastaddr;}' unless defined(&tokenbroadcastaddr);
	eval 'sub token_ipmulticast_min () { &ether_ipmulticast_min;}' unless defined(&token_ipmulticast_min);
	eval 'sub token_ipmulticast_max () { &ether_ipmulticast_max;}' unless defined(&token_ipmulticast_max);
	eval 'sub token_addmulti () { &ether_addmulti;}' unless defined(&token_addmulti);
	eval 'sub token_delmulti () { &ether_delmulti;}' unless defined(&token_delmulti);
	eval 'sub token_sprintf () { &ether_sprintf;}' unless defined(&token_sprintf);
    }
}
1;
