diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-06-29 12:22:50 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-06-29 12:22:50 -0600 |
commit | 5c4d51bb64d37019f2991fe2cc7615b5f64faf80 (patch) | |
tree | 6d5c9cbbb485dd5017d6fc73e756b5166999f032 | |
parent | 1deaf2a9634576bf0e0f35a24911c3f22215fbd2 (diff) | |
download | nuttx-5c4d51bb64d37019f2991fe2cc7615b5f64faf80.tar.gz nuttx-5c4d51bb64d37019f2991fe2cc7615b5f64faf80.tar.bz2 nuttx-5c4d51bb64d37019f2991fe2cc7615b5f64faf80.zip |
NET: Renaming of IP address types
38 files changed, 150 insertions, 143 deletions
diff --git a/apps/include/netutils/smtp.h b/apps/include/netutils/smtp.h index 05b4d543e..cb344b9df 100644 --- a/apps/include/netutils/smtp.h +++ b/apps/include/netutils/smtp.h @@ -52,23 +52,28 @@ ****************************************************************************/ /**************************************************************************** - * Public Function Prototypes + * Public Data ****************************************************************************/ #ifdef __cplusplus #define EXTERN extern "C" -extern "C" { +extern "C" +{ #else #define EXTERN extern #endif -EXTERN void *smtp_open(void); -EXTERN void smtp_configure(void *handle, const char *localhostname, - const uip_ipaddr_t *paddr); -EXTERN int smtp_send(void *handle, const char *to, const char *cc, - const char *from, const char *subject, - const char *msg, int msglen); -EXTERN void smtp_close(void *handle); +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +void *smtp_open(void); +void smtp_configure(FAR void *handle, FAR const char *localhostname, + FAR const net_ipaddr_t *paddr); +int smtp_send(FAR void *handle, FAR const char *to, FAR const char *cc, + FAR const char *from, FAR const char *subject, + FAR const char *msg, int msglen); +void smtp_close(FAR void *handle); #undef EXTERN #ifdef __cplusplus diff --git a/apps/netutils/smtp/smtp.c b/apps/netutils/smtp/smtp.c index d83e260c5..4009beb0d 100644 --- a/apps/netutils/smtp/smtp.c +++ b/apps/netutils/smtp/smtp.c @@ -87,7 +87,7 @@ struct smtp_state uint8_t state; bool connected; sem_t sem; - uip_ipaddr_t smtpserver; + net_ipaddr_t smtpserver; const char *localhostname; const char *to; const char *cc; @@ -283,10 +283,10 @@ static inline int smtp_send_message(int sockfd, struct smtp_state *psmtp) * configured. */ -void smtp_configure(void *handle, const char *lhostname, - const uip_ipaddr_t *paddr) +void smtp_configure(FAR void *handle, FAR const char *lhostname, + FAR const net_ipaddr_t *paddr) { - struct smtp_state *psmtp = (struct smtp_state *)handle; + FAR struct smtp_state *psmtp = (FAR struct smtp_state *)handle; psmtp->localhostname = lhostname; uip_ipaddr_copy(psmtp->smtpserver, paddr); } diff --git a/apps/nshlib/nsh_netcmds.c b/apps/nshlib/nsh_netcmds.c index d0213bb54..4ea58d974 100644 --- a/apps/nshlib/nsh_netcmds.c +++ b/apps/nshlib/nsh_netcmds.c @@ -845,7 +845,7 @@ int cmd_ping(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) { FAR const char *fmt = g_fmtarginvalid; const char *staddr; - uip_ipaddr_t ipaddr; + net_ipaddr_t ipaddr; uint32_t start; uint32_t next; uint32_t dsec = 10; diff --git a/nuttx/include/nuttx/net/icmp.h b/nuttx/include/nuttx/net/icmp.h index 0e0fda6f7..3e1ea5605 100644 --- a/nuttx/include/nuttx/net/icmp.h +++ b/nuttx/include/nuttx/net/icmp.h @@ -122,8 +122,8 @@ struct icmp_iphdr_s uint8_t len[2]; /* 16-bit Payload length */ uint8_t proto; /* 8-bit Next header (same as IPv4 protocol field) */ uint8_t ttl; /* 8-bit Hop limit (like IPv4 TTL field) */ - uip_ip6addr_t srcipaddr; /* 128-bit Source address */ - uip_ip6addr_t destipaddr; /* 128-bit Destination address */ + net_ip6addr_t srcipaddr; /* 128-bit Source address */ + net_ip6addr_t destipaddr; /* 128-bit Destination address */ #else /* CONFIG_NET_IPv6 */ @@ -191,18 +191,20 @@ struct icmp_stats_s * Public Data ****************************************************************************/ -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - #ifdef __cplusplus #define EXTERN extern "C" -extern "C" { +extern "C" +{ #else #define EXTERN extern #endif -EXTERN int uip_ping(uip_ipaddr_t addr, uint16_t id, uint16_t seqno, uint16_t datalen, int dsecs); +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +int uip_ping(net_ipaddr_t addr, uint16_t id, uint16_t seqno, uint16_t datalen, + int dsecs); #undef EXTERN #ifdef __cplusplus diff --git a/nuttx/include/nuttx/net/igmp.h b/nuttx/include/nuttx/net/igmp.h index 67f676c5a..f2cc4a409 100644 --- a/nuttx/include/nuttx/net/igmp.h +++ b/nuttx/include/nuttx/net/igmp.h @@ -137,8 +137,8 @@ struct igmp_iphdr_s uint8_t len[2]; /* 16-bit Payload length */ uint8_t proto; /* 8-bit Next header (same as IPv4 protocol field) */ uint8_t ttl; /* 8-bit Hop limit (like IPv4 TTL field) */ - uip_ip6addr_t srcipaddr; /* 128-bit Source address */ - uip_ip6addr_t destipaddr; /* 128-bit Destination address */ + net_ip6addr_t srcipaddr; /* 128-bit Source address */ + net_ip6addr_t destipaddr; /* 128-bit Destination address */ #else /* CONFIG_NET_IPv6 */ @@ -211,7 +211,7 @@ typedef FAR struct wdog_s *WDOG_ID; struct igmp_group_s { struct igmp_group_s *next; /* Implements a singly-linked list */ - uip_ipaddr_t grpaddr; /* Group IP address */ + net_ipaddr_t grpaddr; /* Group IP address */ WDOG_ID wdog; /* WDOG used to detect timeouts */ sem_t sem; /* Used to wait for message transmission */ volatile uint8_t flags; /* See IGMP_ flags definitions */ @@ -231,8 +231,8 @@ extern "C" #define EXTERN extern #endif -EXTERN uip_ipaddr_t g_allsystems; -EXTERN uip_ipaddr_t g_allrouters; +EXTERN net_ipaddr_t g_allsystems; +EXTERN net_ipaddr_t g_allrouters; /**************************************************************************** * Public Function Prototypes diff --git a/nuttx/include/nuttx/net/netdev.h b/nuttx/include/nuttx/net/netdev.h index 00d112ead..ccf891ae1 100644 --- a/nuttx/include/nuttx/net/netdev.h +++ b/nuttx/include/nuttx/net/netdev.h @@ -102,9 +102,9 @@ struct net_driver_s /* Network identity */ - uip_ipaddr_t d_ipaddr; /* Host IP address assigned to the network interface */ - uip_ipaddr_t d_draddr; /* Default router IP address */ - uip_ipaddr_t d_netmask; /* Network subnet mask */ + net_ipaddr_t d_ipaddr; /* Host IP address assigned to the network interface */ + net_ipaddr_t d_draddr; /* Default router IP address */ + net_ipaddr_t d_netmask; /* Network subnet mask */ /* The d_buf array is used to hold incoming and outgoing packets. The device * driver should place incoming data into this buffer. When sending data, diff --git a/nuttx/include/nuttx/net/tcp.h b/nuttx/include/nuttx/net/tcp.h index d32a231f2..7b196f186 100644 --- a/nuttx/include/nuttx/net/tcp.h +++ b/nuttx/include/nuttx/net/tcp.h @@ -168,7 +168,7 @@ struct tcp_backlog_s; /* Forward reference */ struct tcp_conn_s { dq_entry_t node; /* Implements a doubly linked list */ - uip_ipaddr_t ripaddr; /* The IP address of the remote host */ + net_ipaddr_t ripaddr; /* The IP address of the remote host */ uint8_t rcvseq[4]; /* The sequence number that we expect to * receive next */ uint8_t sndseq[4]; /* The sequence number that was last sent by us */ @@ -343,8 +343,8 @@ struct tcp_iphdr_s uint8_t len[2]; /* 16-bit Payload length */ uint8_t proto; /* 8-bit Next header (same as IPv4 protocol field) */ uint8_t ttl; /* 8-bit Hop limit (like IPv4 TTL field) */ - uip_ip6addr_t srcipaddr; /* 128-bit Source address */ - uip_ip6addr_t destipaddr; /* 128-bit Destination address */ + net_ip6addr_t srcipaddr; /* 128-bit Source address */ + net_ip6addr_t destipaddr; /* 128-bit Destination address */ #else /* CONFIG_NET_IPv6 */ diff --git a/nuttx/include/nuttx/net/udp.h b/nuttx/include/nuttx/net/udp.h index 7daf78681..03d221fd5 100644 --- a/nuttx/include/nuttx/net/udp.h +++ b/nuttx/include/nuttx/net/udp.h @@ -74,7 +74,7 @@ struct uip_callback_s; /* Forward reference */ struct udp_conn_s { dq_entry_t node; /* Supports a doubly linked list */ - uip_ipaddr_t ripaddr; /* The IP address of the remote peer */ + net_ipaddr_t ripaddr; /* The IP address of the remote peer */ uint16_t lport; /* The local port number in network byte order */ uint16_t rport; /* The remote port number in network byte order */ uint8_t ttl; /* Default time-to-live */ @@ -99,8 +99,8 @@ struct udp_iphdr_s uint8_t len[2]; /* 16-bit Payload length */ uint8_t proto; /* 8-bit Next header (same as IPv4 protocol field) */ uint8_t ttl; /* 8-bit Hop limit (like IPv4 TTL field) */ - uip_ip6addr_t srcipaddr; /* 128-bit Source address */ - uip_ip6addr_t destipaddr; /* 128-bit Destination address */ + net_ip6addr_t srcipaddr; /* 128-bit Source address */ + net_ip6addr_t destipaddr; /* 128-bit Destination address */ #else /* CONFIG_NET_IPv6 */ diff --git a/nuttx/include/nuttx/net/uip.h b/nuttx/include/nuttx/net/uip.h index ee396aaec..c52561765 100644 --- a/nuttx/include/nuttx/net/uip.h +++ b/nuttx/include/nuttx/net/uip.h @@ -161,13 +161,13 @@ /* Representation of an IP address */ -typedef in_addr_t uip_ip4addr_t; -typedef uint16_t uip_ip6addr_t[8]; +typedef in_addr_t net_ip4addr_t; +typedef uint16_t net_ip6addr_t[8]; #ifdef CONFIG_NET_IPv6 -typedef uip_ip6addr_t uip_ipaddr_t; +typedef net_ip6addr_t net_ipaddr_t; #else -typedef uip_ip4addr_t uip_ipaddr_t; +typedef net_ip4addr_t net_ipaddr_t; #endif /* The IP header */ @@ -184,8 +184,8 @@ struct net_iphdr_s uint8_t len[2]; /* 16-bit Payload length */ uint8_t proto; /* 8-bit Next header (same as IPv4 protocol field) */ uint8_t ttl; /* 8-bit Hop limit (like IPv4 TTL field) */ - uip_ip6addr_t srcipaddr; /* 128-bit Source address */ - uip_ip6addr_t destipaddr; /* 128-bit Destination address */ + net_ip6addr_t srcipaddr; /* 128-bit Source address */ + net_ip6addr_t destipaddr; /* 128-bit Destination address */ #else /* CONFIG_NET_IPv6 */ @@ -299,7 +299,7 @@ int net_lockedwait(sem_t *sem); * * This function constructs an IPv4 address in network byte order. * - * addr A pointer to a uip_ipaddr_t variable that will be + * addr A pointer to a net_ipaddr_t variable that will be * filled in with the IPv4 address. * addr0 The first octet of the IPv4 address. * addr1 The second octet of the IPv4 address. @@ -362,7 +362,7 @@ int net_lockedwait(sem_t *sem); * * Example: * - * uip_ipaddr_t ipaddr1, ipaddr2; + * net_ipaddr_t ipaddr1, ipaddr2; * * uip_ipaddr(&ipaddr1, 192,16,1,2); * uip_ipaddr_copy(&ipaddr2, &ipaddr1); @@ -382,7 +382,7 @@ int net_lockedwait(sem_t *sem); ((uint16_t*)(dest))[1] = ((uint16_t*)(src))[1]; \ } while (0) #else /* !CONFIG_NET_IPv6 */ -# define uip_ipaddr_copy(dest, src) memcpy(&dest, &src, sizeof(uip_ip6addr_t)) +# define uip_ipaddr_copy(dest, src) memcpy(&dest, &src, sizeof(net_ip6addr_t)) # define uiphdr_ipaddr_copy(dest, src) uip_ipaddr_copy(dest, src) #endif /* !CONFIG_NET_IPv6 */ @@ -390,7 +390,7 @@ int net_lockedwait(sem_t *sem); * * Example: * - * uip_ipaddr_t ipaddr1, ipaddr2; + * net_ipaddr_t ipaddr1, ipaddr2; * * uip_ipaddr(&ipaddr1, 192,16,1,2); * if (uip_ipaddr_cmp(ipaddr2, ipaddr1)) @@ -406,7 +406,7 @@ int net_lockedwait(sem_t *sem); # define uip_ipaddr_cmp(addr1, addr2) (addr1 == addr2) # define uiphdr_ipaddr_cmp(addr1, addr2) uip_ipaddr_cmp(uip_ip4addr_conv(addr1), uip_ip4addr_conv(addr2)) #else /* !CONFIG_NET_IPv6 */ -# define uip_ipaddr_cmp(addr1, addr2) (memcmp(&addr1, &addr2, sizeof(uip_ip6addr_t)) == 0) +# define uip_ipaddr_cmp(addr1, addr2) (memcmp(&addr1, &addr2, sizeof(net_ip6addr_t)) == 0) # define uiphdr_ipaddr_cmp(addr1, addr2) uip_ipaddr_cmp(addr, addr2) #endif /* !CONFIG_NET_IPv6 */ @@ -417,7 +417,7 @@ int net_lockedwait(sem_t *sem); * * Example: * - * uip_ipaddr_t ipaddr1, ipaddr2, mask; + * net_ipaddr_t ipaddr1, ipaddr2, mask; * * uip_ipaddr(&mask, 255,255,255,0); * uip_ipaddr(&ipaddr1, 192,16,1,2); @@ -437,8 +437,8 @@ int net_lockedwait(sem_t *sem); (((in_addr_t)(addr1) & (in_addr_t)(mask)) == \ ((in_addr_t)(addr2) & (in_addr_t)(mask))) #else -bool uip_ipaddr_maskcmp(uip_ipaddr_t addr1, uip_ipaddr_t addr2, - uip_ipaddr_t mask); +bool uip_ipaddr_maskcmp(net_ipaddr_t addr1, net_ipaddr_t addr2, + net_ipaddr_t mask); #endif /* Mask out the network part of an IP address. @@ -448,7 +448,7 @@ bool uip_ipaddr_maskcmp(uip_ipaddr_t addr1, uip_ipaddr_t addr2, * * Example: * - * uip_ipaddr_t ipaddr1, ipaddr2, netmask; + * net_ipaddr_t ipaddr1, ipaddr2, netmask; * * uip_ipaddr(&ipaddr1, 192,16,1,2); * uip_ipaddr(&netmask, 255,255,255,0); diff --git a/nuttx/net/devif/devif.h b/nuttx/net/devif/devif.h index 5fcd846a2..6d81603d9 100644 --- a/nuttx/net/devif/devif.h +++ b/nuttx/net/devif/devif.h @@ -66,8 +66,8 @@ * Public Data ****************************************************************************/ -extern const uip_ipaddr_t g_alloneaddr; -extern const uip_ipaddr_t g_allzeroaddr; +extern const net_ipaddr_t g_alloneaddr; +extern const net_ipaddr_t g_allzeroaddr; /* Increasing number used for the IP ID field. */ diff --git a/nuttx/net/devif/devif_initialize.c b/nuttx/net/devif/devif_initialize.c index 1609ddd8b..861573c19 100644 --- a/nuttx/net/devif/devif_initialize.c +++ b/nuttx/net/devif/devif_initialize.c @@ -68,14 +68,14 @@ struct net_stats_s g_netstats; uint16_t g_ipid; -const uip_ipaddr_t g_alloneaddr = +const net_ipaddr_t g_alloneaddr = #ifdef CONFIG_NET_IPv6 {0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff}; #else 0xffffffff; #endif -const uip_ipaddr_t g_allzeroaddr = +const net_ipaddr_t g_allzeroaddr = #ifdef CONFIG_NET_IPv6 {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}; #else diff --git a/nuttx/net/devif/devif_input.c b/nuttx/net/devif/devif_input.c index 6b550dab2..b167eecb7 100644 --- a/nuttx/net/devif/devif_input.c +++ b/nuttx/net/devif/devif_input.c @@ -460,7 +460,7 @@ int uip_input(FAR struct net_driver_s *dev) if (!uip_ipaddr_cmp(uip_ip4addr_conv(pbuf->destipaddr), dev->d_ipaddr)) { #ifdef CONFIG_NET_IGMP - uip_ipaddr_t destip = uip_ip4addr_conv(pbuf->destipaddr); + net_ipaddr_t destip = uip_ip4addr_conv(pbuf->destipaddr); if (igmp_grpfind(dev, &destip) == NULL) #endif { diff --git a/nuttx/net/icmp/icmp.h b/nuttx/net/icmp/icmp.h index dd644d9ee..e0c2c756c 100644 --- a/nuttx/net/icmp/icmp.h +++ b/nuttx/net/icmp/icmp.h @@ -83,7 +83,7 @@ void icmp_poll(FAR struct net_driver_s *dev); /* Defined in icmp_send.c ***************************************************/ #ifdef CONFIG_NET_ICMP_PING -void icmp_send(FAR struct net_driver_s *dev, FAR uip_ipaddr_t *destaddr); +void icmp_send(FAR struct net_driver_s *dev, FAR net_ipaddr_t *destaddr); #endif /* CONFIG_NET_ICMP_PING */ #undef EXTERN diff --git a/nuttx/net/icmp/icmp_ping.c b/nuttx/net/icmp/icmp_ping.c index 7371f9d31..5e40d0a3a 100644 --- a/nuttx/net/icmp/icmp_ping.c +++ b/nuttx/net/icmp/icmp_ping.c @@ -82,7 +82,7 @@ struct icmp_ping_s uint32_t png_time; /* Start time for determining timeouts */ uint32_t png_ticks; /* System clock ticks to wait */ int png_result; /* 0: success; <0:negated errno on fail */ - uip_ipaddr_t png_addr; /* The peer to be ping'ed */ + net_ipaddr_t png_addr; /* The peer to be ping'ed */ uint16_t png_id; /* Used to match requests with replies */ uint16_t png_seqno; /* IN: seqno to send; OUT: seqno recieved */ uint16_t png_datlen; /* The length of data to send in the ECHO request */ @@ -323,7 +323,7 @@ end_wait: * ****************************************************************************/ -int uip_ping(uip_ipaddr_t addr, uint16_t id, uint16_t seqno, +int uip_ping(net_ipaddr_t addr, uint16_t id, uint16_t seqno, uint16_t datalen, int dsecs) { struct icmp_ping_s state; diff --git a/nuttx/net/icmp/icmp_send.c b/nuttx/net/icmp/icmp_send.c index 6ab73e777..9cbeb4ef6 100644 --- a/nuttx/net/icmp/icmp_send.c +++ b/nuttx/net/icmp/icmp_send.c @@ -90,7 +90,7 @@ * ****************************************************************************/ -void icmp_send(FAR struct net_driver_s *dev, FAR uip_ipaddr_t *destaddr) +void icmp_send(FAR struct net_driver_s *dev, FAR net_ipaddr_t *destaddr) { FAR struct icmp_iphdr_s *picmp = ICMPBUF; diff --git a/nuttx/net/igmp/igmp.h b/nuttx/net/igmp/igmp.h index 2285dbd8b..a1b33c8b2 100644 --- a/nuttx/net/igmp/igmp.h +++ b/nuttx/net/igmp/igmp.h @@ -82,11 +82,11 @@ void igmp_input(struct net_driver_s *dev); void igmp_grpinit(void); FAR struct igmp_group_s *igmp_grpalloc(FAR struct net_driver_s *dev, - FAR const uip_ipaddr_t *addr); + FAR const net_ipaddr_t *addr); FAR struct igmp_group_s *igmp_grpfind(FAR struct net_driver_s *dev, - FAR const uip_ipaddr_t *addr); + FAR const net_ipaddr_t *addr); FAR struct igmp_group_s *igmp_grpallocfind(FAR struct net_driver_s *dev, - FAR const uip_ipaddr_t *addr); + FAR const net_ipaddr_t *addr); void igmp_grpfree(FAR struct net_driver_s *dev, FAR struct igmp_group_s *group); @@ -102,7 +102,7 @@ void igmp_poll(FAR struct net_driver_s *dev); /* Defined in igmp_send.c ***************************************************/ void igmp_send(FAR struct net_driver_s *dev, FAR struct igmp_group_s *group, - FAR uip_ipaddr_t *dest); + FAR net_ipaddr_t *dest); /* Defined in igmp_timer.c **************************************************/ @@ -113,8 +113,8 @@ bool igmp_cmptimer(FAR struct igmp_group_s *group, int maxticks); /* Defined in igmp_mcastmac *************************************************/ -void igmp_addmcastmac(FAR struct net_driver_s *dev, FAR uip_ipaddr_t *ip); -void igmp_removemcastmac(FAR struct net_driver_s *dev, FAR uip_ipaddr_t *ip); +void igmp_addmcastmac(FAR struct net_driver_s *dev, FAR net_ipaddr_t *ip); +void igmp_removemcastmac(FAR struct net_driver_s *dev, FAR net_ipaddr_t *ip); #undef EXTERN #ifdef __cplusplus diff --git a/nuttx/net/igmp/igmp_group.c b/nuttx/net/igmp/igmp_group.c index a4900eb8a..3c76339ad 100644 --- a/nuttx/net/igmp/igmp_group.c +++ b/nuttx/net/igmp/igmp_group.c @@ -220,7 +220,7 @@ void igmp_grpinit(void) ****************************************************************************/ FAR struct igmp_group_s *igmp_grpalloc(FAR struct net_driver_s *dev, - FAR const uip_ipaddr_t *addr) + FAR const net_ipaddr_t *addr) { FAR struct igmp_group_s *group; net_lock_t flags; @@ -283,7 +283,7 @@ FAR struct igmp_group_s *igmp_grpalloc(FAR struct net_driver_s *dev, ****************************************************************************/ FAR struct igmp_group_s *igmp_grpfind(FAR struct net_driver_s *dev, - FAR const uip_ipaddr_t *addr) + FAR const net_ipaddr_t *addr) { FAR struct igmp_group_s *group; net_lock_t flags; @@ -324,7 +324,7 @@ FAR struct igmp_group_s *igmp_grpfind(FAR struct net_driver_s *dev, ****************************************************************************/ FAR struct igmp_group_s *igmp_grpallocfind(FAR struct net_driver_s *dev, - FAR const uip_ipaddr_t *addr) + FAR const net_ipaddr_t *addr) { FAR struct igmp_group_s *group = igmp_grpfind(dev, addr); diff --git a/nuttx/net/igmp/igmp_initialize.c b/nuttx/net/igmp/igmp_initialize.c index f2a4979cb..1ad5e9009 100644 --- a/nuttx/net/igmp/igmp_initialize.c +++ b/nuttx/net/igmp/igmp_initialize.c @@ -67,8 +67,8 @@ * Public Data ****************************************************************************/ -uip_ipaddr_t g_allsystems; -uip_ipaddr_t g_allrouters; +net_ipaddr_t g_allsystems; +net_ipaddr_t g_allrouters; /**************************************************************************** * Public Functions diff --git a/nuttx/net/igmp/igmp_input.c b/nuttx/net/igmp/igmp_input.c index 2d0837122..daae46f14 100644 --- a/nuttx/net/igmp/igmp_input.c +++ b/nuttx/net/igmp/igmp_input.c @@ -116,8 +116,8 @@ void igmp_input(struct net_driver_s *dev) { FAR struct igmp_group_s *group; - uip_ipaddr_t destipaddr; - uip_ipaddr_t grpaddr; + net_ipaddr_t destipaddr; + net_ipaddr_t grpaddr; unsigned int ticks; nllvdbg("IGMP message: %04x%04x\n", IGMPBUF->destipaddr[1], IGMPBUF->destipaddr[0]); diff --git a/nuttx/net/igmp/igmp_join.c b/nuttx/net/igmp/igmp_join.c index b817d9c7e..1f40acc17 100644 --- a/nuttx/net/igmp/igmp_join.c +++ b/nuttx/net/igmp/igmp_join.c @@ -150,7 +150,7 @@ int igmp_joingroup(struct net_driver_s *dev, FAR const struct in_addr *grpaddr) /* Add the group (MAC) address to the ether drivers MAC filter list */ - igmp_addmcastmac(dev, (FAR uip_ipaddr_t *)&grpaddr->s_addr); + igmp_addmcastmac(dev, (FAR net_ipaddr_t *)&grpaddr->s_addr); return OK; } diff --git a/nuttx/net/igmp/igmp_leave.c b/nuttx/net/igmp/igmp_leave.c index e05e900aa..3021fcb8e 100644 --- a/nuttx/net/igmp/igmp_leave.c +++ b/nuttx/net/igmp/igmp_leave.c @@ -171,7 +171,7 @@ int igmp_leavegroup(struct net_driver_s *dev, FAR const struct in_addr *grpaddr) /* And remove the group address from the ethernet drivers MAC filter set */ - igmp_removemcastmac(dev, (FAR uip_ipaddr_t *)&grpaddr->s_addr); + igmp_removemcastmac(dev, (FAR net_ipaddr_t *)&grpaddr->s_addr); return OK; } diff --git a/nuttx/net/igmp/igmp_mcastmac.c b/nuttx/net/igmp/igmp_mcastmac.c index c42a919e2..799b839ed 100644 --- a/nuttx/net/igmp/igmp_mcastmac.c +++ b/nuttx/net/igmp/igmp_mcastmac.c @@ -72,7 +72,7 @@ * ****************************************************************************/ -static void igmp_mcastmac(uip_ipaddr_t *ip, FAR uint8_t *mac) +static void igmp_mcastmac(net_ipaddr_t *ip, FAR uint8_t *mac) { /* This mapping is from the IETF IN RFC 1700 */ @@ -99,7 +99,7 @@ static void igmp_mcastmac(uip_ipaddr_t *ip, FAR uint8_t *mac) * ****************************************************************************/ -void igmp_addmcastmac(FAR struct net_driver_s *dev, FAR uip_ipaddr_t *ip) +void igmp_addmcastmac(FAR struct net_driver_s *dev, FAR net_ipaddr_t *ip) { uint8_t mcastmac[6]; @@ -119,7 +119,7 @@ void igmp_addmcastmac(FAR struct net_driver_s *dev, FAR uip_ipaddr_t *ip) * ****************************************************************************/ -void igmp_removemcastmac(FAR struct net_driver_s *dev, FAR uip_ipaddr_t *ip) +void igmp_removemcastmac(FAR struct net_driver_s *dev, FAR net_ipaddr_t *ip) { uint8_t mcastmac[6]; diff --git a/nuttx/net/igmp/igmp_poll.c b/nuttx/net/igmp/igmp_poll.c index 2722b318f..cdef3111e 100644 --- a/nuttx/net/igmp/igmp_poll.c +++ b/nuttx/net/igmp/igmp_poll.c @@ -82,7 +82,7 @@ static inline void igmp_sched_send(FAR struct net_driver_s *dev, FAR struct igmp_group_s *group) { - uip_ipaddr_t *dest; + net_ipaddr_t *dest; /* Check what kind of message we need to send. There are only two * possibilities: diff --git a/nuttx/net/igmp/igmp_send.c b/nuttx/net/igmp/igmp_send.c index 2658f5767..a4735f622 100644 --- a/nuttx/net/igmp/igmp_send.c +++ b/nuttx/net/igmp/igmp_send.c @@ -121,7 +121,7 @@ static uint16_t igmp_chksum(FAR uint8_t *buffer, int buflen) ****************************************************************************/ void igmp_send(FAR struct net_driver_s *dev, FAR struct igmp_group_s *group, - FAR uip_ipaddr_t *destipaddr) + FAR net_ipaddr_t *destipaddr) { nllvdbg("msgid: %02x destipaddr: %08x\n", group->msgid, (int)*destipaddr); diff --git a/nuttx/net/ipv6/ipv6.h b/nuttx/net/ipv6/ipv6.h index 9d1b13472..9ddecef07 100644 --- a/nuttx/net/ipv6/ipv6.h +++ b/nuttx/net/ipv6/ipv6.h @@ -67,9 +67,9 @@ struct net_neighbor_addr_s ****************************************************************************/ void net_neighbor_init(void); -void net_neighbor_add(uip_ipaddr_t ipaddr, struct net_neighbor_addr_s *addr); -void net_neighbor_update(uip_ipaddr_t ipaddr); -struct net_neighbor_addr_s *net_neighbor_lookup(uip_ipaddr_t ipaddr); +void net_neighbor_add(net_ipaddr_t ipaddr, struct net_neighbor_addr_s *addr); +void net_neighbor_update(net_ipaddr_t ipaddr); +struct net_neighbor_addr_s *net_neighbor_lookup(net_ipaddr_t ipaddr); void net_neighbor_periodic(void); #endif /* __UIP-NEIGHBOR_H__ */ diff --git a/nuttx/net/ipv6/net_neighbor.c b/nuttx/net/ipv6/net_neighbor.c index 4de284af9..1baae9e21 100644 --- a/nuttx/net/ipv6/net_neighbor.c +++ b/nuttx/net/ipv6/net_neighbor.c @@ -63,7 +63,7 @@ struct neighbor_entry { - uip_ipaddr_t ipaddr; + net_ipaddr_t ipaddr; struct net_neighbor_addr_s addr; uint8_t time; }; @@ -78,7 +78,7 @@ static struct neighbor_entry entries[ENTRIES]; * Private Functions ****************************************************************************/ -static struct neighbor_entry *find_entry(uip_ipaddr_t ipaddr) +static struct neighbor_entry *find_entry(net_ipaddr_t ipaddr) { int i; @@ -120,7 +120,7 @@ void net_neighbor_periodic(void) } } -void net_neighbor_add(uip_ipaddr_t ipaddr, struct net_neighbor_addr_s *addr) +void net_neighbor_add(net_ipaddr_t ipaddr, struct net_neighbor_addr_s *addr) { uint8_t oldest_time; int oldest; @@ -164,7 +164,7 @@ void net_neighbor_add(uip_ipaddr_t ipaddr, struct net_neighbor_addr_s *addr) memcpy(&entries[oldest].addr, addr, sizeof(struct net_neighbor_addr_s)); } -void net_neighbor_update(uip_ipaddr_t ipaddr) +void net_neighbor_update(net_ipaddr_t ipaddr) { struct neighbor_entry *e; @@ -175,7 +175,7 @@ void net_neighbor_update(uip_ipaddr_t ipaddr) } } -struct net_neighbor_addr_s *net_neighbor_lookup(uip_ipaddr_t ipaddr) +struct net_neighbor_addr_s *net_neighbor_lookup(net_ipaddr_t ipaddr) { struct neighbor_entry *e; diff --git a/nuttx/net/netdev/netdev.h b/nuttx/net/netdev/netdev.h index b867a3d5d..abc453fae 100644 --- a/nuttx/net/netdev/netdev.h +++ b/nuttx/net/netdev/netdev.h @@ -94,19 +94,19 @@ FAR struct net_driver_s *netdev_findbyname(FAR const char *ifname); /* netdev_findbyaddr.c *******************************************************/ #if CONFIG_NSOCKET_DESCRIPTORS > 0 -FAR struct net_driver_s *netdev_findbyaddr(const uip_ipaddr_t addr); +FAR struct net_driver_s *netdev_findbyaddr(const net_ipaddr_t addr); #endif /* netdev_txnotify.c *********************************************************/ #if CONFIG_NSOCKET_DESCRIPTORS > 0 -void netdev_txnotify(const uip_ipaddr_t addr); +void netdev_txnotify(const net_ipaddr_t addr); #endif /* netdev_rxnotify.c *********************************************************/ #if CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET_RXAVAIL) -void netdev_rxnotify(const uip_ipaddr_t addr); +void netdev_rxnotify(const net_ipaddr_t addr); #else # define netdev_rxnotify(addr) #endif diff --git a/nuttx/net/netdev/netdev_findbyaddr.c b/nuttx/net/netdev/netdev_findbyaddr.c index 2ad23bdf9..5330d919e 100644 --- a/nuttx/net/netdev/netdev_findbyaddr.c +++ b/nuttx/net/netdev/netdev_findbyaddr.c @@ -93,7 +93,7 @@ * ****************************************************************************/ -static FAR struct net_driver_s *netdev_finddevice(const uip_ipaddr_t addr) +static FAR struct net_driver_s *netdev_finddevice(const net_ipaddr_t addr) { struct net_driver_s *dev; @@ -146,11 +146,11 @@ static FAR struct net_driver_s *netdev_finddevice(const uip_ipaddr_t addr) * ****************************************************************************/ -FAR struct net_driver_s *netdev_findbyaddr(const uip_ipaddr_t addr) +FAR struct net_driver_s *netdev_findbyaddr(const net_ipaddr_t addr) { struct net_driver_s *dev; #ifdef CONFIG_NET_ROUTE - uip_ipaddr_t router; + net_ipaddr_t router; int ret; #endif diff --git a/nuttx/net/netdev/netdev_ioctl.c b/nuttx/net/netdev/netdev_ioctl.c index c4ca4ff18..b212da59e 100644 --- a/nuttx/net/netdev/netdev_ioctl.c +++ b/nuttx/net/netdev/netdev_ioctl.c @@ -95,7 +95,7 @@ * ****************************************************************************/ -static void ioctl_getipaddr(FAR void *outaddr, FAR const uip_ipaddr_t *inaddr) +static void ioctl_getipaddr(FAR void *outaddr, FAR const net_ipaddr_t *inaddr) { #ifdef CONFIG_NET_IPv6 FAR struct sockaddr_in6 *dest = (FAR struct sockaddr_in6 *)outaddr; @@ -124,7 +124,7 @@ static void ioctl_getipaddr(FAR void *outaddr, FAR const uip_ipaddr_t *inaddr) * ****************************************************************************/ -static void ioctl_setipaddr(FAR uip_ipaddr_t *outaddr, FAR const void *inaddr) +static void ioctl_setipaddr(FAR net_ipaddr_t *outaddr, FAR const void *inaddr) { #ifdef CONFIG_NET_IPv6 FAR const struct sockaddr_in6 *src = (FAR const struct sockaddr_in6 *)inaddr; @@ -396,7 +396,7 @@ static int netdev_ifrioctl(FAR struct socket *psock, int cmd, if (dev) { ioctl_ifdown(dev); - memset(&dev->d_ipaddr, 0, sizeof(uip_ipaddr_t)); + memset(&dev->d_ipaddr, 0, sizeof(net_ipaddr_t)); ret = OK; } } @@ -569,9 +569,9 @@ static int netdev_rtioctl(FAR struct socket *psock, int cmd, { if (rtentry) { - uip_ipaddr_t target; - uip_ipaddr_t netmask; - uip_ipaddr_t router; + net_ipaddr_t target; + net_ipaddr_t netmask; + net_ipaddr_t router; #ifdef CONFIG_NET_IPv6 FAR struct sockaddr_in6 *addr; #else @@ -586,17 +586,17 @@ static int netdev_rtioctl(FAR struct socket *psock, int cmd, #ifdef CONFIG_NET_IPv6 addr = (FAR struct sockaddr_in6 *)rtentry->rt_target; - target = (uip_ipaddr_t)addr->sin6_addr.u6_addr16; + target = (net_ipaddr_t)addr->sin6_addr.u6_addr16; addr = (FAR struct sockaddr_in6 *)rtentry->rt_netmask; - netmask = (uip_ipaddr_t)addr->sin6_addr.u6_addr16; + netmask = (net_ipaddr_t)addr->sin6_addr.u6_addr16; /* The router is an optional argument */ if (rtentry->rt_router) { addr = (FAR struct sockaddr_in6 *)rtentry->rt_router; - router = (uip_ipaddr_t)addr->sin6_addr.u6_addr16; + router = (net_ipaddr_t)addr->sin6_addr.u6_addr16; } else { @@ -604,17 +604,17 @@ static int netdev_rtioctl(FAR struct socket *psock, int cmd, } #else addr = (FAR struct sockaddr_in *)rtentry->rt_target; - target = (uip_ipaddr_t)addr->sin_addr.s_addr; + target = (net_ipaddr_t)addr->sin_addr.s_addr; addr = (FAR struct sockaddr_in *)rtentry->rt_netmask; - netmask = (uip_ipaddr_t)addr->sin_addr.s_addr; + netmask = (net_ipaddr_t)addr->sin_addr.s_addr; /* The router is an optional argument */ if (rtentry->rt_router) { addr = (FAR struct sockaddr_in *)rtentry->rt_router; - router = (uip_ipaddr_t)addr->sin_addr.s_addr; + router = (net_ipaddr_t)addr->sin_addr.s_addr; } else { @@ -630,8 +630,8 @@ static int netdev_rtioctl(FAR struct socket *psock, int cmd, { if (rtentry) { - uip_ipaddr_t target; - uip_ipaddr_t netmask; + net_ipaddr_t target; + net_ipaddr_t netmask; #ifdef CONFIG_NET_IPv6 FAR struct sockaddr_in6 *addr; #else @@ -647,16 +647,16 @@ static int netdev_rtioctl(FAR struct socket *psock, int cmd, #ifdef CONFIG_NET_IPv6 addr = (FAR struct sockaddr_in6 *)rtentry->rt_target; - target = (uip_ipaddr_t)addr->sin6_addr.u6_addr16; + target = (net_ipaddr_t)addr->sin6_addr.u6_addr16; addr = (FAR struct sockaddr_in6 *)rtentry->rt_netmask; - netmask = (uip_ipaddr_t)addr->sin6_addr.u6_addr16; + netmask = (net_ipaddr_t)addr->sin6_addr.u6_addr16; #else addr = (FAR struct sockaddr_in *)rtentry->rt_target; - target = (uip_ipaddr_t)addr->sin_addr.s_addr; + target = (net_ipaddr_t)addr->sin_addr.s_addr; addr = (FAR struct sockaddr_in *)rtentry->rt_netmask; - netmask = (uip_ipaddr_t)addr->sin_addr.s_addr; + netmask = (net_ipaddr_t)addr->sin_addr.s_addr; #endif ret = net_delroute(target, netmask); } diff --git a/nuttx/net/netdev/netdev_rxnotify.c b/nuttx/net/netdev/netdev_rxnotify.c index c14409c3c..bb8d90368 100644 --- a/nuttx/net/netdev/netdev_rxnotify.c +++ b/nuttx/net/netdev/netdev_rxnotify.c @@ -90,7 +90,7 @@ * ****************************************************************************/ -void netdev_rxnotify(const uip_ipaddr_t raddr) +void netdev_rxnotify(const net_ipaddr_t raddr) { /* Find the device driver that serves the subnet of the remote address */ diff --git a/nuttx/net/netdev/netdev_txnotify.c b/nuttx/net/netdev/netdev_txnotify.c index 6ca3c5513..81679ac93 100644 --- a/nuttx/net/netdev/netdev_txnotify.c +++ b/nuttx/net/netdev/netdev_txnotify.c @@ -90,7 +90,7 @@ * ****************************************************************************/ -void netdev_txnotify(const uip_ipaddr_t raddr) +void netdev_txnotify(const net_ipaddr_t raddr) { /* Find the device driver that serves the subnet of the remote address */ diff --git a/nuttx/net/pkt/pkt_send.c b/nuttx/net/pkt/pkt_send.c index dc71ee6b4..0c7c4b81e 100644 --- a/nuttx/net/pkt/pkt_send.c +++ b/nuttx/net/pkt/pkt_send.c @@ -265,7 +265,7 @@ ssize_t psock_pkt_send(FAR struct socket *psock, FAR const void *buf, /* Notify the device driver that new TX data is available. * NOTES: This is in essence what netdev_txnotify() does, which - * is not possible to call since it expects a uip_ipaddr_t as + * is not possible to call since it expects a net_ipaddr_t as * its single argument to lookup the network interface. */ diff --git a/nuttx/net/route/net_addroute.c b/nuttx/net/route/net_addroute.c index 5f537a346..5bdd380fd 100644 --- a/nuttx/net/route/net_addroute.c +++ b/nuttx/net/route/net_addroute.c @@ -75,8 +75,8 @@ * ****************************************************************************/ -int net_addroute(uip_ipaddr_t target, uip_ipaddr_t netmask, - uip_ipaddr_t router) +int net_addroute(net_ipaddr_t target, net_ipaddr_t netmask, + net_ipaddr_t router) { FAR struct net_route_s *route; net_lock_t save; diff --git a/nuttx/net/route/net_delroute.c b/nuttx/net/route/net_delroute.c index 7bee168a9..29dfbab16 100644 --- a/nuttx/net/route/net_delroute.c +++ b/nuttx/net/route/net_delroute.c @@ -54,8 +54,8 @@ struct route_match_s { FAR struct net_route_s *prev; /* Predecessor in the list */ - uip_ipaddr_t target; /* The target IP address to match */ - uip_ipaddr_t netmask; /* The network mask to match */ + net_ipaddr_t target; /* The target IP address to match */ + net_ipaddr_t netmask; /* The network mask to match */ }; /**************************************************************************** @@ -132,7 +132,7 @@ static int net_match(FAR struct net_route_s *route, FAR void *arg) * ****************************************************************************/ -int net_delroute(uip_ipaddr_t target, uip_ipaddr_t netmask) +int net_delroute(net_ipaddr_t target, net_ipaddr_t netmask) { struct route_match_s match; diff --git a/nuttx/net/route/net_router.c b/nuttx/net/route/net_router.c index 1c04f0ea5..3ebf625b6 100644 --- a/nuttx/net/route/net_router.c +++ b/nuttx/net/route/net_router.c @@ -53,8 +53,8 @@ struct route_match_s { - uip_ipaddr_t target; /* The target IP address on an external network to match */ - uip_ipaddr_t router; /* The IP address of the router on one of our networks*/ + net_ipaddr_t target; /* The target IP address on an external network to match */ + net_ipaddr_t router; /* The IP address of the router on one of our networks*/ }; /**************************************************************************** @@ -121,9 +121,9 @@ static int net_match(FAR struct net_route_s *route, FAR void *arg) ****************************************************************************/ #ifdef CONFIG_NET_IPv6 -int net_router(uip_ipaddr_t target, uip_ipaddr_t router) +int net_router(net_ipaddr_t target, net_ipaddr_t router) #else -int net_router(uip_ipaddr_t target, FAR uip_ipaddr_t *router) +int net_router(net_ipaddr_t target, FAR net_ipaddr_t *router) #endif { struct route_match_s match; diff --git a/nuttx/net/route/netdev_router.c b/nuttx/net/route/netdev_router.c index 7af96259e..819203621 100644 --- a/nuttx/net/route/netdev_router.c +++ b/nuttx/net/route/netdev_router.c @@ -57,8 +57,8 @@ struct route_devmatch_s { FAR struct net_driver_s *dev; /* The route must use this device */ - uip_ipaddr_t target; /* The target IP address on an external network to match */ - uip_ipaddr_t router; /* The IP address of the router on one of our networks*/ + net_ipaddr_t target; /* The target IP address on an external network to match */ + net_ipaddr_t router; /* The IP address of the router on one of our networks*/ }; /**************************************************************************** @@ -132,11 +132,11 @@ static int net_devmatch(FAR struct net_route_s *route, FAR void *arg) ****************************************************************************/ #ifdef CONFIG_NET_IPv6 -void netdev_router(FAR struct net_driver_s *dev, uip_ipaddr_t target, - uip_ipaddr_t router) +void netdev_router(FAR struct net_driver_s *dev, net_ipaddr_t target, + net_ipaddr_t router) #else -void netdev_router(FAR struct net_driver_s *dev, uip_ipaddr_t target, - FAR uip_ipaddr_t *router) +void netdev_router(FAR struct net_driver_s *dev, net_ipaddr_t target, + FAR net_ipaddr_t *router) #endif { struct route_devmatch_s match; diff --git a/nuttx/net/route/route.h b/nuttx/net/route/route.h index a91db2c47..73b2c02f2 100644 --- a/nuttx/net/route/route.h +++ b/nuttx/net/route/route.h @@ -66,9 +66,9 @@ struct net_route_s { FAR struct net_route_s *flink; /* Supports a singly linked list */ - uip_ipaddr_t target; /* The destination network */ - uip_ipaddr_t netmask; /* The network address mask */ - uip_ipaddr_t router; /* Route packets via this router */ + net_ipaddr_t target; /* The destination network */ + net_ipaddr_t netmask; /* The network address mask */ + net_ipaddr_t router; /* Route packets via this router */ }; /* Type of the call out function pointer provided to net_foreachroute() */ @@ -161,8 +161,8 @@ void net_freeroute(FAR struct net_route_s *route); * ****************************************************************************/ -int net_addroute(uip_ipaddr_t target, uip_ipaddr_t netmask, - uip_ipaddr_t router); +int net_addroute(net_ipaddr_t target, net_ipaddr_t netmask, + net_ipaddr_t router); /**************************************************************************** * Function: net_delroute @@ -177,7 +177,7 @@ int net_addroute(uip_ipaddr_t target, uip_ipaddr_t netmask, * ****************************************************************************/ -int net_delroute(uip_ipaddr_t target, uip_ipaddr_t netmask); +int net_delroute(net_ipaddr_t target, net_ipaddr_t netmask); /**************************************************************************** * Function: net_router @@ -200,9 +200,9 @@ int net_delroute(uip_ipaddr_t target, uip_ipaddr_t netmask); ****************************************************************************/ #ifdef CONFIG_NET_IPv6 -int net_router(uip_ipaddr_t target, uip_ipaddr_t router); +int net_router(net_ipaddr_t target, net_ipaddr_t router); #else -int net_router(uip_ipaddr_t target, FAR uip_ipaddr_t *router); +int net_router(net_ipaddr_t target, FAR net_ipaddr_t *router); #endif /**************************************************************************** @@ -232,11 +232,11 @@ int net_router(uip_ipaddr_t target, FAR uip_ipaddr_t *router); struct net_driver_s; #ifdef CONFIG_NET_IPv6 -void netdev_router(FAR struct net_driver_s *dev, uip_ipaddr_t target, - uip_ipaddr_t router); +void netdev_router(FAR struct net_driver_s *dev, net_ipaddr_t target, + net_ipaddr_t router); #else -void netdev_router(FAR struct net_driver_s *dev, uip_ipaddr_t target, - FAR uip_ipaddr_t *router); +void netdev_router(FAR struct net_driver_s *dev, net_ipaddr_t target, + FAR net_ipaddr_t *router); #endif /**************************************************************************** diff --git a/nuttx/net/utils/net_chksum.c b/nuttx/net/utils/net_chksum.c index 789646f50..0f1d13bc9 100644 --- a/nuttx/net/utils/net_chksum.c +++ b/nuttx/net/utils/net_chksum.c @@ -141,7 +141,7 @@ static uint16_t upper_layer_chksum(FAR struct net_driver_s *dev, uint8_t proto) /* Sum IP source and destination addresses. */ - sum = chksum(sum, (uint8_t *)&pbuf->srcipaddr, 2 * sizeof(uip_ipaddr_t)); + sum = chksum(sum, (uint8_t *)&pbuf->srcipaddr, 2 * sizeof(net_ipaddr_t)); /* Sum TCP header and data. */ |