SCCS-vsn: sys/netinet/if_ether.c 4.2
SCCS-vsn: sys/netinet/ip_icmp.c 4.32
SCCS-vsn: sys/netinet/tcp_timer.c 4.32
SCCS-vsn: sys/netinet/tcp_output.c 4.55
-/* if_ether.c 4.1 83/03/15 */
+/* if_ether.c 4.2 83/05/27 */
/*
* Ethernet address resolution protocol.
/*
* Ethernet address resolution protocol.
#include "../h/socket.h"
#include "../h/time.h"
#include "../h/kernel.h"
#include "../h/socket.h"
#include "../h/time.h"
#include "../h/kernel.h"
#include "../net/if.h"
#include "../netinet/in.h"
#include "../net/if.h"
#include "../netinet/in.h"
- register struct arpcom *ac;
register struct arptab *at;
register i;
register struct arptab *at;
register i;
- timeout(arptimer, 0, hz);
+ timeout(arptimer, (caddr_t)0, hz);
#ifdef notdef
if (++arpt_sanity > ARPT_SANITY) {
#ifdef notdef
if (++arpt_sanity > ARPT_SANITY) {
+ register struct arpcom *ac;
+
/*
* Randomize sanity timer based on my host address.
* Ask who has my own address; if someone else replies,
/*
* Randomize sanity timer based on my host address.
* Ask who has my own address; if someone else replies,
struct sockaddr sa;
if ((m = m_get(M_DONTWAIT, MT_DATA)) == NULL)
struct sockaddr sa;
if ((m = m_get(M_DONTWAIT, MT_DATA)) == NULL)
m->m_len = sizeof *ea + sizeof *eh;
m->m_off = MMAXOFF - m->m_len;
ea = mtod(m, struct ether_arp *);
eh = (struct ether_header *)sa.sa_data;
m->m_len = sizeof *ea + sizeof *eh;
m->m_off = MMAXOFF - m->m_len;
ea = mtod(m, struct ether_arp *);
eh = (struct ether_header *)sa.sa_data;
- bzero((caddr_t)ea, sizeof *ea);
- bcopy(etherbroadcastaddr, eh->ether_dhost, sizeof etherbroadcastaddr);
+ bzero((caddr_t)ea, sizeof (*ea));
+ bcopy((caddr_t)etherbroadcastaddr, (caddr_t)eh->ether_dhost,
+ sizeof (etherbroadcastaddr));
eh->ether_type = ETHERPUP_ARPTYPE; /* if_output will swap */
ea->arp_hrd = htons(ARPHRD_ETHER);
ea->arp_pro = htons(ETHERPUP_IPTYPE);
ea->arp_hln = sizeof ea->arp_sha; /* hardware address length */
ea->arp_pln = sizeof ea->arp_spa; /* protocol address length */
ea->arp_op = htons(ARPOP_REQUEST);
eh->ether_type = ETHERPUP_ARPTYPE; /* if_output will swap */
ea->arp_hrd = htons(ARPHRD_ETHER);
ea->arp_pro = htons(ETHERPUP_IPTYPE);
ea->arp_hln = sizeof ea->arp_sha; /* hardware address length */
ea->arp_pln = sizeof ea->arp_spa; /* protocol address length */
ea->arp_op = htons(ARPOP_REQUEST);
- bcopy(ac->ac_enaddr, ea->arp_sha, sizeof ea->arp_sha);
+ bcopy((caddr_t)ac->ac_enaddr, (caddr_t)ea->arp_sha,
+ sizeof (ea->arp_sha));
bcopy((caddr_t)&((struct sockaddr_in *)&ac->ac_if.if_addr)->sin_addr,
bcopy((caddr_t)&((struct sockaddr_in *)&ac->ac_if.if_addr)->sin_addr,
- ea->arp_spa, sizeof ea->arp_spa);
- bcopy((caddr_t)addr, ea->arp_tpa, sizeof ea->arp_tpa);
+ (caddr_t)ea->arp_spa, sizeof (ea->arp_spa));
+ bcopy((caddr_t)addr, (caddr_t)ea->arp_tpa, sizeof (ea->arp_tpa));
sa.sa_family = AF_UNSPEC;
return ((*ac->ac_if.if_output)(&ac->ac_if, m, &sa));
}
sa.sa_family = AF_UNSPEC;
return ((*ac->ac_if.if_output)(&ac->ac_if, m, &sa));
}
register u_char *desten;
{
register struct arptab *at;
register u_char *desten;
{
register struct arptab *at;
struct sockaddr_in sin;
int s, lna;
lna = in_lnaof(*destip);
if (lna == INADDR_ANY) { /* broadcast address */
struct sockaddr_in sin;
int s, lna;
lna = in_lnaof(*destip);
if (lna == INADDR_ANY) { /* broadcast address */
- bcopy(etherbroadcastaddr, desten, sizeof etherbroadcastaddr);
+ bcopy((caddr_t)etherbroadcastaddr, (caddr_t)desten,
+ sizeof (etherbroadcastaddr));
return (1);
}
if (destip->s_addr == ((struct sockaddr_in *)&ac->ac_if.if_addr)->
sin_addr.s_addr) { /* if for us, use lo driver */
sin.sin_family = AF_INET;
sin.sin_addr = *destip;
return (1);
}
if (destip->s_addr == ((struct sockaddr_in *)&ac->ac_if.if_addr)->
sin_addr.s_addr) { /* if for us, use lo driver */
sin.sin_family = AF_INET;
sin.sin_addr = *destip;
- looutput(&loif, m, &sin);
- return (0);
+ return (looutput(&loif, m, (struct sockaddr *)&sin));
}
#ifdef OLDMAP
if (lna >= 1024) {
}
#ifdef OLDMAP
if (lna >= 1024) {
- bcopy(ac->ac_enaddr, desten, 3);
+ bcopy((caddr_t)ac->ac_enaddr, (caddr_t)desten, 3);
desten[3] = (lna >> 16) & 0x7f;
desten[4] = (lna >> 8) & 0xff;
desten[5] = lna & 0xff;
desten[3] = (lna >> 16) & 0x7f;
desten[4] = (lna >> 8) & 0xff;
desten[5] = lna & 0xff;
}
at->at_timer = 0; /* restart the timer */
if (at->at_flags & ATF_COM) { /* entry IS complete */
}
at->at_timer = 0; /* restart the timer */
if (at->at_flags & ATF_COM) { /* entry IS complete */
- bcopy(at->at_enaddr, desten, 6);
+ bcopy((caddr_t)at->at_enaddr, (caddr_t)desten, 6);
* Unimplemented at present, return 0 and assume that the host
* will set his own IP address via the SIOCSIFADDR ioctl.
*/
* Unimplemented at present, return 0 and assume that the host
* will set his own IP address via the SIOCSIFADDR ioctl.
*/
struct in_addr
arpmyaddr(ac)
register struct arpcom *ac;
struct in_addr
arpmyaddr(ac)
register struct arpcom *ac;
goto out;
isaddr.s_addr = ((struct in_addr *)ea->arp_spa)->s_addr;
itaddr.s_addr = ((struct in_addr *)ea->arp_tpa)->s_addr;
goto out;
isaddr.s_addr = ((struct in_addr *)ea->arp_spa)->s_addr;
itaddr.s_addr = ((struct in_addr *)ea->arp_tpa)->s_addr;
- if (!bcmp(ea->arp_sha, ac->ac_enaddr, sizeof ac->ac_enaddr))
+ if (!bcmp((caddr_t)ea->arp_sha, (caddr_t)ac->ac_enaddr,
+ sizeof (ac->ac_enaddr)))
goto out; /* it's from me, ignore it. */
if (isaddr.s_addr == myaddr.s_addr) {
printf("duplicate IP address!! sent from ethernet address: ");
goto out; /* it's from me, ignore it. */
if (isaddr.s_addr == myaddr.s_addr) {
printf("duplicate IP address!! sent from ethernet address: ");
}
ARPTAB_LOOK(at, isaddr.s_addr);
if (at) {
}
ARPTAB_LOOK(at, isaddr.s_addr);
if (at) {
- bcopy(ea->arp_sha, at->at_enaddr, sizeof ea->arp_sha);
+ bcopy((caddr_t)ea->arp_sha, (caddr_t)at->at_enaddr,
+ sizeof (ea->arp_sha));
at->at_flags |= ATF_COM;
if (at->at_hold) {
mhold = at->at_hold;
at->at_flags |= ATF_COM;
if (at->at_hold) {
mhold = at->at_hold;
goto out; /* if I am not the target */
if (at == 0) { /* ensure we have a table entry */
at = arptnew(&isaddr);
goto out; /* if I am not the target */
if (at == 0) { /* ensure we have a table entry */
at = arptnew(&isaddr);
- bcopy(ea->arp_sha, at->at_enaddr, sizeof ea->arp_sha);
+ bcopy((caddr_t)ea->arp_sha, (caddr_t)at->at_enaddr,
+ sizeof (ea->arp_sha));
at->at_flags |= ATF_COM;
}
if (ntohs(ea->arp_op) != ARPOP_REQUEST)
goto out;
reply:
at->at_flags |= ATF_COM;
}
if (ntohs(ea->arp_op) != ARPOP_REQUEST)
goto out;
reply:
- bcopy(ea->arp_sha, ea->arp_tha, sizeof ea->arp_sha);
- bcopy(ea->arp_spa, ea->arp_tpa, sizeof ea->arp_spa);
- bcopy(ac->ac_enaddr, ea->arp_sha, sizeof ea->arp_sha);
- bcopy((caddr_t)&myaddr, ea->arp_spa, sizeof ea->arp_spa);
+ bcopy((caddr_t)ea->arp_sha, (caddr_t)ea->arp_tha,
+ sizeof (ea->arp_sha));
+ bcopy((caddr_t)ea->arp_spa, (caddr_t)ea->arp_tpa,
+ sizeof (ea->arp_spa));
+ bcopy((caddr_t)ac->ac_enaddr, (caddr_t)ea->arp_sha,
+ sizeof (ea->arp_sha));
+ bcopy((caddr_t)&myaddr, (caddr_t)ea->arp_spa,
+ sizeof (ea->arp_spa));
ea->arp_op = htons(ARPOP_REPLY);
eh = (struct ether_header *)sa.sa_data;
ea->arp_op = htons(ARPOP_REPLY);
eh = (struct ether_header *)sa.sa_data;
- bcopy(ea->arp_tha, eh->ether_dhost, sizeof eh->ether_dhost);
+ bcopy((caddr_t)ea->arp_tha, (caddr_t)eh->ether_dhost,
+ sizeof (eh->ether_dhost));
eh->ether_type = ETHERPUP_ARPTYPE;
sa.sa_family = AF_UNSPEC;
(*ac->ac_if.if_output)(&ac->ac_if, m, &sa);
eh->ether_type = ETHERPUP_ARPTYPE;
sa.sa_family = AF_UNSPEC;
(*ac->ac_if.if_output)(&ac->ac_if, m, &sa);
-/* ip_icmp.c 4.31 83/05/01 */
+/* ip_icmp.c 4.32 83/05/27 */
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/param.h"
#include "../h/systm.h"
*/
icmp_error(oip, type, code)
struct ip *oip;
*/
icmp_error(oip, type, code)
struct ip *oip;
{
register unsigned oiplen = oip->ip_hl << 2;
register struct icmp *icp;
{
register unsigned oiplen = oip->ip_hl << 2;
register struct icmp *icp;
m->m_len = oiplen + 8 + ICMP_MINLEN;
m->m_off = MMAXOFF - m->m_len;
icp = mtod(m, struct icmp *);
m->m_len = oiplen + 8 + ICMP_MINLEN;
m->m_off = MMAXOFF - m->m_len;
icp = mtod(m, struct icmp *);
- if (type > ICMP_IREQREPLY)
+ if ((u_int)type > ICMP_IREQREPLY)
panic("icmp_error");
icmpstat.icps_outhist[type]++;
icp->icmp_type = type;
panic("icmp_error");
icmpstat.icps_outhist[type]++;
icp->icmp_type = type;
-/* tcp_output.c 4.54 83/05/12 */
+/* tcp_output.c 4.55 83/05/27 */
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/param.h"
#include "../h/systm.h"
((struct ip *)ti)->ip_len = sizeof (struct tcpiphdr) + optlen + len;
((struct ip *)ti)->ip_ttl = TCP_TTL;
if (so->so_options & SO_DONTROUTE)
((struct ip *)ti)->ip_len = sizeof (struct tcpiphdr) + optlen + len;
((struct ip *)ti)->ip_ttl = TCP_TTL;
if (so->so_options & SO_DONTROUTE)
- error = ip_output(m, tp->t_ipopt, 0, IP_ROUTETOIF);
+ error =
+ ip_output(m, tp->t_ipopt, (struct route *)0, IP_ROUTETOIF);
else
error = ip_output(m, tp->t_ipopt, &tp->t_inpcb->inp_route, 0);
if (error)
else
error = ip_output(m, tp->t_ipopt, &tp->t_inpcb->inp_route, 0);
if (error)
-/* tcp_timer.c 4.31 83/02/10 */
+/* tcp_timer.c 4.32 83/05/27 */
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/param.h"
#include "../h/systm.h"
if (tp->t_timer[i] && --tp->t_timer[i] == 0) {
(void) tcp_usrreq(tp->t_inpcb->inp_socket,
PRU_SLOWTIMO, (struct mbuf *)0,
if (tp->t_timer[i] && --tp->t_timer[i] == 0) {
(void) tcp_usrreq(tp->t_inpcb->inp_socket,
PRU_SLOWTIMO, (struct mbuf *)0,
- (struct mbuf *)i,
- (struct socketopt *)0);
+ (struct mbuf *)i, (struct mbuf *)0);
if (ipnxt->inp_prev != ip)
goto tpgone;
}
if (ipnxt->inp_prev != ip)
goto tpgone;
}