diff options
Diffstat (limited to 'sys/netns/ns_input.c')
| -rw-r--r-- | sys/netns/ns_input.c | 59 |
1 files changed, 46 insertions, 13 deletions
diff --git a/sys/netns/ns_input.c b/sys/netns/ns_input.c index 827c4094b728..2d5d82220957 100644 --- a/sys/netns/ns_input.c +++ b/sys/netns/ns_input.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)ns_input.c 7.8 (Berkeley) 6/27/91 - * $Id: ns_input.c,v 1.2 1993/10/16 19:54:23 rgrimes Exp $ + * $Id: ns_input.c,v 1.5 1993/12/19 00:53:57 wollman Exp $ */ #include "param.h" @@ -57,6 +57,9 @@ #include "idp_var.h" #include "ns_error.h" +static void idp_forward(struct mbuf *); +static void idp_undo_route(struct route *); + /* * NS initialization. */ @@ -78,6 +81,7 @@ int nsqmaxlen = IFQ_MAXLEN; int idpcksum = 1; long ns_pexseq; +void ns_init() { extern struct timeval time; @@ -100,6 +104,8 @@ ns_init() */ int nsintr_getpck = 0; int nsintr_swtch = 0; + +void nsintr() { register struct idp *idp; @@ -236,24 +242,47 @@ bad: } u_char nsctlerrmap[PRC_NCMDS] = { - ECONNABORTED, ECONNABORTED, 0, 0, - 0, 0, EHOSTDOWN, EHOSTUNREACH, - ENETUNREACH, EHOSTUNREACH, ECONNREFUSED, ECONNREFUSED, - EMSGSIZE, 0, 0, 0, - 0, 0, 0, 0 + ECONNABORTED, /* ifdown */ + ECONNABORTED, /* routedead */ + 0, /* #2 */ + 0, /* quench2 */ + 0, /* quench */ + EMSGSIZE, /* msgsize */ + EHOSTDOWN, /* hostdead */ + EHOSTUNREACH, /* hostunreach */ + ENETUNREACH, /* unreachnet */ + EHOSTUNREACH, /* unreachhost */ + ECONNREFUSED, /* unreachproto */ + ECONNREFUSED, /* unreachport */ + EMSGSIZE, /* old needfrag */ + 0, /* srcfail */ + 0, /* netunknown */ + 0, /* hostunknown */ + 0, /* isolated */ + 0, /* net admin. prohibited */ + 0, /* host admin. prohibited */ + 0, /* tos net unreach */ + 0, /* tos host unreach */ + 0, /* redirect net */ + 0, /* redirect host */ + 0, /* redirect tosnet */ + 0, /* redirect toshost */ + 0, /* time exceeded */ + 0, /* reassembly timeout */ + 0, /* parameter problem */ + 0 /* required option missing */ }; int idp_donosocks = 1; +void idp_ctlinput(cmd, arg) int cmd; caddr_t arg; { struct ns_addr *ns; struct nspcb *nsp; - struct ns_errp *errp; - int idp_abort(); - extern struct nspcb *idp_drop(); + struct ns_errp *errp = 0; int type; if (cmd < 0 || cmd > PRC_NCMDS) @@ -304,8 +333,9 @@ int idpforwarding = 1; struct route idp_droute; struct route idp_sroute; +static void idp_forward(m) -struct mbuf *m; + struct mbuf *m; { register struct idp *idp = mtod(m, struct idp *); register int error, type, code; @@ -423,6 +453,7 @@ cleanup: m_freem(mcopy); } +int idp_do_route(src, ro) struct ns_addr *src; struct route *ro; @@ -445,15 +476,17 @@ struct route *ro; return (1); } +static void idp_undo_route(ro) -register struct route *ro; + register struct route *ro; { if (ro->ro_rt) {RTFREE(ro->ro_rt);} } +void ns_watch_output(m, ifp) -struct mbuf *m; -struct ifnet *ifp; + struct mbuf *m; + struct ifnet *ifp; { register struct nspcb *nsp; register struct ifaddr *ifa; |
