require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_NETBT_RFCOMM_H_)) {
    eval 'sub _NETBT_RFCOMM_H_ () {1;}' unless defined(&_NETBT_RFCOMM_H_);
    require 'sys/types.ph';
    eval 'sub RFCOMM_MTU_MAX () {32767;}' unless defined(&RFCOMM_MTU_MAX);
    eval 'sub RFCOMM_MTU_MIN () {23;}' unless defined(&RFCOMM_MTU_MIN);
    eval 'sub RFCOMM_MTU_DEFAULT () {127;}' unless defined(&RFCOMM_MTU_DEFAULT);
    eval 'sub RFCOMM_CREDITS_MAX () {255;}' unless defined(&RFCOMM_CREDITS_MAX);
    eval 'sub RFCOMM_CREDITS_DEFAULT () {7;}' unless defined(&RFCOMM_CREDITS_DEFAULT);
    eval 'sub RFCOMM_CHANNEL_ANY () {0;}' unless defined(&RFCOMM_CHANNEL_ANY);
    eval 'sub RFCOMM_CHANNEL_MIN () {1;}' unless defined(&RFCOMM_CHANNEL_MIN);
    eval 'sub RFCOMM_CHANNEL_MAX () {30;}' unless defined(&RFCOMM_CHANNEL_MAX);
    eval 'sub RFCOMM_FRAME_SABM () {0x2f;}' unless defined(&RFCOMM_FRAME_SABM);
    eval 'sub RFCOMM_FRAME_DISC () {0x43;}' unless defined(&RFCOMM_FRAME_DISC);
    eval 'sub RFCOMM_FRAME_UA () {0x63;}' unless defined(&RFCOMM_FRAME_UA);
    eval 'sub RFCOMM_FRAME_DM () {0xf;}' unless defined(&RFCOMM_FRAME_DM);
    eval 'sub RFCOMM_FRAME_UIH () {0xef;}' unless defined(&RFCOMM_FRAME_UIH);
    eval 'sub RFCOMM_MCC_TEST () {0x8;}' unless defined(&RFCOMM_MCC_TEST);
    eval 'sub RFCOMM_MCC_FCON () {0x28;}' unless defined(&RFCOMM_MCC_FCON);
    eval 'sub RFCOMM_MCC_FCOFF () {0x18;}' unless defined(&RFCOMM_MCC_FCOFF);
    eval 'sub RFCOMM_MCC_MSC () {0x38;}' unless defined(&RFCOMM_MCC_MSC);
    eval 'sub RFCOMM_MCC_RPN () {0x24;}' unless defined(&RFCOMM_MCC_RPN);
    eval 'sub RFCOMM_MCC_RLS () {0x14;}' unless defined(&RFCOMM_MCC_RLS);
    eval 'sub RFCOMM_MCC_PN () {0x20;}' unless defined(&RFCOMM_MCC_PN);
    eval 'sub RFCOMM_MCC_NSC () {0x4;}' unless defined(&RFCOMM_MCC_NSC);
    eval 'sub RFCOMM_MSC_FC () {0x2;}' unless defined(&RFCOMM_MSC_FC);
    eval 'sub RFCOMM_MSC_RTC () {0x4;}' unless defined(&RFCOMM_MSC_RTC);
    eval 'sub RFCOMM_MSC_RTR () {0x8;}' unless defined(&RFCOMM_MSC_RTR);
    eval 'sub RFCOMM_MSC_IC () {0x40;}' unless defined(&RFCOMM_MSC_IC);
    eval 'sub RFCOMM_MSC_DV () {0x80;}' unless defined(&RFCOMM_MSC_DV);
    eval 'sub RFCOMM_RPN_BR_2400 () {0x;}' unless defined(&RFCOMM_RPN_BR_2400);
    eval 'sub RFCOMM_RPN_BR_4800 () {0x1;}' unless defined(&RFCOMM_RPN_BR_4800);
    eval 'sub RFCOMM_RPN_BR_7200 () {0x2;}' unless defined(&RFCOMM_RPN_BR_7200);
    eval 'sub RFCOMM_RPN_BR_9600 () {0x3;}' unless defined(&RFCOMM_RPN_BR_9600);
    eval 'sub RFCOMM_RPN_BR_19200 () {0x4;}' unless defined(&RFCOMM_RPN_BR_19200);
    eval 'sub RFCOMM_RPN_BR_38400 () {0x5;}' unless defined(&RFCOMM_RPN_BR_38400);
    eval 'sub RFCOMM_RPN_BR_57600 () {0x6;}' unless defined(&RFCOMM_RPN_BR_57600);
    eval 'sub RFCOMM_RPN_BR_115200 () {0x7;}' unless defined(&RFCOMM_RPN_BR_115200);
    eval 'sub RFCOMM_RPN_BR_230400 () {0x8;}' unless defined(&RFCOMM_RPN_BR_230400);
    eval 'sub RFCOMM_RPN_DATA_5 () {0x;}' unless defined(&RFCOMM_RPN_DATA_5);
    eval 'sub RFCOMM_RPN_DATA_6 () {0x1;}' unless defined(&RFCOMM_RPN_DATA_6);
    eval 'sub RFCOMM_RPN_DATA_7 () {0x2;}' unless defined(&RFCOMM_RPN_DATA_7);
    eval 'sub RFCOMM_RPN_DATA_8 () {0x3;}' unless defined(&RFCOMM_RPN_DATA_8);
    eval 'sub RFCOMM_RPN_STOP_1 () {0;}' unless defined(&RFCOMM_RPN_STOP_1);
    eval 'sub RFCOMM_RPN_STOP_15 () {1;}' unless defined(&RFCOMM_RPN_STOP_15);
    eval 'sub RFCOMM_RPN_PARITY_NONE () {0x;}' unless defined(&RFCOMM_RPN_PARITY_NONE);
    eval 'sub RFCOMM_RPN_PARITY_ODD () {0x;}' unless defined(&RFCOMM_RPN_PARITY_ODD);
    eval 'sub RFCOMM_RPN_PARITY_EVEN () {0x1;}' unless defined(&RFCOMM_RPN_PARITY_EVEN);
    eval 'sub RFCOMM_RPN_PARITY_MARK () {0x2;}' unless defined(&RFCOMM_RPN_PARITY_MARK);
    eval 'sub RFCOMM_RPN_PARITY_SPACE () {0x3;}' unless defined(&RFCOMM_RPN_PARITY_SPACE);
    eval 'sub RFCOMM_RPN_8_N_1 () {0x3;}' unless defined(&RFCOMM_RPN_8_N_1);
    eval 'sub RFCOMM_RPN_XON_CHAR () {0x11;}' unless defined(&RFCOMM_RPN_XON_CHAR);
    eval 'sub RFCOMM_RPN_XOFF_CHAR () {0x13;}' unless defined(&RFCOMM_RPN_XOFF_CHAR);
    eval 'sub RFCOMM_RPN_FLOW_NONE () {0x;}' unless defined(&RFCOMM_RPN_FLOW_NONE);
    eval 'sub RFCOMM_RPN_PM_RATE () {0x1;}' unless defined(&RFCOMM_RPN_PM_RATE);
    eval 'sub RFCOMM_RPN_PM_DATA () {0x2;}' unless defined(&RFCOMM_RPN_PM_DATA);
    eval 'sub RFCOMM_RPN_PM_STOP () {0x4;}' unless defined(&RFCOMM_RPN_PM_STOP);
    eval 'sub RFCOMM_RPN_PM_PARITY () {0x8;}' unless defined(&RFCOMM_RPN_PM_PARITY);
    eval 'sub RFCOMM_RPN_PM_PTYPE () {0x10;}' unless defined(&RFCOMM_RPN_PM_PTYPE);
    eval 'sub RFCOMM_RPN_PM_XON () {0x20;}' unless defined(&RFCOMM_RPN_PM_XON);
    eval 'sub RFCOMM_RPN_PM_XOFF () {0x40;}' unless defined(&RFCOMM_RPN_PM_XOFF);
    eval 'sub RFCOMM_RPN_PM_FLOW () {0x3f00;}' unless defined(&RFCOMM_RPN_PM_FLOW);
    eval 'sub RFCOMM_RPN_PM_ALL () {0x3f7f;}' unless defined(&RFCOMM_RPN_PM_ALL);
    eval 'sub RFCOMM_DLCI {
        my($b) = @_;
	    eval q(((($b) & 0xfc) >> 2));
    }' unless defined(&RFCOMM_DLCI);
    eval 'sub RFCOMM_TYPE {
        my($b) = @_;
	    eval q(((($b) & 0xef)));
    }' unless defined(&RFCOMM_TYPE);
    eval 'sub RFCOMM_EA {
        my($b) = @_;
	    eval q(((($b) & 0x1)));
    }' unless defined(&RFCOMM_EA);
    eval 'sub RFCOMM_CR {
        my($b) = @_;
	    eval q(((($b) & 0x2) >> 1));
    }' unless defined(&RFCOMM_CR);
    eval 'sub RFCOMM_PF {
        my($b) = @_;
	    eval q(((($b) & 0x10) >> 4));
    }' unless defined(&RFCOMM_PF);
    eval 'sub RFCOMM_CHANNEL {
        my($dlci) = @_;
	    eval q(((($dlci) >> 1) & 0x2f));
    }' unless defined(&RFCOMM_CHANNEL);
    eval 'sub RFCOMM_DIRECTION {
        my($dlci) = @_;
	    eval q((($dlci) & 0x1));
    }' unless defined(&RFCOMM_DIRECTION);
    eval 'sub RFCOMM_MKADDRESS {
        my($cr, $dlci) = @_;
	    eval q((((($dlci) & 0x3f) << 2) | (($cr) << 1) | 0x1));
    }' unless defined(&RFCOMM_MKADDRESS);
    eval 'sub RFCOMM_MKCONTROL {
        my($type, $pf) = @_;
	    eval q((((($type) & 0xef) | (($pf) << 4))));
    }' unless defined(&RFCOMM_MKCONTROL);
    eval 'sub RFCOMM_MKDLCI {
        my($dir, $channel) = @_;
	    eval q((((($channel) & 0x1f) << 1) | ($dir)));
    }' unless defined(&RFCOMM_MKDLCI);
    eval 'sub RFCOMM_MCC_TYPE {
        my($b) = @_;
	    eval q(((($b) & 0xfc) >> 2));
    }' unless defined(&RFCOMM_MCC_TYPE);
    eval 'sub RFCOMM_MCC_LENGTH {
        my($b) = @_;
	    eval q(((($b) & 0xfe) >> 1));
    }' unless defined(&RFCOMM_MCC_LENGTH);
    eval 'sub RFCOMM_MKMCC_TYPE {
        my($cr, $type) = @_;
	    eval q((((($type) << 2) | (($cr) << 1) | 0x1)));
    }' unless defined(&RFCOMM_MKMCC_TYPE);
    eval 'sub RFCOMM_RPN_DATA_BITS {
        my($line) = @_;
	    eval q((($line) & 0x3));
    }' unless defined(&RFCOMM_RPN_DATA_BITS);
    eval 'sub RFCOMM_RPN_STOP_BITS {
        my($line) = @_;
	    eval q(((($line) >> 2) & 0x1));
    }' unless defined(&RFCOMM_RPN_STOP_BITS);
    eval 'sub RFCOMM_RPN_PARITY {
        my($line) = @_;
	    eval q(((($line) >> 3) & 0x1));
    }' unless defined(&RFCOMM_RPN_PARITY);
    eval 'sub SO_RFCOMM_MTU () {1;}' unless defined(&SO_RFCOMM_MTU);
    eval 'sub SO_RFCOMM_FC_INFO () {2;}' unless defined(&SO_RFCOMM_FC_INFO);
    eval 'sub SO_RFCOMM_LM () {3;}' unless defined(&SO_RFCOMM_LM);
    eval 'sub RFCOMM_LM_AUTH () {(1<<0);}' unless defined(&RFCOMM_LM_AUTH);
    eval 'sub RFCOMM_LM_ENCRYPT () {(1<<1);}' unless defined(&RFCOMM_LM_ENCRYPT);
    eval 'sub RFCOMM_LM_SECURE () {(1<<2);}' unless defined(&RFCOMM_LM_SECURE);
    if(defined(&_KERNEL)) {
	eval 'sub RFCOMM_SESSION_CLOSED () {0;}' unless defined(&RFCOMM_SESSION_CLOSED);
	eval 'sub RFCOMM_SESSION_WAIT_CONNECT () {1;}' unless defined(&RFCOMM_SESSION_WAIT_CONNECT);
	eval 'sub RFCOMM_SESSION_OPEN () {2;}' unless defined(&RFCOMM_SESSION_OPEN);
	eval 'sub RFCOMM_SESSION_WAIT_DISCONNECT () {3;}' unless defined(&RFCOMM_SESSION_WAIT_DISCONNECT);
	eval 'sub RFCOMM_SESSION_LISTEN () {4;}' unless defined(&RFCOMM_SESSION_LISTEN);
	eval 'sub RFCOMM_SESSION_INITIATOR () {(1<< 0);}' unless defined(&RFCOMM_SESSION_INITIATOR);
	eval 'sub RFCOMM_SESSION_CFC () {(1<< 1);}' unless defined(&RFCOMM_SESSION_CFC);
	eval 'sub RFCOMM_SESSION_LFC () {(1<< 2);}' unless defined(&RFCOMM_SESSION_LFC);
	eval 'sub RFCOMM_SESSION_RFC () {(1<< 3);}' unless defined(&RFCOMM_SESSION_RFC);
	eval 'sub RFCOMM_SESSION_FREE () {(1<< 4);}' unless defined(&RFCOMM_SESSION_FREE);
	eval 'sub IS_INITIATOR {
	    my($rs) = @_;
    	    eval q((($rs)-> &rs_flags &  &RFCOMM_SESSION_INITIATOR));
	}' unless defined(&IS_INITIATOR);
	eval 'sub RFCOMM_DLC_DETACH () {(1<< 0);}' unless defined(&RFCOMM_DLC_DETACH);
	eval 'sub RFCOMM_DLC_SHUTDOWN () {(1<< 1);}' unless defined(&RFCOMM_DLC_SHUTDOWN);
	eval 'sub RFCOMM_DLC_CLOSED () {0;}' unless defined(&RFCOMM_DLC_CLOSED);
	eval 'sub RFCOMM_DLC_WAIT_SESSION () {1;}' unless defined(&RFCOMM_DLC_WAIT_SESSION);
	eval 'sub RFCOMM_DLC_WAIT_CONNECT () {2;}' unless defined(&RFCOMM_DLC_WAIT_CONNECT);
	eval 'sub RFCOMM_DLC_WAIT_SEND_SABM () {3;}' unless defined(&RFCOMM_DLC_WAIT_SEND_SABM);
	eval 'sub RFCOMM_DLC_WAIT_SEND_UA () {4;}' unless defined(&RFCOMM_DLC_WAIT_SEND_UA);
	eval 'sub RFCOMM_DLC_WAIT_RECV_UA () {5;}' unless defined(&RFCOMM_DLC_WAIT_RECV_UA);
	eval 'sub RFCOMM_DLC_OPEN () {6;}' unless defined(&RFCOMM_DLC_OPEN);
	eval 'sub RFCOMM_DLC_WAIT_DISCONNECT () {7;}' unless defined(&RFCOMM_DLC_WAIT_DISCONNECT);
	eval 'sub RFCOMM_DLC_LISTEN () {8;}' unless defined(&RFCOMM_DLC_LISTEN);
    }
}
1;
