mirror of
https://github.com/apache/nuttx.git
synced 2025-12-19 19:08:23 +08:00
net/: Run nxstyle against all C files.
This commit is contained in:
@@ -125,8 +125,10 @@ void arp_arpin(FAR struct net_driver_s *dev)
|
|||||||
|
|
||||||
arp->ah_opcode = HTONS(ARP_REPLY);
|
arp->ah_opcode = HTONS(ARP_REPLY);
|
||||||
memcpy(arp->ah_dhwaddr, arp->ah_shwaddr, ETHER_ADDR_LEN);
|
memcpy(arp->ah_dhwaddr, arp->ah_shwaddr, ETHER_ADDR_LEN);
|
||||||
memcpy(arp->ah_shwaddr, dev->d_mac.ether.ether_addr_octet, ETHER_ADDR_LEN);
|
memcpy(arp->ah_shwaddr, dev->d_mac.ether.ether_addr_octet,
|
||||||
memcpy(eth->src, dev->d_mac.ether.ether_addr_octet, ETHER_ADDR_LEN);
|
ETHER_ADDR_LEN);
|
||||||
|
memcpy(eth->src, dev->d_mac.ether.ether_addr_octet,
|
||||||
|
ETHER_ADDR_LEN);
|
||||||
memcpy(eth->dest, arp->ah_dhwaddr, ETHER_ADDR_LEN);
|
memcpy(eth->dest, arp->ah_dhwaddr, ETHER_ADDR_LEN);
|
||||||
|
|
||||||
arp->ah_dipaddr[0] = arp->ah_sipaddr[0];
|
arp->ah_dipaddr[0] = arp->ah_sipaddr[0];
|
||||||
|
|||||||
@@ -86,7 +86,8 @@ static const uint16_t g_broadcast_ipaddr[2] =
|
|||||||
* Well-known ethernet multicast address:
|
* Well-known ethernet multicast address:
|
||||||
*
|
*
|
||||||
* ADDRESS TYPE USAGE
|
* ADDRESS TYPE USAGE
|
||||||
* 01-00-0c-cc-cc-cc 0x0802 CDP (Cisco Discovery Protocol), VTP (Virtual Trunking Protocol)
|
* 01-00-0c-cc-cc-cc 0x0802 CDP (Cisco Discovery Protocol),
|
||||||
|
* VTP (Virtual Trunking Protocol)
|
||||||
* 01-00-0c-cc-cc-cd 0x0802 Cisco Shared Spanning Tree Protocol Address
|
* 01-00-0c-cc-cc-cd 0x0802 Cisco Shared Spanning Tree Protocol Address
|
||||||
* 01-80-c2-00-00-00 0x0802 Spanning Tree Protocol (for bridges) IEEE 802.1D
|
* 01-80-c2-00-00-00 0x0802 Spanning Tree Protocol (for bridges) IEEE 802.1D
|
||||||
* 01-80-c2-00-00-02 0x0809 Ethernet OAM Protocol IEEE 802.3ah
|
* 01-80-c2-00-00-02 0x0809 Ethernet OAM Protocol IEEE 802.3ah
|
||||||
|
|||||||
@@ -240,6 +240,7 @@ static uint16_t bluetooth_recvfrom_eventhandler(FAR struct net_driver_s *dev,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Make sure that this is the driver to which the socket is bound. */
|
/* Make sure that this is the driver to which the socket is bound. */
|
||||||
|
|
||||||
#warning Missing logic
|
#warning Missing logic
|
||||||
|
|
||||||
pstate = (FAR struct bluetooth_recvfrom_s *)pvpriv;
|
pstate = (FAR struct bluetooth_recvfrom_s *)pvpriv;
|
||||||
|
|||||||
@@ -119,6 +119,7 @@ static uint16_t bluetooth_sendto_eventhandler(FAR struct net_driver_s *dev,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Make sure that this is the driver to which the socket is connected. */
|
/* Make sure that this is the driver to which the socket is connected. */
|
||||||
|
|
||||||
#warning Missing logic
|
#warning Missing logic
|
||||||
|
|
||||||
pstate = (FAR struct bluetooth_sendto_s *)pvpriv;
|
pstate = (FAR struct bluetooth_sendto_s *)pvpriv;
|
||||||
@@ -203,6 +204,7 @@ static uint16_t bluetooth_sendto_eventhandler(FAR struct net_driver_s *dev,
|
|||||||
return flags;
|
return flags;
|
||||||
|
|
||||||
errout:
|
errout:
|
||||||
|
|
||||||
/* Don't allow any further call backs. */
|
/* Don't allow any further call backs. */
|
||||||
|
|
||||||
pstate->is_cb->flags = 0;
|
pstate->is_cb->flags = 0;
|
||||||
|
|||||||
@@ -466,6 +466,7 @@ int ipv6_input(FAR struct net_driver_s *dev)
|
|||||||
{
|
{
|
||||||
#ifdef NET_TCP_HAVE_STACK
|
#ifdef NET_TCP_HAVE_STACK
|
||||||
case IP_PROTO_TCP: /* TCP input */
|
case IP_PROTO_TCP: /* TCP input */
|
||||||
|
|
||||||
/* Forward the IPv6 TCP packet */
|
/* Forward the IPv6 TCP packet */
|
||||||
|
|
||||||
tcp_ipv6_input(dev, iphdrlen);
|
tcp_ipv6_input(dev, iphdrlen);
|
||||||
@@ -502,6 +503,7 @@ int ipv6_input(FAR struct net_driver_s *dev)
|
|||||||
|
|
||||||
#ifdef NET_UDP_HAVE_STACK
|
#ifdef NET_UDP_HAVE_STACK
|
||||||
case IP_PROTO_UDP: /* UDP input */
|
case IP_PROTO_UDP: /* UDP input */
|
||||||
|
|
||||||
/* Forward the IPv6 UDP packet */
|
/* Forward the IPv6 UDP packet */
|
||||||
|
|
||||||
udp_ipv6_input(dev, iphdrlen);
|
udp_ipv6_input(dev, iphdrlen);
|
||||||
@@ -512,6 +514,7 @@ int ipv6_input(FAR struct net_driver_s *dev)
|
|||||||
|
|
||||||
#ifdef NET_ICMPv6_HAVE_STACK
|
#ifdef NET_ICMPv6_HAVE_STACK
|
||||||
case IP_PROTO_ICMP6: /* ICMP6 input */
|
case IP_PROTO_ICMP6: /* ICMP6 input */
|
||||||
|
|
||||||
/* Forward the ICMPv6 packet */
|
/* Forward the ICMPv6 packet */
|
||||||
|
|
||||||
icmpv6_input(dev, iphdrlen);
|
icmpv6_input(dev, iphdrlen);
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ struct icmp_recvfrom_s
|
|||||||
FAR uint8_t *recv_buf; /* Location to return the response */
|
FAR uint8_t *recv_buf; /* Location to return the response */
|
||||||
uint16_t recv_buflen; /* Size of the response */
|
uint16_t recv_buflen; /* Size of the response */
|
||||||
int16_t recv_result; /* >=0: receive size on success;
|
int16_t recv_result; /* >=0: receive size on success;
|
||||||
* <0:negated errno on fail */
|
* <0: negated errno on fail */
|
||||||
};
|
};
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -300,11 +300,12 @@ static uint16_t sendto_eventhandler(FAR struct net_driver_s *dev,
|
|||||||
* device.
|
* device.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!net_ipv4addr_maskcmp(pstate->snd_toaddr, dev->d_ipaddr, dev->d_netmask))
|
if (!net_ipv4addr_maskcmp(pstate->snd_toaddr, dev->d_ipaddr,
|
||||||
|
dev->d_netmask))
|
||||||
{
|
{
|
||||||
/* Destination address was not on the local network served by this
|
/* Destination address was not on the local network served by
|
||||||
* device. If a timeout occurs, then the most likely reason is
|
* this device. If a timeout occurs, then the most likely
|
||||||
* that the destination address is not reachable.
|
* reason is that the destination address is not reachable.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
nerr("ERROR: Not reachable\n");
|
nerr("ERROR: Not reachable\n");
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ struct icmpv6_recvfrom_s
|
|||||||
FAR uint8_t *recv_buf; /* Location to return the response */
|
FAR uint8_t *recv_buf; /* Location to return the response */
|
||||||
uint16_t recv_buflen; /* Size of the response */
|
uint16_t recv_buflen; /* Size of the response */
|
||||||
int16_t recv_result; /* >=0: receive size on success;
|
int16_t recv_result; /* >=0: receive size on success;
|
||||||
* <0:negated errno on fail */
|
* <0: negated errno on fail */
|
||||||
};
|
};
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -190,7 +190,8 @@ static ssize_t ieee802154_recvfrom_rxqueue(FAR struct radio_driver_s *radio,
|
|||||||
{
|
{
|
||||||
iaddr = (FAR struct sockaddr_ieee802154_s *)pstate->ir_from;
|
iaddr = (FAR struct sockaddr_ieee802154_s *)pstate->ir_from;
|
||||||
iaddr->sa_family = AF_IEEE802154;
|
iaddr->sa_family = AF_IEEE802154;
|
||||||
memcpy(&iaddr->sa_addr, &container->ic_src, sizeof(struct ieee802154_saddr_s));
|
memcpy(&iaddr->sa_addr, &container->ic_src,
|
||||||
|
sizeof(struct ieee802154_saddr_s));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Free both the IOB and the container */
|
/* Free both the IOB and the container */
|
||||||
@@ -237,6 +238,7 @@ static uint16_t ieee802154_recvfrom_eventhandler(FAR struct net_driver_s *dev,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Make sure that this is the driver to which the socket is bound. */
|
/* Make sure that this is the driver to which the socket is bound. */
|
||||||
|
|
||||||
#warning Missing logic
|
#warning Missing logic
|
||||||
|
|
||||||
pstate = (FAR struct ieee802154_recvfrom_s *)pvpriv;
|
pstate = (FAR struct ieee802154_recvfrom_s *)pvpriv;
|
||||||
|
|||||||
@@ -308,6 +308,7 @@ static uint16_t ieee802154_sendto_eventhandler(FAR struct net_driver_s *dev,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Make sure that this is the driver to which the socket is connected. */
|
/* Make sure that this is the driver to which the socket is connected. */
|
||||||
|
|
||||||
#warning Missing logic
|
#warning Missing logic
|
||||||
|
|
||||||
pstate = (FAR struct ieee802154_sendto_s *)pvpriv;
|
pstate = (FAR struct ieee802154_sendto_s *)pvpriv;
|
||||||
@@ -391,6 +392,7 @@ static uint16_t ieee802154_sendto_eventhandler(FAR struct net_driver_s *dev,
|
|||||||
return flags;
|
return flags;
|
||||||
|
|
||||||
errout:
|
errout:
|
||||||
|
|
||||||
/* Don't allow any further call backs. */
|
/* Don't allow any further call backs. */
|
||||||
|
|
||||||
pstate->is_cb->flags = 0;
|
pstate->is_cb->flags = 0;
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ static uint16_t tcp_close_eventhandler(FAR struct net_driver_s *dev,
|
|||||||
pstate->cl_result = OK;
|
pstate->cl_result = OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
goto end_wait;
|
goto end_wait;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_NET_TCP_WRITE_BUFFERS
|
#ifdef CONFIG_NET_TCP_WRITE_BUFFERS
|
||||||
|
|||||||
@@ -853,7 +853,8 @@ static uint16_t inet_tcp_eventhandler(FAR struct net_driver_s *dev,
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef NET_UDP_HAVE_STACK
|
#ifdef NET_UDP_HAVE_STACK
|
||||||
static inline void inet_udp_sender(struct net_driver_s *dev, struct inet_recvfrom_s *pstate)
|
static inline void inet_udp_sender(FAR struct net_driver_s *dev,
|
||||||
|
FAR struct inet_recvfrom_s *pstate)
|
||||||
{
|
{
|
||||||
/* Get the family from the packet type, IP address from the IP header, and
|
/* Get the family from the packet type, IP address from the IP header, and
|
||||||
* the port number from the UDP header.
|
* the port number from the UDP header.
|
||||||
|
|||||||
@@ -163,6 +163,7 @@ static int ipv4_decr_ttl(FAR struct ipv4_hdr_s *ipv4)
|
|||||||
{
|
{
|
||||||
#ifdef CONFIG_NET_ICMP
|
#ifdef CONFIG_NET_ICMP
|
||||||
/* Return an ICMP error packet back to the sender. */
|
/* Return an ICMP error packet back to the sender. */
|
||||||
|
|
||||||
# warning Missing logic
|
# warning Missing logic
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -488,6 +489,7 @@ int ipv4_forward(FAR struct net_driver_s *dev, FAR struct ipv4_hdr_s *ipv4)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* Correct dev->d_buf by adding back the L1 header length */
|
/* Correct dev->d_buf by adding back the L1 header length */
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
nwarn("WARNING: Packet forwarding to same device not supportedN\n");
|
nwarn("WARNING: Packet forwarding to same device not supportedN\n");
|
||||||
|
|||||||
@@ -159,6 +159,7 @@ static int ipv6_decr_ttl(FAR struct ipv6_hdr_s *ipv6)
|
|||||||
{
|
{
|
||||||
#ifdef CONFIG_NET_ICMPv6
|
#ifdef CONFIG_NET_ICMPv6
|
||||||
/* Return an ICMPv6 error packet back to the sender. */
|
/* Return an ICMPv6 error packet back to the sender. */
|
||||||
|
|
||||||
# warning Missing logic
|
# warning Missing logic
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -635,6 +636,7 @@ int ipv6_forward(FAR struct net_driver_s *dev, FAR struct ipv6_hdr_s *ipv6)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* Correct dev->d_buf by adding back the L1 header length */
|
/* Correct dev->d_buf by adding back the L1 header length */
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Nothing other 6LoWPAN forwarding is currently handled and that
|
/* Nothing other 6LoWPAN forwarding is currently handled and that
|
||||||
|
|||||||
@@ -369,12 +369,14 @@ psock_dgram_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len,
|
|||||||
return readlen;
|
return readlen;
|
||||||
|
|
||||||
errout_with_infd:
|
errout_with_infd:
|
||||||
|
|
||||||
/* Close the read-only file descriptor */
|
/* Close the read-only file descriptor */
|
||||||
|
|
||||||
file_close(&conn->lc_infile);
|
file_close(&conn->lc_infile);
|
||||||
conn->lc_infile.f_inode = NULL;
|
conn->lc_infile.f_inode = NULL;
|
||||||
|
|
||||||
errout_with_halfduplex:
|
errout_with_halfduplex:
|
||||||
|
|
||||||
/* Release our reference to the half duplex FIFO */
|
/* Release our reference to the half duplex FIFO */
|
||||||
|
|
||||||
(void)local_release_halfduplex(conn);
|
(void)local_release_halfduplex(conn);
|
||||||
|
|||||||
@@ -168,6 +168,7 @@ ssize_t psock_local_sendto(FAR struct socket *psock, FAR const void *buf,
|
|||||||
conn->lc_outfile.f_inode = NULL;
|
conn->lc_outfile.f_inode = NULL;
|
||||||
|
|
||||||
errout_with_halfduplex:
|
errout_with_halfduplex:
|
||||||
|
|
||||||
/* Release our reference to the half duplex FIFO */
|
/* Release our reference to the half duplex FIFO */
|
||||||
|
|
||||||
(void)local_release_halfduplex(conn);
|
(void)local_release_halfduplex(conn);
|
||||||
|
|||||||
@@ -553,6 +553,7 @@ static int local_connect(FAR struct socket *psock,
|
|||||||
case SOCK_DGRAM:
|
case SOCK_DGRAM:
|
||||||
{
|
{
|
||||||
/* Perform the datagram connection logic */
|
/* Perform the datagram connection logic */
|
||||||
|
|
||||||
#warning Missing logic
|
#warning Missing logic
|
||||||
|
|
||||||
return -ENOSYS;
|
return -ENOSYS;
|
||||||
@@ -697,6 +698,7 @@ static ssize_t local_send(FAR struct socket *psock, FAR const void *buf,
|
|||||||
case SOCK_DGRAM:
|
case SOCK_DGRAM:
|
||||||
{
|
{
|
||||||
/* Local UDP packet send */
|
/* Local UDP packet send */
|
||||||
|
|
||||||
#warning Missing logic
|
#warning Missing logic
|
||||||
|
|
||||||
ret = -ENOSYS;
|
ret = -ENOSYS;
|
||||||
|
|||||||
@@ -171,6 +171,7 @@ void mld_send(FAR struct net_driver_s *dev, FAR struct mld_group_s *group,
|
|||||||
mlderr("Bad msgtype: %02x \n", msgtype);
|
mlderr("Bad msgtype: %02x \n", msgtype);
|
||||||
DEBUGPANIC();
|
DEBUGPANIC();
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -224,7 +224,8 @@ static int ioctl_add_ipv6route(FAR struct rtentry *rtentry)
|
|||||||
net_ipv6addr_copy(router, in6addr_any.s6_addr16);
|
net_ipv6addr_copy(router, in6addr_any.s6_addr16);
|
||||||
}
|
}
|
||||||
|
|
||||||
return net_addroute_ipv6(target->sin6_addr.s6_addr16, netmask->sin6_addr.s6_addr16, router);
|
return net_addroute_ipv6(target->sin6_addr.s6_addr16,
|
||||||
|
netmask->sin6_addr.s6_addr16, router);
|
||||||
}
|
}
|
||||||
#endif /* HAVE_WRITABLE_IPv6ROUTE */
|
#endif /* HAVE_WRITABLE_IPv6ROUTE */
|
||||||
|
|
||||||
@@ -1553,18 +1554,21 @@ ssize_t net_ioctl_arglen(int cmd)
|
|||||||
return sizeof(struct iwreq);
|
return sizeof(struct iwreq);
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# ifdef CONFIG_WIRELESS_IEEE802154
|
# ifdef CONFIG_WIRELESS_IEEE802154
|
||||||
if (_MAC802154IOCVALID(cmd))
|
if (_MAC802154IOCVALID(cmd))
|
||||||
{
|
{
|
||||||
return sizeof(struct ieee802154_netmac_s);
|
return sizeof(struct ieee802154_netmac_s);
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# ifdef CONFIG_WIRELESS_PKTRADIO
|
# ifdef CONFIG_WIRELESS_PKTRADIO
|
||||||
if (WL_ISPKTRADIOCMD(cmd))
|
if (WL_ISPKTRADIOCMD(cmd))
|
||||||
{
|
{
|
||||||
return sizeof(struct pktradio_ifreq_s);
|
return sizeof(struct pktradio_ifreq_s);
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# ifdef CONFIG_WIRELESS_BLUETOOTH
|
# ifdef CONFIG_WIRELESS_BLUETOOTH
|
||||||
if (WL_IBLUETOOTHCMD(cmd))
|
if (WL_IBLUETOOTHCMD(cmd))
|
||||||
{
|
{
|
||||||
@@ -1572,6 +1576,7 @@ ssize_t net_ioctl_arglen(int cmd)
|
|||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return -ENOTTY;
|
return -ENOTTY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -425,9 +425,12 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype)
|
|||||||
|
|
||||||
#if defined(CONFIG_NET_ETHERNET) || defined(CONFIG_DRIVERS_IEEE80211)
|
#if defined(CONFIG_NET_ETHERNET) || defined(CONFIG_DRIVERS_IEEE80211)
|
||||||
ninfo("Registered MAC: %02x:%02x:%02x:%02x:%02x:%02x as dev: %s\n",
|
ninfo("Registered MAC: %02x:%02x:%02x:%02x:%02x:%02x as dev: %s\n",
|
||||||
dev->d_mac.ether.ether_addr_octet[0], dev->d_mac.ether.ether_addr_octet[1],
|
dev->d_mac.ether.ether_addr_octet[0],
|
||||||
dev->d_mac.ether.ether_addr_octet[2], dev->d_mac.ether.ether_addr_octet[3],
|
dev->d_mac.ether.ether_addr_octet[1],
|
||||||
dev->d_mac.ether.ether_addr_octet[4], dev->d_mac.ether.ether_addr_octet[5],
|
dev->d_mac.ether.ether_addr_octet[2],
|
||||||
|
dev->d_mac.ether.ether_addr_octet[3],
|
||||||
|
dev->d_mac.ether.ether_addr_octet[4],
|
||||||
|
dev->d_mac.ether.ether_addr_octet[5],
|
||||||
dev->d_ifname);
|
dev->d_ifname);
|
||||||
#else
|
#else
|
||||||
ninfo("Registered dev: %s\n", dev->d_ifname);
|
ninfo("Registered dev: %s\n", dev->d_ifname);
|
||||||
@@ -437,4 +440,3 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype)
|
|||||||
|
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -550,6 +550,7 @@ static int netlink_close(FAR struct socket *psock)
|
|||||||
if (conn->crefs <= 1)
|
if (conn->crefs <= 1)
|
||||||
{
|
{
|
||||||
/* Yes... inform user-space daemon of socket close. */
|
/* Yes... inform user-space daemon of socket close. */
|
||||||
|
|
||||||
#warning Missing logic
|
#warning Missing logic
|
||||||
|
|
||||||
/* Free the connection structure */
|
/* Free the connection structure */
|
||||||
|
|||||||
@@ -299,6 +299,7 @@ static ssize_t netprocfs_read(FAR struct file *filep, FAR char *buffer,
|
|||||||
switch (priv->entry)
|
switch (priv->entry)
|
||||||
{
|
{
|
||||||
case NETPROCFS_SUBDIR_DEV:
|
case NETPROCFS_SUBDIR_DEV:
|
||||||
|
|
||||||
/* Show device-specific statistics */
|
/* Show device-specific statistics */
|
||||||
|
|
||||||
nreturned = netprocfs_read_devstats(priv, buffer, buflen);
|
nreturned = netprocfs_read_devstats(priv, buffer, buflen);
|
||||||
@@ -306,6 +307,7 @@ static ssize_t netprocfs_read(FAR struct file *filep, FAR char *buffer,
|
|||||||
|
|
||||||
#ifdef CONFIG_NET_STATISTICS
|
#ifdef CONFIG_NET_STATISTICS
|
||||||
case NETPROCFS_SUBDIR_STAT:
|
case NETPROCFS_SUBDIR_STAT:
|
||||||
|
|
||||||
/* Show the network layer statistics */
|
/* Show the network layer statistics */
|
||||||
|
|
||||||
nreturned = netprocfs_read_netstats(priv, buffer, buflen);
|
nreturned = netprocfs_read_netstats(priv, buffer, buflen);
|
||||||
@@ -313,6 +315,7 @@ static ssize_t netprocfs_read(FAR struct file *filep, FAR char *buffer,
|
|||||||
|
|
||||||
#ifdef CONFIG_NET_MLD
|
#ifdef CONFIG_NET_MLD
|
||||||
case NETPROCFS_SUBDIR_MLD:
|
case NETPROCFS_SUBDIR_MLD:
|
||||||
|
|
||||||
/* Show the MLD statistics */
|
/* Show the MLD statistics */
|
||||||
|
|
||||||
nreturned = netprocfs_read_mldstats(priv, buffer, buflen);
|
nreturned = netprocfs_read_mldstats(priv, buffer, buflen);
|
||||||
@@ -362,7 +365,8 @@ static int netprocfs_dup(FAR const struct file *oldp, FAR struct file *newp)
|
|||||||
|
|
||||||
/* Allocate a new container to hold the task and attribute selection */
|
/* Allocate a new container to hold the task and attribute selection */
|
||||||
|
|
||||||
newpriv = (FAR struct netprocfs_file_s *)kmm_zalloc(sizeof(struct netprocfs_file_s));
|
newpriv = (FAR struct netprocfs_file_s *)
|
||||||
|
kmm_zalloc(sizeof(struct netprocfs_file_s));
|
||||||
if (!newpriv)
|
if (!newpriv)
|
||||||
{
|
{
|
||||||
ferr("ERROR: Failed to allocate file attributes\n");
|
ferr("ERROR: Failed to allocate file attributes\n");
|
||||||
|
|||||||
@@ -638,6 +638,7 @@ static int route_opendir(FAR const char *relpath,
|
|||||||
return -ENOTDIR;
|
return -ENOTDIR;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_NET_IPv6
|
#ifdef CONFIG_NET_IPv6
|
||||||
if (strcmp(relpath, g_route_ipv6_path) == 0)
|
if (strcmp(relpath, g_route_ipv6_path) == 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -241,8 +241,9 @@ static FAR struct sixlowpan_addrcontext_s *
|
|||||||
net_ipv6addr_prefixcmp(&g_hc06_addrcontexts[i].prefix, ipaddr, 64))
|
net_ipv6addr_prefixcmp(&g_hc06_addrcontexts[i].prefix, ipaddr, 64))
|
||||||
{
|
{
|
||||||
ninfo("Context found for ipaddr=%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x Context: %d\n",
|
ninfo("Context found for ipaddr=%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x Context: %d\n",
|
||||||
ntohs(ipaddr[0]), ntohs(ipaddr[1]), ntohs(ipaddr[2]), ntohs(ipaddr[3]),
|
ntohs(ipaddr[0]), ntohs(ipaddr[1]), ntohs(ipaddr[2]),
|
||||||
ntohs(ipaddr[4]), ntohs(ipaddr[5]), ntohs(ipaddr[6]), ntohs(ipaddr[7]),
|
ntohs(ipaddr[3]), ntohs(ipaddr[4]), ntohs(ipaddr[5]),
|
||||||
|
ntohs(ipaddr[6]), ntohs(ipaddr[7]),
|
||||||
g_hc06_addrcontexts[i].number);
|
g_hc06_addrcontexts[i].number);
|
||||||
|
|
||||||
return &g_hc06_addrcontexts[i];
|
return &g_hc06_addrcontexts[i];
|
||||||
@@ -1406,6 +1407,7 @@ void sixlowpan_uncompresshdr_hc06(FAR struct radio_driver_s *radio,
|
|||||||
switch (*g_hc06ptr & SIXLOWPAN_NHC_UDP_CS_P_11)
|
switch (*g_hc06ptr & SIXLOWPAN_NHC_UDP_CS_P_11)
|
||||||
{
|
{
|
||||||
case SIXLOWPAN_NHC_UDP_CS_P_00:
|
case SIXLOWPAN_NHC_UDP_CS_P_00:
|
||||||
|
|
||||||
/* 1 byte for NHC, 4 byte for ports, 2 bytes chksum */
|
/* 1 byte for NHC, 4 byte for ports, 2 bytes chksum */
|
||||||
|
|
||||||
memcpy(&udp->srcport, g_hc06ptr + 1, 2);
|
memcpy(&udp->srcport, g_hc06ptr + 1, 2);
|
||||||
@@ -1418,6 +1420,7 @@ void sixlowpan_uncompresshdr_hc06(FAR struct radio_driver_s *radio,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case SIXLOWPAN_NHC_UDP_CS_P_01:
|
case SIXLOWPAN_NHC_UDP_CS_P_01:
|
||||||
|
|
||||||
/* 1 byte for NHC + source 16bit inline, dest = 0xF0 + 8 bit
|
/* 1 byte for NHC + source 16bit inline, dest = 0xF0 + 8 bit
|
||||||
* inline
|
* inline
|
||||||
*/
|
*/
|
||||||
@@ -1435,6 +1438,7 @@ void sixlowpan_uncompresshdr_hc06(FAR struct radio_driver_s *radio,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case SIXLOWPAN_NHC_UDP_CS_P_10:
|
case SIXLOWPAN_NHC_UDP_CS_P_10:
|
||||||
|
|
||||||
/* 1 byte for NHC + source = 0xF0 + 8bit inline, dest = 16 bit
|
/* 1 byte for NHC + source = 0xF0 + 8bit inline, dest = 16 bit
|
||||||
* inline
|
* inline
|
||||||
*/
|
*/
|
||||||
@@ -1452,6 +1456,7 @@ void sixlowpan_uncompresshdr_hc06(FAR struct radio_driver_s *radio,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case SIXLOWPAN_NHC_UDP_CS_P_11:
|
case SIXLOWPAN_NHC_UDP_CS_P_11:
|
||||||
|
|
||||||
/* 1 byte for NHC, 1 byte for ports */
|
/* 1 byte for NHC, 1 byte for ports */
|
||||||
|
|
||||||
udp->srcport =
|
udp->srcport =
|
||||||
|
|||||||
@@ -342,7 +342,8 @@ static int sixlowpan_frame_process(FAR struct radio_driver_s *radio,
|
|||||||
|
|
||||||
if (fragsize > CONFIG_NET_6LOWPAN_PKTSIZE)
|
if (fragsize > CONFIG_NET_6LOWPAN_PKTSIZE)
|
||||||
{
|
{
|
||||||
nwarn("WARNING: Reassembled packet size exeeds CONFIG_NET_6LOWPAN_PKTSIZE\n");
|
nwarn("WARNING: Reassembled packet size exceeds "
|
||||||
|
"CONFIG_NET_6LOWPAN_PKTSIZE\n");
|
||||||
return -ENOSPC;
|
return -ENOSPC;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -448,7 +449,8 @@ static int sixlowpan_frame_process(FAR struct radio_driver_s *radio,
|
|||||||
hc1 = fptr + g_frame_hdrlen;
|
hc1 = fptr + g_frame_hdrlen;
|
||||||
|
|
||||||
#ifdef CONFIG_NET_6LOWPAN_COMPRESSION_HC06
|
#ifdef CONFIG_NET_6LOWPAN_COMPRESSION_HC06
|
||||||
if ((hc1[SIXLOWPAN_HC1_DISPATCH] & SIXLOWPAN_DISPATCH_IPHC_MASK) == SIXLOWPAN_DISPATCH_IPHC)
|
if ((hc1[SIXLOWPAN_HC1_DISPATCH] & SIXLOWPAN_DISPATCH_IPHC_MASK) ==
|
||||||
|
SIXLOWPAN_DISPATCH_IPHC)
|
||||||
{
|
{
|
||||||
ninfo("IPHC Dispatch\n");
|
ninfo("IPHC Dispatch\n");
|
||||||
sixlowpan_uncompresshdr_hc06(radio, metadata, fragsize, iob, fptr, bptr);
|
sixlowpan_uncompresshdr_hc06(radio, metadata, fragsize, iob, fptr, bptr);
|
||||||
|
|||||||
@@ -220,6 +220,7 @@ static uint16_t send_eventhandler(FAR struct net_driver_s *dev,
|
|||||||
return flags;
|
return flags;
|
||||||
|
|
||||||
end_wait:
|
end_wait:
|
||||||
|
|
||||||
/* Do not allow any further callbacks */
|
/* Do not allow any further callbacks */
|
||||||
|
|
||||||
sinfo->s_cb->flags = 0;
|
sinfo->s_cb->flags = 0;
|
||||||
|
|||||||
@@ -603,6 +603,7 @@ static uint16_t tcp_send_eventhandler(FAR struct net_driver_s *dev,
|
|||||||
return flags;
|
return flags;
|
||||||
|
|
||||||
end_wait:
|
end_wait:
|
||||||
|
|
||||||
/* Do not allow any further callbacks */
|
/* Do not allow any further callbacks */
|
||||||
|
|
||||||
sinfo->s_cb->flags = 0;
|
sinfo->s_cb->flags = 0;
|
||||||
|
|||||||
@@ -704,7 +704,7 @@ int sixlowpan_extract_srcaddr(FAR struct radio_driver_s *radio,
|
|||||||
{
|
{
|
||||||
srcaddr->nv_addrlen = NET_6LOWPAN_EADDRSIZE;
|
srcaddr->nv_addrlen = NET_6LOWPAN_EADDRSIZE;
|
||||||
memcpy(srcaddr->nv_addr, ind->src.eaddr, NET_6LOWPAN_EADDRSIZE);
|
memcpy(srcaddr->nv_addr, ind->src.eaddr, NET_6LOWPAN_EADDRSIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,7 +91,8 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int psock_getpeername(FAR struct socket *psock, FAR struct sockaddr *addr, FAR socklen_t *addrlen)
|
int psock_getpeername(FAR struct socket *psock, FAR struct sockaddr *addr,
|
||||||
|
FAR socklen_t *addrlen)
|
||||||
{
|
{
|
||||||
/* Verify that the psock corresponds to valid, allocated socket */
|
/* Verify that the psock corresponds to valid, allocated socket */
|
||||||
|
|
||||||
|
|||||||
@@ -91,7 +91,8 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int psock_getsockname(FAR struct socket *psock, FAR struct sockaddr *addr, FAR socklen_t *addrlen)
|
int psock_getsockname(FAR struct socket *psock, FAR struct sockaddr *addr,
|
||||||
|
FAR socklen_t *addrlen)
|
||||||
{
|
{
|
||||||
/* Verify that the psock corresponds to valid, allocated socket */
|
/* Verify that the psock corresponds to valid, allocated socket */
|
||||||
|
|
||||||
|
|||||||
@@ -204,45 +204,51 @@ int psock_vfcntl(FAR struct socket *psock, int cmd, va_list ap)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case F_GETOWN:
|
case F_GETOWN:
|
||||||
/* If fd refers to a socket, get the process or process group ID specified
|
/* If fd refers to a socket, get the process or process group ID
|
||||||
* to receive SIGURG signals when out-of-band data is available. Positive values
|
* specified to receive SIGURG signals when out-of-band data is
|
||||||
* indicate a process ID; negative values, other than -1, indicate a process group
|
* available. Positive values indicate a process ID; negative
|
||||||
* ID. If fd does not refer to a socket, the results are unspecified.
|
* values, other than -1, indicate a process group ID. If fd does
|
||||||
|
* not refer to a socket, the results are unspecified.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
case F_SETOWN:
|
case F_SETOWN:
|
||||||
/* If fd refers to a socket, set the process or process group ID specified
|
/* If fd refers to a socket, set the process or process group ID
|
||||||
* to receive SIGURG signals when out-of-band data is available, using the value
|
* specified to receive SIGURG signals when out-of-band data is
|
||||||
* of the third argument, arg, taken as type int. Positive values indicate a
|
* available, using the value of the third argument, arg, taken as
|
||||||
* process ID; negative values, other than -1, indicate a process group ID. If
|
* type int. Positive values indicate a process ID; negative values,
|
||||||
* fd does not refer to a socket, the results are unspecified.
|
* other than -1, indicate a process group ID. If fd does not refer
|
||||||
|
* to a socket, the results are unspecified.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
case F_GETLK:
|
case F_GETLK:
|
||||||
/* Get the first lock which blocks the lock description pointed to by the third
|
/* Get the first lock which blocks the lock description pointed to
|
||||||
* argument, arg, taken as a pointer to type struct flock, defined in <fcntl.h>.
|
* by the third argument, arg, taken as a pointer to type struct
|
||||||
* The information retrieved shall overwrite the information passed to fcntl() in
|
* flock, defined in <fcntl.h>. The information retrieved shall
|
||||||
* the structure flock. If no lock is found that would prevent this lock from being
|
* overwrite the information passed to fcntl() in the structure
|
||||||
* created, then the structure shall be left unchanged except for the lock type
|
* flock. If no lock is found that would prevent this lock from
|
||||||
* which shall be set to F_UNLCK.
|
* being created, then the structure shall be left unchanged except
|
||||||
|
* for the lock type which shall be set to F_UNLCK.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
case F_SETLK:
|
case F_SETLK:
|
||||||
/* Set or clear a file segment lock according to the lock description pointed to
|
/* Set or clear a file segment lock according to the lock
|
||||||
* by the third argument, arg, taken as a pointer to type struct flock, defined in
|
* description pointed to by the third argument, arg, taken as a
|
||||||
* <fcntl.h>. F_SETLK can establish shared (or read) locks (F_RDLCK) or exclusive
|
* pointer to type struct flock, defined in <fcntl.h>. F_SETLK can
|
||||||
* (or write) locks (F_WRLCK), as well as to remove either type of lock (F_UNLCK).
|
* establish shared (or read) locks (F_RDLCK) or exclusive (or
|
||||||
* F_RDLCK, F_WRLCK, and F_UNLCK are defined in <fcntl.h>. If a shared or exclusive
|
* write) locks (F_WRLCK), as well as to remove either type of
|
||||||
* lock cannot be set, fcntl() shall return immediately with a return value of -1.
|
* lock (F_UNLCK). F_RDLCK, F_WRLCK, and F_UNLCK are defined in
|
||||||
|
* <fcntl.h>. If a shared or exclusive lock cannot be set, fcntl()
|
||||||
|
* shall return immediately with a return value of -1.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
case F_SETLKW:
|
case F_SETLKW:
|
||||||
/* This command shall be equivalent to F_SETLK except that if a shared or exclusive
|
/* This command shall be equivalent to F_SETLK except that if a
|
||||||
* lock is blocked by other locks, the thread shall wait until the request can be
|
* shared or exclusive lock is blocked by other locks, the thread
|
||||||
* satisfied. If a signal that is to be caught is received while fcntl() is waiting
|
* shall wait until the request can be satisfied. If a signal that
|
||||||
* for a region, fcntl() shall be interrupted. Upon return from the signal handler,
|
* is to be caught is received while fcntl() is waiting for a
|
||||||
* fcntl() shall return -1 with errno set to [EINTR], and the lock operation shall
|
* region, fcntl() shall be interrupted. Upon return from the signal
|
||||||
* not be done.
|
* handler, fcntl() shall return -1 with errno set to [EINTR], and
|
||||||
|
* the lock operation shall not be done.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ret = -ENOSYS; /* F_GETOWN, F_SETOWN, F_GETLK, F_SETLK, F_SETLKW */
|
ret = -ENOSYS; /* F_GETOWN, F_SETOWN, F_GETLK, F_SETLK, F_SETLKW */
|
||||||
|
|||||||
@@ -287,6 +287,7 @@ static void tcp_input(FAR struct net_driver_s *dev, uint8_t domain,
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
i += dev->d_buf[hdrlen + 1 + i];
|
i += dev->d_buf[hdrlen + 1 + i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -703,6 +704,7 @@ found:
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
i += dev->d_buf[hdrlen + 1 + i];
|
i += dev->d_buf[hdrlen + 1 + i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -310,6 +310,7 @@ void tcp_timer(FAR struct net_driver_s *dev, FAR struct tcp_conn_s *conn,
|
|||||||
switch (conn->tcpstateflags & TCP_STATE_MASK)
|
switch (conn->tcpstateflags & TCP_STATE_MASK)
|
||||||
{
|
{
|
||||||
case TCP_SYN_RCVD:
|
case TCP_SYN_RCVD:
|
||||||
|
|
||||||
/* In the SYN_RCVD state, we should retransmit our
|
/* In the SYN_RCVD state, we should retransmit our
|
||||||
* SYNACK.
|
* SYNACK.
|
||||||
*/
|
*/
|
||||||
@@ -318,12 +319,14 @@ void tcp_timer(FAR struct net_driver_s *dev, FAR struct tcp_conn_s *conn,
|
|||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
case TCP_SYN_SENT:
|
case TCP_SYN_SENT:
|
||||||
|
|
||||||
/* In the SYN_SENT state, we retransmit out SYN. */
|
/* In the SYN_SENT state, we retransmit out SYN. */
|
||||||
|
|
||||||
tcp_ack(dev, conn, TCP_SYN);
|
tcp_ack(dev, conn, TCP_SYN);
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
case TCP_ESTABLISHED:
|
case TCP_ESTABLISHED:
|
||||||
|
|
||||||
/* In the ESTABLISHED state, we call upon the application
|
/* In the ESTABLISHED state, we call upon the application
|
||||||
* to do the actual retransmit after which we jump into
|
* to do the actual retransmit after which we jump into
|
||||||
* the code for sending out the packet.
|
* the code for sending out the packet.
|
||||||
@@ -336,6 +339,7 @@ void tcp_timer(FAR struct net_driver_s *dev, FAR struct tcp_conn_s *conn,
|
|||||||
case TCP_FIN_WAIT_1:
|
case TCP_FIN_WAIT_1:
|
||||||
case TCP_CLOSING:
|
case TCP_CLOSING:
|
||||||
case TCP_LAST_ACK:
|
case TCP_LAST_ACK:
|
||||||
|
|
||||||
/* In all these states we should retransmit a FINACK. */
|
/* In all these states we should retransmit a FINACK. */
|
||||||
|
|
||||||
tcp_send(dev, conn, TCP_FIN | TCP_ACK, hdrlen);
|
tcp_send(dev, conn, TCP_FIN | TCP_ACK, hdrlen);
|
||||||
@@ -467,6 +471,7 @@ void tcp_timer(FAR struct net_driver_s *dev, FAR struct tcp_conn_s *conn,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* There was no need for a retransmission and there was no
|
/* There was no need for a retransmission and there was no
|
||||||
* need to probe the remote peer. We poll the application for
|
* need to probe the remote peer. We poll the application for
|
||||||
* new outgoing data.
|
* new outgoing data.
|
||||||
|
|||||||
@@ -159,20 +159,20 @@ int tcp_txdrain(FAR struct socket *psock,
|
|||||||
|
|
||||||
ret = tcp_disconnect_notifier_setup(txdrain_worker, conn, &waitsem);
|
ret = tcp_disconnect_notifier_setup(txdrain_worker, conn, &waitsem);
|
||||||
|
|
||||||
/* Zero is a special value that means that no connection has been
|
/* Zero is a special value that means that no connection has been
|
||||||
* established. Otherwise it is a special 'key' that can be used
|
* established. Otherwise it is a special 'key' that can be used
|
||||||
* to teardown the notification later
|
* to teardown the notification later
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (ret > 0)
|
if (ret > 0)
|
||||||
{
|
{
|
||||||
/* Save the disconnect key */
|
/* Save the disconnect key */
|
||||||
|
|
||||||
int disconn_key = ret;
|
int disconn_key = ret;
|
||||||
|
|
||||||
/* There is pending write data and the socket is connected..
|
/* There is pending write data and the socket is connected..
|
||||||
* wait for it to drain or be be disconnected.
|
* wait for it to drain or be be disconnected.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -76,7 +76,8 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_NET_UDP_READAHEAD
|
#ifdef CONFIG_NET_UDP_READAHEAD
|
||||||
static uint16_t udp_datahandler(FAR struct net_driver_s *dev, FAR struct udp_conn_s *conn,
|
static uint16_t udp_datahandler(FAR struct net_driver_s *dev,
|
||||||
|
FAR struct udp_conn_s *conn,
|
||||||
FAR uint8_t *buffer, uint16_t buflen)
|
FAR uint8_t *buffer, uint16_t buflen)
|
||||||
{
|
{
|
||||||
FAR struct iob_s *iob;
|
FAR struct iob_s *iob;
|
||||||
@@ -87,12 +88,14 @@ static uint16_t udp_datahandler(FAR struct net_driver_s *dev, FAR struct udp_con
|
|||||||
0
|
0
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_NET_IPv4
|
#ifdef CONFIG_NET_IPv4
|
||||||
FAR struct sockaddr_in src_addr4 =
|
FAR struct sockaddr_in src_addr4 =
|
||||||
{
|
{
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
FAR void *src_addr;
|
FAR void *src_addr;
|
||||||
uint8_t src_addr_size;
|
uint8_t src_addr_size;
|
||||||
|
|
||||||
|
|||||||
@@ -561,6 +561,7 @@ ssize_t psock_udp_sendto(FAR struct socket *psock, FAR const void *buf,
|
|||||||
ret = state.st_sndlen;
|
ret = state.st_sndlen;
|
||||||
|
|
||||||
errout_with_lock:
|
errout_with_lock:
|
||||||
|
|
||||||
/* Release the semaphore */
|
/* Release the semaphore */
|
||||||
|
|
||||||
nxsem_destroy(&state.st_sem);
|
nxsem_destroy(&state.st_sem);
|
||||||
|
|||||||
@@ -160,6 +160,7 @@ static int do_accept_request(FAR struct usrsock_conn_s *conn,
|
|||||||
struct usrsock_request_accept_s req =
|
struct usrsock_request_accept_s req =
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
struct iovec bufs[1];
|
struct iovec bufs[1];
|
||||||
|
|
||||||
if (addrlen > UINT16_MAX)
|
if (addrlen > UINT16_MAX)
|
||||||
@@ -233,6 +234,7 @@ int usrsock_accept(FAR struct socket *psock, FAR struct sockaddr *addr,
|
|||||||
struct usrsock_data_reqstate_s state =
|
struct usrsock_data_reqstate_s state =
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
FAR struct usrsock_conn_s *newconn;
|
FAR struct usrsock_conn_s *newconn;
|
||||||
struct iovec inbufs[2];
|
struct iovec inbufs[2];
|
||||||
socklen_t inaddrlen = 0;
|
socklen_t inaddrlen = 0;
|
||||||
|
|||||||
@@ -112,6 +112,7 @@ static int do_bind_request(FAR struct usrsock_conn_s *conn,
|
|||||||
struct usrsock_request_bind_s req =
|
struct usrsock_request_bind_s req =
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
struct iovec bufs[2];
|
struct iovec bufs[2];
|
||||||
|
|
||||||
/* Prepare request for daemon to read. */
|
/* Prepare request for daemon to read. */
|
||||||
@@ -170,6 +171,7 @@ int usrsock_bind(FAR struct socket *psock,
|
|||||||
struct usrsock_reqstate_s state =
|
struct usrsock_reqstate_s state =
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
ssize_t ret;
|
ssize_t ret;
|
||||||
|
|
||||||
DEBUGASSERT(conn);
|
DEBUGASSERT(conn);
|
||||||
|
|||||||
@@ -111,6 +111,7 @@ static int do_close_request(FAR struct usrsock_conn_s *conn)
|
|||||||
struct usrsock_request_close_s req =
|
struct usrsock_request_close_s req =
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
struct iovec bufs[1];
|
struct iovec bufs[1];
|
||||||
|
|
||||||
/* Prepare request for daemon to read. */
|
/* Prepare request for daemon to read. */
|
||||||
@@ -140,6 +141,7 @@ int usrsock_close(FAR struct usrsock_conn_s *conn)
|
|||||||
struct usrsock_reqstate_s state =
|
struct usrsock_reqstate_s state =
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
net_lock();
|
net_lock();
|
||||||
|
|||||||
@@ -112,6 +112,7 @@ static int do_connect_request(FAR struct usrsock_conn_s *conn,
|
|||||||
struct usrsock_request_connect_s req =
|
struct usrsock_request_connect_s req =
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
struct iovec bufs[2];
|
struct iovec bufs[2];
|
||||||
|
|
||||||
if (addrlen > UINT16_MAX)
|
if (addrlen > UINT16_MAX)
|
||||||
@@ -162,6 +163,7 @@ int usrsock_connect(FAR struct socket *psock,
|
|||||||
struct usrsock_reqstate_s state =
|
struct usrsock_reqstate_s state =
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
DEBUGASSERT(conn);
|
DEBUGASSERT(conn);
|
||||||
|
|||||||
@@ -123,6 +123,7 @@ static int do_getpeername_request(FAR struct usrsock_conn_s *conn,
|
|||||||
struct usrsock_request_getpeername_s req =
|
struct usrsock_request_getpeername_s req =
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
struct iovec bufs[1];
|
struct iovec bufs[1];
|
||||||
|
|
||||||
if (addrlen > UINT16_MAX)
|
if (addrlen > UINT16_MAX)
|
||||||
@@ -175,6 +176,7 @@ int usrsock_getpeername(FAR struct socket *psock,
|
|||||||
struct usrsock_data_reqstate_s state =
|
struct usrsock_data_reqstate_s state =
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
struct iovec inbufs[1];
|
struct iovec inbufs[1];
|
||||||
ssize_t ret;
|
ssize_t ret;
|
||||||
socklen_t outaddrlen = 0;
|
socklen_t outaddrlen = 0;
|
||||||
|
|||||||
@@ -123,6 +123,7 @@ static int do_getsockname_request(FAR struct usrsock_conn_s *conn,
|
|||||||
struct usrsock_request_getsockname_s req =
|
struct usrsock_request_getsockname_s req =
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
struct iovec bufs[1];
|
struct iovec bufs[1];
|
||||||
|
|
||||||
if (addrlen > UINT16_MAX)
|
if (addrlen > UINT16_MAX)
|
||||||
@@ -175,6 +176,7 @@ int usrsock_getsockname(FAR struct socket *psock,
|
|||||||
struct usrsock_data_reqstate_s state =
|
struct usrsock_data_reqstate_s state =
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
struct iovec inbufs[1];
|
struct iovec inbufs[1];
|
||||||
ssize_t ret;
|
ssize_t ret;
|
||||||
socklen_t outaddrlen = 0;
|
socklen_t outaddrlen = 0;
|
||||||
|
|||||||
@@ -122,6 +122,7 @@ static int do_getsockopt_request(FAR struct usrsock_conn_s *conn, int level,
|
|||||||
struct usrsock_request_getsockopt_s req =
|
struct usrsock_request_getsockopt_s req =
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
struct iovec bufs[1];
|
struct iovec bufs[1];
|
||||||
|
|
||||||
if (level < INT16_MIN || level > INT16_MAX)
|
if (level < INT16_MIN || level > INT16_MAX)
|
||||||
@@ -189,6 +190,7 @@ int usrsock_getsockopt(FAR struct usrsock_conn_s *conn, int level, int option,
|
|||||||
struct usrsock_data_reqstate_s state =
|
struct usrsock_data_reqstate_s state =
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
struct iovec inbufs[1];
|
struct iovec inbufs[1];
|
||||||
ssize_t ret;
|
ssize_t ret;
|
||||||
|
|
||||||
|
|||||||
@@ -122,6 +122,7 @@ static int do_ioctl_request(FAR struct usrsock_conn_s *conn, int cmd,
|
|||||||
struct usrsock_request_ioctl_s req =
|
struct usrsock_request_ioctl_s req =
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
struct iovec bufs[2];
|
struct iovec bufs[2];
|
||||||
|
|
||||||
if (arglen > UINT16_MAX)
|
if (arglen > UINT16_MAX)
|
||||||
@@ -168,6 +169,7 @@ int usrsock_ioctl(FAR struct socket *psock, int cmd, FAR void *arg,
|
|||||||
struct usrsock_data_reqstate_s state =
|
struct usrsock_data_reqstate_s state =
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
struct iovec inbufs[1];
|
struct iovec inbufs[1];
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
|||||||
@@ -105,6 +105,7 @@ static int do_listen_request(FAR struct usrsock_conn_s *conn, int backlog)
|
|||||||
struct usrsock_request_listen_s req =
|
struct usrsock_request_listen_s req =
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
struct iovec bufs[1];
|
struct iovec bufs[1];
|
||||||
|
|
||||||
if (backlog > UINT16_MAX)
|
if (backlog > UINT16_MAX)
|
||||||
@@ -160,6 +161,7 @@ int usrsock_listen(FAR struct socket *psock, int backlog)
|
|||||||
struct usrsock_reqstate_s state =
|
struct usrsock_reqstate_s state =
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
DEBUGASSERT(conn);
|
DEBUGASSERT(conn);
|
||||||
|
|||||||
@@ -166,6 +166,7 @@ static int do_recvfrom_request(FAR struct usrsock_conn_s *conn, size_t buflen,
|
|||||||
struct usrsock_request_recvfrom_s req =
|
struct usrsock_request_recvfrom_s req =
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
struct iovec bufs[1];
|
struct iovec bufs[1];
|
||||||
|
|
||||||
if (addrlen > UINT16_MAX)
|
if (addrlen > UINT16_MAX)
|
||||||
@@ -221,6 +222,7 @@ ssize_t usrsock_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len,
|
|||||||
struct usrsock_data_reqstate_s state =
|
struct usrsock_data_reqstate_s state =
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
struct iovec inbufs[2];
|
struct iovec inbufs[2];
|
||||||
socklen_t addrlen = 0;
|
socklen_t addrlen = 0;
|
||||||
socklen_t outaddrlen = 0;
|
socklen_t outaddrlen = 0;
|
||||||
|
|||||||
@@ -156,6 +156,7 @@ static int do_sendto_request(FAR struct usrsock_conn_s *conn,
|
|||||||
struct usrsock_request_sendto_s req =
|
struct usrsock_request_sendto_s req =
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
struct iovec bufs[3];
|
struct iovec bufs[3];
|
||||||
|
|
||||||
if (addrlen > UINT16_MAX)
|
if (addrlen > UINT16_MAX)
|
||||||
@@ -216,6 +217,7 @@ ssize_t usrsock_sendto(FAR struct socket *psock, FAR const void *buf,
|
|||||||
struct usrsock_reqstate_s state =
|
struct usrsock_reqstate_s state =
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
ssize_t ret;
|
ssize_t ret;
|
||||||
#ifdef CONFIG_NET_SOCKOPTS
|
#ifdef CONFIG_NET_SOCKOPTS
|
||||||
struct timespec abstime;
|
struct timespec abstime;
|
||||||
|
|||||||
@@ -114,6 +114,7 @@ static int do_setsockopt_request(FAR struct usrsock_conn_s *conn,
|
|||||||
struct usrsock_request_setsockopt_s req =
|
struct usrsock_request_setsockopt_s req =
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
struct iovec bufs[2];
|
struct iovec bufs[2];
|
||||||
|
|
||||||
if (level < INT16_MIN || level > INT16_MAX)
|
if (level < INT16_MIN || level > INT16_MAX)
|
||||||
@@ -180,6 +181,7 @@ int usrsock_setsockopt(FAR struct usrsock_conn_s *conn, int level, int option,
|
|||||||
struct usrsock_reqstate_s state =
|
struct usrsock_reqstate_s state =
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
ssize_t ret;
|
ssize_t ret;
|
||||||
|
|
||||||
DEBUGASSERT(conn);
|
DEBUGASSERT(conn);
|
||||||
|
|||||||
@@ -121,6 +121,7 @@ static int do_socket_request(FAR struct usrsock_conn_s *conn, int domain,
|
|||||||
struct usrsock_request_socket_s req =
|
struct usrsock_request_socket_s req =
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
struct iovec bufs[1];
|
struct iovec bufs[1];
|
||||||
|
|
||||||
/* Prepare request for daemon to read. */
|
/* Prepare request for daemon to read. */
|
||||||
@@ -200,6 +201,7 @@ int usrsock_socket(int domain, int type, int protocol,
|
|||||||
struct usrsock_reqstate_s state =
|
struct usrsock_reqstate_s state =
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
FAR struct usrsock_conn_s *conn;
|
FAR struct usrsock_conn_s *conn;
|
||||||
int err;
|
int err;
|
||||||
int ret;
|
int ret;
|
||||||
|
|||||||
@@ -142,6 +142,7 @@ static int usrsock_sockif_setup(FAR struct socket *psock, int protocol)
|
|||||||
return -ENETDOWN;
|
return -ENETDOWN;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CONFIG_NET_USRSOCK_TCP
|
#ifndef CONFIG_NET_USRSOCK_TCP
|
||||||
if (type == SOCK_STREAM)
|
if (type == SOCK_STREAM)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user