DF-5763 / stub.c
/* * DF-5763 rig stubs — provide the symbols that the VERBATIM production * sys/netbt/bt_proto.c references but that live in the netbt socket/unit * files we deliberately do not link (we only exercise domain registration, * socket create + sorflush, i.e. the dom_dispose contract). * * Everything stubbed here is OUTSIDE the code under test. */ #include <sys/param.h> #include <sys/kernel.h> #include <sys/protosw.h> #include <sys/socketvar.h> #include <sys/libkern.h> #include <sys/malloc.h> #include <sys/msgport.h> #include <sys/msgport2.h> #include <net/netisr.h> #include <net/netisr2.h> #include <netbt/bluetooth.h> #include <netbt/hci.h> #include <netbt/l2cap.h> #include <netbt/rfcomm.h> #include <netbt/sco.h> /* ---- pr_usrreqs definitions (real ones live in *_socket.c) ---- */ struct pr_usrreqs hci_usrreqs; struct pr_usrreqs sco_usrreqs; struct pr_usrreqs l2cap_usrreqs; struct pr_usrreqs rfcomm_usrreqs; /* ---- ctloutput handlers (real ones live in *_socket.c) ---- */ void hci_ctloutput(union netmsg *msg) { lwkt_replymsg(&msg->ctloutput.base.lmsg, EINVAL); } void sco_ctloutput(union netmsg *msg) { lwkt_replymsg(&msg->ctloutput.base.lmsg, EINVAL); } void l2cap_ctloutput(union netmsg *msg) { lwkt_replymsg(&msg->ctloutput.base.lmsg, EINVAL); } void rfcomm_ctloutput(union netmsg *msg) { lwkt_replymsg(&msg->ctloutput.base.lmsg, EINVAL); } /* ---- btintr (real one walks hci_unit_list in bt_input.c) ---- */ void btintr(union netmsg *msg) { /* production btintr would drain unit rx queues; no units exist */ } /* ---- sysctl-exposed ints (real ones live in *_var.c) ---- */ int hci_sendspace, hci_recvspace; int hci_acl_expiry, hci_memo_expiry; int hci_eventq_max, hci_aclrxq_max, hci_scorxq_max; int l2cap_sendspace, l2cap_recvspace; int l2cap_response_timeout = 30; int l2cap_response_extended_timeout = 180; int rfcomm_sendspace, rfcomm_recvspace; int rfcomm_mtu_default; int rfcomm_ack_timeout, rfcomm_mcc_timeout; int sco_sendspace, sco_recvspace; /* ---- vm_zones (real definitions live in l2cap_misc.c / rfcomm_*.c); * netbt_init() (dom_init, production) assigns them via zinit(). ---- */ vm_zone_t l2cap_pdu_pool; vm_zone_t l2cap_req_pool; vm_zone_t rfcomm_credit_pool; |