Use const and static as needed, disable unused code
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3452 c046a42c-6fe2-441c-8c8c-71466251a162
diff --git a/slirp/ip_input.c b/slirp/ip_input.c
index 629745f..b046840 100644
--- a/slirp/ip_input.c
+++ b/slirp/ip_input.c
@@ -45,14 +45,19 @@
#include <slirp.h>
#include "ip_icmp.h"
-int ip_defttl;
-
#ifdef LOG_ENABLED
struct ipstat ipstat;
#endif
struct ipq ipq;
+static struct ip *ip_reass(register struct ipasfrag *ip,
+ register struct ipq *fp);
+static void ip_freef(struct ipq *fp);
+static void ip_enq(register struct ipasfrag *p,
+ register struct ipasfrag *prev);
+static void ip_deq(register struct ipasfrag *p);
+
/*
* IP initialization: fill in IP protocol switch table.
* All protocols not implemented in kernel go to raw IP protocol handler.
@@ -64,7 +69,6 @@
ip_id = tt.tv_sec & 0xffff;
udp_init();
tcp_init();
- ip_defttl = IPDEFTTL;
}
/*
@@ -239,10 +243,8 @@
* reassembly of this datagram already exists, then it
* is given as fp; otherwise have to make a chain.
*/
-struct ip *
-ip_reass(ip, fp)
- register struct ipasfrag *ip;
- register struct ipq *fp;
+static struct ip *
+ip_reass(register struct ipasfrag *ip, register struct ipq *fp)
{
register struct mbuf *m = dtom(ip);
register struct ipasfrag *q;
@@ -398,9 +400,8 @@
* Free a fragment reassembly header and all
* associated datagrams.
*/
-void
-ip_freef(fp)
- struct ipq *fp;
+static void
+ip_freef(struct ipq *fp)
{
register struct ipasfrag *q, *p;
@@ -418,9 +419,8 @@
* Put an ip fragment on a reassembly chain.
* Like insque, but pointers in middle of structure.
*/
-void
-ip_enq(p, prev)
- register struct ipasfrag *p, *prev;
+static void
+ip_enq(register struct ipasfrag *p, register struct ipasfrag *prev)
{
DEBUG_CALL("ip_enq");
DEBUG_ARG("prev = %lx", (long)prev);
@@ -433,9 +433,8 @@
/*
* To ip_enq as remque is to insque.
*/
-void
-ip_deq(p)
- register struct ipasfrag *p;
+static void
+ip_deq(register struct ipasfrag *p)
{
((struct ipasfrag *)(p->ipf_prev))->ipf_next = p->ipf_next;
((struct ipasfrag *)(p->ipf_next))->ipf_prev = p->ipf_prev;