mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 23:40:19 +08:00
net: nxstyle fixes
Nxstyle fixes to pass CI. Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
This commit is contained in:
committed by
Xiang Xiao
parent
d0002b24c7
commit
7dc7ef45f1
+5
-5
@@ -193,11 +193,11 @@ void arp_format(FAR struct net_driver_s *dev, in_addr_t ipaddr);
|
|||||||
* address. This function first checks if the IPv4 address is already in
|
* address. This function first checks if the IPv4 address is already in
|
||||||
* the ARP table. If so, then it returns success immediately.
|
* the ARP table. If so, then it returns success immediately.
|
||||||
*
|
*
|
||||||
* If the requested IPv4 address in not in the ARP table, then this function
|
* If the requested IPv4 address in not in the ARP table, then this
|
||||||
* will send an ARP request, delay, then check if the IP address is now in
|
* function will send an ARP request, delay, then check if the IP address
|
||||||
* the ARP table. It will repeat this sequence until either (1) the IP
|
* is now in the ARP table. It will repeat this sequence until either (1)
|
||||||
* address mapping is now in the ARP table, or (2) a configurable number
|
* the IP address mapping is now in the ARP table, or (2) a configurable
|
||||||
* of timeouts occur without receiving the ARP replay.
|
* number of timeouts occur without receiving the ARP replay.
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* ipaddr The IP address to be queried.
|
* ipaddr The IP address to be queried.
|
||||||
|
|||||||
+2
-1
@@ -70,7 +70,8 @@
|
|||||||
* The arp_ipin() function should be called by Ethernet device drivers
|
* The arp_ipin() function should be called by Ethernet device drivers
|
||||||
* whenever an IP packet arrives from the network. The function will
|
* whenever an IP packet arrives from the network. The function will
|
||||||
* check if the address is in the ARP cache, and if so the ARP cache entry
|
* check if the address is in the ARP cache, and if so the ARP cache entry
|
||||||
* will be refreshed. If no ARP cache entry was found, a new one is created.
|
* will be refreshed. If no ARP cache entry was found, a new one is
|
||||||
|
* created.
|
||||||
*
|
*
|
||||||
* This function expects that an IP packet with an Ethernet header is
|
* This function expects that an IP packet with an Ethernet header is
|
||||||
* present in the d_buf buffer and that the length of the packet is in the
|
* present in the d_buf buffer and that the length of the packet is in the
|
||||||
|
|||||||
+8
-3
@@ -171,14 +171,17 @@ void arp_out(FAR struct net_driver_s *dev)
|
|||||||
|
|
||||||
if (net_ipv4addr_hdrcmp(pip->eh_destipaddr, g_broadcast_ipaddr))
|
if (net_ipv4addr_hdrcmp(pip->eh_destipaddr, g_broadcast_ipaddr))
|
||||||
{
|
{
|
||||||
memcpy(peth->dest, g_broadcast_ethaddr.ether_addr_octet, ETHER_ADDR_LEN);
|
memcpy(peth->dest,
|
||||||
|
g_broadcast_ethaddr.ether_addr_octet,
|
||||||
|
ETHER_ADDR_LEN);
|
||||||
goto finish_header;
|
goto finish_header;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_NET_IGMP
|
#ifdef CONFIG_NET_IGMP
|
||||||
/* Check if the destination address is a multicast address
|
/* Check if the destination address is a multicast address
|
||||||
*
|
*
|
||||||
* - IPv4: multicast addresses lie in the class D group -- The address range
|
* - IPv4:
|
||||||
|
* multicast addresses lie in the class D group -- The address range
|
||||||
* 224.0.0.0 to 239.255.255.255 (224.0.0.0/4)
|
* 224.0.0.0 to 239.255.255.255 (224.0.0.0/4)
|
||||||
*
|
*
|
||||||
* - IPv6 multicast addresses are have the high-order octet of the
|
* - IPv6 multicast addresses are have the high-order octet of the
|
||||||
@@ -240,7 +243,9 @@ void arp_out(FAR struct net_driver_s *dev)
|
|||||||
{
|
{
|
||||||
/* Yes.. then we won't need to know the destination MAC address */
|
/* Yes.. then we won't need to know the destination MAC address */
|
||||||
|
|
||||||
memcpy(peth->dest, g_broadcast_ethaddr.ether_addr_octet, ETHER_ADDR_LEN);
|
memcpy(peth->dest,
|
||||||
|
g_broadcast_ethaddr.ether_addr_octet,
|
||||||
|
ETHER_ADDR_LEN);
|
||||||
goto finish_header;
|
goto finish_header;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -80,7 +80,8 @@ struct bluetooth_finddev_s
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static int bluetooth_dev_callback(FAR struct net_driver_s *dev, FAR void *arg)
|
static int bluetooth_dev_callback(FAR struct net_driver_s *dev,
|
||||||
|
FAR void *arg)
|
||||||
{
|
{
|
||||||
FAR struct bluetooth_finddev_s *match =
|
FAR struct bluetooth_finddev_s *match =
|
||||||
(FAR struct bluetooth_finddev_s *)arg;
|
(FAR struct bluetooth_finddev_s *)arg;
|
||||||
|
|||||||
@@ -140,8 +140,8 @@ static int bluetooth_queue_frame(FAR struct bluetooth_conn_s *conn,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if CONFIG_NET_BLUETOOTH_BACKLOG > 0
|
#if CONFIG_NET_BLUETOOTH_BACKLOG > 0
|
||||||
/* If incrementing the count would exceed the maximum bc_backlog value, then
|
/* If incrementing the count would exceed the maximum bc_backlog value,
|
||||||
* delete the oldest frame from the head of the RX queue.
|
* then delete the oldest frame from the head of the RX queue.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (conn->bc_backlog >= CONFIG_NET_BLUETOOTH_BACKLOG)
|
if (conn->bc_backlog >= CONFIG_NET_BLUETOOTH_BACKLOG)
|
||||||
|
|||||||
@@ -160,7 +160,8 @@ static uint16_t icmp_datahandler(FAR struct net_driver_s *dev,
|
|||||||
* not free any I/O buffers.
|
* not free any I/O buffers.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
nerr("ERROR: Failed to source address to the I/O buffer chain: %d\n", ret);
|
nerr("ERROR: Failed to source address to the I/O buffer chain: %d\n",
|
||||||
|
ret);
|
||||||
goto drop_with_chain;
|
goto drop_with_chain;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -275,8 +276,9 @@ void icmp_input(FAR struct net_driver_s *dev)
|
|||||||
/* The slow way... sum over the ICMP message */
|
/* The slow way... sum over the ICMP message */
|
||||||
|
|
||||||
icmp->icmpchksum = 0;
|
icmp->icmpchksum = 0;
|
||||||
icmp->icmpchksum = ~icmp_chksum(dev, (((uint16_t)ipv4->len[0] << 8) |
|
icmp->icmpchksum = ~icmp_chksum(dev,
|
||||||
(uint16_t)ipv4->len[1]) - iphdrlen);
|
(((uint16_t)ipv4->len[0] << 8) |
|
||||||
|
(uint16_t)ipv4->len[1]) - iphdrlen);
|
||||||
if (icmp->icmpchksum == 0)
|
if (icmp->icmpchksum == 0)
|
||||||
{
|
{
|
||||||
icmp->icmpchksum = 0xffff;
|
icmp->icmpchksum = 0xffff;
|
||||||
|
|||||||
+23
-16
@@ -217,7 +217,8 @@ void icmpv6_input(FAR struct net_driver_s *dev, unsigned int iplen);
|
|||||||
*
|
*
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
* Zero (OK) is returned on success and the IP address mapping can now be
|
* Zero (OK) is returned on success and the IP address mapping can now be
|
||||||
* found in the Neighbor Table. On error a negated errno value is returned:
|
* found in the Neighbor Table.
|
||||||
|
* On error a negated errno value is returned:
|
||||||
*
|
*
|
||||||
* -ETIMEDOUT: The number or retry counts has been exceed.
|
* -ETIMEDOUT: The number or retry counts has been exceed.
|
||||||
* -EHOSTUNREACH: Could not find a route to the host
|
* -EHOSTUNREACH: Could not find a route to the host
|
||||||
@@ -350,8 +351,8 @@ void icmpv6_radvertise(FAR struct net_driver_s *dev);
|
|||||||
* is sent so that there is no race condition when icmpv6_wait() is called.
|
* is sent so that there is no race condition when icmpv6_wait() is called.
|
||||||
*
|
*
|
||||||
* Assumptions:
|
* Assumptions:
|
||||||
* This function is called from icmpv6_neighbor() and executes in the normal
|
* This function is called from icmpv6_neighbor() and executes in the
|
||||||
* tasking environment.
|
* normal tasking environment.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
@@ -521,8 +522,10 @@ int icmpv6_rwait(FAR struct icmpv6_rnotify_s *notify, unsigned int timeout);
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_NET_ICMPv6_AUTOCONF
|
#ifdef CONFIG_NET_ICMPv6_AUTOCONF
|
||||||
void icmpv6_rnotify(FAR struct net_driver_s *dev, const net_ipv6addr_t draddr,
|
void icmpv6_rnotify(FAR struct net_driver_s *dev,
|
||||||
const net_ipv6addr_t prefix, unsigned int preflen);
|
const net_ipv6addr_t draddr,
|
||||||
|
const net_ipv6addr_t prefix,
|
||||||
|
unsigned int preflen);
|
||||||
#else
|
#else
|
||||||
# define icmpv6_rnotify(d,p,l)
|
# define icmpv6_rnotify(d,p,l)
|
||||||
#endif
|
#endif
|
||||||
@@ -602,8 +605,8 @@ FAR struct icmpv6_conn_s *icmpv6_nextconn(FAR struct icmpv6_conn_s *conn);
|
|||||||
* Name: icmpv6_findconn
|
* Name: icmpv6_findconn
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Find an ICMPv6 connection structure that is expecting a ICMPv6 ECHO response
|
* Find an ICMPv6 connection structure that is expecting a ICMPv6 ECHO
|
||||||
* with this ID from this device
|
* response with this ID from this device
|
||||||
*
|
*
|
||||||
* Assumptions:
|
* Assumptions:
|
||||||
* This function is called from network logic at with the network locked.
|
* This function is called from network logic at with the network locked.
|
||||||
@@ -641,8 +644,12 @@ FAR struct icmpv6_conn_s *icmpv6_findconn(FAR struct net_driver_s *dev,
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_NET_ICMPv6_SOCKET
|
#ifdef CONFIG_NET_ICMPv6_SOCKET
|
||||||
ssize_t icmpv6_sendto(FAR struct socket *psock, FAR const void *buf, size_t len,
|
ssize_t icmpv6_sendto(FAR struct socket *psock,
|
||||||
int flags, FAR const struct sockaddr *to, socklen_t tolen);
|
FAR const void *buf,
|
||||||
|
size_t len,
|
||||||
|
int flags,
|
||||||
|
FAR const struct sockaddr *to,
|
||||||
|
socklen_t tolen);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -725,13 +732,13 @@ int icmpv6_pollteardown(FAR struct socket *psock, FAR struct pollfd *fds);
|
|||||||
* Name: icmpv6_linkipaddr
|
* Name: icmpv6_linkipaddr
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Generate the device link scope ipv6 address as below:
|
* Generate the device link scope ipv6 address as below:
|
||||||
* 128 112 96 80 64 48 32 16
|
* 128 112 96 80 64 48 32 16
|
||||||
* ---- ---- ---- ---- ---- ---- ---- ----
|
* ---- ---- ---- ---- ---- ---- ---- ----
|
||||||
* fe80 0000 0000 0000 0000 00ff fe00 xx00 1-byte short address IEEE 48-bit MAC
|
* fe80 0000 0000 0000 0000 00ff fe00 xx00 1-byte short addr IEEE 48-bit MAC
|
||||||
* fe80 0000 0000 0000 0000 00ff fe00 xxxx 2-byte short address IEEE 48-bit MAC
|
* fe80 0000 0000 0000 0000 00ff fe00 xxxx 2-byte short addr IEEE 48-bit MAC
|
||||||
* fe80 0000 0000 0000 xxxx xxff fexx xxxx 6-byte normal address IEEE 48-bit MAC
|
* fe80 0000 0000 0000 xxxx xxff fexx xxxx 6-byte normal addr IEEE 48-bit MAC
|
||||||
* fe80 0000 0000 0000 xxxx xxxx xxxx xxxx 8-byte extended address IEEE EUI-64
|
* fe80 0000 0000 0000 xxxx xxxx xxxx xxxx 8-byte extended addr IEEE EUI-64
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* dev - The device driver structure containing the link layer address
|
* dev - The device driver structure containing the link layer address
|
||||||
|
|||||||
@@ -125,7 +125,8 @@ void icmpv6_advertise(FAR struct net_driver_s *dev,
|
|||||||
adv = ICMPv6ADVERTISE;
|
adv = ICMPv6ADVERTISE;
|
||||||
adv->type = ICMPv6_NEIGHBOR_ADVERTISE; /* Message type */
|
adv->type = ICMPv6_NEIGHBOR_ADVERTISE; /* Message type */
|
||||||
adv->code = 0; /* Message qualifier */
|
adv->code = 0; /* Message qualifier */
|
||||||
adv->flags[0] = ICMPv6_NADV_FLAG_S | ICMPv6_NADV_FLAG_O; /* Solicited+Override flags. */
|
adv->flags[0] = ICMPv6_NADV_FLAG_S |
|
||||||
|
ICMPv6_NADV_FLAG_O; /* Solicited+Override flags. */
|
||||||
adv->flags[1] = 0;
|
adv->flags[1] = 0;
|
||||||
adv->flags[2] = 0;
|
adv->flags[2] = 0;
|
||||||
adv->flags[3] = 0;
|
adv->flags[3] = 0;
|
||||||
|
|||||||
@@ -122,7 +122,8 @@ FAR struct icmpv6_conn_s *icmpv6_alloc(void)
|
|||||||
ret = net_lockedwait(&g_free_sem);
|
ret = net_lockedwait(&g_free_sem);
|
||||||
if (ret >= 0)
|
if (ret >= 0)
|
||||||
{
|
{
|
||||||
conn = (FAR struct icmpv6_conn_s *)dq_remfirst(&g_free_icmpv6_connections);
|
conn = (FAR struct icmpv6_conn_s *)
|
||||||
|
dq_remfirst(&g_free_icmpv6_connections);
|
||||||
if (conn != NULL)
|
if (conn != NULL)
|
||||||
{
|
{
|
||||||
/* Clear the connection structure */
|
/* Clear the connection structure */
|
||||||
@@ -232,8 +233,8 @@ FAR struct icmpv6_conn_s *icmpv6_nextconn(FAR struct icmpv6_conn_s *conn)
|
|||||||
* Name: icmpv6_findconn
|
* Name: icmpv6_findconn
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Find an ICMPv6 connection structure that is expecting a ICMPv6 ECHO response
|
* Find an ICMPv6 connection structure that is expecting a ICMPv6 ECHO
|
||||||
* with this ID from this device
|
* response with this ID from this device
|
||||||
*
|
*
|
||||||
* Assumptions:
|
* Assumptions:
|
||||||
* This function is called from network logic at with the network locked.
|
* This function is called from network logic at with the network locked.
|
||||||
@@ -245,7 +246,8 @@ FAR struct icmpv6_conn_s *icmpv6_findconn(FAR struct net_driver_s *dev,
|
|||||||
{
|
{
|
||||||
FAR struct icmpv6_conn_s *conn;
|
FAR struct icmpv6_conn_s *conn;
|
||||||
|
|
||||||
for (conn = icmpv6_nextconn(NULL); conn != NULL; conn = icmpv6_nextconn(conn))
|
for (conn = icmpv6_nextconn(NULL); conn != NULL;
|
||||||
|
conn = icmpv6_nextconn(conn))
|
||||||
{
|
{
|
||||||
if (conn->id == id && conn->dev == dev && conn->nreqs > 0)
|
if (conn->id == id && conn->dev == dev && conn->nreqs > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -165,7 +165,8 @@ static uint16_t icmpv6_datahandler(FAR struct net_driver_s *dev,
|
|||||||
* not free any I/O buffers.
|
* not free any I/O buffers.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
nerr("ERROR: Failed to source address to the I/O buffer chain: %d\n", ret);
|
nerr("ERROR: Failed to source address to the I/O buffer chain: %d\n",
|
||||||
|
ret);
|
||||||
goto drop_with_chain;
|
goto drop_with_chain;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -275,7 +276,7 @@ void icmpv6_input(FAR struct net_driver_s *dev, unsigned int iplen)
|
|||||||
neighbor_add(dev, ipv6->srcipaddr, sol->srclladdr);
|
neighbor_add(dev, ipv6->srcipaddr, sol->srclladdr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Yes.. Send a neighbor advertisement back to where the neighbor
|
/* Yes.. Send a neighbor advertisement back to where the neighbor
|
||||||
* solicitation came from.
|
* solicitation came from.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -303,7 +304,8 @@ void icmpv6_input(FAR struct net_driver_s *dev, unsigned int iplen)
|
|||||||
*
|
*
|
||||||
* Missing checks:
|
* Missing checks:
|
||||||
* optlen = 1 (8 octets)
|
* optlen = 1 (8 octets)
|
||||||
* Should only update Neighbor Table if [O]verride bit is set in flags
|
* Should only update Neighbor Table if
|
||||||
|
* [O]verride bit is set in flags
|
||||||
*/
|
*/
|
||||||
|
|
||||||
adv = ICMPv6ADVERTISE;
|
adv = ICMPv6ADVERTISE;
|
||||||
@@ -384,7 +386,8 @@ void icmpv6_input(FAR struct net_driver_s *dev, unsigned int iplen)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
adv = ICMPv6RADVERTISE;
|
adv = ICMPv6RADVERTISE;
|
||||||
options = (FAR uint8_t *)adv + sizeof(struct icmpv6_router_advertise_s);
|
options = (FAR uint8_t *)adv +
|
||||||
|
sizeof(struct icmpv6_router_advertise_s);
|
||||||
|
|
||||||
for (ndx = 0; ndx + sizeof(struct icmpv6_prefixinfo_s) <= optlen; )
|
for (ndx = 0; ndx + sizeof(struct icmpv6_prefixinfo_s) <= optlen; )
|
||||||
{
|
{
|
||||||
@@ -408,7 +411,8 @@ void icmpv6_input(FAR struct net_driver_s *dev, unsigned int iplen)
|
|||||||
{
|
{
|
||||||
/* Yes.. Notify any waiting threads */
|
/* Yes.. Notify any waiting threads */
|
||||||
|
|
||||||
icmpv6_rnotify(dev, ipv6->srcipaddr, opt->prefix, opt->preflen);
|
icmpv6_rnotify(dev, ipv6->srcipaddr,
|
||||||
|
opt->prefix, opt->preflen);
|
||||||
prefix = true;
|
prefix = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -82,7 +82,8 @@ void icmpv6_poll(FAR struct net_driver_s *dev,
|
|||||||
|
|
||||||
/* Perform the application callback */
|
/* Perform the application callback */
|
||||||
|
|
||||||
devif_conn_event(dev, conn, ICMPv6_POLL, conn ? conn->list : dev->d_conncb);
|
devif_conn_event(dev, conn, ICMPv6_POLL,
|
||||||
|
conn ? conn->list : dev->d_conncb);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_NET_ICMPv6_SOCKET || CONFIG_NET_ICMPv6_NEIGHBOR */
|
#endif /* CONFIG_NET_ICMPv6_SOCKET || CONFIG_NET_ICMPv6_NEIGHBOR */
|
||||||
|
|||||||
@@ -289,7 +289,8 @@ FAR struct ieee802154_conn_s *
|
|||||||
* Name: ieee802154_callback
|
* Name: ieee802154_callback
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Inform the application holding the IEEE 802.15.4 socket of a change in state.
|
* Inform the application holding the IEEE 802.15.4 socket of a change in
|
||||||
|
* state.
|
||||||
*
|
*
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
* OK if IEEE 802.15.4 has been processed, otherwise ERROR.
|
* OK if IEEE 802.15.4 has been processed, otherwise ERROR.
|
||||||
@@ -308,9 +309,9 @@ uint16_t ieee802154_callback(FAR struct radio_driver_s *radio,
|
|||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Implements the socket recvfrom interface for the case of the AF_INET
|
* Implements the socket recvfrom interface for the case of the AF_INET
|
||||||
* and AF_INET6 address families. ieee802154_recvfrom() receives messages from
|
* and AF_INET6 address families. ieee802154_recvfrom() receives messages
|
||||||
* a socket, and may be used to receive data on a socket whether or not it
|
* from a socket, and may be used to receive data on a socket whether or
|
||||||
* is connection-oriented.
|
* not it is connection-oriented.
|
||||||
*
|
*
|
||||||
* If 'from' is not NULL, and the underlying protocol provides the source
|
* If 'from' is not NULL, and the underlying protocol provides the source
|
||||||
* address, this source address is filled in. The argument 'fromlen' is
|
* address, this source address is filled in. The argument 'fromlen' is
|
||||||
@@ -407,7 +408,8 @@ void ieee802154_poll(FAR struct net_driver_s *dev,
|
|||||||
ssize_t psock_ieee802154_sendto(FAR struct socket *psock,
|
ssize_t psock_ieee802154_sendto(FAR struct socket *psock,
|
||||||
FAR const void *buf,
|
FAR const void *buf,
|
||||||
size_t len, int flags,
|
size_t len, int flags,
|
||||||
FAR const struct sockaddr *to, socklen_t tolen);
|
FAR const struct sockaddr *to,
|
||||||
|
socklen_t tolen);
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: ieee802154_container_initialize
|
* Name: ieee802154_container_initialize
|
||||||
@@ -445,8 +447,8 @@ void ieee802154_container_initialize(void);
|
|||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
* A reference to the allocated container structure. All user fields in this
|
* A reference to the allocated container structure. All user fields in
|
||||||
* structure have been zeroed. On a failure to allocate, NULL is
|
* this structure have been zeroed. On a failure to allocate, NULL is
|
||||||
* returned.
|
* returned.
|
||||||
*
|
*
|
||||||
* Assumptions:
|
* Assumptions:
|
||||||
|
|||||||
@@ -208,7 +208,8 @@ FAR struct ieee802154_conn_s *
|
|||||||
|
|
||||||
DEBUGASSERT(meta != NULL);
|
DEBUGASSERT(meta != NULL);
|
||||||
|
|
||||||
for (conn = (FAR struct ieee802154_conn_s *)g_active_ieee802154_connections.head;
|
for (conn = (FAR struct ieee802154_conn_s *)
|
||||||
|
g_active_ieee802154_connections.head;
|
||||||
conn != NULL;
|
conn != NULL;
|
||||||
conn = (FAR struct ieee802154_conn_s *)conn->node.flink)
|
conn = (FAR struct ieee802154_conn_s *)conn->node.flink)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -79,7 +79,8 @@ struct ieee802154_finddev_s
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static int ieee802154_dev_callback(FAR struct net_driver_s *dev, FAR void *arg)
|
static int ieee802154_dev_callback(FAR struct net_driver_s *dev,
|
||||||
|
FAR void *arg)
|
||||||
{
|
{
|
||||||
FAR struct ieee802154_finddev_s *match =
|
FAR struct ieee802154_finddev_s *match =
|
||||||
(FAR struct ieee802154_finddev_s *)arg;
|
(FAR struct ieee802154_finddev_s *)arg;
|
||||||
|
|||||||
@@ -94,7 +94,8 @@ void ieee802154_poll(FAR struct net_driver_s *dev,
|
|||||||
|
|
||||||
/* Perform the application callback.
|
/* Perform the application callback.
|
||||||
*
|
*
|
||||||
* REVISIT: Need to pass the meta data and the IOB through the callback.
|
* REVISIT:
|
||||||
|
* Need to pass the meta data and the IOB through the callback.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#warning Missing logic
|
#warning Missing logic
|
||||||
|
|||||||
+11
-11
@@ -20,21 +20,21 @@
|
|||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
* documentation and/or other materials provided with the distribution.
|
* documentation and/or other materials provided with the distribution.
|
||||||
* 3. Neither the name of CITEL Technologies Ltd nor the names of its contributors
|
* 3. Neither the name of CITEL Technologies Ltd nor the names of its
|
||||||
* may be used to endorse or promote products derived from this software
|
* contributors may be used to endorse or promote products derived from
|
||||||
* without specific prior written permission.
|
* this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY CITEL TECHNOLOGIES AND CONTRIBUTORS ``AS IS''
|
* THIS SOFTWARE IS PROVIDED BY CITEL TECHNOLOGIES AND CONTRIBUTORS ``AS IS''
|
||||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
* ARE DISCLAIMED. IN NO EVENT SHALL CITEL TECHNOLOGIES OR CONTRIBUTORS BE LIABLE
|
* ARE DISCLAIMED. IN NO EVENT SHALL CITEL TECHNOLOGIES OR CONTRIBUTORS BE
|
||||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
|||||||
+11
-11
@@ -19,21 +19,21 @@
|
|||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
* documentation and/or other materials provided with the distribution.
|
* documentation and/or other materials provided with the distribution.
|
||||||
* 3. Neither the name of CITEL Technologies Ltd nor the names of its contributors
|
* 3. Neither the name of CITEL Technologies Ltd nor the names of its
|
||||||
* may be used to endorse or promote products derived from this software
|
* contributors may be used to endorse or promote products derived from
|
||||||
* without specific prior written permission.
|
* this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY CITEL TECHNOLOGIES AND CONTRIBUTORS ``AS IS''
|
* THIS SOFTWARE IS PROVIDED BY CITEL TECHNOLOGIES AND CONTRIBUTORS ``AS IS''
|
||||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
* ARE DISCLAIMED. IN NO EVENT SHALL CITEL TECHNOLOGIES OR CONTRIBUTORS BE LIABLE
|
* ARE DISCLAIMED. IN NO EVENT SHALL CITEL TECHNOLOGIES OR CONTRIBUTORS BE
|
||||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
|||||||
+14
-12
@@ -19,21 +19,21 @@
|
|||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
* documentation and/or other materials provided with the distribution.
|
* documentation and/or other materials provided with the distribution.
|
||||||
* 3. Neither the name of CITEL Technologies Ltd nor the names of its contributors
|
* 3. Neither the name of CITEL Technologies Ltd nor the names of its
|
||||||
* may be used to endorse or promote products derived from this software
|
* contributors may be used to endorse or promote products derived from
|
||||||
* without specific prior written permission.
|
* this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY CITEL TECHNOLOGIES AND CONTRIBUTORS ``AS IS''
|
* THIS SOFTWARE IS PROVIDED BY CITEL TECHNOLOGIES AND CONTRIBUTORS ``AS IS''
|
||||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
* ARE DISCLAIMED. IN NO EVENT SHALL CITEL TECHNOLOGIES OR CONTRIBUTORS BE LIABLE
|
* ARE DISCLAIMED. IN NO EVENT SHALL CITEL TECHNOLOGIES OR CONTRIBUTORS BE
|
||||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
@@ -78,7 +78,9 @@ int igmp_schedmsg(FAR struct igmp_group_s *group, uint8_t msgid)
|
|||||||
DEBUGASSERT(group != NULL && !IS_SCHEDMSG(group->flags));
|
DEBUGASSERT(group != NULL && !IS_SCHEDMSG(group->flags));
|
||||||
DEBUGASSERT(group->ifindex > 0);
|
DEBUGASSERT(group->ifindex > 0);
|
||||||
|
|
||||||
/* Get the device instance associated with the interface index of the group */
|
/* Get the device instance associated with the interface index of the
|
||||||
|
* group
|
||||||
|
*/
|
||||||
|
|
||||||
dev = netdev_findbyindex(group->ifindex);
|
dev = netdev_findbyindex(group->ifindex);
|
||||||
if (dev == NULL)
|
if (dev == NULL)
|
||||||
|
|||||||
+11
-11
@@ -19,21 +19,21 @@
|
|||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
* documentation and/or other materials provided with the distribution.
|
* documentation and/or other materials provided with the distribution.
|
||||||
* 3. Neither the name of CITEL Technologies Ltd nor the names of its contributors
|
* 3. Neither the name of CITEL Technologies Ltd nor the names of its
|
||||||
* may be used to endorse or promote products derived from this software
|
* contributors may be used to endorse or promote products derived from
|
||||||
* without specific prior written permission.
|
* this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY CITEL TECHNOLOGIES AND CONTRIBUTORS ``AS IS''
|
* THIS SOFTWARE IS PROVIDED BY CITEL TECHNOLOGIES AND CONTRIBUTORS ``AS IS''
|
||||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
* ARE DISCLAIMED. IN NO EVENT SHALL CITEL TECHNOLOGIES OR CONTRIBUTORS BE LIABLE
|
* ARE DISCLAIMED. IN NO EVENT SHALL CITEL TECHNOLOGIES OR CONTRIBUTORS BE
|
||||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -108,7 +108,8 @@ int ipv4_getsockname(FAR struct socket *psock, FAR struct sockaddr *addr,
|
|||||||
#ifdef NET_TCP_HAVE_STACK
|
#ifdef NET_TCP_HAVE_STACK
|
||||||
case SOCK_STREAM:
|
case SOCK_STREAM:
|
||||||
{
|
{
|
||||||
FAR struct tcp_conn_s *tcp_conn = (FAR struct tcp_conn_s *)psock->s_conn;
|
FAR struct tcp_conn_s *tcp_conn =
|
||||||
|
(FAR struct tcp_conn_s *)psock->s_conn;
|
||||||
|
|
||||||
outaddr->sin_port = tcp_conn->lport; /* Already in network byte order */
|
outaddr->sin_port = tcp_conn->lport; /* Already in network byte order */
|
||||||
lipaddr = tcp_conn->u.ipv4.laddr;
|
lipaddr = tcp_conn->u.ipv4.laddr;
|
||||||
@@ -120,7 +121,8 @@ int ipv4_getsockname(FAR struct socket *psock, FAR struct sockaddr *addr,
|
|||||||
#ifdef NET_UDP_HAVE_STACK
|
#ifdef NET_UDP_HAVE_STACK
|
||||||
case SOCK_DGRAM:
|
case SOCK_DGRAM:
|
||||||
{
|
{
|
||||||
FAR struct udp_conn_s *udp_conn = (FAR struct udp_conn_s *)psock->s_conn;
|
FAR struct udp_conn_s *udp_conn =
|
||||||
|
(FAR struct udp_conn_s *)psock->s_conn;
|
||||||
|
|
||||||
outaddr->sin_port = udp_conn->lport; /* Already in network byte order */
|
outaddr->sin_port = udp_conn->lport; /* Already in network byte order */
|
||||||
lipaddr = udp_conn->u.ipv4.laddr;
|
lipaddr = udp_conn->u.ipv4.laddr;
|
||||||
|
|||||||
@@ -107,7 +107,8 @@ int ipv6_getsockname(FAR struct socket *psock, FAR struct sockaddr *addr,
|
|||||||
#ifdef NET_TCP_HAVE_STACK
|
#ifdef NET_TCP_HAVE_STACK
|
||||||
case SOCK_STREAM:
|
case SOCK_STREAM:
|
||||||
{
|
{
|
||||||
FAR struct tcp_conn_s *tcp_conn = (FAR struct tcp_conn_s *)psock->s_conn;
|
FAR struct tcp_conn_s *tcp_conn =
|
||||||
|
(FAR struct tcp_conn_s *)psock->s_conn;
|
||||||
|
|
||||||
outaddr->sin6_port = tcp_conn->lport; /* Already in network byte order */
|
outaddr->sin6_port = tcp_conn->lport; /* Already in network byte order */
|
||||||
lipaddr = &tcp_conn->u.ipv6.laddr;
|
lipaddr = &tcp_conn->u.ipv6.laddr;
|
||||||
@@ -119,7 +120,8 @@ int ipv6_getsockname(FAR struct socket *psock, FAR struct sockaddr *addr,
|
|||||||
#ifdef NET_UDP_HAVE_STACK
|
#ifdef NET_UDP_HAVE_STACK
|
||||||
case SOCK_DGRAM:
|
case SOCK_DGRAM:
|
||||||
{
|
{
|
||||||
FAR struct udp_conn_s *udp_conn = (FAR struct udp_conn_s *)psock->s_conn;
|
FAR struct udp_conn_s *udp_conn =
|
||||||
|
(FAR struct udp_conn_s *)psock->s_conn;
|
||||||
|
|
||||||
outaddr->sin6_port = udp_conn->lport; /* Already in network byte order */
|
outaddr->sin6_port = udp_conn->lport; /* Already in network byte order */
|
||||||
lipaddr = &udp_conn->u.ipv6.laddr;
|
lipaddr = &udp_conn->u.ipv6.laddr;
|
||||||
|
|||||||
@@ -132,7 +132,8 @@ static inline void forward_ipselect(FAR struct forward_s *fwd)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static uint16_t ipfwd_eventhandler(FAR struct net_driver_s *dev, FAR void *conn,
|
static uint16_t ipfwd_eventhandler(FAR struct net_driver_s *dev,
|
||||||
|
FAR void *conn,
|
||||||
FAR void *pvpriv, uint16_t flags)
|
FAR void *pvpriv, uint16_t flags)
|
||||||
{
|
{
|
||||||
FAR struct forward_s *fwd = (FAR struct forward_s *)pvpriv;
|
FAR struct forward_s *fwd = (FAR struct forward_s *)pvpriv;
|
||||||
|
|||||||
@@ -476,9 +476,9 @@ int ipv4_forward(FAR struct net_driver_s *dev, FAR struct ipv4_hdr_s *ipv4)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Single network device. The use case here is where an endpoint acts
|
/* Single network device. The use case here is where an endpoint acts
|
||||||
* as a hub in a star configuration. This is typical for a wireless star
|
* as a hub in a star configuration. This is typical for a wireless
|
||||||
* configuration where not all endpoints are accessible from all other
|
* star configuration where not all endpoints are accessible from all
|
||||||
* endpoints, but seems less useful for a wired network.
|
* other endpoints, but seems less useful for a wired network.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef CONFIG_NET_ETHERNET
|
#ifdef CONFIG_NET_ETHERNET
|
||||||
|
|||||||
@@ -609,9 +609,9 @@ int ipv6_forward(FAR struct net_driver_s *dev, FAR struct ipv6_hdr_s *ipv6)
|
|||||||
#if defined(CONFIG_NET_6LOWPAN) /* REVISIT: Currently only support for 6LoWPAN */
|
#if defined(CONFIG_NET_6LOWPAN) /* REVISIT: Currently only support for 6LoWPAN */
|
||||||
{
|
{
|
||||||
/* Single network device. The use case here is where an endpoint acts
|
/* Single network device. The use case here is where an endpoint acts
|
||||||
* as a hub in a star configuration. This is typical for a wireless star
|
* as a hub in a star configuration. This is typical for a wireless
|
||||||
* configuration where not all endpoints are accessible from all other
|
* star configuration where not all endpoints are accessible from all
|
||||||
* endpoints, but seems less useful for a wired network.
|
* other endpoints, but seems less useful for a wired network.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Perform any necessary packet conversions. If the packet was handled
|
/* Perform any necessary packet conversions. If the packet was handled
|
||||||
@@ -629,9 +629,11 @@ int ipv6_forward(FAR struct net_driver_s *dev, FAR struct ipv6_hdr_s *ipv6)
|
|||||||
else if (ret == PACKET_NOT_FORWARDED)
|
else if (ret == PACKET_NOT_FORWARDED)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_NET_ETHERNET
|
#ifdef CONFIG_NET_ETHERNET
|
||||||
/* REVISIT: For Ethernet we may have to fix up the Ethernet header:
|
/* REVISIT:
|
||||||
|
* For Ethernet we may have to fix up the Ethernet header:
|
||||||
* - source MAC, the MAC of the current device.
|
* - source MAC, the MAC of the current device.
|
||||||
* - dest MAC, the MAC associated with the destination IPv6 address.
|
* - dest MAC, the MAC associated with the destination IPv6
|
||||||
|
* address.
|
||||||
* This will involve ICMPv6 and Neighbor Discovery.
|
* This will involve ICMPv6 and Neighbor Discovery.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -653,7 +655,8 @@ int ipv6_forward(FAR struct net_driver_s *dev, FAR struct ipv6_hdr_s *ipv6)
|
|||||||
|
|
||||||
#else /* CONFIG_NET_6LOWPAN */
|
#else /* CONFIG_NET_6LOWPAN */
|
||||||
{
|
{
|
||||||
nwarn("WARNING: Packet forwarding not supported in this configuration\n");
|
nwarn(
|
||||||
|
"WARNING: Packet forwarding not supported in this configuration\n");
|
||||||
ret = -ENOSYS;
|
ret = -ENOSYS;
|
||||||
goto drop;
|
goto drop;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,7 +95,8 @@ static int local_waitlisten(FAR struct local_conn_s *server)
|
|||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* psock The listening Unix domain socket structure
|
* psock The listening Unix domain socket structure
|
||||||
* addr Receives the address of the connecting client
|
* addr Receives the address of the connecting client
|
||||||
* addrlen Input: allocated size of 'addr', Return: returned size of 'addr'
|
* addrlen Input: allocated size of 'addr',
|
||||||
|
* Return: returned size of 'addr'
|
||||||
* newconn The new, accepted Unix domain connection structure
|
* newconn The new, accepted Unix domain connection structure
|
||||||
*
|
*
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
@@ -190,8 +191,8 @@ int local_accept(FAR struct socket *psock, FAR struct sockaddr *addr,
|
|||||||
_SS_ISNONBLOCK(psock->s_flags));
|
_SS_ISNONBLOCK(psock->s_flags));
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
nerr("ERROR: Failed to open write-only FIFOs for %s: %d\n",
|
nerr("ERROR: Failed to open write-only FIFOs for %s: %d\n",
|
||||||
conn->lc_path, ret);
|
conn->lc_path, ret);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -100,7 +100,8 @@ int local_release(FAR struct local_conn_s *conn)
|
|||||||
|
|
||||||
/* Are there still clients waiting for a connection to the server? */
|
/* Are there still clients waiting for a connection to the server? */
|
||||||
|
|
||||||
for (client = (FAR struct local_conn_s *)conn->u.server.lc_waiters.head;
|
for (client =
|
||||||
|
(FAR struct local_conn_s *)conn->u.server.lc_waiters.head;
|
||||||
client;
|
client;
|
||||||
client = (FAR struct local_conn_s *)dq_next(&client->lc_node))
|
client = (FAR struct local_conn_s *)dq_next(&client->lc_node))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -81,8 +81,10 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
ssize_t psock_local_sendto(FAR struct socket *psock, FAR const void *buf,
|
ssize_t psock_local_sendto(FAR struct socket *psock,
|
||||||
size_t len, int flags, FAR const struct sockaddr *to,
|
FAR const void *buf,
|
||||||
|
size_t len, int flags,
|
||||||
|
FAR const struct sockaddr *to,
|
||||||
socklen_t tolen)
|
socklen_t tolen)
|
||||||
{
|
{
|
||||||
FAR struct local_conn_s *conn = (FAR struct local_conn_s *)psock->s_conn;
|
FAR struct local_conn_s *conn = (FAR struct local_conn_s *)psock->s_conn;
|
||||||
@@ -118,7 +120,9 @@ ssize_t psock_local_sendto(FAR struct socket *psock, FAR const void *buf,
|
|||||||
|
|
||||||
if (tolen < sizeof(sa_family_t) + 2)
|
if (tolen < sizeof(sa_family_t) + 2)
|
||||||
{
|
{
|
||||||
/* EFAULT - An invalid user space address was specified for a parameter */
|
/* EFAULT
|
||||||
|
* - An invalid user space address was specified for a parameter
|
||||||
|
*/
|
||||||
|
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-1
@@ -72,7 +72,9 @@ int mld_schedmsg(FAR struct mld_group_s *group, uint8_t msgtype)
|
|||||||
DEBUGASSERT(group != NULL && !IS_MLD_SCHEDMSG(group->flags));
|
DEBUGASSERT(group != NULL && !IS_MLD_SCHEDMSG(group->flags));
|
||||||
DEBUGASSERT(group->ifindex > 0);
|
DEBUGASSERT(group->ifindex > 0);
|
||||||
|
|
||||||
/* Get the device instance associated with the interface index of the group */
|
/* Get the device instance associated with the interface index
|
||||||
|
* of the group
|
||||||
|
*/
|
||||||
|
|
||||||
dev = netdev_findbyindex(group->ifindex);
|
dev = netdev_findbyindex(group->ifindex);
|
||||||
if (dev == NULL)
|
if (dev == NULL)
|
||||||
|
|||||||
+4
-2
@@ -106,7 +106,7 @@ static inline void mld_check_v1compat(FAR struct net_driver_s *dev,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
mld_start_v1timer(dev,
|
mld_start_v1timer(dev,
|
||||||
MSEC2TICK(MLD_V1PRESENT_MSEC((clock_t)MLD_QUERY_MSEC)));
|
MSEC2TICK(MLD_V1PRESENT_MSEC((clock_t)MLD_QUERY_MSEC)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,7 +124,9 @@ static clock_t mld_mrc2mrd(uint16_t mrc)
|
|||||||
{
|
{
|
||||||
uint32_t mrd; /* Units of milliseconds */
|
uint32_t mrd; /* Units of milliseconds */
|
||||||
|
|
||||||
/* If bit 15 is not set (i.e., mrc < 32768), then no conversion is required. */
|
/* If bit 15 is not set (i.e., mrc < 32768),
|
||||||
|
* then no conversion is required.
|
||||||
|
*/
|
||||||
|
|
||||||
if (mrc < 32768)
|
if (mrc < 32768)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -62,7 +62,8 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int mld_report(FAR struct net_driver_s *dev, FAR const net_ipv6addr_t grpaddr)
|
int mld_report(FAR struct net_driver_s *dev,
|
||||||
|
FAR const net_ipv6addr_t grpaddr)
|
||||||
{
|
{
|
||||||
FAR struct mld_group_s *group;
|
FAR struct mld_group_s *group;
|
||||||
|
|
||||||
|
|||||||
+4
-3
@@ -205,14 +205,15 @@ void mld_send(FAR struct net_driver_s *dev, FAR struct mld_group_s *group,
|
|||||||
|
|
||||||
net_ipv6addr_hdrcopy(ipv6->srcipaddr, dev->d_ipv6addr);
|
net_ipv6addr_hdrcopy(ipv6->srcipaddr, dev->d_ipv6addr);
|
||||||
|
|
||||||
/* Select the IPv6 destination address. This varies with the type of message
|
/* Select the IPv6 destination address.
|
||||||
* being sent:
|
* This varies with the type of message being sent:
|
||||||
*
|
*
|
||||||
* MESSAGE DESTINATION ADDRESS
|
* MESSAGE DESTINATION ADDRESS
|
||||||
* General Query Message: The link-local, all nodes multicast address.
|
* General Query Message: The link-local, all nodes multicast address.
|
||||||
* MAS Query Messages: The group multicast address.
|
* MAS Query Messages: The group multicast address.
|
||||||
* V1 Report Message: The group multicast address.
|
* V1 Report Message: The group multicast address.
|
||||||
* V2 Report Message: The link-local, all MLDv2 router multicast address.
|
* V2 Report Message: The link-local, all MLDv2 router multicast
|
||||||
|
* address.
|
||||||
* Done Message: The link-local, all routers multicast address.
|
* Done Message: The link-local, all routers multicast address.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -120,7 +120,8 @@ void neighbor_add(FAR struct net_driver_s *dev, FAR net_ipv6addr_t ipaddr,
|
|||||||
* ipaddr - The IPv6 address to use in the lookup;
|
* ipaddr - The IPv6 address to use in the lookup;
|
||||||
* laddr - Location to return the corresponding link layer address.
|
* laddr - Location to return the corresponding link layer address.
|
||||||
* This address may be NULL. In that case, this function may be
|
* This address may be NULL. In that case, this function may be
|
||||||
* used simply to determine if the link layer address is available.
|
* used simply to determine if the link layer address is
|
||||||
|
* available.
|
||||||
*
|
*
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
* Zero (OK) if the link layer address is returned. A negated errno value
|
* Zero (OK) if the link layer address is returned. A negated errno value
|
||||||
|
|||||||
@@ -120,7 +120,8 @@ static int neighbor_match(FAR struct net_driver_s *dev, FAR void *arg)
|
|||||||
* ipaddr - The IPv6 address to use in the lookup;
|
* ipaddr - The IPv6 address to use in the lookup;
|
||||||
* laddr - Location to return the corresponding link layer address.
|
* laddr - Location to return the corresponding link layer address.
|
||||||
* This address may be NULL. In that case, this function may be
|
* This address may be NULL. In that case, this function may be
|
||||||
* used simply to determine if the link layer address is available.
|
* used simply to determine if the link layer address is
|
||||||
|
* available.
|
||||||
*
|
*
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
* Zero (OK) if the link layer address is returned. A negated errno value
|
* Zero (OK) if the link layer address is returned. A negated errno value
|
||||||
|
|||||||
@@ -92,7 +92,8 @@ unsigned int neighbor_snapshot(FAR struct neighbor_entry_s *snapshot,
|
|||||||
|
|
||||||
if (!net_ipv6addr_cmp(neighbor->ne_ipaddr, g_ipv6_unspecaddr))
|
if (!net_ipv6addr_cmp(neighbor->ne_ipaddr, g_ipv6_unspecaddr))
|
||||||
{
|
{
|
||||||
memcpy(&snapshot[ncopied], neighbor, sizeof(struct neighbor_entry_s));
|
memcpy(&snapshot[ncopied], neighbor,
|
||||||
|
sizeof(struct neighbor_entry_s));
|
||||||
ncopied++;
|
ncopied++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-4
@@ -108,7 +108,8 @@ EXTERN uint32_t g_devfreed;
|
|||||||
/* Callback from netdev_foreach() */
|
/* Callback from netdev_foreach() */
|
||||||
|
|
||||||
struct net_driver_s; /* Forward reference */
|
struct net_driver_s; /* Forward reference */
|
||||||
typedef int (*netdev_callback_t)(FAR struct net_driver_s *dev, FAR void *arg);
|
typedef int (*netdev_callback_t)(FAR struct net_driver_s *dev,
|
||||||
|
FAR void *arg);
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Function Prototypes
|
* Public Function Prototypes
|
||||||
@@ -224,7 +225,8 @@ FAR struct net_driver_s *netdev_findby_lipv4addr(in_addr_t lipaddr);
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_NET_IPv6
|
#ifdef CONFIG_NET_IPv6
|
||||||
FAR struct net_driver_s *netdev_findby_lipv6addr(const net_ipv6addr_t lipaddr);
|
FAR struct net_driver_s *netdev_findby_lipv6addr(
|
||||||
|
const net_ipv6addr_t lipaddr);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -267,8 +269,9 @@ FAR struct net_driver_s *netdev_findby_ripv4addr(in_addr_t lipaddr,
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_NET_IPv6
|
#ifdef CONFIG_NET_IPv6
|
||||||
FAR struct net_driver_s *netdev_findby_ripv6addr(const net_ipv6addr_t lipaddr,
|
FAR struct net_driver_s *netdev_findby_ripv6addr(
|
||||||
const net_ipv6addr_t ripaddr);
|
const net_ipv6addr_t lipaddr,
|
||||||
|
const net_ipv6addr_t ripaddr);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -129,7 +129,8 @@ FAR struct net_driver_s *netdev_findby_lipv4addr(in_addr_t lipaddr)
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_NET_IPv6
|
#ifdef CONFIG_NET_IPv6
|
||||||
FAR struct net_driver_s *netdev_findby_lipv6addr(const net_ipv6addr_t lipaddr)
|
FAR struct net_driver_s *netdev_findby_lipv6addr(
|
||||||
|
const net_ipv6addr_t lipaddr)
|
||||||
{
|
{
|
||||||
FAR struct net_driver_s *dev;
|
FAR struct net_driver_s *dev;
|
||||||
|
|
||||||
@@ -270,8 +271,9 @@ FAR struct net_driver_s *netdev_findby_ripv4addr(in_addr_t lipaddr,
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_NET_IPv6
|
#ifdef CONFIG_NET_IPv6
|
||||||
FAR struct net_driver_s *netdev_findby_ripv6addr(const net_ipv6addr_t lipaddr,
|
FAR struct net_driver_s *netdev_findby_ripv6addr(
|
||||||
const net_ipv6addr_t ripaddr)
|
const net_ipv6addr_t lipaddr,
|
||||||
|
const net_ipv6addr_t ripaddr)
|
||||||
{
|
{
|
||||||
struct net_driver_s *dev;
|
struct net_driver_s *dev;
|
||||||
#ifdef CONFIG_NET_ROUTE
|
#ifdef CONFIG_NET_ROUTE
|
||||||
|
|||||||
@@ -85,9 +85,12 @@ static int netprocfs_joinleave(FAR struct netprocfs_file_s *netfile);
|
|||||||
static int netprocfs_queries_sent(FAR struct netprocfs_file_s *netfile);
|
static int netprocfs_queries_sent(FAR struct netprocfs_file_s *netfile);
|
||||||
static int netprocfs_reports_sent(FAR struct netprocfs_file_s *netfile);
|
static int netprocfs_reports_sent(FAR struct netprocfs_file_s *netfile);
|
||||||
static int netprocfs_done_sent(FAR struct netprocfs_file_s *netfile);
|
static int netprocfs_done_sent(FAR struct netprocfs_file_s *netfile);
|
||||||
static int netprocfs_queries_received_1(FAR struct netprocfs_file_s *netfile);
|
static int netprocfs_queries_received_1(
|
||||||
static int netprocfs_queries_received_2(FAR struct netprocfs_file_s *netfile);
|
FAR struct netprocfs_file_s *netfile);
|
||||||
static int netprocfs_reports_received(FAR struct netprocfs_file_s *netfile);
|
static int netprocfs_queries_received_2(
|
||||||
|
FAR struct netprocfs_file_s *netfile);
|
||||||
|
static int netprocfs_reports_received(
|
||||||
|
FAR struct netprocfs_file_s *netfile);
|
||||||
static int netprocfs_done_received(FAR struct netprocfs_file_s *netfile);
|
static int netprocfs_done_received(FAR struct netprocfs_file_s *netfile);
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -261,7 +264,8 @@ static int netprocfs_done_received(FAR struct netprocfs_file_s *netfile)
|
|||||||
ssize_t netprocfs_read_mldstats(FAR struct netprocfs_file_s *priv,
|
ssize_t netprocfs_read_mldstats(FAR struct netprocfs_file_s *priv,
|
||||||
FAR char *buffer, size_t buflen)
|
FAR char *buffer, size_t buflen)
|
||||||
{
|
{
|
||||||
return netprocfs_read_linegen(priv, buffer, buflen, g_mld_linegen, NSTAT_LINES);
|
return netprocfs_read_linegen(priv, buffer, buflen,
|
||||||
|
g_mld_linegen, NSTAT_LINES);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_NET_ICMPv6 || CONFIG_NET_MLD */
|
#endif /* CONFIG_NET_ICMPv6 || CONFIG_NET_MLD */
|
||||||
|
|||||||
+13
-12
@@ -61,24 +61,24 @@
|
|||||||
|
|
||||||
/* Line generating functions */
|
/* Line generating functions */
|
||||||
|
|
||||||
static int netprocfs_header(FAR struct netprocfs_file_s *netfile);
|
static int netprocfs_header(FAR struct netprocfs_file_s *netfile);
|
||||||
static int netprocfs_received(FAR struct netprocfs_file_s *netfile);
|
static int netprocfs_received(FAR struct netprocfs_file_s *netfile);
|
||||||
static int netprocfs_dropped(FAR struct netprocfs_file_s *netfile);
|
static int netprocfs_dropped(FAR struct netprocfs_file_s *netfile);
|
||||||
#ifdef CONFIG_NET_IPv4
|
#ifdef CONFIG_NET_IPv4
|
||||||
static int netprocfs_ipv4_dropped(FAR struct netprocfs_file_s *netfile);
|
static int netprocfs_ipv4_dropped(FAR struct netprocfs_file_s *netfile);
|
||||||
#endif /* CONFIG_NET_IPv4 */
|
#endif /* CONFIG_NET_IPv4 */
|
||||||
#ifdef CONFIG_NET_IPv6
|
#ifdef CONFIG_NET_IPv6
|
||||||
static int netprocfs_ipv6_dropped(FAR struct netprocfs_file_s *netfile);
|
static int netprocfs_ipv6_dropped(FAR struct netprocfs_file_s *netfile);
|
||||||
#endif /* CONFIG_NET_IPv4 */
|
#endif /* CONFIG_NET_IPv4 */
|
||||||
static int netprocfs_checksum(FAR struct netprocfs_file_s *netfile);
|
static int netprocfs_checksum(FAR struct netprocfs_file_s *netfile);
|
||||||
#ifdef CONFIG_NET_TCP
|
#ifdef CONFIG_NET_TCP
|
||||||
static int netprocfs_tcp_dropped_1(FAR struct netprocfs_file_s *netfile);
|
static int netprocfs_tcp_dropped_1(FAR struct netprocfs_file_s *netfile);
|
||||||
static int netprocfs_tcp_dropped_2(FAR struct netprocfs_file_s *netfile);
|
static int netprocfs_tcp_dropped_2(FAR struct netprocfs_file_s *netfile);
|
||||||
#endif /* CONFIG_NET_TCP */
|
#endif /* CONFIG_NET_TCP */
|
||||||
static int netprocfs_prototype(FAR struct netprocfs_file_s *netfile);
|
static int netprocfs_prototype(FAR struct netprocfs_file_s *netfile);
|
||||||
static int netprocfs_sent(FAR struct netprocfs_file_s *netfile);
|
static int netprocfs_sent(FAR struct netprocfs_file_s *netfile);
|
||||||
#ifdef CONFIG_NET_TCP
|
#ifdef CONFIG_NET_TCP
|
||||||
static int netprocfs_retransmissions(FAR struct netprocfs_file_s *netfile);
|
static int netprocfs_retransmissions(FAR struct netprocfs_file_s *netfile);
|
||||||
#endif /* CONFIG_NET_TCP */
|
#endif /* CONFIG_NET_TCP */
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -461,7 +461,8 @@ static int netprocfs_retransmissions(FAR struct netprocfs_file_s *netfile)
|
|||||||
ssize_t netprocfs_read_netstats(FAR struct netprocfs_file_s *priv,
|
ssize_t netprocfs_read_netstats(FAR struct netprocfs_file_s *priv,
|
||||||
FAR char *buffer, size_t buflen)
|
FAR char *buffer, size_t buflen)
|
||||||
{
|
{
|
||||||
return netprocfs_read_linegen(priv, buffer, buflen, g_stat_linegen, NSTAT_LINES);
|
return netprocfs_read_linegen(priv, buffer, buflen,
|
||||||
|
g_stat_linegen, NSTAT_LINES);
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -111,7 +111,8 @@ int net_openroute_ipv6(int oflags, FAR struct file *filep);
|
|||||||
* Read one route entry from the IPv4/IPv6 routing table.
|
* Read one route entry from the IPv4/IPv6 routing table.
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* filep - Detached file instance obtained by net_openroute_ipv{4|6}[_rdonly]
|
* filep - Detached file instance obtained by
|
||||||
|
* net_openroute_ipv{4|6}[_rdonly]
|
||||||
* route - Location to return the next route read from the file
|
* route - Location to return the next route read from the file
|
||||||
*
|
*
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
@@ -138,7 +139,8 @@ ssize_t net_readroute_ipv6(FAR struct file *filep,
|
|||||||
* Write one route entry to the IPv4/IPv6 routing table.
|
* Write one route entry to the IPv4/IPv6 routing table.
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* filep - Detached file instance obtained by net_openroute_ipv{4|6}[_rdonly]
|
* filep - Detached file instance obtained by
|
||||||
|
* net_openroute_ipv{4|6}[_rdonly]
|
||||||
* route - Location to return the next route read from the file
|
* route - Location to return the next route read from the file
|
||||||
*
|
*
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
@@ -164,7 +166,8 @@ ssize_t net_writeroute_ipv6(FAR struct file *filep,
|
|||||||
* Seek to a specific entry entry to the IPv4/IPv6 routing table.
|
* Seek to a specific entry entry to the IPv4/IPv6 routing table.
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* filep - Detached file instance obtained by net_openroute_ipv{4|6}[_rdonly]
|
* filep - Detached file instance obtained by
|
||||||
|
* net_openroute_ipv{4|6}[_rdonly]
|
||||||
* index - The index of the routing table entry to seek to.
|
* index - The index of the routing table entry to seek to.
|
||||||
*
|
*
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
@@ -264,7 +267,8 @@ int net_unlockroute_ipv6(void);
|
|||||||
* Close the IPv4/IPv6 routing table.
|
* Close the IPv4/IPv6 routing table.
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* filep - Detached file instance obtained by net_openroute_ipv{4|6}[_rdonly]
|
* filep - Detached file instance obtained by
|
||||||
|
* net_openroute_ipv{4|6}[_rdonly]
|
||||||
*
|
*
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
* Zero (OK) is returned on success. A negated errno value is returned on
|
* Zero (OK) is returned on success. A negated errno value is returned on
|
||||||
|
|||||||
@@ -427,7 +427,9 @@ static void net_reset_ipv4_cache(void)
|
|||||||
cacheroute_init(&g_ipv4_cache);
|
cacheroute_init(&g_ipv4_cache);
|
||||||
cacheroute_init(&g_free_ipv4cache);
|
cacheroute_init(&g_free_ipv4cache);
|
||||||
|
|
||||||
/* Add all of the pre-allocated routing table cache entries to a free list */
|
/* Add all of the pre-allocated routing table cache entries to
|
||||||
|
* a free list
|
||||||
|
*/
|
||||||
|
|
||||||
for (i = 0; i < CONFIG_ROUTE_MAX_IPv4_CACHEROUTES; i++)
|
for (i = 0; i < CONFIG_ROUTE_MAX_IPv4_CACHEROUTES; i++)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -101,7 +101,8 @@ struct route_match_ipv6_s
|
|||||||
#ifdef CONFIG_ROUTE_IPv4_FILEROUTE
|
#ifdef CONFIG_ROUTE_IPv4_FILEROUTE
|
||||||
static int net_match_ipv4(FAR struct net_route_ipv4_s *route, FAR void *arg)
|
static int net_match_ipv4(FAR struct net_route_ipv4_s *route, FAR void *arg)
|
||||||
{
|
{
|
||||||
FAR struct route_match_ipv4_s *match = (FAR struct route_match_ipv4_s *)arg;
|
FAR struct route_match_ipv4_s *match =
|
||||||
|
(FAR struct route_match_ipv4_s *)arg;
|
||||||
|
|
||||||
/* To match, the masked target address must be the same, and the masks
|
/* To match, the masked target address must be the same, and the masks
|
||||||
* must be the same.
|
* must be the same.
|
||||||
@@ -132,7 +133,8 @@ static int net_match_ipv4(FAR struct net_route_ipv4_s *route, FAR void *arg)
|
|||||||
#ifdef CONFIG_ROUTE_IPv6_FILEROUTE
|
#ifdef CONFIG_ROUTE_IPv6_FILEROUTE
|
||||||
static int net_match_ipv6(FAR struct net_route_ipv6_s *route, FAR void *arg)
|
static int net_match_ipv6(FAR struct net_route_ipv6_s *route, FAR void *arg)
|
||||||
{
|
{
|
||||||
FAR struct route_match_ipv6_s *match = (FAR struct route_match_ipv6_s *)arg;
|
FAR struct route_match_ipv6_s *match =
|
||||||
|
(FAR struct route_match_ipv6_s *)arg;
|
||||||
|
|
||||||
/* To match, the masked target address must be the same, and the masks
|
/* To match, the masked target address must be the same, and the masks
|
||||||
* must be the same.
|
* must be the same.
|
||||||
@@ -230,7 +232,9 @@ int net_delroute_ipv4(in_addr_t target, in_addr_t netmask)
|
|||||||
net_ipv4addr_copy(match.netmask, netmask);
|
net_ipv4addr_copy(match.netmask, netmask);
|
||||||
match.index = 0;
|
match.index = 0;
|
||||||
|
|
||||||
/* Then find the index into the routing table where the match can be found */
|
/* Then find the index into the routing table where the match can be
|
||||||
|
* found
|
||||||
|
*/
|
||||||
|
|
||||||
ret = net_foreachroute_ipv4(net_match_ipv4, &match);
|
ret = net_foreachroute_ipv4(net_match_ipv4, &match);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
@@ -378,7 +382,9 @@ int net_delroute_ipv6(net_ipv6addr_t target, net_ipv6addr_t netmask)
|
|||||||
net_ipv6addr_copy(match.netmask, netmask);
|
net_ipv6addr_copy(match.netmask, netmask);
|
||||||
match.index = 0;
|
match.index = 0;
|
||||||
|
|
||||||
/* Then find the index into the routing table where the match can be found */
|
/* Then find the index into the routing table where the match can be
|
||||||
|
* found
|
||||||
|
*/
|
||||||
|
|
||||||
ret = net_foreachroute_ipv6(net_match_ipv6, &match);
|
ret = net_foreachroute_ipv6(net_match_ipv6, &match);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
|
|||||||
@@ -96,7 +96,8 @@ struct route_match_ipv6_s
|
|||||||
#ifdef CONFIG_ROUTE_IPv4_RAMROUTE
|
#ifdef CONFIG_ROUTE_IPv4_RAMROUTE
|
||||||
static int net_match_ipv4(FAR struct net_route_ipv4_s *route, FAR void *arg)
|
static int net_match_ipv4(FAR struct net_route_ipv4_s *route, FAR void *arg)
|
||||||
{
|
{
|
||||||
FAR struct route_match_ipv4_s *match = (FAR struct route_match_ipv4_s *)arg;
|
FAR struct route_match_ipv4_s *match =
|
||||||
|
(FAR struct route_match_ipv4_s *)arg;
|
||||||
|
|
||||||
/* To match, the masked target address must be the same, and the masks
|
/* To match, the masked target address must be the same, and the masks
|
||||||
* must be the same.
|
* must be the same.
|
||||||
@@ -114,8 +115,9 @@ static int net_match_ipv4(FAR struct net_route_ipv4_s *route, FAR void *arg)
|
|||||||
|
|
||||||
if (match->prev)
|
if (match->prev)
|
||||||
{
|
{
|
||||||
ramroute_ipv4_remafter((FAR struct net_route_ipv4_entry_s *)match->prev,
|
ramroute_ipv4_remafter(
|
||||||
&g_ipv4_routes);
|
(FAR struct net_route_ipv4_entry_s *)match->prev,
|
||||||
|
&g_ipv4_routes);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -139,9 +141,11 @@ static int net_match_ipv4(FAR struct net_route_ipv4_s *route, FAR void *arg)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_ROUTE_IPv6_RAMROUTE
|
#ifdef CONFIG_ROUTE_IPv6_RAMROUTE
|
||||||
static int net_match_ipv6(FAR struct net_route_ipv6_s *route, FAR void *arg)
|
static int net_match_ipv6(
|
||||||
|
FAR struct net_route_ipv6_s *route, FAR void *arg)
|
||||||
{
|
{
|
||||||
FAR struct route_match_ipv6_s *match = (FAR struct route_match_ipv6_s *)arg;
|
FAR struct route_match_ipv6_s *match =
|
||||||
|
(FAR struct route_match_ipv6_s *)arg;
|
||||||
|
|
||||||
/* To match, the masked target address must be the same, and the masks
|
/* To match, the masked target address must be the same, and the masks
|
||||||
* must be the same.
|
* must be the same.
|
||||||
@@ -167,8 +171,9 @@ static int net_match_ipv6(FAR struct net_route_ipv6_s *route, FAR void *arg)
|
|||||||
|
|
||||||
if (match->prev)
|
if (match->prev)
|
||||||
{
|
{
|
||||||
ramroute_ipv6_remafter((FAR struct net_route_ipv6_entry_s *)match->prev,
|
ramroute_ipv6_remafter(
|
||||||
&g_ipv6_routes);
|
(FAR struct net_route_ipv6_entry_s *)match->prev,
|
||||||
|
&g_ipv6_routes);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -119,7 +119,8 @@ struct route_ipv6_match_s
|
|||||||
#ifdef CONFIG_NET_IPv4
|
#ifdef CONFIG_NET_IPv4
|
||||||
static int net_ipv4_match(FAR struct net_route_ipv4_s *route, FAR void *arg)
|
static int net_ipv4_match(FAR struct net_route_ipv4_s *route, FAR void *arg)
|
||||||
{
|
{
|
||||||
FAR struct route_ipv4_match_s *match = (FAR struct route_ipv4_match_s *)arg;
|
FAR struct route_ipv4_match_s *match =
|
||||||
|
(FAR struct route_ipv4_match_s *)arg;
|
||||||
|
|
||||||
/* To match, the masked target addresses must be the same. In the event
|
/* To match, the masked target addresses must be the same. In the event
|
||||||
* of multiple matches, only the first is returned. There is not (yet) any
|
* of multiple matches, only the first is returned. There is not (yet) any
|
||||||
@@ -162,7 +163,8 @@ static int net_ipv4_match(FAR struct net_route_ipv4_s *route, FAR void *arg)
|
|||||||
#ifdef CONFIG_NET_IPv6
|
#ifdef CONFIG_NET_IPv6
|
||||||
static int net_ipv6_match(FAR struct net_route_ipv6_s *route, FAR void *arg)
|
static int net_ipv6_match(FAR struct net_route_ipv6_s *route, FAR void *arg)
|
||||||
{
|
{
|
||||||
FAR struct route_ipv6_match_s *match = (FAR struct route_ipv6_match_s *)arg;
|
FAR struct route_ipv6_match_s *match =
|
||||||
|
(FAR struct route_ipv6_match_s *)arg;
|
||||||
|
|
||||||
/* To match, the masked target addresses must be the same. In the event
|
/* To match, the masked target addresses must be the same. In the event
|
||||||
* of multiple matches, only the first is returned. There is not (yet) any
|
* of multiple matches, only the first is returned. There is not (yet) any
|
||||||
|
|||||||
+6
-2
@@ -62,7 +62,9 @@ struct net_route_ipv4_s
|
|||||||
in_addr_t router; /* Route packets via this router */
|
in_addr_t router; /* Route packets via this router */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Type of the call out function pointer provided to net_foreachroute_ipv4() */
|
/* Type of the call out function pointer provided to
|
||||||
|
* net_foreachroute_ipv4()
|
||||||
|
*/
|
||||||
|
|
||||||
typedef int (*route_handler_ipv4_t)(FAR struct net_route_ipv4_s *route,
|
typedef int (*route_handler_ipv4_t)(FAR struct net_route_ipv4_s *route,
|
||||||
FAR void *arg);
|
FAR void *arg);
|
||||||
@@ -76,7 +78,9 @@ struct net_route_ipv6_s
|
|||||||
net_ipv6addr_t router; /* Route packets via this router */
|
net_ipv6addr_t router; /* Route packets via this router */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Type of the call out function pointer provided to net_foreachroute_ipv6() */
|
/* Type of the call out function pointer provided to
|
||||||
|
* net_foreachroute_ipv6()
|
||||||
|
*/
|
||||||
|
|
||||||
typedef int (*route_handler_ipv6_t)(FAR struct net_route_ipv6_s *route,
|
typedef int (*route_handler_ipv6_t)(FAR struct net_route_ipv6_s *route,
|
||||||
FAR void *arg);
|
FAR void *arg);
|
||||||
|
|||||||
@@ -83,8 +83,8 @@ void sixlowpan_initialize(void);
|
|||||||
* Name: psock_6lowpan_tcp_send
|
* Name: psock_6lowpan_tcp_send
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* psock_6lowpan_tcp_send() call may be used only when the TCP socket is in a
|
* psock_6lowpan_tcp_send() call may be used only when the TCP socket is in
|
||||||
* connected state (so that the intended recipient is known).
|
* a connected state (so that the intended recipient is known).
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* psock - An instance of the internal socket structure.
|
* psock - An instance of the internal socket structure.
|
||||||
|
|||||||
+6
-4
@@ -86,7 +86,8 @@
|
|||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* psock Reference to the listening socket structure
|
* psock Reference to the listening socket structure
|
||||||
* addr Receives the address of the connecting client
|
* addr Receives the address of the connecting client
|
||||||
* addrlen Input: allocated size of 'addr', Return: returned size of 'addr'
|
* addrlen Input: allocated size of 'addr', Return: returned size
|
||||||
|
* of 'addr'
|
||||||
* newsock Location to return the accepted socket information.
|
* newsock Location to return the accepted socket information.
|
||||||
*
|
*
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
@@ -197,7 +198,8 @@ errout_with_lock:
|
|||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* sockfd The listening socket descriptor
|
* sockfd The listening socket descriptor
|
||||||
* addr Receives the address of the connecting client
|
* addr Receives the address of the connecting client
|
||||||
* addrlen Input: allocated size of 'addr', Return: returned size of 'addr'
|
* addrlen Input: allocated size of 'addr',
|
||||||
|
* Return: returned size of 'addr'
|
||||||
*
|
*
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
* Returns -1 on error. If it succeeds, it returns a non-negative integer
|
* Returns -1 on error. If it succeeds, it returns a non-negative integer
|
||||||
@@ -252,8 +254,8 @@ int accept(int sockfd, FAR struct sockaddr *addr, FAR socklen_t *addrlen)
|
|||||||
if (psock == NULL || psock->s_crefs <= 0)
|
if (psock == NULL || psock->s_crefs <= 0)
|
||||||
{
|
{
|
||||||
/* It is not a valid socket description. Distinguish between the cases
|
/* It is not a valid socket description. Distinguish between the cases
|
||||||
* where sockfd is a just valid and when it is a valid file descriptor used
|
* where sockfd is a just valid and when it is a valid file descriptor
|
||||||
* in the wrong context.
|
* used in the wrong context.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ((unsigned int)sockfd < CONFIG_NFILE_DESCRIPTORS)
|
if ((unsigned int)sockfd < CONFIG_NFILE_DESCRIPTORS)
|
||||||
|
|||||||
@@ -149,7 +149,8 @@ int psock_connect(FAR struct socket *psock, FAR const struct sockaddr *addr,
|
|||||||
|
|
||||||
/* Let the address family's connect() method handle the operation */
|
/* Let the address family's connect() method handle the operation */
|
||||||
|
|
||||||
DEBUGASSERT(psock->s_sockif != NULL && psock->s_sockif->si_connect != NULL);
|
DEBUGASSERT(psock->s_sockif != NULL &&
|
||||||
|
psock->s_sockif->si_connect != NULL);
|
||||||
ret = psock->s_sockif->si_connect(psock, addr, addrlen);
|
ret = psock->s_sockif->si_connect(psock, addr, addrlen);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
@@ -172,9 +173,9 @@ int psock_connect(FAR struct socket *psock, FAR const struct sockaddr *addr,
|
|||||||
* Name: connect
|
* Name: connect
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* connect() connects the socket referred to by the file descriptor 'sockfd'
|
* connect() connects the socket referred to by the file descriptor
|
||||||
* to the address specified by 'addr'. The addrlen argument specifies
|
* 'sockfd' to the address specified by 'addr'. The addrlen argument
|
||||||
* the size of 'addr'. The format of the address in 'addr' is
|
* specifies the size of 'addr'. The format of the address in 'addr' is
|
||||||
* determined by the address space of the socket 'sockfd'.
|
* determined by the address space of the socket 'sockfd'.
|
||||||
*
|
*
|
||||||
* If the socket 'sockfd' is of type SOCK_DGRAM then 'addr' is the address
|
* If the socket 'sockfd' is of type SOCK_DGRAM then 'addr' is the address
|
||||||
|
|||||||
+4
-4
@@ -112,10 +112,10 @@ int psock_listen(FAR struct socket *psock, int backlog)
|
|||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* To accept connections, a socket is first created with socket(), a
|
* To accept connections, a socket is first created with socket(), a
|
||||||
* willingness to accept incoming connections and a queue limit for incoming
|
* willingness to accept incoming connections and a queue limit for
|
||||||
* connections are specified with listen(), and then the connections are
|
* incoming connections are specified with listen(), and then the
|
||||||
* accepted with accept(). The listen() call applies only to sockets of
|
* connections are accepted with accept(). The listen() call applies only
|
||||||
* type SOCK_STREAM or SOCK_SEQPACKET.
|
* to sockets of type SOCK_STREAM or SOCK_SEQPACKET.
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* sockfd Socket descriptor of the bound socket
|
* sockfd Socket descriptor of the bound socket
|
||||||
|
|||||||
@@ -124,7 +124,8 @@ int net_fstat(int sockfd, FAR struct stat *buf)
|
|||||||
#if defined(NET_TCP_HAVE_STACK)
|
#if defined(NET_TCP_HAVE_STACK)
|
||||||
case SOCK_STREAM:
|
case SOCK_STREAM:
|
||||||
{
|
{
|
||||||
FAR struct tcp_conn_s *conn = (FAR struct tcp_conn_s *)psock->s_conn;
|
FAR struct tcp_conn_s *conn =
|
||||||
|
(FAR struct tcp_conn_s *)psock->s_conn;
|
||||||
|
|
||||||
/* For TCP, the MSS is a dynamic value that maintained in the
|
/* For TCP, the MSS is a dynamic value that maintained in the
|
||||||
* connection structure.
|
* connection structure.
|
||||||
@@ -138,7 +139,8 @@ int net_fstat(int sockfd, FAR struct stat *buf)
|
|||||||
#if defined(NET_UDP_HAVE_STACK)
|
#if defined(NET_UDP_HAVE_STACK)
|
||||||
case SOCK_DGRAM:
|
case SOCK_DGRAM:
|
||||||
{
|
{
|
||||||
FAR struct udp_conn_s *conn = (FAR struct udp_conn_s *)psock->s_conn;
|
FAR struct udp_conn_s *conn =
|
||||||
|
(FAR struct udp_conn_s *)psock->s_conn;
|
||||||
FAR struct net_driver_s *dev;
|
FAR struct net_driver_s *dev;
|
||||||
uint16_t iplen;
|
uint16_t iplen;
|
||||||
|
|
||||||
@@ -146,8 +148,8 @@ int net_fstat(int sockfd, FAR struct stat *buf)
|
|||||||
*
|
*
|
||||||
* MSS = MTU - LL_HDRLEN - UDP_HDRLEN - IP_HDRLEN
|
* MSS = MTU - LL_HDRLEN - UDP_HDRLEN - IP_HDRLEN
|
||||||
*
|
*
|
||||||
* We need to have the device that services the connection in order
|
* We need to have the device that services the connection in
|
||||||
* to get the MTU and LL_HDRLEN:
|
* order to get the MTU and LL_HDRLEN:
|
||||||
*/
|
*/
|
||||||
|
|
||||||
dev = udp_find_raddr_device(conn);
|
dev = udp_find_raddr_device(conn);
|
||||||
|
|||||||
+10
-6
@@ -136,9 +136,9 @@ int tcp_backlogcreate(FAR struct tcp_conn_s *conn, int nblg)
|
|||||||
tcp_backlogdestroy(conn);
|
tcp_backlogdestroy(conn);
|
||||||
|
|
||||||
/* Now install the backlog tear-off in the connection. NOTE that bls may
|
/* Now install the backlog tear-off in the connection. NOTE that bls may
|
||||||
* actually be NULL if nblg is <= 0; In that case, we are disabling backlog
|
* actually be NULL if nblg is <= 0; In that case, we are disabling
|
||||||
* support. Since the network is locked, destroying the old backlog and
|
* backlog support. Since the network is locked, destroying the old
|
||||||
* replace it with the new is an atomic operation
|
* backlog and replace it with the new is an atomic operation
|
||||||
*/
|
*/
|
||||||
|
|
||||||
conn->backlog = bls;
|
conn->backlog = bls;
|
||||||
@@ -193,7 +193,9 @@ int tcp_backlogdestroy(FAR struct tcp_conn_s *conn)
|
|||||||
blconn = blc->bc_conn;
|
blconn = blc->bc_conn;
|
||||||
if (blconn)
|
if (blconn)
|
||||||
{
|
{
|
||||||
/* REVISIT -- such connections really need to be gracefully closed */
|
/* REVISIT
|
||||||
|
* -- such connections really need to be gracefully closed
|
||||||
|
*/
|
||||||
|
|
||||||
blconn->blparent = NULL;
|
blconn->blparent = NULL;
|
||||||
blconn->backlog = NULL;
|
blconn->backlog = NULL;
|
||||||
@@ -223,7 +225,8 @@ int tcp_backlogdestroy(FAR struct tcp_conn_s *conn)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int tcp_backlogadd(FAR struct tcp_conn_s *conn, FAR struct tcp_conn_s *blconn)
|
int tcp_backlogadd(FAR struct tcp_conn_s *conn,
|
||||||
|
FAR struct tcp_conn_s *blconn)
|
||||||
{
|
{
|
||||||
FAR struct tcp_backlog_s *bls;
|
FAR struct tcp_backlog_s *bls;
|
||||||
FAR struct tcp_blcontainer_s *blc;
|
FAR struct tcp_blcontainer_s *blc;
|
||||||
@@ -367,7 +370,8 @@ int tcp_backlogdelete(FAR struct tcp_conn_s *conn,
|
|||||||
for (blc = (FAR struct tcp_blcontainer_s *)sq_peek(&bls->bl_pending),
|
for (blc = (FAR struct tcp_blcontainer_s *)sq_peek(&bls->bl_pending),
|
||||||
prev = NULL;
|
prev = NULL;
|
||||||
blc;
|
blc;
|
||||||
prev = blc, blc = (FAR struct tcp_blcontainer_s *)sq_next(&blc->bc_node))
|
prev = blc,
|
||||||
|
blc = (FAR struct tcp_blcontainer_s *)sq_next(&blc->bc_node))
|
||||||
{
|
{
|
||||||
if (blc->bc_conn == blconn)
|
if (blc->bc_conn == blconn)
|
||||||
{
|
{
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user