fix warnings for Haiku build

debug mode fixed


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14762 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval
2005-11-07 20:10:54 +00:00
parent e970946333
commit 909e5eb1d4
4 changed files with 38 additions and 27 deletions
+1 -1
View File
@@ -8,7 +8,7 @@
#endif
#include "net_misc.h"
#include "sys/socket.h"
#include <sys/socket.h>
/* Basically use dump_ to see the address plus message on a line,
* print_ to simply have the address printed with nothing else...
@@ -1,22 +1,22 @@
/* icmp.c
*/
#ifndef _KERNEL_MODE
#include <stdio.h>
#include <string.h>
#endif
#include <string.h>
#include "net_misc.h"
#include "sys/socket.h"
#include "netinet/in_systm.h"
#include "netinet/ip.h"
#include "netinet/ip_icmp.h"
#include <sys/socket.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/ip_icmp.h>
#include "protocols.h"
#include "sys/protosw.h"
#include "sys/domain.h"
#include "netinet/icmp_var.h"
#include "netinet/in_var.h"
#include "net/if.h"
#include <netinet/icmp_var.h>
#include <netinet/in_var.h>
#include <net/if.h>
#include "core_module.h"
#include "net_module.h"
@@ -43,18 +43,18 @@ static struct route icmprt;
static void dump_icmp(struct mbuf *buf)
{
struct ip *ip = mtod(buf, struct ip *);
struct icmp *ic = (struct icmp*)((caddr_t)ip + (ip->hl * 4));
struct icmp *ic = (struct icmp*)((caddr_t)ip + (ip->ip_hl * 4));
printf("ICMP: ");
switch (ic->icmp_type) {
case ICMP_ECHORQST:
case ICMP_ECHO:
printf ("Echo request\n");
break;
case ICMP_ECHORPLY:
case ICMP_ECHOREPLY:
printf("echo reply\n");
break;
default:
printf("?? type = %d\n", ic->type);
printf("?? type = %d\n", ic->icmp_type);
}
}
#endif
@@ -65,7 +65,17 @@ struct route ipforward_rt;
//int ipv4_output(struct mbuf *, struct mbuf *, struct route *, int, void *);
#if SHOW_DEBUG
static void dump_ipv4_header(struct mbuf *buf)
void
dump_ipv4_addr(char *msg, void *ad)
{
uint8 *b = (uint8*)ad;
printf("%s %d.%d.%d.%d\n", msg, b[0], b[1], b[2], b[3]);
}
static void
dump_ipv4_header(struct mbuf *buf)
{
struct ip *ip = mtod(buf, struct ip *);
@@ -629,7 +639,7 @@ void ipv4_input(struct mbuf *m, int hdrlen)
struct ipq *fp;
#if SHOW_DEBUG
dump_ipv4_header(buf);
dump_ipv4_header(m);
#endif
if (!m)
return;
+13 -12
View File
@@ -3,21 +3,21 @@
#ifndef _KERNEL_MODE
#include <stdio.h>
#include <string.h>
#endif
#include <string.h>
#include "net_misc.h"
#include "protocols.h"
#include "netinet/in_systm.h"
#include "netinet/in_var.h"
#include "netinet/in_pcb.h"
#include "netinet/ip.h"
#include <netinet/in_systm.h>
#include <netinet/in_var.h>
#include <netinet/in_pcb.h>
#include <netinet/ip.h>
#include "sys/domain.h"
#include "sys/protosw.h"
#include "netinet/ip_var.h"
#include "netinet/udp.h"
#include "netinet/udp_var.h"
#include "netinet/ip_icmp.h"
#include <netinet/ip_var.h>
#include <netinet/udp.h>
#include <netinet/udp_var.h>
#include <netinet/ip_icmp.h>
#include "core_module.h"
#include "net_module.h"
@@ -51,9 +51,10 @@ static void dump_udp(struct mbuf *buf)
struct udphdr *udp = (struct udphdr*)((caddr_t)ip + (ip->ip_hl * 4));
printf("udp_header :\n");
printf(" : src_port : %d\n", ntohs(udp->src_port));
printf(" : dst_port : %d\n", ntohs(udp->dst_port));
printf(" : udp length : %d bytes\n", ntohs(udp->length));
printf(" : src_port : %d\n", ntohs(udp->uh_sport));
printf(" : dst_port : %d\n", ntohs(udp->uh_dport));
printf(" : udp length : %d bytes\n", ntohs(udp->uh_ulen));
printf(" : udp sum : %d\n", ntohs(udp->uh_sum));
}
#endif /* SHOW_DEBUG */