xref: /freebsd/sys/netinet/in_pcb_var.h (revision a057769205c3a14e14d4e2a4a3635f6db78c4098)
10f617ae4SGleb Smirnoff /*-
20f617ae4SGleb Smirnoff  * SPDX-License-Identifier: BSD-3-Clause
30f617ae4SGleb Smirnoff  *
40f617ae4SGleb Smirnoff  * Copyright (c) 1982, 1986, 1990, 1993
50f617ae4SGleb Smirnoff  *	The Regents of the University of California.
60f617ae4SGleb Smirnoff  * Copyright (c) 2010-2011 Juniper Networks, Inc.
70f617ae4SGleb Smirnoff  * All rights reserved.
80f617ae4SGleb Smirnoff  *
90f617ae4SGleb Smirnoff  * Portions of this software were developed by Robert N. M. Watson under
100f617ae4SGleb Smirnoff  * contract to Juniper Networks, Inc.
110f617ae4SGleb Smirnoff  *
120f617ae4SGleb Smirnoff  * Redistribution and use in source and binary forms, with or without
130f617ae4SGleb Smirnoff  * modification, are permitted provided that the following conditions
140f617ae4SGleb Smirnoff  * are met:
150f617ae4SGleb Smirnoff  * 1. Redistributions of source code must retain the above copyright
160f617ae4SGleb Smirnoff  *    notice, this list of conditions and the following disclaimer.
170f617ae4SGleb Smirnoff  * 2. Redistributions in binary form must reproduce the above copyright
180f617ae4SGleb Smirnoff  *    notice, this list of conditions and the following disclaimer in the
190f617ae4SGleb Smirnoff  *    documentation and/or other materials provided with the distribution.
200f617ae4SGleb Smirnoff  * 3. Neither the name of the University nor the names of its contributors
210f617ae4SGleb Smirnoff  *    may be used to endorse or promote products derived from this software
220f617ae4SGleb Smirnoff  *    without specific prior written permission.
230f617ae4SGleb Smirnoff  *
240f617ae4SGleb Smirnoff  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
250f617ae4SGleb Smirnoff  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
260f617ae4SGleb Smirnoff  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
270f617ae4SGleb Smirnoff  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
280f617ae4SGleb Smirnoff  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
290f617ae4SGleb Smirnoff  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
300f617ae4SGleb Smirnoff  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
310f617ae4SGleb Smirnoff  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
320f617ae4SGleb Smirnoff  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
330f617ae4SGleb Smirnoff  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
340f617ae4SGleb Smirnoff  * SUCH DAMAGE.
350f617ae4SGleb Smirnoff  *
360f617ae4SGleb Smirnoff  *	@(#)in_pcb.h	8.1 (Berkeley) 6/10/93
370f617ae4SGleb Smirnoff  * $FreeBSD$
380f617ae4SGleb Smirnoff  */
390f617ae4SGleb Smirnoff 
400f617ae4SGleb Smirnoff #ifndef _NETINET_IN_PCB_VAR_H_
410f617ae4SGleb Smirnoff #define _NETINET_IN_PCB_VAR_H_
420f617ae4SGleb Smirnoff 
430f617ae4SGleb Smirnoff /*
440f617ae4SGleb Smirnoff  * Definitions shared between netinet/in_pcb.c and netinet6/in6_pcb.c
450f617ae4SGleb Smirnoff  */
460f617ae4SGleb Smirnoff 
47*a0577692SGleb Smirnoff VNET_DECLARE(uint32_t, in_pcbhashseed);
48*a0577692SGleb Smirnoff #define	V_in_pcbhashseed	VNET(in_pcbhashseed)
49*a0577692SGleb Smirnoff 
50db0ac6deSCy Schubert bool	inp_smr_lock(struct inpcb *, const inp_lookup_t);
510f617ae4SGleb Smirnoff int	in_pcb_lport(struct inpcb *, struct in_addr *, u_short *,
520f617ae4SGleb Smirnoff 	    struct ucred *, int);
530f617ae4SGleb Smirnoff int	in_pcb_lport_dest(struct inpcb *inp, struct sockaddr *lsa,
540f617ae4SGleb Smirnoff             u_short *lportp, struct sockaddr *fsa, u_short fport,
550f617ae4SGleb Smirnoff             struct ucred *cred, int lookupflags);
560f617ae4SGleb Smirnoff struct inpcb *	in_pcblookup_local(struct inpcbinfo *, struct in_addr, u_short,
570f617ae4SGleb Smirnoff 	    int, struct ucred *);
580f617ae4SGleb Smirnoff 
59db0ac6deSCy Schubert struct inpcbport {
60db0ac6deSCy Schubert 	struct inpcbhead phd_pcblist;
61db0ac6deSCy Schubert 	CK_LIST_ENTRY(inpcbport) phd_hash;
62db0ac6deSCy Schubert 	u_short phd_port;
63db0ac6deSCy Schubert };
64db0ac6deSCy Schubert 
650f617ae4SGleb Smirnoff #endif /* !_NETINET_IN_PCB_VAR_H_ */
66