Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
[dragonfly.git] / sys / netbt / sco.h
blobc6d734386c719534cd18e47ff9323033d38cff91
1 /* $DragonFly: src/sys/netbt/sco.h,v 1.2 2008/03/18 13:41:42 hasso Exp $ */
2 /* $OpenBSD: sco.h,v 1.2 2007/06/01 02:46:12 uwe Exp $ */
3 /* $NetBSD: sco.h,v 1.2 2006/07/26 10:20:56 tron Exp $ */
5 /*-
6 * Copyright (c) 2006 Itronix Inc.
7 * All rights reserved.
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. The name of Itronix Inc. may not be used to endorse
18 * or promote products derived from this software without specific
19 * prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY ITRONIX INC. ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ITRONIX INC. BE LIABLE FOR ANY
25 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
28 * ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGE.
34 #ifndef _NETBT_SCO_H_
35 #define _NETBT_SCO_H_
37 #define SO_SCO_MTU 1
38 #define SO_SCO_HANDLE 2
40 #ifdef _KERNEL
42 * SCO protocol control block
44 struct sco_pcb {
45 struct hci_link *sp_link; /* SCO link */
46 unsigned int sp_flags; /* flags */
47 bdaddr_t sp_laddr; /* local address */
48 bdaddr_t sp_raddr; /* remote address */
49 unsigned int sp_mtu; /* link MTU */
50 int sp_pending; /* number of packets pending */
52 const struct btproto *sp_proto; /* upper layer protocol */
53 void *sp_upper; /* upper layer argument */
55 LIST_ENTRY(sco_pcb) sp_next;
58 LIST_HEAD(sco_pcb_list, sco_pcb);
59 extern struct sco_pcb_list sco_pcb;
61 /* sp_flags */
62 #define SP_LISTENING (1<<0) /* is listening pcb */
64 /* sco_socket.c */
65 struct socket;
66 extern struct pr_usrreqs sco_usrreqs;
67 extern int sco_sendspace;
68 extern int sco_recvspace;
69 int sco_usrreq(struct socket *, int, struct mbuf *,
70 struct mbuf *, struct mbuf *);
71 int sco_ctloutput(struct socket *so, struct sockopt *sopt);
73 /* sco_upper.c */
74 int sco_attach(struct sco_pcb **, const struct btproto *, void *);
75 int sco_bind(struct sco_pcb *, struct sockaddr_bt *);
76 int sco_sockaddr(struct sco_pcb *, struct sockaddr_bt *);
77 int sco_connect(struct sco_pcb *, struct sockaddr_bt *);
78 int sco_peeraddr(struct sco_pcb *, struct sockaddr_bt *);
79 int sco_disconnect(struct sco_pcb *, int);
80 int sco_detach(struct sco_pcb **);
81 int sco_listen(struct sco_pcb *);
82 int sco_send(struct sco_pcb *, struct mbuf *);
83 int sco_setopt(struct sco_pcb *, int, void *);
84 int sco_getopt(struct sco_pcb *, int, void *);
86 #endif /* _KERNEL */
88 #endif /* _NETBT_SCO_H_ */