| version 1.7, 1994/01/08 23:50:45 |
version 1.8, 1994/01/09 01:06:13 |
|
|
| #include <netinet/in_var.h> |
#include <netinet/in_var.h> |
| #include <netinet/ip_var.h> |
#include <netinet/ip_var.h> |
| #include <netinet/ip_icmp.h> |
#include <netinet/ip_icmp.h> |
| |
#include <netinet/ip_mroute.h> |
| |
|
| #ifndef IPFORWARDING |
#ifndef IPFORWARDING |
| #ifdef GATEWAY |
#ifdef GATEWAY |
| Line 98 extern int if_index; |
|
| Line 99 extern int if_index; |
|
| u_long *ip_ifmatrix; |
u_long *ip_ifmatrix; |
| #endif |
#endif |
| |
|
| |
static void ip_forward __P((struct mbuf *, int)); |
| |
static void save_rte __P((u_char *, struct in_addr)); |
| |
|
| /* |
/* |
| * IP initialization: fill in IP protocol switch table. |
* IP initialization: fill in IP protocol switch table. |
| * All protocols not implemented in kernel go to raw IP protocol handler. |
* All protocols not implemented in kernel go to raw IP protocol handler. |
| */ |
*/ |
| |
void |
| ip_init() |
ip_init() |
| { |
{ |
| register struct protosw *pr; |
register struct protosw *pr; |
| Line 135 struct route ipforward_rt; |
|
| Line 140 struct route ipforward_rt; |
|
| * Ip input routine. Checksum and byte swap header. If fragmented |
* Ip input routine. Checksum and byte swap header. If fragmented |
| * try to reassemble. Process options. Pass to next level. |
* try to reassemble. Process options. Pass to next level. |
| */ |
*/ |
| |
void |
| ipintr() |
ipintr() |
| { |
{ |
| register struct ip *ip; |
register struct ip *ip; |
|
|
| * Free a fragment reassembly header and all |
* Free a fragment reassembly header and all |
| * associated datagrams. |
* associated datagrams. |
| */ |
*/ |
| |
void |
| ip_freef(fp) |
ip_freef(fp) |
| struct ipq *fp; |
struct ipq *fp; |
| { |
{ |
|
|
| * Put an ip fragment on a reassembly chain. |
* Put an ip fragment on a reassembly chain. |
| * Like insque, but pointers in middle of structure. |
* Like insque, but pointers in middle of structure. |
| */ |
*/ |
| |
void |
| ip_enq(p, prev) |
ip_enq(p, prev) |
| register struct ipasfrag *p, *prev; |
register struct ipasfrag *p, *prev; |
| { |
{ |
|
|
| /* |
/* |
| * To ip_enq as remque is to insque. |
* To ip_enq as remque is to insque. |
| */ |
*/ |
| |
void |
| ip_deq(p) |
ip_deq(p) |
| register struct ipasfrag *p; |
register struct ipasfrag *p; |
| { |
{ |
|
|
| * if a timer expires on a reassembly |
* if a timer expires on a reassembly |
| * queue, discard it. |
* queue, discard it. |
| */ |
*/ |
| |
void |
| ip_slowtimo() |
ip_slowtimo() |
| { |
{ |
| register struct ipq *fp; |
register struct ipq *fp; |
|
|
| /* |
/* |
| * Drain off all datagram fragments. |
* Drain off all datagram fragments. |
| */ |
*/ |
| |
void |
| ip_drain() |
ip_drain() |
| { |
{ |
| |
|
| Line 632 struct in_ifaddr *ip_rtaddr(); |
|
| Line 643 struct in_ifaddr *ip_rtaddr(); |
|
| * Returns 1 if packet has been forwarded/freed, |
* Returns 1 if packet has been forwarded/freed, |
| * 0 if the packet should be processed further. |
* 0 if the packet should be processed further. |
| */ |
*/ |
| |
int |
| ip_dooptions(m) |
ip_dooptions(m) |
| struct mbuf *m; |
struct mbuf *m; |
| { |
{ |
|
|
| * Save incoming source route for use in replies, |
* Save incoming source route for use in replies, |
| * to be picked up later by ip_srcroute if the receiver is interested. |
* to be picked up later by ip_srcroute if the receiver is interested. |
| */ |
*/ |
| |
static void |
| save_rte(option, dst) |
save_rte(option, dst) |
| u_char *option; |
u_char *option; |
| struct in_addr dst; |
struct in_addr dst; |
|
|
| * will be moved, and return value is their length. |
* will be moved, and return value is their length. |
| * XXX should be deleted; last arg currently ignored. |
* XXX should be deleted; last arg currently ignored. |
| */ |
*/ |
| |
void |
| ip_stripoptions(m, mopt) |
ip_stripoptions(m, mopt) |
| register struct mbuf *m; |
register struct mbuf *m; |
| struct mbuf *mopt; |
struct mbuf *mopt; |
| Line 980 u_char inetctlerrmap[PRC_NCMDS] = { |
|
| Line 994 u_char inetctlerrmap[PRC_NCMDS] = { |
|
| * The srcrt parameter indicates whether the packet is being forwarded |
* The srcrt parameter indicates whether the packet is being forwarded |
| * via a source route. |
* via a source route. |
| */ |
*/ |
| |
static void |
| ip_forward(m, srcrt) |
ip_forward(m, srcrt) |
| struct mbuf *m; |
struct mbuf *m; |
| int srcrt; |
int srcrt; |