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