The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/netinet/in_pcb.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*      $NetBSD: in_pcb.h,v 1.36 2003/10/23 20:55:08 mycroft Exp $      */
    2 
    3 /*
    4  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
    5  * All rights reserved.
    6  *
    7  * Redistribution and use in source and binary forms, with or without
    8  * modification, are permitted provided that the following conditions
    9  * are met:
   10  * 1. Redistributions of source code must retain the above copyright
   11  *    notice, this list of conditions and the following disclaimer.
   12  * 2. Redistributions in binary form must reproduce the above copyright
   13  *    notice, this list of conditions and the following disclaimer in the
   14  *    documentation and/or other materials provided with the distribution.
   15  * 3. Neither the name of the project nor the names of its contributors
   16  *    may be used to endorse or promote products derived from this software
   17  *    without specific prior written permission.
   18  *
   19  * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
   20  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   22  * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
   23  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   24  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   25  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   26  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   27  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   28  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   29  * SUCH DAMAGE.
   30  */
   31 
   32 /*
   33  * Copyright (c) 1982, 1986, 1990, 1993
   34  *      The Regents of the University of California.  All rights reserved.
   35  *
   36  * Redistribution and use in source and binary forms, with or without
   37  * modification, are permitted provided that the following conditions
   38  * are met:
   39  * 1. Redistributions of source code must retain the above copyright
   40  *    notice, this list of conditions and the following disclaimer.
   41  * 2. Redistributions in binary form must reproduce the above copyright
   42  *    notice, this list of conditions and the following disclaimer in the
   43  *    documentation and/or other materials provided with the distribution.
   44  * 3. Neither the name of the University nor the names of its contributors
   45  *    may be used to endorse or promote products derived from this software
   46  *    without specific prior written permission.
   47  *
   48  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   49  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   50  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   51  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   52  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   53  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   54  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   55  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   56  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   57  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   58  * SUCH DAMAGE.
   59  *
   60  *      @(#)in_pcb.h    8.1 (Berkeley) 6/10/93
   61  */
   62 
   63 #ifndef _NETINET_IN_PCB_H_
   64 #define _NETINET_IN_PCB_H_
   65 
   66 #include <sys/queue.h>
   67 #include <netinet/in_pcb_hdr.h>
   68 
   69 /*
   70  * Common structure pcb for internet protocol implementation.
   71  * Here are stored pointers to local and foreign host table
   72  * entries, local and foreign socket numbers, and pointers
   73  * up (to a socket structure) and down (to a protocol-specific)
   74  * control block.
   75  */
   76 struct inpcb {
   77         struct inpcb_hdr inp_head;
   78 #define inp_hash        inp_head.inph_hash
   79 #define inp_queue       inp_head.inph_queue
   80 #define inp_af          inp_head.inph_af
   81 #define inp_ppcb        inp_head.inph_ppcb
   82 #define inp_state       inp_head.inph_state
   83 #define inp_socket      inp_head.inph_socket
   84 #define inp_table       inp_head.inph_table
   85 #define inp_sp          inp_head.inph_sp
   86         struct    route inp_route;      /* placeholder for routing entry */
   87         u_int16_t inp_fport;            /* foreign port */
   88         u_int16_t inp_lport;            /* local port */
   89         int       inp_flags;            /* generic IP/datagram flags */
   90         struct    ip inp_ip;            /* header prototype; should have more */
   91         struct    mbuf *inp_options;    /* IP options */
   92         struct    ip_moptions *inp_moptions; /* IP multicast options */
   93         int       inp_errormtu;         /* MTU of last xmit status = EMSGSIZE */
   94 };
   95 
   96 #define inp_faddr       inp_ip.ip_dst
   97 #define inp_laddr       inp_ip.ip_src
   98 
   99 /* flags in inp_flags: */
  100 #define INP_RECVOPTS            0x01    /* receive incoming IP options */
  101 #define INP_RECVRETOPTS         0x02    /* receive IP options for reply */
  102 #define INP_RECVDSTADDR         0x04    /* receive IP dst address */
  103 #define INP_HDRINCL             0x08    /* user supplies entire IP header */
  104 #define INP_HIGHPORT            0x10    /* (unused; FreeBSD compat) */
  105 #define INP_LOWPORT             0x20    /* user wants "low" port binding */
  106 #define INP_ANONPORT            0x40    /* port chosen for user */
  107 #define INP_RECVIF              0x80    /* receive incoming interface */
  108 #define INP_CONTROLOPTS         (INP_RECVOPTS|INP_RECVRETOPTS|INP_RECVDSTADDR|\
  109                                 INP_RECVIF)
  110 
  111 #define sotoinpcb(so)           ((struct inpcb *)(so)->so_pcb)
  112 
  113 #ifdef _KERNEL
  114 void    in_losing __P((struct inpcb *));
  115 int     in_pcballoc __P((struct socket *, void *));
  116 int     in_pcbbind __P((void *, struct mbuf *, struct proc *));
  117 int     in_pcbconnect __P((void *, struct mbuf *));
  118 void    in_pcbdetach __P((void *));
  119 void    in_pcbdisconnect __P((void *));
  120 void    in_pcbinit __P((struct inpcbtable *, int, int));
  121 struct inpcb *
  122         in_pcblookup_port __P((struct inpcbtable *,
  123             struct in_addr, u_int, int));
  124 struct inpcb *
  125         in_pcblookup_bind __P((struct inpcbtable *,
  126             struct in_addr, u_int));
  127 struct inpcb *
  128         in_pcblookup_connect __P((struct inpcbtable *,
  129             struct in_addr, u_int, struct in_addr, u_int));
  130 int     in_pcbnotify __P((struct inpcbtable *, struct in_addr, u_int,
  131             struct in_addr, u_int, int, void (*)(struct inpcb *, int)));
  132 void    in_pcbnotifyall __P((struct inpcbtable *, struct in_addr, int,
  133             void (*)(struct inpcb *, int)));
  134 void    in_pcbpurgeif0 __P((struct inpcbtable *, struct ifnet *));
  135 void    in_pcbpurgeif __P((struct inpcbtable *, struct ifnet *));
  136 void    in_pcbstate __P((struct inpcb *, int));
  137 void    in_rtchange __P((struct inpcb *, int));
  138 void    in_setpeeraddr __P((struct inpcb *, struct mbuf *));
  139 void    in_setsockaddr __P((struct inpcb *, struct mbuf *));
  140 struct rtentry *
  141         in_pcbrtentry __P((struct inpcb *));
  142 extern struct sockaddr_in *in_selectsrc __P((struct sockaddr_in *,
  143         struct route *, int, struct ip_moptions *, int *));
  144 #endif
  145 
  146 #endif /* _NETINET_IN_PCB_H_ */

Cache object: a71eb6785c6f34daea079ea95185ca2b


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.