version 1.46, 1999/09/13 12:15:55 |
version 1.46.2.2, 2001/02/11 19:17:17 |
|
|
#include <netinet6/ipsec.h> |
#include <netinet6/ipsec.h> |
#endif /*IPSEC*/ |
#endif /*IPSEC*/ |
|
|
extern u_char ip_protox[]; |
|
extern struct protosw inetsw[]; |
|
struct inpcbtable rawcbtable; |
struct inpcbtable rawcbtable; |
|
|
int rip_bind __P((struct inpcb *, struct mbuf *)); |
int rip_bind __P((struct inpcb *, struct mbuf *)); |
Line 140 rip_input(m, va_alist) |
|
Line 138 rip_input(m, va_alist) |
|
#endif |
#endif |
{ |
{ |
int off, proto; |
int off, proto; |
register struct ip *ip = mtod(m, struct ip *); |
struct ip *ip = mtod(m, struct ip *); |
register struct inpcb *inp; |
struct inpcb *inp; |
struct inpcb *last = 0; |
struct inpcb *last = 0; |
struct mbuf *opts = 0; |
struct mbuf *opts = 0; |
struct sockaddr_in ripsrc; |
struct sockaddr_in ripsrc; |
Line 207 rip_input(m, va_alist) |
|
Line 205 rip_input(m, va_alist) |
|
sorwakeup(last->inp_socket); |
sorwakeup(last->inp_socket); |
} else { |
} else { |
if (inetsw[ip_protox[ip->ip_p]].pr_input == rip_input) { |
if (inetsw[ip_protox[ip->ip_p]].pr_input == rip_input) { |
icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_PROTOCOL,0,0); |
icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_PROTOCOL, |
|
0, 0); |
ipstat.ips_noproto++; |
ipstat.ips_noproto++; |
ipstat.ips_delivered--; |
ipstat.ips_delivered--; |
} else |
} else |
Line 229 rip_output(m, va_alist) |
|
Line 228 rip_output(m, va_alist) |
|
va_dcl |
va_dcl |
#endif |
#endif |
{ |
{ |
register struct inpcb *inp; |
struct inpcb *inp; |
register struct ip *ip; |
struct ip *ip; |
struct mbuf *opts; |
struct mbuf *opts; |
int flags; |
int flags; |
va_list ap; |
va_list ap; |
Line 280 rip_output(m, va_alist) |
|
Line 279 rip_output(m, va_alist) |
|
ipstat.ips_rawout++; |
ipstat.ips_rawout++; |
} |
} |
#ifdef IPSEC |
#ifdef IPSEC |
m->m_pkthdr.rcvif = (struct ifnet *)inp->inp_socket; /*XXX*/ |
if (ipsec_setsocket(m, inp->inp_socket) != 0) { |
|
m_freem(m); |
|
return ENOBUFS; |
|
} |
#endif /*IPSEC*/ |
#endif /*IPSEC*/ |
return (ip_output(m, opts, &inp->inp_route, flags, inp->inp_moptions, &inp->inp_errormtu)); |
return (ip_output(m, opts, &inp->inp_route, flags, inp->inp_moptions, &inp->inp_errormtu)); |
} |
} |
Line 295 rip_ctloutput(op, so, level, optname, m) |
|
Line 297 rip_ctloutput(op, so, level, optname, m) |
|
int level, optname; |
int level, optname; |
struct mbuf **m; |
struct mbuf **m; |
{ |
{ |
register struct inpcb *inp = sotoinpcb(so); |
struct inpcb *inp = sotoinpcb(so); |
int error = 0; |
int error = 0; |
|
|
if (level != IPPROTO_IP) { |
if (level != IPPROTO_IP) { |
Line 414 u_long rip_recvspace = RIPRCVQ; |
|
Line 416 u_long rip_recvspace = RIPRCVQ; |
|
/*ARGSUSED*/ |
/*ARGSUSED*/ |
int |
int |
rip_usrreq(so, req, m, nam, control, p) |
rip_usrreq(so, req, m, nam, control, p) |
register struct socket *so; |
struct socket *so; |
int req; |
int req; |
struct mbuf *m, *nam, *control; |
struct mbuf *m, *nam, *control; |
struct proc *p; |
struct proc *p; |
{ |
{ |
register struct inpcb *inp; |
struct inpcb *inp; |
int s; |
int s; |
register int error = 0; |
int error = 0; |
#ifdef MROUTING |
#ifdef MROUTING |
extern struct socket *ip_mrouter; |
extern struct socket *ip_mrouter; |
#endif |
#endif |
Line 430 rip_usrreq(so, req, m, nam, control, p) |
|
Line 432 rip_usrreq(so, req, m, nam, control, p) |
|
return (in_control(so, (long)m, (caddr_t)nam, |
return (in_control(so, (long)m, (caddr_t)nam, |
(struct ifnet *)control, p)); |
(struct ifnet *)control, p)); |
|
|
|
if (req == PRU_PURGEIF) { |
|
in_purgeif((struct ifnet *)control); |
|
in_pcbpurgeif(&rawcbtable, (struct ifnet *)control); |
|
return (0); |
|
} |
|
|
s = splsoftnet(); |
s = splsoftnet(); |
inp = sotoinpcb(so); |
inp = sotoinpcb(so); |
#ifdef DIAGNOSTIC |
#ifdef DIAGNOSTIC |
Line 463 rip_usrreq(so, req, m, nam, control, p) |
|
Line 471 rip_usrreq(so, req, m, nam, control, p) |
|
inp = sotoinpcb(so); |
inp = sotoinpcb(so); |
inp->inp_ip.ip_p = (long)nam; |
inp->inp_ip.ip_p = (long)nam; |
#ifdef IPSEC |
#ifdef IPSEC |
if ((error = ipsec_init_policy(&inp->inp_sp)) != 0) |
error = ipsec_init_policy(so, &inp->inp_sp); |
|
if (error != 0) { |
in_pcbdetach(inp); |
in_pcbdetach(inp); |
|
break; |
|
} |
#endif /*IPSEC*/ |
#endif /*IPSEC*/ |
break; |
break; |
|
|