NET: Renaming of IP address types
This commit is contained in:
parent
5ac94ff988
commit
899dc193ca
35 changed files with 131 additions and 129 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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. */
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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]);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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__ */
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
|||
|
|
@ -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. */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue