require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_ISCSI_IOCTL_H)) {
    eval 'sub _ISCSI_IOCTL_H () {1;}' unless defined(&_ISCSI_IOCTL_H);
    require 'dev/iscsi/iscsi.ph';
    require 'sys/scsiio.ph';
    eval("sub ISCSI_SESSION_TERMINATED () { 1; }") unless defined(&ISCSI_SESSION_TERMINATED);
    eval("sub ISCSI_CONNECTION_TERMINATED () { 2; }") unless defined(&ISCSI_CONNECTION_TERMINATED);
    eval("sub ISCSI_RECOVER_CONNECTION () { 3; }") unless defined(&ISCSI_RECOVER_CONNECTION);
    eval("sub ISCSI_DRIVER_TERMINATING () { 4; }") unless defined(&ISCSI_DRIVER_TERMINATING);
    eval 'sub ISCSI_GET_VERSION () { &_IOWR("0", 1,  &iscsi_get_version_parameters_t);}' unless defined(&ISCSI_GET_VERSION);
    eval 'sub ISCSI_LOGIN () { &_IOWR("0", 2,  &iscsi_login_parameters_t);}' unless defined(&ISCSI_LOGIN);
    eval 'sub ISCSI_LOGOUT () { &_IOWR("0", 3,  &iscsi_logout_parameters_t);}' unless defined(&ISCSI_LOGOUT);
    eval 'sub ISCSI_ADD_CONNECTION () { &_IOWR("0", 4,  &iscsi_login_parameters_t);}' unless defined(&ISCSI_ADD_CONNECTION);
    eval 'sub ISCSI_RESTORE_CONNECTION () { &_IOWR("0", 5,  &iscsi_login_parameters_t);}' unless defined(&ISCSI_RESTORE_CONNECTION);
    eval 'sub ISCSI_REMOVE_CONNECTION () { &_IOWR("0", 6,  &iscsi_remove_parameters_t);}' unless defined(&ISCSI_REMOVE_CONNECTION);
    eval 'sub ISCSI_CONNECTION_STATUS () { &_IOWR("0", 7,  &iscsi_conn_status_parameters_t);}' unless defined(&ISCSI_CONNECTION_STATUS);
    eval 'sub ISCSI_SEND_TARGETS () { &_IOWR("0", 8,  &iscsi_send_targets_parameters_t);}' unless defined(&ISCSI_SEND_TARGETS);
    eval 'sub ISCSI_SET_NODE_NAME () { &_IOWR("0", 9,  &iscsi_set_node_name_parameters_t);}' unless defined(&ISCSI_SET_NODE_NAME);
    eval 'sub ISCSI_IO_COMMAND () { &_IOWR("0", 10,  &iscsi_iocommand_parameters_t);}' unless defined(&ISCSI_IO_COMMAND);
    eval 'sub ISCSI_REGISTER_EVENT () { &_IOWR("0", 11,  &iscsi_register_event_parameters_t);}' unless defined(&ISCSI_REGISTER_EVENT);
    eval 'sub ISCSI_DEREGISTER_EVENT () { &_IOWR("0", 12,  &iscsi_register_event_parameters_t);}' unless defined(&ISCSI_DEREGISTER_EVENT);
    eval 'sub ISCSI_WAIT_EVENT () { &_IOWR("0", 13,  &iscsi_wait_event_parameters_t);}' unless defined(&ISCSI_WAIT_EVENT);
    eval 'sub ISCSI_POLL_EVENT () { &_IOWR("0", 14,  &iscsi_wait_event_parameters_t);}' unless defined(&ISCSI_POLL_EVENT);
}
1;
