2008-08-06 19:01:23 +04:00
|
|
|
/* $NetBSD: tp_var.h,v 1.18 2008/08/06 15:01:23 plunky Exp $ */
|
1996-02-14 01:07:57 +03:00
|
|
|
|
1998-09-05 18:30:31 +04:00
|
|
|
/*-
|
|
|
|
* Copyright (c) 1995 The NetBSD Foundation, Inc.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This code is derived from software contributed to The NetBSD Foundation
|
|
|
|
* by Christos Zoulas.
|
1996-02-14 01:07:57 +03:00
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
1998-09-05 18:30:31 +04:00
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
|
|
|
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
|
|
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
* POSSIBILITY OF SUCH DAMAGE.
|
1996-02-14 01:07:57 +03:00
|
|
|
*/
|
|
|
|
|
2005-12-11 03:01:36 +03:00
|
|
|
#ifndef _NETISO_TP_VAR_H_
|
|
|
|
#define _NETISO_TP_VAR_H_
|
|
|
|
|
1996-02-14 01:07:57 +03:00
|
|
|
#ifdef _KERNEL
|
|
|
|
struct isopcb;
|
|
|
|
struct mbuf;
|
|
|
|
struct sockaddr_iso;
|
|
|
|
struct tp_pcb;
|
|
|
|
struct sockaddr_in;
|
|
|
|
struct iso_addr;
|
|
|
|
struct tp_conn_param;
|
|
|
|
struct tp_event;
|
|
|
|
struct inpcb;
|
|
|
|
struct route;
|
|
|
|
struct pklcd;
|
|
|
|
struct sockaddr;
|
|
|
|
struct x25_packet;
|
|
|
|
struct in_addr;
|
|
|
|
|
|
|
|
|
|
|
|
/* tp_cons.c */
|
2004-04-20 06:13:26 +04:00
|
|
|
int tpcons_output (struct mbuf *, ...);
|
1996-02-14 01:07:57 +03:00
|
|
|
|
|
|
|
/* tp_driver.c */
|
2004-04-20 06:13:26 +04:00
|
|
|
int tp_driver (struct tp_pcb *, struct tp_event *);
|
1996-02-14 01:07:57 +03:00
|
|
|
|
|
|
|
/* tp_emit.c */
|
2004-04-20 06:13:26 +04:00
|
|
|
int tp_emit (int, struct tp_pcb *, SeqNum, u_int, struct mbuf *);
|
|
|
|
int tp_error_emit (int, u_long, struct sockaddr_iso *,
|
1996-02-14 01:07:57 +03:00
|
|
|
struct sockaddr_iso *, struct mbuf *, int,
|
2007-03-04 08:59:00 +03:00
|
|
|
struct tp_pcb *, void *,
|
2004-04-20 06:13:26 +04:00
|
|
|
int (*) (struct mbuf *, ...));
|
1996-02-14 01:07:57 +03:00
|
|
|
|
|
|
|
/* tp_inet.c */
|
2007-03-04 08:59:00 +03:00
|
|
|
void in_getsufx (void *, u_short *, void *, int);
|
|
|
|
void in_putsufx (void *, void *, int, int);
|
2004-04-20 06:13:26 +04:00
|
|
|
void in_recycle_tsuffix (void *);
|
|
|
|
void in_putnetaddr (void *, struct sockaddr *, int);
|
|
|
|
int in_cmpnetaddr (void *, struct sockaddr *, int);
|
|
|
|
void in_getnetaddr (void *, struct mbuf *, int);
|
|
|
|
int tpip_mtu (void *);
|
|
|
|
int tpip_output (struct mbuf *, ...);
|
|
|
|
int tpip_output_dg (struct mbuf *, ...);
|
|
|
|
void tpip_input (struct mbuf *, ...);
|
|
|
|
void tpin_quench (struct inpcb *, int);
|
KNF: de-__P, bzero -> memset, bcmp -> memcmp. Remove extraneous
parentheses in return statements.
Cosmetic: don't open-code TAILQ_FOREACH().
Cosmetic: change types of variables to avoid oodles of casts: in
in6_src.c, avoid casts by changing several route_in6 pointers
to struct route pointers. Remove unnecessary casts to caddr_t
elsewhere.
Pave the way for eliminating address family-specific route caches:
soon, struct route will not embed a sockaddr, but it will hold
a reference to an external sockaddr, instead. We will set the
destination sockaddr using rtcache_setdst(). (I created a stub
for it, but it isn't used anywhere, yet.) rtcache_free() will
free the sockaddr. I have extracted from rtcache_free() a helper
subroutine, rtcache_clear(). rtcache_clear() will "forget" a
cached route, but it will not forget the destination by releasing
the sockaddr. I use rtcache_clear() instead of rtcache_free()
in rtcache_update(), because rtcache_update() is not supposed
to forget the destination.
Constify:
1 Introduce const accessor for route->ro_dst, rtcache_getdst().
2 Constify the 'dst' argument to ifnet->if_output(). This
led me to constify a lot of code called by output routines.
3 Constify the sockaddr argument to protosw->pr_ctlinput. This
led me to constify a lot of code called by ctlinput routines.
4 Introduce const macros for converting from a generic sockaddr
to family-specific sockaddrs, e.g., sockaddr_in: satocsin6,
satocsin, et cetera.
2007-02-18 01:34:07 +03:00
|
|
|
void *tpip_ctlinput(int, const struct sockaddr *, void *);
|
2004-04-20 06:13:26 +04:00
|
|
|
void tpin_abort (struct inpcb *, int);
|
|
|
|
void dump_inaddr (struct sockaddr_in *);
|
1996-02-14 01:07:57 +03:00
|
|
|
|
|
|
|
/* tp_input.c */
|
2004-04-20 06:13:26 +04:00
|
|
|
struct mbuf *tp_inputprep (struct mbuf *);
|
|
|
|
void tp_input (struct mbuf *, ...);
|
|
|
|
int tp_headersize (int, struct tp_pcb *);
|
1996-02-14 01:07:57 +03:00
|
|
|
|
|
|
|
/* tp_iso.c */
|
2007-03-04 08:59:00 +03:00
|
|
|
void iso_getsufx (void *, u_short *, void *, int);
|
|
|
|
void iso_putsufx (void *, void *, int, int);
|
2004-04-20 06:13:26 +04:00
|
|
|
void iso_recycle_tsuffix (void *);
|
|
|
|
void iso_putnetaddr (void *, struct sockaddr *, int);
|
|
|
|
int iso_cmpnetaddr (void *, struct sockaddr *, int);
|
|
|
|
void iso_getnetaddr (void *, struct mbuf *, int);
|
|
|
|
int tpclnp_mtu (void *);
|
|
|
|
int tpclnp_output (struct mbuf *, ...);
|
|
|
|
int tpclnp_output_dg (struct mbuf *, ...);
|
|
|
|
void tpclnp_input (struct mbuf *, ...);
|
|
|
|
void iso_rtchange (struct isopcb *);
|
|
|
|
void tpiso_decbit (struct isopcb *);
|
|
|
|
void tpiso_quench (struct isopcb *);
|
KNF: de-__P, bzero -> memset, bcmp -> memcmp. Remove extraneous
parentheses in return statements.
Cosmetic: don't open-code TAILQ_FOREACH().
Cosmetic: change types of variables to avoid oodles of casts: in
in6_src.c, avoid casts by changing several route_in6 pointers
to struct route pointers. Remove unnecessary casts to caddr_t
elsewhere.
Pave the way for eliminating address family-specific route caches:
soon, struct route will not embed a sockaddr, but it will hold
a reference to an external sockaddr, instead. We will set the
destination sockaddr using rtcache_setdst(). (I created a stub
for it, but it isn't used anywhere, yet.) rtcache_free() will
free the sockaddr. I have extracted from rtcache_free() a helper
subroutine, rtcache_clear(). rtcache_clear() will "forget" a
cached route, but it will not forget the destination by releasing
the sockaddr. I use rtcache_clear() instead of rtcache_free()
in rtcache_update(), because rtcache_update() is not supposed
to forget the destination.
Constify:
1 Introduce const accessor for route->ro_dst, rtcache_getdst().
2 Constify the 'dst' argument to ifnet->if_output(). This
led me to constify a lot of code called by output routines.
3 Constify the sockaddr argument to protosw->pr_ctlinput. This
led me to constify a lot of code called by ctlinput routines.
4 Introduce const macros for converting from a generic sockaddr
to family-specific sockaddrs, e.g., sockaddr_in: satocsin6,
satocsin, et cetera.
2007-02-18 01:34:07 +03:00
|
|
|
void *tpclnp_ctlinput(int, const struct sockaddr *, void *);
|
2004-04-20 06:13:26 +04:00
|
|
|
void tpclnp_ctlinput1 (int, struct iso_addr *);
|
|
|
|
void tpiso_abort (struct isopcb *);
|
|
|
|
void tpiso_reset (struct isopcb *);
|
1996-02-14 01:07:57 +03:00
|
|
|
|
|
|
|
/* tp_meas.c */
|
2004-04-20 06:13:26 +04:00
|
|
|
void Tpmeas (u_int, u_int, struct timeval *, u_int, u_int, u_int);
|
1996-02-14 01:07:57 +03:00
|
|
|
|
|
|
|
/* tp_output.c */
|
2004-04-20 06:13:26 +04:00
|
|
|
int tp_consistency (struct tp_pcb *, u_int, struct tp_conn_param *);
|
2008-08-06 19:01:23 +04:00
|
|
|
int tp_ctloutput (int, struct socket *, struct sockopt *);
|
1996-02-14 01:07:57 +03:00
|
|
|
|
|
|
|
/* tp_pcb.c */
|
2004-04-20 06:13:26 +04:00
|
|
|
void tp_init (void);
|
|
|
|
void tp_soisdisconnecting (struct socket *);
|
|
|
|
void tp_soisdisconnected (struct tp_pcb *);
|
|
|
|
void tp_freeref (RefNum);
|
|
|
|
u_long tp_getref (struct tp_pcb *);
|
|
|
|
int tp_set_npcb (struct tp_pcb *);
|
|
|
|
int tp_attach (struct socket *, int);
|
|
|
|
void tp_detach (struct tp_pcb *);
|
KNF: de-__P, bzero -> memset, bcmp -> memcmp. Remove extraneous
parentheses in return statements.
Cosmetic: don't open-code TAILQ_FOREACH().
Cosmetic: change types of variables to avoid oodles of casts: in
in6_src.c, avoid casts by changing several route_in6 pointers
to struct route pointers. Remove unnecessary casts to caddr_t
elsewhere.
Pave the way for eliminating address family-specific route caches:
soon, struct route will not embed a sockaddr, but it will hold
a reference to an external sockaddr, instead. We will set the
destination sockaddr using rtcache_setdst(). (I created a stub
for it, but it isn't used anywhere, yet.) rtcache_free() will
free the sockaddr. I have extracted from rtcache_free() a helper
subroutine, rtcache_clear(). rtcache_clear() will "forget" a
cached route, but it will not forget the destination by releasing
the sockaddr. I use rtcache_clear() instead of rtcache_free()
in rtcache_update(), because rtcache_update() is not supposed
to forget the destination.
Constify:
1 Introduce const accessor for route->ro_dst, rtcache_getdst().
2 Constify the 'dst' argument to ifnet->if_output(). This
led me to constify a lot of code called by output routines.
3 Constify the sockaddr argument to protosw->pr_ctlinput. This
led me to constify a lot of code called by ctlinput routines.
4 Introduce const macros for converting from a generic sockaddr
to family-specific sockaddrs, e.g., sockaddr_in: satocsin6,
satocsin, et cetera.
2007-02-18 01:34:07 +03:00
|
|
|
int tp_tselinuse(int, const char *, struct sockaddr_iso *, int);
|
2006-07-24 02:06:03 +04:00
|
|
|
int tp_pcbbind (void *, struct mbuf *, struct lwp *);
|
1996-02-14 01:07:57 +03:00
|
|
|
|
|
|
|
/* tp_subr.c */
|
2004-04-20 06:13:26 +04:00
|
|
|
int tp_goodXack (struct tp_pcb *, SeqNum);
|
|
|
|
void tp_rtt_rtv (struct tp_pcb *);
|
|
|
|
int tp_goodack (struct tp_pcb *, u_int, SeqNum, u_int);
|
|
|
|
int tp_sbdrop (struct tp_pcb *, SeqNum);
|
|
|
|
void tp_send (struct tp_pcb *);
|
|
|
|
int tp_packetize (struct tp_pcb *, struct mbuf *, int);
|
|
|
|
int tp_stash (struct tp_pcb *, struct tp_event *);
|
|
|
|
void tp_rsyflush (struct tp_pcb *);
|
|
|
|
void tp_rsyset (struct tp_pcb *);
|
|
|
|
void tpsbcheck (struct tp_pcb *, int);
|
1996-02-14 01:07:57 +03:00
|
|
|
|
|
|
|
/* tp_subr2.c */
|
2004-04-20 06:13:26 +04:00
|
|
|
void tp_local_credit (struct tp_pcb *);
|
|
|
|
int tp_protocol_error (struct tp_event *, struct tp_pcb *);
|
|
|
|
void tp_drain (void);
|
|
|
|
void tp_indicate (int, struct tp_pcb *, u_int);
|
|
|
|
void tp_getoptions (struct tp_pcb *);
|
|
|
|
void tp_recycle_tsuffix (void *);
|
|
|
|
void tp_quench (struct inpcb *, int);
|
|
|
|
void tp_netcmd (struct tp_pcb *, int);
|
|
|
|
int tp_mask_to_num (u_char);
|
|
|
|
void tp_mss (struct tp_pcb *, int);
|
2007-03-04 08:59:00 +03:00
|
|
|
int tp_route_to (struct mbuf *, struct tp_pcb *, void *);
|
2004-04-20 06:13:26 +04:00
|
|
|
void tp0_stash (struct tp_pcb *, struct tp_event *);
|
|
|
|
void tp0_openflow (struct tp_pcb *);
|
|
|
|
int tp_setup_perf (struct tp_pcb *);
|
|
|
|
void dump_addr (struct sockaddr *);
|
1996-02-14 01:07:57 +03:00
|
|
|
|
|
|
|
/* tp_timer.c */
|
2004-04-20 06:13:26 +04:00
|
|
|
void tp_timerinit (void);
|
|
|
|
void tp_etimeout (struct tp_pcb *, int, int);
|
|
|
|
void tp_euntimeout (struct tp_pcb *, int);
|
|
|
|
void tp_slowtimo (void);
|
|
|
|
void tp_data_retrans (struct tp_pcb *);
|
|
|
|
void tp_fasttimo (void);
|
|
|
|
void tp_ctimeout (struct tp_pcb *, int, int);
|
|
|
|
void tp_ctimeout_MIN (struct tp_pcb *, int, int);
|
|
|
|
void tp_cuntimeout (struct tp_pcb *, int);
|
1996-02-14 01:07:57 +03:00
|
|
|
|
|
|
|
/* tp_trace.c */
|
2004-04-20 06:13:26 +04:00
|
|
|
void tpTrace (struct tp_pcb *, u_int, u_int, u_int, u_int, u_int, u_int);
|
1996-02-14 01:07:57 +03:00
|
|
|
|
|
|
|
/* tp_usrreq.c */
|
2005-05-30 01:27:45 +04:00
|
|
|
void dump_mbuf (struct mbuf *, const char *);
|
2004-04-20 06:13:26 +04:00
|
|
|
int tp_rcvoob (struct tp_pcb *, struct socket *, struct mbuf *,
|
|
|
|
int *, int);
|
|
|
|
int tp_sendoob (struct tp_pcb *, struct socket *, struct mbuf *, int *);
|
|
|
|
int tp_usrreq (struct socket *, int, struct mbuf *, struct mbuf *,
|
2005-12-11 15:16:03 +03:00
|
|
|
struct mbuf *, struct lwp *);
|
2004-04-20 06:13:26 +04:00
|
|
|
void tp_ltrace (struct socket *, struct uio *);
|
|
|
|
int tp_confirm (struct tp_pcb *);
|
|
|
|
int tp_snd_control (struct mbuf *, struct socket *, struct mbuf **);
|
1996-02-14 01:07:57 +03:00
|
|
|
|
|
|
|
#endif
|
2005-12-11 03:01:36 +03:00
|
|
|
|
|
|
|
#endif /* !_NETISO_TP_VAR_H_ */
|