diff options
Diffstat (limited to 'sys/netiso/esis.c')
| -rw-r--r-- | sys/netiso/esis.c | 76 |
1 files changed, 48 insertions, 28 deletions
diff --git a/sys/netiso/esis.c b/sys/netiso/esis.c index 5d63388bd6fc..1cc68ce2dfc5 100644 --- a/sys/netiso/esis.c +++ b/sys/netiso/esis.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)esis.c 7.19 (Berkeley) 6/27/91 - * $Id: esis.c,v 1.2 1993/10/16 21:05:06 rgrimes Exp $ + * $Id: esis.c,v 1.6 1993/12/19 00:53:18 wollman Exp $ */ /*********************************************************** @@ -99,12 +99,17 @@ SOFTWARE. * */ struct rawcb esis_pcb; -int esis_config(), snpac_age(); -int esis_sendspace = 2048; -int esis_recvspace = 2048; -short esis_holding_time = ESIS_HT; -short esis_config_time = ESIS_CONFIG; -short esis_esconfig_time = ESIS_CONFIG; +struct esis_stat esis_stat; + +static void esis_eshinput(struct mbuf *, struct snpa_hdr *); +static void esis_ishinput(struct mbuf *, struct snpa_hdr *); +static void esis_rdinput(struct mbuf *, struct snpa_hdr *); + +int esis_sendspace = 2048; +int esis_recvspace = 2048; +short esis_holding_time = ESIS_HT; +short esis_config_time = ESIS_CONFIG; +short esis_esconfig_time = ESIS_CONFIG; extern int iso_systype; struct sockaddr_dl esis_dl = { sizeof(esis_dl), AF_LINK }; extern char all_es_snpa[], all_is_snpa[]; @@ -118,6 +123,11 @@ extern char all_es_snpa[], all_is_snpa[]; (m) = (m)->m_next;\ (cp) = mtod((m), caddr_t);\ } + +#ifdef ISO_X25ESIS +void x25esis_input(); +#endif ISO_X25ESIS + /* * FUNCTION: esis_init * @@ -129,13 +139,10 @@ extern char all_es_snpa[], all_is_snpa[]; * * NOTES: */ +void esis_init() { extern struct clnl_protosw clnl_protox[256]; - int esis_input(), isis_input(); -#ifdef ISO_X25ESIS - int x25esis_input(); -#endif ISO_X25ESIS esis_pcb.rcb_next = esis_pcb.rcb_prev = &esis_pcb; llinfo_llc.lc_next = llinfo_llc.lc_prev = &llinfo_llc; @@ -161,6 +168,7 @@ esis_init() * */ /*ARGSUSED*/ +int esis_usrreq(so, req, m, nam, control) struct socket *so; /* socket: used only to get to this code */ int req; /* request */ @@ -243,6 +251,7 @@ release: * * NOTES: */ +void esis_input(m0, shp) struct mbuf *m0; /* ptr to first mbuf of pkt */ struct snpa_hdr *shp; /* subnetwork header */ @@ -300,6 +309,7 @@ bad: * NOTES: Assumes there is enough space for fixed part of header, * DA, BSNPA and NET in first mbuf. */ +void esis_rdoutput(inbound_shp, inbound_m, inbound_oidx, rd_dstnsap, rt) struct snpa_hdr *inbound_shp; /* snpa hdr from incoming packet */ struct mbuf *inbound_m; /* incoming pkt itself */ @@ -444,7 +454,7 @@ struct rtentry *rt; /* snpa cache info regarding next hop of siso.siso_nlen = 6 + 1; /* should be taken from snpa_hdr */ /* +1 is for AFI */ bcopy(inbound_shp->snh_shost, siso.siso_data + 1, 6); - (ifp->if_output)(ifp, m0, &siso, 0); + (ifp->if_output)(ifp, m0, (struct sockaddr *)&siso, 0); } /* @@ -458,6 +468,7 @@ struct rtentry *rt; /* snpa cache info regarding next hop of * * NOTES: Plus 1 here is for length byte */ +int esis_insert_addr(buf, len, isoa, m, nsellen) register caddr_t *buf; /* ptr to buffer to put address into */ int *len; /* ptr to length of buffer so far */ @@ -485,7 +496,6 @@ int nsellen; #define ESIS_NEXT_OPTION(b) { b += (2 + b[1]); \ if (b > buflim) {esis_stat.es_toosmall++; goto bad;}} int ESHonly = 0; -/* /* * FUNCTION: esis_eshinput @@ -498,13 +508,14 @@ int ESHonly = 0; * * NOTES: */ +void esis_eshinput(m, shp) struct mbuf *m; /* esh pdu */ struct snpa_hdr *shp; /* subnetwork header */ { struct esis_fixed *pdu = mtod(m, struct esis_fixed *); u_short ht; /* holding time */ - struct iso_addr *nsap; + struct iso_addr *nsap = 0; int naddr; u_char *buf = (u_char *)(pdu + 1); u_char *buflim = pdu->esis_hdr_len + (u_char *)pdu; @@ -582,6 +593,7 @@ bad: * * NOTES: */ +void esis_ishinput(m, shp) struct mbuf *m; /* esh pdu */ struct snpa_hdr *shp; /* subnetwork header */ @@ -612,10 +624,10 @@ struct snpa_hdr *shp; /* subnetwork header */ if (buf[1] != 2) goto bad; CTOH(buf[2], buf[3], newct); - if (esis_config_time != newct) { + if ((u_long)esis_config_time != (u_long)newct) { untimeout(esis_config,0); esis_config_time = newct; - esis_config(); + esis_config(0, 0); } break; @@ -649,6 +661,7 @@ bad: * * NOTES: */ +void esis_rdinput(m0, shp) struct mbuf *m0; /* esh pdu */ struct snpa_hdr *shp; /* subnetwork header */ @@ -744,7 +757,8 @@ bad: ; /* Needed by ESIS_NEXT_OPTION */ * * NOTES: Called every esis_config_time seconds */ -esis_config() +void +esis_config(caddr_t dummy1, int dummy2) { register struct ifnet *ifp; @@ -793,13 +807,14 @@ esis_config() * * NOTES: */ +void esis_shoutput(ifp, type, ht, sn_addr, sn_len, isoa) -struct ifnet *ifp; -int type; -short ht; -caddr_t sn_addr; -int sn_len; -struct iso_addr *isoa; + struct ifnet *ifp; + int type; + short ht; + caddr_t sn_addr; + int sn_len; + struct iso_addr *isoa; { struct mbuf *m, *m0; caddr_t cp, naddrp; @@ -921,7 +936,7 @@ struct iso_addr *isoa; siso.siso_data[0] = AFI_SNA; siso.siso_nlen = sn_len + 1; bcopy(sn_addr, siso.siso_data + 1, (unsigned)sn_len); - (ifp->if_output)(ifp, m0, &siso, 0); + (ifp->if_output)(ifp, m0, (struct sockaddr *)&siso, 0); } /* @@ -935,6 +950,7 @@ struct iso_addr *isoa; * * NOTES: */ +void isis_input(m0, shp) struct mbuf *m0; /* ptr to first mbuf of pkt */ struct snpa_hdr *shp; /* subnetwork header */ @@ -967,24 +983,27 @@ struct snpa_hdr *shp; /* subnetwork header */ } if (mm = m_copy(m0, 0, M_COPYALL)) { /*can't block at interrupt level */ if (sbappendaddr(&rp->rcb_socket->so_rcv, - &esis_dl, mm, (struct mbuf *)0) != 0) + (struct sockaddr *)&esis_dl, + mm, (struct mbuf *)0) != 0) sorwakeup(rp->rcb_socket); else { IFDEBUG(D_ISISINPUT) - printf("Error in sbappenaddr, mm = 0x%x\n", mm); + printf("Error in sbappenaddr, mm = 0x%x\n", mm); ENDDEBUG m_freem(mm); } } } if (first_rp && sbappendaddr(&first_rp->rcb_socket->so_rcv, - &esis_dl, m0, (struct mbuf *)0) != 0) { + (struct sockaddr *)&esis_dl, + m0, (struct mbuf *)0) != 0) { sorwakeup(first_rp->rcb_socket); return; } m_freem(m0); } +int isis_output(sdl, m) register struct sockaddr_dl *sdl; struct mbuf *m; @@ -1048,6 +1067,7 @@ release: * The loop through iso_ifaddr is stupid because * back in if_down, we knew the ifp... */ +void esis_ctlinput(req, siso) int req; /* request: we handle only PRC_IFDOWN */ struct sockaddr_iso *siso; /* address of ifp */ @@ -1061,4 +1081,4 @@ struct sockaddr_iso *siso; /* address of ifp */ } } -#endif ISO +#endif /* ISO */ |
