Fixed unix port after changing struct ip_addr to ip_addr_t

This commit is contained in:
goldsimon 2010-02-09 13:19:01 +00:00
parent b5212c5d60
commit e70c0bd3f5
11 changed files with 30 additions and 30 deletions

View File

@ -62,7 +62,7 @@ struct delif {
struct delif_pbuf {
struct delif_pbuf *next;
struct pbuf *p;
struct ip_addr *ipaddr;
ip_addr_t *ipaddr;
unsigned int time;
};
@ -155,7 +155,7 @@ delif_output_timeout(void *arg)
}
/*-----------------------------------------------------------------------------------*/
static err_t
delif_output(struct netif *netif, struct pbuf *p, struct ip_addr *ipaddr)
delif_output(struct netif *netif, struct pbuf *p, ip_addr_t *ipaddr)
{
struct delif_pbuf *dp, *np;
struct pbuf *q;

View File

@ -80,7 +80,7 @@ static char errbuf[PCAP_ERRBUF_SIZE];
/*-----------------------------------------------------------------------------------*/
static err_t
pcapif_output(struct netif *netif, struct pbuf *p,
struct ip_addr *ipaddr)
ip_addr_t *ipaddr)
{
return ERR_OK;
}

View File

@ -76,14 +76,14 @@ tcpdump(struct pbuf *p)
tcphdr = (struct tcp_hdr *)((char *)iphdr + IP_HLEN);
pbuf_header(p, -IP_HLEN);
if (inet_chksum_pseudo(p, (struct ip_addr *)&(iphdr->src),
(struct ip_addr *)&(iphdr->dest),
if (inet_chksum_pseudo(p, (ip_addr_t *)&(iphdr->src),
(ip_addr_t *)&(iphdr->dest),
IP_PROTO_TCP, p->tot_len) != 0) {
LWIP_DEBUGF(TCPDUMP_DEBUG, ("tcpdump: IP checksum failed!\n"));
/* fprintf(file, "chksum 0x%lx ", tcphdr->chksum);
tcphdr->chksum = 0;
fprintf(file, "should be 0x%lx ", inet_chksum_pseudo(p, (struct ip_addr *)&(iphdr->src),
(struct ip_addr *)&(iphdr->dest),
fprintf(file, "should be 0x%lx ", inet_chksum_pseudo(p, (ip_addr_t *)&(iphdr->src),
(ip_addr_t *)&(iphdr->dest),
IP_PROTO_TCP, p->tot_len));*/
fprintf(file, "!chksum ");
}
@ -146,14 +146,14 @@ tcpdump(struct pbuf *p)
udphdr = (struct udp_hdr *)((char *)iphdr + IP_HLEN);
pbuf_header(p, -IP_HLEN);
if (inet_chksum_pseudo(p, (struct ip_addr *)&(iphdr->src),
(struct ip_addr *)&(iphdr->dest),
if (inet_chksum_pseudo(p, (ip_addr_t *)&(iphdr->src),
(ip_addr_t *)&(iphdr->dest),
IP_PROTO_UDP, p->tot_len) != 0) {
LWIP_DEBUGF(TCPDUMP_DEBUG, ("tcpdump: IP checksum failed!\n"));
/* fprintf(file, "chksum 0x%lx ", tcphdr->chksum);
tcphdr->chksum = 0;
fprintf(file, "should be 0x%lx ", inet_chksum_pseudo(p, (struct ip_addr *)&(iphdr->src),
(struct ip_addr *)&(iphdr->dest),
fprintf(file, "should be 0x%lx ", inet_chksum_pseudo(p, (ip_addr_t *)&(iphdr->src),
(ip_addr_t *)&(iphdr->dest),
IP_PROTO_TCP, p->tot_len));*/
fprintf(file, "!chksum ");
}

View File

@ -62,7 +62,7 @@ struct tunif {
/* Forward declarations. */
static void tunif_input(struct netif *netif);
static err_t tunif_output(struct netif *netif, struct pbuf *p,
struct ip_addr *ipaddr);
ip_addr_t *ipaddr);
static void tunif_thread(void *data);
@ -231,7 +231,7 @@ tunif_thread(void *arg)
/*-----------------------------------------------------------------------------------*/
static err_t
tunif_output(struct netif *netif, struct pbuf *p,
struct ip_addr *ipaddr)
ip_addr_t *ipaddr)
{
struct tunif *tunif;
LWIP_UNUSED_ARG(ipaddr);

View File

@ -92,7 +92,7 @@ unix_socket_client(char *name)
memset(&unix_addr, 0, sizeof(unix_addr));
unix_addr.sun_family = AF_UNIX;
snprintf(unix_addr.sun_path, sizeof(unix_addr.sun_path), "%s%05d", "/var/tmp/", getpid());
#if !defined(linux) && !defined(cygwin)
#if !defined(linux) && !defined(cygwin) && !defined(__CYGWIN__)
len = sizeof(unix_addr.sun_len) + sizeof(unix_addr.sun_family) +
strlen(unix_addr.sun_path) + 1;
unix_addr.sun_len = len;
@ -116,7 +116,7 @@ unix_socket_client(char *name)
memset(&unix_addr, 0, sizeof(unix_addr));
unix_addr.sun_family = AF_UNIX;
strcpy(unix_addr.sun_path, name);
#if !defined(linux) && !defined(cygwin)
#if !defined(linux) && !defined(cygwin) && !defined(__CYGWIN__)
len = sizeof(unix_addr.sun_len) + sizeof(unix_addr.sun_family) +
strlen(unix_addr.sun_path) + 1;
unix_addr.sun_len = len;
@ -150,7 +150,7 @@ unix_socket_server(char *name)
memset(&unix_addr, 0, sizeof(unix_addr));
unix_addr.sun_family = AF_UNIX;
strcpy(unix_addr.sun_path, name);
#if !defined(linux) && !defined(cygwin)
#if !defined(linux) && !defined(cygwin) && !defined(__CYGWIN__)
len = sizeof(unix_addr.sun_len) + sizeof(unix_addr.sun_family) +
strlen(unix_addr.sun_path) + 1;
unix_addr.sun_len = len;
@ -282,7 +282,7 @@ unixif_thread2(void *arg)
static void unixif_output_timeout(void *arg);
static err_t
unixif_output(struct netif *netif, struct pbuf *p, struct ip_addr *ipaddr)
unixif_output(struct netif *netif, struct pbuf *p, ip_addr_t *ipaddr)
{
struct unixif *unixif;
struct unixif_buf *buf;

View File

@ -26,7 +26,7 @@
*
* Author: Kieran Mansley <kjm25@cam.ac.uk>
*
* $Id: unixlib.c,v 1.7 2010/01/07 10:21:13 goldsimon Exp $
* $Id: unixlib.c,v 1.8 2010/02/09 13:19:01 goldsimon Exp $
*/
/*-----------------------------------------------------------------------------------*/
@ -59,7 +59,7 @@ struct netif netif;
static void
tcpip_init_done(void *arg)
{
struct ip_addr ipaddr, netmask, gateway;
ip_addr_t ipaddr, netmask, gateway;
sys_sem_t *sem;
sem = arg;

View File

@ -47,7 +47,7 @@ LWIPDIR=$(CONTRIBDIR)/../lwip/src
CFLAGS:=$(CFLAGS) \
-I$(LWIPDIR)/include -I$(LWIPARCH)/include -I$(LWIPDIR)/include/ipv4 \
-Iapps -I.
-I. -I$(CONTRIBDIR)/apps/snmp_private_mib
# COREFILES, CORE4FILES: The minimum set of files needed for lwIP.
COREFILES=$(LWIPDIR)/core/mem.c $(LWIPDIR)/core/memp.c $(LWIPDIR)/core/netif.c \

View File

@ -58,11 +58,11 @@
#include "private_mib.h"
/* (manual) host IP configuration */
static struct ip_addr ipaddr, netmask, gw;
static ip_addr_t ipaddr, netmask, gw;
/* SNMP trap destination cmd option */
static unsigned char trap_flag;
static struct ip_addr trap_addr;
static ip_addr_t trap_addr;
/* nonstatic debug cmd option, exported in lwipopts.h */
unsigned char debug_flags;

View File

@ -80,11 +80,11 @@
#endif
/* (manual) host IP configuration */
static struct ip_addr ipaddr, netmask, gw;
static ip_addr_t ipaddr, netmask, gw;
/* ping out destination cmd option */
static unsigned char ping_flag;
static struct ip_addr ping_addr;
static ip_addr_t ping_addr;
/* nonstatic debug cmd option, exported in lwipopts.h */
unsigned char debug_flags;
@ -206,14 +206,14 @@ static int seq_num;
#if 0
/* Ping using the raw api */
static int
ping_recv(void *arg, struct raw_pcb *pcb, struct pbuf *p, struct ip_addr *addr)
ping_recv(void *arg, struct raw_pcb *pcb, struct pbuf *p, ip_addr_t *addr)
{
printf("ping recv\n");
return 1; /* eat the event */
}
static void
ping_send(struct raw_pcb *raw, struct ip_addr *addr)
ping_send(struct raw_pcb *raw, ip_addr_t *addr)
{
struct pbuf *p;
struct icmp_echo_hdr *iecho;
@ -256,7 +256,7 @@ ping_thread(void *arg)
/* Ping using the socket api */
static void
ping_send(int s, struct ip_addr *addr)
ping_send(int s, ip_addr_t *addr)
{
struct icmp_echo_hdr *iecho;
struct sockaddr_in to;
@ -280,7 +280,7 @@ ping_send(int s, struct ip_addr *addr)
}
static void
ping_recv(int s, struct ip_addr *addr)
ping_recv(int s, ip_addr_t *addr)
{
char buf[200];
socklen_t fromlen;

View File

@ -80,7 +80,7 @@ struct netif netif_unix;
static void
tcpip_init_done(void *arg)
{
struct ip_addr ipaddr, netmask, gw;
ip_addr_t ipaddr, netmask, gw;
sys_sem_t *sem;
sem = arg;

View File

@ -84,7 +84,7 @@ struct netif netif_tap, netif_unix;
static void
tcpip_init_done(void *arg)
{
struct ip_addr ipaddr, netmask, gw;
ip_addr_t ipaddr, netmask, gw;
sys_sem_t *sem;
sem = arg;