|
|
1.1 ! root 1: /* ! 2: * Copyright (c) 1982, 1986, 1990 Regents of the University of California. ! 3: * All rights reserved. ! 4: * ! 5: * Redistribution is only permitted until one year after the first shipment ! 6: * of 4.4BSD by the Regents. Otherwise, redistribution and use in source and ! 7: * binary forms are permitted provided that: (1) source distributions retain ! 8: * this entire copyright notice and comment, and (2) distributions including ! 9: * binaries display the following acknowledgement: This product includes ! 10: * software developed by the University of California, Berkeley and its ! 11: * contributors'' in the documentation or other materials provided with the ! 12: * distribution and in all advertising materials mentioning features or use ! 13: * of this software. Neither the name of the University nor the names of ! 14: * its contributors may be used to endorse or promote products derived from ! 15: * this software without specific prior written permission. ! 16: * THIS SOFTWARE IS PROVIDED AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED ! 17: * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF ! 18: * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 19: * ! 20: * @(#)in_pcb.h 7.6 (Berkeley) 6/28/90 ! 21: */ ! 22: ! 23: /* ! 24: * Common structure pcb for internet protocol implementation. ! 25: * Here are stored pointers to local and foreign host table ! 26: * entries, local and foreign socket numbers, and pointers ! 27: * up (to a socket structure) and down (to a protocol-specific) ! 28: * control block. ! 29: */ ! 30: struct inpcb { ! 31: struct inpcb *inp_next,*inp_prev; ! 32: /* pointers to other pcb's */ ! 33: struct inpcb *inp_head; /* pointer back to chain of inpcb's ! 34: for this protocol */ ! 35: struct in_addr inp_faddr; /* foreign host table entry */ ! 36: u_short inp_fport; /* foreign port */ ! 37: struct in_addr inp_laddr; /* local host table entry */ ! 38: u_short inp_lport; /* local port */ ! 39: struct socket *inp_socket; /* back pointer to socket */ ! 40: caddr_t inp_ppcb; /* pointer to per-protocol pcb */ ! 41: struct route inp_route; /* placeholder for routing entry */ ! 42: int inp_flags; /* generic IP/datagram flags */ ! 43: struct ip inp_ip; /* header prototype; should have more */ ! 44: struct mbuf *inp_options; /* IP options */ ! 45: }; ! 46: ! 47: /* flags in inp_flags: */ ! 48: #define INP_RECVOPTS 0x01 /* receive incoming IP options */ ! 49: #define INP_RECVRETOPTS 0x02 /* receive IP options for reply */ ! 50: #define INP_RECVDSTADDR 0x04 /* receive IP dst address */ ! 51: #define INP_CONTROLOPTS (INP_RECVOPTS|INP_RECVRETOPTS|INP_RECVDSTADDR) ! 52: ! 53: #ifdef sotorawcb ! 54: /* ! 55: * Common structure pcb for raw internet protocol access. ! 56: * Here are internet specific extensions to the raw control block, ! 57: * and space is allocated to the necessary sockaddrs. ! 58: */ ! 59: struct raw_inpcb { ! 60: struct rawcb rinp_rcb; /* common control block prefix */ ! 61: struct mbuf *rinp_options; /* IP options */ ! 62: int rinp_flags; /* flags, e.g. raw sockopts */ ! 63: #define RINPF_HDRINCL 0x1 /* user supplies entire IP header */ ! 64: struct sockaddr_in rinp_faddr; /* foreign address */ ! 65: struct sockaddr_in rinp_laddr; /* local address */ ! 66: struct route rinp_route; /* placeholder for routing entry */ ! 67: }; ! 68: #endif ! 69: ! 70: #define INPLOOKUP_WILDCARD 1 ! 71: #define INPLOOKUP_SETLOCAL 2 ! 72: ! 73: #define sotoinpcb(so) ((struct inpcb *)(so)->so_pcb) ! 74: #define sotorawinpcb(so) ((struct raw_inpcb *)(so)->so_pcb) ! 75: ! 76: #ifdef KERNEL ! 77: struct inpcb *in_pcblookup(); ! 78: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.