Commit | Line | Data |
---|---|---|
8ae0e4b4 | 1 | /* |
9dfba522 | 2 | * Copyright (c) 1982, 1986, 1990 Regents of the University of California. |
2b6b6284 | 3 | * All rights reserved. |
8ae0e4b4 | 4 | * |
dbf0c423 | 5 | * %sccs.include.redist.c% |
2b6b6284 | 6 | * |
dbf0c423 | 7 | * @(#)in_pcb.h 7.6 (Berkeley) %G% |
8ae0e4b4 | 8 | */ |
bae4854b BJ |
9 | |
10 | /* | |
11 | * Common structure pcb for internet protocol implementation. | |
12 | * Here are stored pointers to local and foreign host table | |
13 | * entries, local and foreign socket numbers, and pointers | |
14 | * up (to a socket structure) and down (to a protocol-specific) | |
15 | * control block. | |
16 | */ | |
17 | struct inpcb { | |
18 | struct inpcb *inp_next,*inp_prev; | |
19 | /* pointers to other pcb's */ | |
b454c3ea BJ |
20 | struct inpcb *inp_head; /* pointer back to chain of inpcb's |
21 | for this protocol */ | |
bae4854b BJ |
22 | struct in_addr inp_faddr; /* foreign host table entry */ |
23 | u_short inp_fport; /* foreign port */ | |
24 | struct in_addr inp_laddr; /* local host table entry */ | |
25 | u_short inp_lport; /* local port */ | |
26 | struct socket *inp_socket; /* back pointer to socket */ | |
27 | caddr_t inp_ppcb; /* pointer to per-protocol pcb */ | |
c124e997 | 28 | struct route inp_route; /* placeholder for routing entry */ |
9dfba522 MK |
29 | int inp_flags; /* generic IP/datagram flags */ |
30 | struct ip inp_ip; /* header prototype; should have more */ | |
ae484c2c | 31 | struct mbuf *inp_options; /* IP options */ |
bae4854b BJ |
32 | }; |
33 | ||
9dfba522 MK |
34 | /* flags in inp_flags: */ |
35 | #define INP_RECVOPTS 0x01 /* receive incoming IP options */ | |
36 | #define INP_RECVRETOPTS 0x02 /* receive IP options for reply */ | |
37 | #define INP_RECVDSTADDR 0x04 /* receive IP dst address */ | |
38 | #define INP_CONTROLOPTS (INP_RECVOPTS|INP_RECVRETOPTS|INP_RECVDSTADDR) | |
39 | ||
b4dc7708 KS |
40 | #ifdef sotorawcb |
41 | /* | |
42 | * Common structure pcb for raw internet protocol access. | |
43 | * Here are internet specific extensions to the raw control block, | |
44 | * and space is allocated to the necessary sockaddrs. | |
45 | */ | |
46 | struct raw_inpcb { | |
47 | struct rawcb rinp_rcb; /* common control block prefix */ | |
48 | struct mbuf *rinp_options; /* IP options */ | |
49 | int rinp_flags; /* flags, e.g. raw sockopts */ | |
50 | #define RINPF_HDRINCL 0x1 /* user supplies entire IP header */ | |
51 | struct sockaddr_in rinp_faddr; /* foreign address */ | |
52 | struct sockaddr_in rinp_laddr; /* local address */ | |
53 | struct route rinp_route; /* placeholder for routing entry */ | |
54 | }; | |
55 | #endif | |
56 | ||
ebcadd38 BJ |
57 | #define INPLOOKUP_WILDCARD 1 |
58 | #define INPLOOKUP_SETLOCAL 2 | |
59 | ||
bae4854b | 60 | #define sotoinpcb(so) ((struct inpcb *)(so)->so_pcb) |
b4dc7708 | 61 | #define sotorawinpcb(so) ((struct raw_inpcb *)(so)->so_pcb) |
bae4854b BJ |
62 | |
63 | #ifdef KERNEL | |
64 | struct inpcb *in_pcblookup(); | |
65 | #endif |