diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 61f7afd98c18..20447b3bc9c8 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -1,4 +1,4 @@ -/* $NetBSD: ip_output.c,v 1.20 1995/04/11 04:30:56 mycroft Exp $ */ +/* $NetBSD: ip_output.c,v 1.21 1995/04/13 06:35:38 cgd Exp $ */ /* * Copyright (c) 1982, 1986, 1988, 1990, 1993 @@ -269,7 +269,7 @@ ip_output(m0, opt, ro, flags, imo) goto bad; } /* don't allow broadcast messages to be fragmented */ - if ((u_short)ip->ip_len > ifp->if_mtu) { + if ((u_int16_t)ip->ip_len > ifp->if_mtu) { error = EMSGSIZE; goto bad; } @@ -281,9 +281,9 @@ sendit: /* * If small enough for interface, can just send directly. */ - if ((u_short)ip->ip_len <= ifp->if_mtu) { - ip->ip_len = htons((u_short)ip->ip_len); - ip->ip_off = htons((u_short)ip->ip_off); + if ((u_int16_t)ip->ip_len <= ifp->if_mtu) { + ip->ip_len = htons((u_int16_t)ip->ip_len); + ip->ip_off = htons((u_int16_t)ip->ip_off); ip->ip_sum = 0; ip->ip_sum = in_cksum(m, hlen); error = (*ifp->if_output)(ifp, m, @@ -315,7 +315,7 @@ sendit: */ m0 = m; mhlen = sizeof (struct ip); - for (off = hlen + len; off < (u_short)ip->ip_len; off += len) { + for (off = hlen + len; off < (u_int16_t)ip->ip_len; off += len) { MGETHDR(m, M_DONTWAIT, MT_HEADER); if (m == 0) { error = ENOBUFS; @@ -333,11 +333,11 @@ sendit: mhip->ip_off = ((off - hlen) >> 3) + (ip->ip_off & ~IP_MF); if (ip->ip_off & IP_MF) mhip->ip_off |= IP_MF; - if (off + len >= (u_short)ip->ip_len) - len = (u_short)ip->ip_len - off; + if (off + len >= (u_int16_t)ip->ip_len) + len = (u_int16_t)ip->ip_len - off; else mhip->ip_off |= IP_MF; - mhip->ip_len = htons((u_short)(len + mhlen)); + mhip->ip_len = htons((u_int16_t)(len + mhlen)); m->m_next = m_copy(m0, off, len); if (m->m_next == 0) { (void) m_free(m); @@ -347,7 +347,7 @@ sendit: } m->m_pkthdr.len = mhlen + len; m->m_pkthdr.rcvif = (struct ifnet *)0; - mhip->ip_off = htons((u_short)mhip->ip_off); + mhip->ip_off = htons((u_int16_t)mhip->ip_off); mhip->ip_sum = 0; mhip->ip_sum = in_cksum(m, mhlen); *mnext = m; @@ -359,10 +359,10 @@ sendit: * and updating header, then send each fragment (in order). */ m = m0; - m_adj(m, hlen + firstlen - (u_short)ip->ip_len); + m_adj(m, hlen + firstlen - (u_int16_t)ip->ip_len); m->m_pkthdr.len = hlen + firstlen; - ip->ip_len = htons((u_short)m->m_pkthdr.len); - ip->ip_off = htons((u_short)(ip->ip_off | IP_MF)); + ip->ip_len = htons((u_int16_t)m->m_pkthdr.len); + ip->ip_off = htons((u_int16_t)(ip->ip_off | IP_MF)); ip->ip_sum = 0; ip->ip_sum = in_cksum(m, hlen); sendorfree: @@ -405,7 +405,7 @@ ip_insertoptions(m, opt, phlen) unsigned optlen; optlen = opt->m_len - sizeof(p->ipopt_dst); - if (optlen + (u_short)ip->ip_len > IP_MAXPACKET) + if (optlen + (u_int16_t)ip->ip_len > IP_MAXPACKET) return (m); /* XXX should fail */ if (p->ipopt_dst.s_addr) ip->ip_dst = p->ipopt_dst; @@ -656,7 +656,7 @@ ip_pcbopts(pcbopt, m) } #ifndef vax - if (m->m_len % sizeof(long)) + if (m->m_len % sizeof(int32_t)) goto bad; #endif /* @@ -1056,8 +1056,8 @@ ip_mloopback(ifp, m, dst) * than the interface's MTU. Can this possibly matter? */ ip = mtod(copym, struct ip *); - ip->ip_len = htons((u_short)ip->ip_len); - ip->ip_off = htons((u_short)ip->ip_off); + ip->ip_len = htons((u_int16_t)ip->ip_len); + ip->ip_off = htons((u_int16_t)ip->ip_off); ip->ip_sum = 0; ip->ip_sum = in_cksum(copym, ip->ip_hl << 2); (void) looutput(ifp, copym, (struct sockaddr *)dst, NULL); diff --git a/sys/netinet/ip_var.h b/sys/netinet/ip_var.h index b76c32a58869..fbb94182993d 100644 --- a/sys/netinet/ip_var.h +++ b/sys/netinet/ip_var.h @@ -1,4 +1,4 @@ -/* $NetBSD: ip_var.h,v 1.11 1995/03/26 20:32:33 jtc Exp $ */ +/* $NetBSD: ip_var.h,v 1.12 1995/04/13 06:36:06 cgd Exp $ */ /* * Copyright (c) 1982, 1986, 1993 @@ -39,12 +39,12 @@ * Overlay for ip header used by other protocols (tcp, udp). */ struct ipovly { - caddr_t ih_next, ih_prev; /* for protocol sequence q's */ - u_char ih_x1; /* (unused) */ - u_char ih_pr; /* protocol */ - short ih_len; /* protocol length */ - struct in_addr ih_src; /* source internet address */ - struct in_addr ih_dst; /* destination internet address */ + caddr_t ih_next, ih_prev; /* for protocol sequence q's */ + u_int8_t ih_x1; /* (unused) */ + u_int8_t ih_pr; /* protocol */ + int16_t ih_len; /* protocol length */ + struct in_addr ih_src; /* source internet address */ + struct in_addr ih_dst; /* destination internet address */ }; /* @@ -54,13 +54,13 @@ struct ipovly { * be reclaimed if memory becomes tight. */ struct ipq { - struct ipq *next,*prev; /* to other reass headers */ - u_char ipq_ttl; /* time for reass q to live */ - u_char ipq_p; /* protocol of this fragment */ - u_short ipq_id; /* sequence id for reassembly */ - struct ipasfrag *ipq_next,*ipq_prev; + struct ipq *next,*prev; /* to other reass headers */ + u_int8_t ipq_ttl; /* time for reass q to live */ + u_int8_t ipq_p; /* protocol of this fragment */ + u_int16_t ipq_id; /* sequence id for reassembly */ + struct ipasfrag *ipq_next,*ipq_prev; /* to ip headers of fragments */ - struct in_addr ipq_src,ipq_dst; + struct in_addr ipq_src,ipq_dst; }; /* @@ -70,24 +70,24 @@ struct ipq { */ struct ipasfrag { #if BYTE_ORDER == LITTLE_ENDIAN - u_char ip_hl:4, - ip_v:4; + u_int8_t ip_hl:4, + ip_v:4; #endif #if BYTE_ORDER == BIG_ENDIAN - u_char ip_v:4, - ip_hl:4; + u_int8_t ip_v:4, + ip_hl:4; #endif - u_char ipf_mff; /* XXX overlays ip_tos: use low bit + u_int8_t ipf_mff; /* XXX overlays ip_tos: use low bit * to avoid destroying tos; * copied from (ip_off&IP_MF) */ - short ip_len; - u_short ip_id; - short ip_off; - u_char ip_ttl; - u_char ip_p; - u_short ip_sum; - struct ipasfrag *ipf_next; /* next fragment */ - struct ipasfrag *ipf_prev; /* previous fragment */ + int16_t ip_len; + u_int16_t ip_id; + int16_t ip_off; + u_int8_t ip_ttl; + u_int8_t ip_p; + u_int16_t ip_sum; + struct ipasfrag *ipf_next; /* next fragment */ + struct ipasfrag *ipf_prev; /* previous fragment */ }; /* @@ -100,7 +100,7 @@ struct ipasfrag { struct ipoption { struct in_addr ipopt_dst; /* first-hop dst if source routed */ - char ipopt_list[MAX_IPOPTLEN]; /* options proper */ + int8_t ipopt_list[MAX_IPOPTLEN]; /* options proper */ }; /* @@ -108,11 +108,11 @@ struct ipoption { * passed to ip_output when IP multicast options are in use. */ struct ip_moptions { - struct ifnet *imo_multicast_ifp; /* ifp for outgoing multicasts */ - u_char imo_multicast_ttl; /* TTL for outgoing multicasts */ - u_char imo_multicast_loop; /* 1 => hear sends if a member */ - u_short imo_num_memberships; /* no. memberships this socket */ - struct in_multi *imo_membership[IP_MAX_MEMBERSHIPS]; + struct ifnet *imo_multicast_ifp; /* ifp for outgoing multicasts */ + u_int8_t imo_multicast_ttl; /* TTL for outgoing multicasts */ + u_int8_t imo_multicast_loop; /* 1 => hear sends if a member */ + u_int16_t imo_num_memberships; /* no. memberships this socket */ + struct in_multi *imo_membership[IP_MAX_MEMBERSHIPS]; }; struct ipstat { @@ -149,12 +149,11 @@ struct ipstat { #define IP_ROUTETOIF SO_DONTROUTE /* bypass routing tables */ #define IP_ALLOWBROADCAST SO_BROADCAST /* can send broadcast packets */ -struct ipstat ipstat; -struct ipq ipq; /* ip reass. queue */ -u_short ip_id; /* ip packet ctr, for ids */ -int ip_defttl; /* default IP ttl */ +struct ipstat ipstat; +struct ipq ipq; /* ip reass. queue */ +u_int16_t ip_id; /* ip packet ctr, for ids */ +int ip_defttl; /* default IP ttl */ -int in_control __P((struct socket *, int, caddr_t, struct ifnet *)); int ip_ctloutput __P((int, struct socket *, int, int, struct mbuf **)); void ip_deq __P((struct ipasfrag *)); int ip_dooptions __P((struct mbuf *)); diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index ec7fc441e98f..704feb9e8acb 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -1,4 +1,4 @@ -/* $NetBSD: raw_ip.c,v 1.16 1995/03/02 09:33:40 glass Exp $ */ +/* $NetBSD: raw_ip.c,v 1.17 1995/04/13 06:36:21 cgd Exp $ */ /* * Copyright (c) 1982, 1986, 1988, 1993 @@ -261,7 +261,7 @@ rip_usrreq(so, req, m, nam, control) (error = in_pcballoc(so, &rawinpcb))) break; inp = (struct inpcb *)so->so_pcb; - inp->inp_ip.ip_p = (int)nam; + inp->inp_ip.ip_p = (long)nam; break; case PRU_DISCONNECT: @@ -341,7 +341,7 @@ rip_usrreq(so, req, m, nam, control) */ case PRU_SEND: { - register u_long dst; + register u_int32_t dst; if (so->so_state & SS_ISCONNECTED) { if (nam) { diff --git a/sys/netinet/tcp.h b/sys/netinet/tcp.h index efbb3ff040b0..99945f49e23f 100644 --- a/sys/netinet/tcp.h +++ b/sys/netinet/tcp.h @@ -1,4 +1,4 @@ -/* $NetBSD: tcp.h,v 1.6 1994/06/29 06:38:34 cgd Exp $ */ +/* $NetBSD: tcp.h,v 1.7 1995/04/13 06:36:30 cgd Exp $ */ /* * Copyright (c) 1982, 1986, 1993 @@ -35,34 +35,34 @@ * @(#)tcp.h 8.1 (Berkeley) 6/10/93 */ -typedef u_long tcp_seq; +typedef u_int32_t tcp_seq; /* * TCP header. * Per RFC 793, September, 1981. */ struct tcphdr { - u_short th_sport; /* source port */ - u_short th_dport; /* destination port */ - tcp_seq th_seq; /* sequence number */ - tcp_seq th_ack; /* acknowledgement number */ + u_int16_t th_sport; /* source port */ + u_int16_t th_dport; /* destination port */ + tcp_seq th_seq; /* sequence number */ + tcp_seq th_ack; /* acknowledgement number */ #if BYTE_ORDER == LITTLE_ENDIAN - u_char th_x2:4, /* (unused) */ - th_off:4; /* data offset */ + u_int8_t th_x2:4, /* (unused) */ + th_off:4; /* data offset */ #endif #if BYTE_ORDER == BIG_ENDIAN - u_char th_off:4, /* data offset */ - th_x2:4; /* (unused) */ + u_int8_t th_off:4, /* data offset */ + th_x2:4; /* (unused) */ #endif - u_char th_flags; + u_int8_t th_flags; #define TH_FIN 0x01 #define TH_SYN 0x02 #define TH_RST 0x04 #define TH_PUSH 0x08 #define TH_ACK 0x10 #define TH_URG 0x20 - u_short th_win; /* window */ - u_short th_sum; /* checksum */ - u_short th_urp; /* urgent pointer */ + u_int16_t th_win; /* window */ + u_int16_t th_sum; /* checksum */ + u_int16_t th_urp; /* urgent pointer */ }; #define TCPOPT_EOL 0 diff --git a/sys/netinet/tcp_debug.c b/sys/netinet/tcp_debug.c index d4d0853f6e80..beabcd33c963 100644 --- a/sys/netinet/tcp_debug.c +++ b/sys/netinet/tcp_debug.c @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_debug.c,v 1.8 1994/06/29 06:38:36 cgd Exp $ */ +/* $NetBSD: tcp_debug.c,v 1.9 1995/04/13 06:36:32 cgd Exp $ */ /* * Copyright (c) 1982, 1986, 1993 @@ -120,7 +120,7 @@ tcp_trace(act, ostate, tp, ti, req) if (act == TA_OUTPUT) { seq = ntohl(seq); ack = ntohl(ack); - len = ntohs((u_short)len); + len = ntohs((u_int16_t)len); } if (act == TA_OUTPUT) len -= sizeof (struct tcphdr); diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index e386ffb37db4..308c9e9188db 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_input.c,v 1.11 1994/10/14 16:01:49 mycroft Exp $ */ +/* $NetBSD: tcp_input.c,v 1.12 1995/04/13 06:36:37 cgd Exp $ */ /* * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1994 @@ -232,7 +232,8 @@ tcp_input(m, iphlen) struct in_addr laddr; int dropsocket = 0; int iss = 0; - u_long tiwin, ts_val, ts_ecr; + u_long tiwin; + u_int32_t ts_val, ts_ecr; int ts_present = 0; tcpstat.tcps_rcvtotal++; @@ -258,7 +259,7 @@ tcp_input(m, iphlen) len = sizeof (struct ip) + tlen; ti->ti_next = ti->ti_prev = 0; ti->ti_x1 = 0; - ti->ti_len = (u_short)tlen; + ti->ti_len = (u_int16_t)tlen; HTONS(ti->ti_len); if (ti->ti_sum = in_cksum(m, len)) { tcpstat.tcps_rcvbadsum++; @@ -297,11 +298,11 @@ tcp_input(m, iphlen) if ((optlen == TCPOLEN_TSTAMP_APPA || (optlen > TCPOLEN_TSTAMP_APPA && optp[TCPOLEN_TSTAMP_APPA] == TCPOPT_EOL)) && - *(u_long *)optp == htonl(TCPOPT_TSTAMP_HDR) && + *(u_int32_t *)optp == htonl(TCPOPT_TSTAMP_HDR) && (ti->ti_flags & TH_SYN) == 0) { ts_present = 1; - ts_val = ntohl(*(u_long *)(optp + 4)); - ts_ecr = ntohl(*(u_long *)(optp + 8)); + ts_val = ntohl(*(u_int32_t *)(optp + 4)); + ts_ecr = ntohl(*(u_int32_t *)(optp + 8)); optp = NULL; /* we've parsed the options */ } } @@ -1317,9 +1318,9 @@ tcp_dooptions(tp, cp, cnt, ti, ts_present, ts_val, ts_ecr) int cnt; struct tcpiphdr *ti; int *ts_present; - u_long *ts_val, *ts_ecr; + u_int32_t *ts_val, *ts_ecr; { - u_short mss; + u_int16_t mss; int opt, optlen; for (; cnt > 0; cnt -= optlen, cp += optlen) { diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index da2251e15de7..c69135323151 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_output.c,v 1.11 1995/01/23 20:18:35 mycroft Exp $ */ +/* $NetBSD: tcp_output.c,v 1.12 1995/04/13 06:36:41 cgd Exp $ */ /* * Copyright (c) 1982, 1986, 1988, 1990, 1993 @@ -278,18 +278,18 @@ send: if (flags & TH_SYN) { tp->snd_nxt = tp->iss; if ((tp->t_flags & TF_NOOPT) == 0) { - u_short mss; + u_int16_t mss; opt[0] = TCPOPT_MAXSEG; opt[1] = 4; - mss = htons((u_short) tcp_mss(tp, 0)); + mss = htons((u_int16_t) tcp_mss(tp, 0)); bcopy((caddr_t)&mss, (caddr_t)(opt + 2), sizeof(mss)); optlen = 4; if ((tp->t_flags & TF_REQ_SCALE) && ((flags & TH_ACK) == 0 || (tp->t_flags & TF_RCVD_SCALE))) { - *((u_long *) (opt + optlen)) = htonl( + *((u_int32_t *) (opt + optlen)) = htonl( TCPOPT_NOP << 24 | TCPOPT_WINDOW << 16 | TCPOLEN_WINDOW << 8 | @@ -308,7 +308,7 @@ send: (flags & TH_RST) == 0 && ((flags & (TH_SYN|TH_ACK)) == TH_SYN || (tp->t_flags & TF_RCVD_TSTMP))) { - u_long *lp = (u_long *)(opt + optlen); + u_int32_t *lp = (u_long *)(opt + optlen); /* Form timestamp option as shown in appendix A of RFC 1323. */ *lp++ = htonl(TCPOPT_TSTAMP_HDR); @@ -451,9 +451,9 @@ send: win = (long)TCP_MAXWIN << tp->rcv_scale; if (win < (long)(tp->rcv_adv - tp->rcv_nxt)) win = (long)(tp->rcv_adv - tp->rcv_nxt); - ti->ti_win = htons((u_short) (win>>tp->rcv_scale)); + ti->ti_win = htons((u_int16_t) (win>>tp->rcv_scale)); if (SEQ_GT(tp->snd_up, tp->snd_nxt)) { - ti->ti_urp = htons((u_short)(tp->snd_up - tp->snd_nxt)); + ti->ti_urp = htons((u_int16_t)(tp->snd_up - tp->snd_nxt)); ti->ti_flags |= TH_URG; } else /* @@ -469,7 +469,7 @@ send: * checksum extended header and data. */ if (len + optlen) - ti->ti_len = htons((u_short)(sizeof (struct tcphdr) + + ti->ti_len = htons((u_int16_t)(sizeof (struct tcphdr) + optlen + len)); ti->ti_sum = in_cksum(m, (int)(hdrlen + len)); diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 8aba993f9af6..e68b14498c0b 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_subr.c,v 1.12 1994/10/14 16:01:51 mycroft Exp $ */ +/* $NetBSD: tcp_subr.c,v 1.13 1995/04/13 06:36:44 cgd Exp $ */ /* * Copyright (c) 1982, 1986, 1988, 1990, 1993 @@ -172,8 +172,8 @@ tcp_respond(tp, ti, m, ack, seq, flags) m->m_len = sizeof (struct tcpiphdr); tlen = 0; #define xchg(a,b,type) { type t; t=a; a=b; b=t; } - xchg(ti->ti_dst.s_addr, ti->ti_src.s_addr, u_long); - xchg(ti->ti_dport, ti->ti_sport, u_short); + xchg(ti->ti_dst.s_addr, ti->ti_src.s_addr, u_int32_t); + xchg(ti->ti_dport, ti->ti_sport, u_int16_t); #undef xchg } ti->ti_len = htons((u_short)(sizeof (struct tcphdr) + tlen)); @@ -189,9 +189,9 @@ tcp_respond(tp, ti, m, ack, seq, flags) ti->ti_off = sizeof (struct tcphdr) >> 2; ti->ti_flags = flags; if (tp) - ti->ti_win = htons((u_short) (win >> tp->rcv_scale)); + ti->ti_win = htons((u_int16_t) (win >> tp->rcv_scale)); else - ti->ti_win = htons((u_short)win); + ti->ti_win = htons((u_int16_t)win); ti->ti_urp = 0; ti->ti_sum = 0; ti->ti_sum = in_cksum(m, tlen); diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c index a05631adaf25..0690b1f7e642 100644 --- a/sys/netinet/tcp_timer.c +++ b/sys/netinet/tcp_timer.c @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_timer.c,v 1.9 1994/10/14 16:01:52 mycroft Exp $ */ +/* $NetBSD: tcp_timer.c,v 1.10 1995/04/13 06:36:49 cgd Exp $ */ /* * Copyright (c) 1982, 1986, 1988, 1990, 1993 @@ -98,7 +98,7 @@ tcp_slowtimo() register struct inpcb *ip, *ipnxt; register struct tcpcb *tp; int s = splnet(); - register int i; + register long i; tcp_maxidle = TCPTV_KEEPCNT * tcp_keepintvl; /* diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 5800a2e02d8b..7eb7a314746a 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_usrreq.c,v 1.13 1995/03/21 07:48:14 glass Exp $ */ +/* $NetBSD: tcp_usrreq.c,v 1.14 1995/04/13 06:36:53 cgd Exp $ */ /* * Copyright (c) 1982, 1986, 1988, 1993 @@ -51,6 +51,7 @@ #include #include +#include #include #include #include @@ -86,7 +87,7 @@ tcp_usrreq(so, req, m, nam, control) int ostate; if (req == PRU_CONTROL) - return (in_control(so, (int)m, (caddr_t)nam, + return (in_control(so, (long)m, (caddr_t)nam, (struct ifnet *)control)); if (control && control->m_len) { m_freem(control); @@ -285,7 +286,7 @@ tcp_usrreq(so, req, m, nam, control) } m->m_len = 1; *mtod(m, caddr_t) = tp->t_iobc; - if (((int)nam & MSG_PEEK) == 0) + if (((long)nam & MSG_PEEK) == 0) tp->t_oobflags ^= (TCPOOB_HAVEDATA | TCPOOB_HADDATA); break; @@ -323,8 +324,8 @@ tcp_usrreq(so, req, m, nam, control) * routine for tracing's sake. */ case PRU_SLOWTIMO: - tp = tcp_timers(tp, (int)nam); - req |= (int)nam << 8; /* for debug's sake */ + tp = tcp_timers(tp, (long)nam); + req |= (long)nam << 8; /* for debug's sake */ break; default: diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 2bf5391b918c..d9ca46790999 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_var.h,v 1.10 1995/03/26 20:32:39 jtc Exp $ */ +/* $NetBSD: tcp_var.h,v 1.11 1995/04/13 06:37:01 cgd Exp $ */ /* * Copyright (c) 1982, 1986, 1993, 1994 @@ -122,8 +122,8 @@ struct tcpcb { u_char rcv_scale; /* window scaling for recv window */ u_char request_r_scale; /* pending window scaling */ u_char requested_s_scale; - u_long ts_recent; /* timestamp echo data */ - u_long ts_recent_age; /* when last updated */ + u_int32_t ts_recent; /* timestamp echo data */ + u_int32_t ts_recent_age; /* when last updated */ tcp_seq last_ack_sent; /* TUBA stuff */ @@ -236,7 +236,7 @@ struct tcpstat { #ifdef _KERNEL struct inpcb tcb; /* head of queue of active tcpcb's */ struct tcpstat tcpstat; /* tcp statistics */ -u_long tcp_now; /* for RFC 1323 timestamps */ +u_int32_t tcp_now; /* for RFC 1323 timestamps */ int tcp_attach __P((struct socket *)); void tcp_canceltimers __P((struct tcpcb *)); @@ -249,7 +249,7 @@ struct tcpcb * struct tcpcb * tcp_drop __P((struct tcpcb *, int)); void tcp_dooptions __P((struct tcpcb *, - u_char *, int, struct tcpiphdr *, int *, u_long *, u_long *)); + u_char *, int, struct tcpiphdr *, int *, u_int32_t *, u_int32_t *)); void tcp_drain __P((void)); void tcp_fasttimo __P((void)); void tcp_init __P((void)); @@ -264,7 +264,7 @@ void tcp_pulloutofband __P((struct socket *, void tcp_quench __P((struct inpcb *, int)); int tcp_reass __P((struct tcpcb *, struct tcpiphdr *, struct mbuf *)); void tcp_respond __P((struct tcpcb *, - struct tcpiphdr *, struct mbuf *, u_long, u_long, int)); + struct tcpiphdr *, struct mbuf *, tcp_seq, tcp_seq, int)); void tcp_setpersist __P((struct tcpcb *)); void tcp_slowtimo __P((void)); struct tcpiphdr * diff --git a/sys/netinet/udp.h b/sys/netinet/udp.h index 4015fc4fd579..c7964dfd30fc 100644 --- a/sys/netinet/udp.h +++ b/sys/netinet/udp.h @@ -1,4 +1,4 @@ -/* $NetBSD: udp.h,v 1.5 1994/06/29 06:38:56 cgd Exp $ */ +/* $NetBSD: udp.h,v 1.6 1995/04/13 06:37:10 cgd Exp $ */ /* * Copyright (c) 1982, 1986, 1993 @@ -40,8 +40,8 @@ * Per RFC 768, September, 1981. */ struct udphdr { - u_short uh_sport; /* source port */ - u_short uh_dport; /* destination port */ - short uh_ulen; /* udp length */ - u_short uh_sum; /* udp checksum */ + u_int16_t uh_sport; /* source port */ + u_int16_t uh_dport; /* destination port */ + int16_t uh_ulen; /* udp length */ + u_int16_t uh_sum; /* udp checksum */ }; diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 6b8622143cb6..946f0bc0f730 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -1,4 +1,4 @@ -/* $NetBSD: udp_usrreq.c,v 1.14 1994/06/29 06:38:57 cgd Exp $ */ +/* $NetBSD: udp_usrreq.c,v 1.15 1995/04/13 06:37:18 cgd Exp $ */ /* * Copyright (c) 1982, 1986, 1988, 1990, 1993 @@ -49,6 +49,7 @@ #include #include +#include #include #include #include @@ -121,7 +122,7 @@ udp_input(m, iphlen) * Make mbuf data length reflect UDP length. * If not enough data to reflect UDP length, drop. */ - len = ntohs((u_short)uh->uh_ulen); + len = ntohs((u_int16_t)uh->uh_ulen); if (ip->ip_len != len) { if (len > ip->ip_len) { udpstat.udps_badlen++; @@ -428,7 +429,7 @@ udp_output(inp, m, addr, control) ui->ui_next = ui->ui_prev = 0; ui->ui_x1 = 0; ui->ui_pr = IPPROTO_UDP; - ui->ui_len = htons((u_short)len + sizeof (struct udphdr)); + ui->ui_len = htons((u_int16_t)len + sizeof (struct udphdr)); ui->ui_src = inp->inp_laddr; ui->ui_dst = inp->inp_faddr; ui->ui_sport = inp->inp_lport; @@ -479,7 +480,7 @@ udp_usrreq(so, req, m, addr, control) int s; if (req == PRU_CONTROL) - return (in_control(so, (int)m, (caddr_t)addr, + return (in_control(so, (long)m, (caddr_t)addr, (struct ifnet *)control)); if (inp == NULL && req != PRU_ATTACH) { error = EINVAL;