require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_NETGRAPH_BTSOCKET_H_)) {
    eval 'sub _NETGRAPH_BTSOCKET_H_ () {1;}' unless defined(&_NETGRAPH_BTSOCKET_H_);
    eval 'sub bitstr_size {
        my($nbits) = @_;
	    eval q(((($nbits) + 7) >> 3));
    }' unless defined(&bitstr_size);
    eval 'sub bit_decl {
        my($name, $nbits) = @_;
	    eval q((($name)[ &bitstr_size($nbits)]));
    }' unless defined(&bit_decl);
    eval 'sub _bit_byte {
        my($bit) = @_;
	    eval q((($bit) >> 3));
    }' unless defined(&_bit_byte);
    eval 'sub _bit_mask {
        my($bit) = @_;
	    eval q((1<< (($bit)&0x7)));
    }' unless defined(&_bit_mask);
    eval 'sub bit_test {
        my($name, $bit) = @_;
	    eval q((($name)[ &_bit_byte($bit)] &  &_bit_mask($bit)));
    }' unless defined(&bit_test);
    eval 'sub bit_set {
        my($name, $bit) = @_;
	    eval q((($name)[ &_bit_byte($bit)] |=  &_bit_mask($bit)));
    }' unless defined(&bit_set);
    eval 'sub bit_clear {
        my($name, $bit) = @_;
	    eval q((($name)[ &_bit_byte($bit)] &= ~ &_bit_mask($bit)));
    }' unless defined(&bit_clear);
    eval 'sub BLUETOOTH_PROTO_HCI () {134;}' unless defined(&BLUETOOTH_PROTO_HCI);
    eval 'sub BLUETOOTH_PROTO_L2CAP () {135;}' unless defined(&BLUETOOTH_PROTO_L2CAP);
    eval 'sub BLUETOOTH_PROTO_RFCOMM () {136;}' unless defined(&BLUETOOTH_PROTO_RFCOMM);
    eval 'sub SOL_HCI_RAW () {0x802;}' unless defined(&SOL_HCI_RAW);
    eval 'sub SO_HCI_RAW_FILTER () {1;}' unless defined(&SO_HCI_RAW_FILTER);
    eval 'sub SO_HCI_RAW_DIRECTION () {2;}' unless defined(&SO_HCI_RAW_DIRECTION);
    eval 'sub SCM_HCI_RAW_DIRECTION () { &SO_HCI_RAW_DIRECTION;}' unless defined(&SCM_HCI_RAW_DIRECTION);
    eval 'sub SIOC_HCI_RAW_NODE_GET_STATE () { &_IOWR(ord(\'b\'),  &NGM_HCI_NODE_GET_STATE, \'struct ng_btsocket_hci_raw_node_state\');}' unless defined(&SIOC_HCI_RAW_NODE_GET_STATE);
    eval 'sub SIOC_HCI_RAW_NODE_INIT () { &_IO(ord(\'b\'),  &NGM_HCI_NODE_INIT);}' unless defined(&SIOC_HCI_RAW_NODE_INIT);
    eval 'sub SIOC_HCI_RAW_NODE_GET_DEBUG () { &_IOWR(ord(\'b\'),  &NGM_HCI_NODE_GET_DEBUG, \'struct ng_btsocket_hci_raw_node_debug\');}' unless defined(&SIOC_HCI_RAW_NODE_GET_DEBUG);
    eval 'sub SIOC_HCI_RAW_NODE_SET_DEBUG () { &_IOWR(ord(\'b\'),  &NGM_HCI_NODE_SET_DEBUG, \'struct ng_btsocket_hci_raw_node_debug\');}' unless defined(&SIOC_HCI_RAW_NODE_SET_DEBUG);
    eval 'sub SIOC_HCI_RAW_NODE_GET_BUFFER () { &_IOWR(ord(\'b\'),  &NGM_HCI_NODE_GET_BUFFER, \'struct ng_btsocket_hci_raw_node_buffer\');}' unless defined(&SIOC_HCI_RAW_NODE_GET_BUFFER);
    eval 'sub SIOC_HCI_RAW_NODE_GET_BDADDR () { &_IOWR(ord(\'b\'),  &NGM_HCI_NODE_GET_BDADDR, \'struct ng_btsocket_hci_raw_node_bdaddr\');}' unless defined(&SIOC_HCI_RAW_NODE_GET_BDADDR);
    eval 'sub SIOC_HCI_RAW_NODE_GET_FEATURES () { &_IOWR(ord(\'b\'),  &NGM_HCI_NODE_GET_FEATURES, \'struct ng_btsocket_hci_raw_node_features\');}' unless defined(&SIOC_HCI_RAW_NODE_GET_FEATURES);
    eval 'sub SIOC_HCI_RAW_NODE_GET_STAT () { &_IOWR(ord(\'b\'),  &NGM_HCI_NODE_GET_STAT, \'struct ng_btsocket_hci_raw_node_stat\');}' unless defined(&SIOC_HCI_RAW_NODE_GET_STAT);
    eval 'sub SIOC_HCI_RAW_NODE_RESET_STAT () { &_IO(ord(\'b\'),  &NGM_HCI_NODE_RESET_STAT);}' unless defined(&SIOC_HCI_RAW_NODE_RESET_STAT);
    eval 'sub SIOC_HCI_RAW_NODE_FLUSH_NEIGHBOR_CACHE () { &_IO(ord(\'b\'),  &NGM_HCI_NODE_FLUSH_NEIGHBOR_CACHE);}' unless defined(&SIOC_HCI_RAW_NODE_FLUSH_NEIGHBOR_CACHE);
    eval 'sub SIOC_HCI_RAW_NODE_GET_NEIGHBOR_CACHE () { &_IOWR(ord(\'b\'),  &NGM_HCI_NODE_GET_NEIGHBOR_CACHE, \'struct ng_btsocket_hci_raw_node_neighbor_cache\');}' unless defined(&SIOC_HCI_RAW_NODE_GET_NEIGHBOR_CACHE);
    eval 'sub SIOC_HCI_RAW_NODE_GET_CON_LIST () { &_IOWR(ord(\'b\'),  &NGM_HCI_NODE_GET_CON_LIST, \'struct ng_btsocket_hci_raw_con_list\');}' unless defined(&SIOC_HCI_RAW_NODE_GET_CON_LIST);
    eval 'sub SIOC_HCI_RAW_NODE_GET_LINK_POLICY_MASK () { &_IOWR(ord(\'b\'),  &NGM_HCI_NODE_GET_LINK_POLICY_SETTINGS_MASK, \'struct ng_btsocket_hci_raw_node_link_policy_mask\');}' unless defined(&SIOC_HCI_RAW_NODE_GET_LINK_POLICY_MASK);
    eval 'sub SIOC_HCI_RAW_NODE_SET_LINK_POLICY_MASK () { &_IOWR(ord(\'b\'),  &NGM_HCI_NODE_SET_LINK_POLICY_SETTINGS_MASK, \'struct ng_btsocket_hci_raw_node_link_policy_mask\');}' unless defined(&SIOC_HCI_RAW_NODE_SET_LINK_POLICY_MASK);
    eval 'sub SIOC_HCI_RAW_NODE_GET_PACKET_MASK () { &_IOWR(ord(\'b\'),  &NGM_HCI_NODE_GET_PACKET_MASK, \'struct ng_btsocket_hci_raw_node_packet_mask\');}' unless defined(&SIOC_HCI_RAW_NODE_GET_PACKET_MASK);
    eval 'sub SIOC_HCI_RAW_NODE_SET_PACKET_MASK () { &_IOWR(ord(\'b\'),  &NGM_HCI_NODE_SET_PACKET_MASK, \'struct ng_btsocket_hci_raw_node_packet_mask\');}' unless defined(&SIOC_HCI_RAW_NODE_SET_PACKET_MASK);
    eval 'sub SIOC_HCI_RAW_NODE_GET_ROLE_SWITCH () { &_IOWR(ord(\'b\'),  &NGM_HCI_NODE_GET_ROLE_SWITCH, \'struct ng_btsocket_hci_raw_node_role_switch\');}' unless defined(&SIOC_HCI_RAW_NODE_GET_ROLE_SWITCH);
    eval 'sub SIOC_HCI_RAW_NODE_SET_ROLE_SWITCH () { &_IOWR(ord(\'b\'),  &NGM_HCI_NODE_SET_ROLE_SWITCH, \'struct ng_btsocket_hci_raw_node_role_switch\');}' unless defined(&SIOC_HCI_RAW_NODE_SET_ROLE_SWITCH);
    eval 'sub SOL_L2CAP () {0x1609;}' unless defined(&SOL_L2CAP);
    eval 'sub SO_L2CAP_IMTU () {1;}' unless defined(&SO_L2CAP_IMTU);
    eval 'sub SO_L2CAP_OMTU () {2;}' unless defined(&SO_L2CAP_OMTU);
    eval 'sub SO_L2CAP_IFLOW () {3;}' unless defined(&SO_L2CAP_IFLOW);
    eval 'sub SO_L2CAP_OFLOW () {4;}' unless defined(&SO_L2CAP_OFLOW);
    eval 'sub SO_L2CAP_FLUSH () {5;}' unless defined(&SO_L2CAP_FLUSH);
    eval 'sub SIOC_L2CAP_L2CA_PING () { &_IOWR(ord(\'b\'),  &NGM_L2CAP_L2CA_PING, \'struct ng_btsocket_l2cap_raw_ping\');}' unless defined(&SIOC_L2CAP_L2CA_PING);
    eval 'sub SIOC_L2CAP_L2CA_GET_INFO () { &_IOWR(ord(\'b\'),  &NGM_L2CAP_L2CA_GET_INFO, \'struct ng_btsocket_l2cap_raw_get_info\');}' unless defined(&SIOC_L2CAP_L2CA_GET_INFO);
    eval 'sub SIOC_L2CAP_NODE_GET_FLAGS () { &_IOWR(ord(\'b\'),  &NGM_L2CAP_NODE_GET_FLAGS, \'struct ng_btsocket_l2cap_raw_node_flags\');}' unless defined(&SIOC_L2CAP_NODE_GET_FLAGS);
    eval 'sub SIOC_L2CAP_NODE_GET_DEBUG () { &_IOWR(ord(\'b\'),  &NGM_L2CAP_NODE_GET_DEBUG, \'struct ng_btsocket_l2cap_raw_node_debug\');}' unless defined(&SIOC_L2CAP_NODE_GET_DEBUG);
    eval 'sub SIOC_L2CAP_NODE_SET_DEBUG () { &_IOWR(ord(\'b\'),  &NGM_L2CAP_NODE_SET_DEBUG, \'struct ng_btsocket_l2cap_raw_node_debug\');}' unless defined(&SIOC_L2CAP_NODE_SET_DEBUG);
    eval 'sub SIOC_L2CAP_NODE_GET_CON_LIST () { &_IOWR(ord(\'b\'),  &NGM_L2CAP_NODE_GET_CON_LIST, \'struct ng_btsocket_l2cap_raw_con_list\');}' unless defined(&SIOC_L2CAP_NODE_GET_CON_LIST);
    eval 'sub SIOC_L2CAP_NODE_GET_CHAN_LIST () { &_IOWR(ord(\'b\'),  &NGM_L2CAP_NODE_GET_CHAN_LIST, \'struct ng_btsocket_l2cap_raw_chan_list\');}' unless defined(&SIOC_L2CAP_NODE_GET_CHAN_LIST);
    eval 'sub SIOC_L2CAP_NODE_GET_AUTO_DISCON_TIMO () { &_IOWR(ord(\'b\'),  &NGM_L2CAP_NODE_GET_AUTO_DISCON_TIMO, \'struct ng_btsocket_l2cap_raw_auto_discon_timo\');}' unless defined(&SIOC_L2CAP_NODE_GET_AUTO_DISCON_TIMO);
    eval 'sub SIOC_L2CAP_NODE_SET_AUTO_DISCON_TIMO () { &_IOWR(ord(\'b\'),  &NGM_L2CAP_NODE_SET_AUTO_DISCON_TIMO, \'struct ng_btsocket_l2cap_raw_auto_discon_timo\');}' unless defined(&SIOC_L2CAP_NODE_SET_AUTO_DISCON_TIMO);
    eval 'sub SOL_RFCOMM () {0x816;}' unless defined(&SOL_RFCOMM);
    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 NG_BTSOCKET_HCI_RAW_NODE_TYPE () {"btsock_hci_raw";}' unless defined(&NG_BTSOCKET_HCI_RAW_NODE_TYPE);
    eval 'sub NG_BTSOCKET_L2CAP_RAW_NODE_TYPE () {"btsock_l2c_raw";}' unless defined(&NG_BTSOCKET_L2CAP_RAW_NODE_TYPE);
    eval 'sub NG_BTSOCKET_L2CAP_NODE_TYPE () {"btsock_l2c";}' unless defined(&NG_BTSOCKET_L2CAP_NODE_TYPE);
    eval 'sub NG_BTSOCKET_ALERT_LEVEL () {1;}' unless defined(&NG_BTSOCKET_ALERT_LEVEL);
    eval 'sub NG_BTSOCKET_ERR_LEVEL () {2;}' unless defined(&NG_BTSOCKET_ERR_LEVEL);
    eval 'sub NG_BTSOCKET_WARN_LEVEL () {3;}' unless defined(&NG_BTSOCKET_WARN_LEVEL);
    eval 'sub NG_BTSOCKET_INFO_LEVEL () {4;}' unless defined(&NG_BTSOCKET_INFO_LEVEL);
}
1;
