| version 1.81.6.2, 2005/03/19 08:36:38 |
version 1.82, 2005/02/02 21:41:55 |
| Line 68 __KERNEL_RCSID(0, "$NetBSD$"); |
|
| Line 68 __KERNEL_RCSID(0, "$NetBSD$"); |
|
| #include "opt_mrouting.h" |
#include "opt_mrouting.h" |
| |
|
| #include <sys/param.h> |
#include <sys/param.h> |
| #include <sys/sysctl.h> |
|
| #include <sys/malloc.h> |
#include <sys/malloc.h> |
| #include <sys/mbuf.h> |
#include <sys/mbuf.h> |
| #include <sys/socket.h> |
#include <sys/socket.h> |
| Line 123 void rip_disconnect(struct inpcb *); |
|
| Line 122 void rip_disconnect(struct inpcb *); |
|
| * Initialize raw connection block q. |
* Initialize raw connection block q. |
| */ |
*/ |
| void |
void |
| rip_init(void) |
rip_init() |
| { |
{ |
| |
|
| in_pcbinit(&rawcbtable, 1, 1); |
in_pcbinit(&rawcbtable, 1, 1); |
| Line 237 rip_input(struct mbuf *m, ...) |
|
| Line 236 rip_input(struct mbuf *m, ...) |
|
| } |
} |
| |
|
| int |
int |
| rip_pcbnotify(struct inpcbtable *table, |
rip_pcbnotify(table, faddr, laddr, proto, errno, notify) |
| struct in_addr faddr, struct in_addr laddr, int proto, int errno, |
struct inpcbtable *table; |
| void (*notify)(struct inpcb *, int)) |
struct in_addr faddr, laddr; |
| |
int proto; |
| |
int errno; |
| |
void (*notify)(struct inpcb *, int); |
| { |
{ |
| struct inpcb *inp, *ninp; |
struct inpcb *inp, *ninp; |
| int nmatch; |
int nmatch; |
| Line 264 rip_pcbnotify(struct inpcbtable *table, |
|
| Line 266 rip_pcbnotify(struct inpcbtable *table, |
|
| } |
} |
| |
|
| void * |
void * |
| rip_ctlinput(int cmd, struct sockaddr *sa, void *v) |
rip_ctlinput(cmd, sa, v) |
| |
int cmd; |
| |
struct sockaddr *sa; |
| |
void *v; |
| { |
{ |
| struct ip *ip = v; |
struct ip *ip = v; |
| void (*notify)(struct inpcb *, int) = in_rtchange; |
void (*notify)(struct inpcb *, int) = in_rtchange; |
| Line 378 rip_output(struct mbuf *m, ...) |
|
| Line 383 rip_output(struct mbuf *m, ...) |
|
| * Raw IP socket option processing. |
* Raw IP socket option processing. |
| */ |
*/ |
| int |
int |
| rip_ctloutput(int op, struct socket *so, int level, int optname, |
rip_ctloutput(op, so, level, optname, m) |
| struct mbuf **m) |
int op; |
| |
struct socket *so; |
| |
int level, optname; |
| |
struct mbuf **m; |
| { |
{ |
| struct inpcb *inp = sotoinpcb(so); |
struct inpcb *inp = sotoinpcb(so); |
| int error = 0; |
int error = 0; |
| Line 454 rip_ctloutput(int op, struct socket *so, |
|
| Line 462 rip_ctloutput(int op, struct socket *so, |
|
| } |
} |
| |
|
| int |
int |
| rip_bind(struct inpcb *inp, struct mbuf *nam) |
rip_bind(inp, nam) |
| |
struct inpcb *inp; |
| |
struct mbuf *nam; |
| { |
{ |
| struct sockaddr_in *addr = mtod(nam, struct sockaddr_in *); |
struct sockaddr_in *addr = mtod(nam, struct sockaddr_in *); |
| |
|
| Line 473 rip_bind(struct inpcb *inp, struct mbuf |
|
| Line 483 rip_bind(struct inpcb *inp, struct mbuf |
|
| } |
} |
| |
|
| int |
int |
| rip_connect(struct inpcb *inp, struct mbuf *nam) |
rip_connect(inp, nam) |
| |
struct inpcb *inp; |
| |
struct mbuf *nam; |
| { |
{ |
| struct sockaddr_in *addr = mtod(nam, struct sockaddr_in *); |
struct sockaddr_in *addr = mtod(nam, struct sockaddr_in *); |
| |
|
| Line 489 rip_connect(struct inpcb *inp, struct mb |
|
| Line 501 rip_connect(struct inpcb *inp, struct mb |
|
| } |
} |
| |
|
| void |
void |
| rip_disconnect(struct inpcb *inp) |
rip_disconnect(inp) |
| |
struct inpcb *inp; |
| { |
{ |
| |
|
| inp->inp_faddr = zeroin_addr; |
inp->inp_faddr = zeroin_addr; |
| Line 500 u_long rip_recvspace = RIPRCVQ; |
|
| Line 513 u_long rip_recvspace = RIPRCVQ; |
|
| |
|
| /*ARGSUSED*/ |
/*ARGSUSED*/ |
| int |
int |
| rip_usrreq(struct socket *so, int req, |
rip_usrreq(so, req, m, nam, control, p) |
| struct mbuf *m, struct mbuf *nam, struct mbuf *control, struct proc *p) |
struct socket *so; |
| |
int req; |
| |
struct mbuf *m, *nam, *control; |
| |
struct proc *p; |
| { |
{ |
| struct inpcb *inp; |
struct inpcb *inp; |
| int s; |
int s; |
|
|
| splx(s); |
splx(s); |
| return (error); |
return (error); |
| } |
} |
| |
|
| SYSCTL_SETUP(sysctl_net_inet_raw_setup, "sysctl net.inet.raw subtree setup") |
|
| { |
|
| |
|
| sysctl_createv(clog, 0, NULL, NULL, |
|
| CTLFLAG_PERMANENT, |
|
| CTLTYPE_NODE, "net", NULL, |
|
| NULL, 0, NULL, 0, |
|
| CTL_NET, CTL_EOL); |
|
| sysctl_createv(clog, 0, NULL, NULL, |
|
| CTLFLAG_PERMANENT, |
|
| CTLTYPE_NODE, "inet", NULL, |
|
| NULL, 0, NULL, 0, |
|
| CTL_NET, PF_INET, CTL_EOL); |
|
| sysctl_createv(clog, 0, NULL, NULL, |
|
| CTLFLAG_PERMANENT, |
|
| CTLTYPE_NODE, "raw", |
|
| SYSCTL_DESCR("Raw IPv4 settings"), |
|
| NULL, 0, NULL, 0, |
|
| CTL_NET, PF_INET, IPPROTO_RAW, CTL_EOL); |
|
| |
|
| sysctl_createv(clog, 0, NULL, NULL, |
|
| CTLFLAG_PERMANENT, |
|
| CTLTYPE_STRUCT, "pcblist", |
|
| SYSCTL_DESCR("Raw IPv4 control block list"), |
|
| sysctl_inpcblist, 0, &rawcbtable, 0, |
|
| CTL_NET, PF_INET, IPPROTO_RAW, |
|
| CTL_CREATE, CTL_EOL); |
|
| } |
|