require '_h2ph_pre.ph';

unless(defined(&LINUX_ATMDEV_H)) {
    eval 'sub LINUX_ATMDEV_H () {1;}' unless defined(&LINUX_ATMDEV_H);
    require 'linux/config.ph';
    require 'linux/atmapi.ph';
    require 'linux/atm.ph';
    require 'linux/atmioc.ph';
    eval 'sub ESI_LEN () {6;}' unless defined(&ESI_LEN);
    eval 'sub ATM_OC3_PCR () {(155520000/270*260/8/53);}' unless defined(&ATM_OC3_PCR);
    eval 'sub ATM_25_PCR () {((25600000/8-8000)/54);}' unless defined(&ATM_25_PCR);
    eval 'sub ATM_OC12_PCR () {(622080000/1080*1040/8/53);}' unless defined(&ATM_OC12_PCR);
    eval 'sub ATM_DS3_PCR () {(8000*12);}' unless defined(&ATM_DS3_PCR);
    eval 'sub ATM_PDU_OVHD () {0;}' unless defined(&ATM_PDU_OVHD);
    eval 'sub ATM_SD {
        local($s) = @_;
	    eval q((($s)-> ($sk->{protinfo}->{af_atm})));
    }' unless defined(&ATM_SD);
    eval 'sub __AAL_STAT_ITEMS () { &__HANDLE_ITEM( &tx);  &__HANDLE_ITEM( &tx_err);  &__HANDLE_ITEM( &rx);  &__HANDLE_ITEM( &rx_err);  &__HANDLE_ITEM( &rx_drop);;}' unless defined(&__AAL_STAT_ITEMS);
    eval 'sub __HANDLE_ITEM {
        local($i) = @_;
	    eval q(\'int\' $i);
    }' unless defined(&__HANDLE_ITEM);
    undef(&__HANDLE_ITEM) if defined(&__HANDLE_ITEM);
    eval 'sub ATM_GETLINKRATE () { &_IOW(ord(\'a\'), &ATMIOC_ITF+1,\'struct atmif_sioc\');}' unless defined(&ATM_GETLINKRATE);
    eval 'sub ATM_GETNAMES () { &_IOW(ord(\'a\'), &ATMIOC_ITF+3,\'struct atm_iobuf\');}' unless defined(&ATM_GETNAMES);
    eval 'sub ATM_GETTYPE () { &_IOW(ord(\'a\'), &ATMIOC_ITF+4,\'struct atmif_sioc\');}' unless defined(&ATM_GETTYPE);
    eval 'sub ATM_GETESI () { &_IOW(ord(\'a\'), &ATMIOC_ITF+5,\'struct atmif_sioc\');}' unless defined(&ATM_GETESI);
    eval 'sub ATM_GETADDR () { &_IOW(ord(\'a\'), &ATMIOC_ITF+6,\'struct atmif_sioc\');}' unless defined(&ATM_GETADDR);
    eval 'sub ATM_RSTADDR () { &_IOW(ord(\'a\'), &ATMIOC_ITF+7,\'struct atmif_sioc\');}' unless defined(&ATM_RSTADDR);
    eval 'sub ATM_ADDADDR () { &_IOW(ord(\'a\'), &ATMIOC_ITF+8,\'struct atmif_sioc\');}' unless defined(&ATM_ADDADDR);
    eval 'sub ATM_DELADDR () { &_IOW(ord(\'a\'), &ATMIOC_ITF+9,\'struct atmif_sioc\');}' unless defined(&ATM_DELADDR);
    eval 'sub ATM_GETCIRANGE () { &_IOW(ord(\'a\'), &ATMIOC_ITF+10,\'struct atmif_sioc\');}' unless defined(&ATM_GETCIRANGE);
    eval 'sub ATM_SETCIRANGE () { &_IOW(ord(\'a\'), &ATMIOC_ITF+11,\'struct atmif_sioc\');}' unless defined(&ATM_SETCIRANGE);
    eval 'sub ATM_SETESI () { &_IOW(ord(\'a\'), &ATMIOC_ITF+12,\'struct atmif_sioc\');}' unless defined(&ATM_SETESI);
    eval 'sub ATM_SETESIF () { &_IOW(ord(\'a\'), &ATMIOC_ITF+13,\'struct atmif_sioc\');}' unless defined(&ATM_SETESIF);
    eval 'sub ATM_GETSTAT () { &_IOW(ord(\'a\'), &ATMIOC_SARCOM+0,\'struct atmif_sioc\');}' unless defined(&ATM_GETSTAT);
    eval 'sub ATM_GETSTATZ () { &_IOW(ord(\'a\'), &ATMIOC_SARCOM+1,\'struct atmif_sioc\');}' unless defined(&ATM_GETSTATZ);
    eval 'sub ATM_GETLOOP () { &_IOW(ord(\'a\'), &ATMIOC_SARCOM+2,\'struct atmif_sioc\');}' unless defined(&ATM_GETLOOP);
    eval 'sub ATM_SETLOOP () { &_IOW(ord(\'a\'), &ATMIOC_SARCOM+3,\'struct atmif_sioc\');}' unless defined(&ATM_SETLOOP);
    eval 'sub ATM_QUERYLOOP () { &_IOW(ord(\'a\'), &ATMIOC_SARCOM+4,\'struct atmif_sioc\');}' unless defined(&ATM_QUERYLOOP);
    eval 'sub ATM_SETSC () { &_IOW(ord(\'a\'), &ATMIOC_SPECIAL+1,\'int\');}' unless defined(&ATM_SETSC);
    eval 'sub ATM_SETBACKEND () { &_IOW(ord(\'a\'), &ATMIOC_SPECIAL+2, &atm_backend_t);}' unless defined(&ATM_SETBACKEND);
    eval 'sub ATM_BACKEND_RAW () {0;}' unless defined(&ATM_BACKEND_RAW);
    eval 'sub ATM_BACKEND_PPP () {1;}' unless defined(&ATM_BACKEND_PPP);
    eval 'sub ATM_BACKEND_BR_2684 () {2;}' unless defined(&ATM_BACKEND_BR_2684);
    eval 'sub ATM_ITFTYP_LEN () {8;}' unless defined(&ATM_ITFTYP_LEN);
    eval 'sub __ATM_LM_NONE () {0;}' unless defined(&__ATM_LM_NONE);
    eval 'sub __ATM_LM_AAL () {1;}' unless defined(&__ATM_LM_AAL);
    eval 'sub __ATM_LM_ATM () {2;}' unless defined(&__ATM_LM_ATM);
    eval 'sub __ATM_LM_PHY () {8;}' unless defined(&__ATM_LM_PHY);
    eval 'sub __ATM_LM_ANALOG () {16;}' unless defined(&__ATM_LM_ANALOG);
    eval 'sub __ATM_LM_MKLOC {
        local($n) = @_;
	    eval q((($n)));
    }' unless defined(&__ATM_LM_MKLOC);
    eval 'sub __ATM_LM_MKRMT {
        local($n) = @_;
	    eval q((($n) << 8));
    }' unless defined(&__ATM_LM_MKRMT);
    eval 'sub __ATM_LM_XTLOC {
        local($n) = @_;
	    eval q((($n) & 0xff));
    }' unless defined(&__ATM_LM_XTLOC);
    eval 'sub __ATM_LM_XTRMT {
        local($n) = @_;
	    eval q(((($n) >> 8) & 0xff));
    }' unless defined(&__ATM_LM_XTRMT);
    eval 'sub ATM_LM_NONE () {0;}' unless defined(&ATM_LM_NONE);
    eval 'sub ATM_LM_LOC_AAL () { &__ATM_LM_MKLOC( &__ATM_LM_AAL);}' unless defined(&ATM_LM_LOC_AAL);
    eval 'sub ATM_LM_LOC_ATM () { &__ATM_LM_MKLOC( &__ATM_LM_ATM);}' unless defined(&ATM_LM_LOC_ATM);
    eval 'sub ATM_LM_LOC_PHY () { &__ATM_LM_MKLOC( &__ATM_LM_PHY);}' unless defined(&ATM_LM_LOC_PHY);
    eval 'sub ATM_LM_LOC_ANALOG () { &__ATM_LM_MKLOC( &__ATM_LM_ANALOG);}' unless defined(&ATM_LM_LOC_ANALOG);
    eval 'sub ATM_LM_RMT_AAL () { &__ATM_LM_MKRMT( &__ATM_LM_AAL);}' unless defined(&ATM_LM_RMT_AAL);
    eval 'sub ATM_LM_RMT_ATM () { &__ATM_LM_MKRMT( &__ATM_LM_ATM);}' unless defined(&ATM_LM_RMT_ATM);
    eval 'sub ATM_LM_RMT_PHY () { &__ATM_LM_MKRMT( &__ATM_LM_PHY);}' unless defined(&ATM_LM_RMT_PHY);
    eval 'sub ATM_LM_RMT_ANALOG () { &__ATM_LM_MKRMT( &__ATM_LM_ANALOG);}' unless defined(&ATM_LM_RMT_ANALOG);
    eval 'sub ATM_CI_MAX () {-1;}' unless defined(&ATM_CI_MAX);
    eval 'sub ATM_SC_RX () {1024;}' unless defined(&ATM_SC_RX);
    eval 'sub ATM_SC_TX () {2048;}' unless defined(&ATM_SC_TX);
    eval 'sub ATM_BACKLOG_DEFAULT () {32;}' unless defined(&ATM_BACKLOG_DEFAULT);
    eval 'sub ATM_MF_IMMED () {1;}' unless defined(&ATM_MF_IMMED);
    eval 'sub ATM_MF_INC_RSV () {2;}' unless defined(&ATM_MF_INC_RSV);
    eval 'sub ATM_MF_INC_SHP () {4;}' unless defined(&ATM_MF_INC_SHP);
    eval 'sub ATM_MF_DEC_RSV () {8;}' unless defined(&ATM_MF_DEC_RSV);
    eval 'sub ATM_MF_DEC_SHP () {16;}' unless defined(&ATM_MF_DEC_SHP);
    eval 'sub ATM_MF_BWD () {32;}' unless defined(&ATM_MF_BWD);
    eval 'sub ATM_MF_SET () {( &ATM_MF_INC_RSV |  &ATM_MF_INC_SHP |  &ATM_MF_DEC_RSV |  &ATM_MF_DEC_SHP |  &ATM_MF_BWD);}' unless defined(&ATM_MF_SET);
    eval 'sub ATM_VS_IDLE () {0;}' unless defined(&ATM_VS_IDLE);
    eval 'sub ATM_VS_CONNECTED () {1;}' unless defined(&ATM_VS_CONNECTED);
    eval 'sub ATM_VS_CLOSING () {2;}' unless defined(&ATM_VS_CLOSING);
    eval 'sub ATM_VS_LISTEN () {3;}' unless defined(&ATM_VS_LISTEN);
    eval 'sub ATM_VS_INUSE () {4;}' unless defined(&ATM_VS_INUSE);
    eval 'sub ATM_VS_BOUND () {5;}' unless defined(&ATM_VS_BOUND);
    eval 'sub ATM_VS2TXT_MAP () {"IDLE", "CONNECTED", "CLOSING", "LISTEN", "INUSE", "BOUND";}' unless defined(&ATM_VS2TXT_MAP);
    eval 'sub ATM_VF2TXT_MAP () {"ADDR", "READY", "PARTIAL", "REGIS", "RELEASED", "HASQOS", "LISTEN", "META", "256", "512", "1024", "2048", "SESSION", "HASSAP", "BOUND", "CLOSE";}' unless defined(&ATM_VF2TXT_MAP);
    undef(&__AAL_STAT_ITEMS) if defined(&__AAL_STAT_ITEMS);
}
1;
