diff --git a/src/add-ons/kernel/network/protocols/icmp/icmp.c b/src/add-ons/kernel/network/protocols/icmp/icmp.c index 7162e185a7..0c83dcd62e 100644 --- a/src/add-ons/kernel/network/protocols/icmp/icmp.c +++ b/src/add-ons/kernel/network/protocols/icmp/icmp.c @@ -121,8 +121,7 @@ static void icmp_reflect(struct mbuf *m) ip->ip_ttl = MAXTTL; if (optlen > 0) { uint8 *cp; - int opt, cnt; - uint len; + int opt, cnt, len; cp = (uint8*)(ip + 1); if ((opts = ipm->srcroute()) == 0 && @@ -172,7 +171,7 @@ done: m_free(opts); } -void icmp_input(struct mbuf *buf, int hdrlen) +static void icmp_input(struct mbuf *buf, int hdrlen) { struct ip *ip = mtod(buf, struct ip *); struct icmp *ic; @@ -189,8 +188,8 @@ void icmp_input(struct mbuf *buf, int hdrlen) #if SHOW_DEBUG dump_icmp(buf); #endif - i = hdrlen + min(icl, ICMP_ADVLENMIN); - if (buf->m_len < i && (buf = m_pullup(buf, i)) == NULL) { + i = hdrlen + min(icl, (int) ICMP_ADVLENMIN); + if ((int) buf->m_len < i && (buf = m_pullup(buf, i)) == NULL) { icmpstat.icps_tooshort++; return; } @@ -254,7 +253,7 @@ void icmp_input(struct mbuf *buf, int hdrlen) goto badcode; code = PRC_QUENCH; deliver: - if (icl < ICMP_ADVLENMIN || icl < ICMP_ADVLEN(ic) || + if (icl < (int) ICMP_ADVLENMIN || icl < ICMP_ADVLEN(ic) || (ic->icmp_ip.ip_hl < sizeof(struct ip) >> 2)) { icmpstat.icps_badlen++; goto freeit; @@ -295,7 +294,7 @@ freeit: } -void icmp_error(struct mbuf *n, int type, int code, n_long dest, +static void icmp_error(struct mbuf *n, int type, int code, n_long dest, struct ifnet *destifp) { struct ip *oip = mtod(n, struct ip*), *nip; @@ -432,7 +431,8 @@ struct icmp_module_info protocol_info = { std_ops }, icmp_protocol_init, - icmp_protocol_stop + icmp_protocol_stop, + NULL }, icmp_error diff --git a/src/add-ons/kernel/network/protocols/ipv4/ipv4.c b/src/add-ons/kernel/network/protocols/ipv4/ipv4.c index a8bb11ca93..722a66a7d7 100644 --- a/src/add-ons/kernel/network/protocols/ipv4/ipv4.c +++ b/src/add-ons/kernel/network/protocols/ipv4/ipv4.c @@ -1195,7 +1195,8 @@ struct ipv4_module_info protocol_info = { std_ops }, ipv4_module_init, - ipv4_module_stop + ipv4_module_stop, + NULL }, ipv4_output, diff --git a/src/add-ons/kernel/network/protocols/raw/raw.c b/src/add-ons/kernel/network/protocols/raw/raw.c index c88f32d5cc..f289f85634 100644 --- a/src/add-ons/kernel/network/protocols/raw/raw.c +++ b/src/add-ons/kernel/network/protocols/raw/raw.c @@ -32,7 +32,7 @@ static int rip_recvspace = 8192; struct ipstat ipstat; //XXX might need to be shared -void rip_init(void) +static void rip_init(void) { rawinpcb.inp_next = rawinpcb.inp_prev = &rawinpcb; memset(&ripsrc, 0, sizeof(ripsrc)); @@ -40,7 +40,7 @@ void rip_init(void) ripsrc.sin_len = sizeof(ripsrc); } -void rip_input(struct mbuf *m, int hdrlen) +static void rip_input(struct mbuf *m, int hdrlen) { struct ip *ip = mtod(m, struct ip*); struct inpcb *inp; @@ -80,7 +80,7 @@ void rip_input(struct mbuf *m, int hdrlen) return; } -int rip_output(struct mbuf *m, struct socket *so, uint32 dst) +static int rip_output(struct mbuf *m, struct socket *so, uint32 dst) { struct ip *ip; struct inpcb *inp = sotoinpcb(so); @@ -88,7 +88,7 @@ int rip_output(struct mbuf *m, struct socket *so, uint32 dst) int flags = (so->so_options & SO_DONTROUTE) | IP_ALLOWBROADCAST; if ((inp->inp_flags & INP_HDRINCL) == 0) { - M_PREPEND(m, sizeof(struct ip)); + M_PREPEND(m, (int) sizeof(struct ip)); ip = mtod(m, struct ip *); ip->ip_p = inp->inp_ip.ip_p; ip->ip_len = m->m_pkthdr.len; @@ -120,7 +120,7 @@ int rip_output(struct mbuf *m, struct socket *so, uint32 dst) return 0; } -int rip_userreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam, +static int rip_userreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam, struct mbuf *control) { int error = 0; @@ -229,7 +229,7 @@ int rip_userreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam, return error; } -int rip_ctloutput(int op, struct socket *so, int level, +static int rip_ctloutput(int op, struct socket *so, int level, int optnum, struct mbuf **m) { struct inpcb *inp = sotoinpcb(so); @@ -314,7 +314,8 @@ struct raw_module_info protocol_info = { std_ops }, raw_module_init, - raw_module_stop + raw_module_stop, + NULL }, &rip_input }; diff --git a/src/add-ons/kernel/network/protocols/tcp/tcp.c b/src/add-ons/kernel/network/protocols/tcp/tcp.c index 817b1253e5..b9e54bd696 100644 --- a/src/add-ons/kernel/network/protocols/tcp/tcp.c +++ b/src/add-ons/kernel/network/protocols/tcp/tcp.c @@ -67,13 +67,13 @@ tcp_seq tcp_iss; /* tcp initial send seq # */ // XXX shared? look into sockbuf.c uint32 sb_max = SB_MAX; -void tcp_init(void) +static void tcp_init(void) { tcp_now = arc4random() / 2; tcp_iss = 1; tcb.inp_next = tcb.inp_prev = &tcb; - if (get_max_protohdr() < sizeof(struct tcpiphdr)) + if (get_max_protohdr() < (int) sizeof(struct tcpiphdr)) set_max_protohdr(sizeof(struct tcpiphdr)); memset(&tcpstat, 0, sizeof(struct tcpstat)); @@ -277,7 +277,7 @@ void tcp_respond(struct tcpcb *tp, struct tcpiphdr *ti, struct mbuf *m, ipm->output(m, NULL, ro, 0, NULL); } -struct tcpcb *tcp_usrclosed(struct tcpcb *tp) +static struct tcpcb *tcp_usrclosed(struct tcpcb *tp) { switch(tp->t_state) { case TCPS_CLOSED: @@ -554,7 +554,8 @@ struct kernel_net_module_info protocol_info = { std_ops }, tcp_module_init, - tcp_module_stop + tcp_module_stop, + NULL }; // #pragma mark - diff --git a/src/add-ons/kernel/network/protocols/udp/udp.c b/src/add-ons/kernel/network/protocols/udp/udp.c index 316df02646..180ead2f64 100644 --- a/src/add-ons/kernel/network/protocols/udp/udp.c +++ b/src/add-ons/kernel/network/protocols/udp/udp.c @@ -57,7 +57,8 @@ static void dump_udp(struct mbuf *buf) } #endif /* SHOW_DEBUG */ -int udp_output(struct inpcb *inp, struct mbuf *m, struct mbuf *addr,struct mbuf *control) +static int udp_output(struct inpcb *inp, struct mbuf *m, struct mbuf *addr, + struct mbuf *control) { struct udpiphdr *ui; uint16 len = m->m_pkthdr.len; @@ -85,7 +86,7 @@ int udp_output(struct inpcb *inp, struct mbuf *m, struct mbuf *addr,struct mbuf } } - M_PREPEND(m, sizeof(*ui)); + M_PREPEND(m, (int) sizeof(*ui)); if (!m) { error = ENOMEM; goto release; @@ -132,7 +133,7 @@ release: return error; } -int udp_userreq(struct socket *so, int req, +static int udp_userreq(struct socket *so, int req, struct mbuf *m, struct mbuf *addr, struct mbuf *ctrl) { struct inpcb *inp = sotoinpcb(so); @@ -227,7 +228,7 @@ release: return error; } -void udp_input(struct mbuf *buf, int hdrlen) +static void udp_input(struct mbuf *buf, int hdrlen) { struct ip *ip = mtod(buf, struct ip*); struct udphdr *udp = (struct udphdr*)((caddr_t)ip + hdrlen); @@ -332,7 +333,7 @@ static void udp_ctlinput(int cmd, struct sockaddr *sa, void *ipp) in_pcbnotify(&udb, sa, 0, zeroin_addr, 0, cmd, udp_notify); } -void udp_init(void) +static void udp_init(void) { udb.inp_prev = udb.inp_next = &udb; udp_sendspace = 9216; /* default size */ @@ -392,7 +393,8 @@ struct kernel_net_module_info protocol_info = { std_ops }, udp_module_init, - udp_module_stop + udp_module_stop, + NULL }; // #pragma mark -