mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
Update TODO; Cosmetic changes to comments
This commit is contained in:
@@ -15,7 +15,7 @@ nuttx/
|
|||||||
(8) Kernel/Protected Builds
|
(8) Kernel/Protected Builds
|
||||||
(4) C++ Support
|
(4) C++ Support
|
||||||
(6) Binary loaders (binfmt/)
|
(6) Binary loaders (binfmt/)
|
||||||
(11) Network (net/, drivers/net)
|
(12) Network (net/, drivers/net)
|
||||||
(4) USB (drivers/usbdev, drivers/usbhost)
|
(4) USB (drivers/usbdev, drivers/usbhost)
|
||||||
(10) Libraries (libc/, )
|
(10) Libraries (libc/, )
|
||||||
(11) File system/Generic drivers (fs/, drivers/)
|
(11) File system/Generic drivers (fs/, drivers/)
|
||||||
@@ -829,6 +829,28 @@ o Network (net/, drivers/net)
|
|||||||
Priority: Medium. Important on slow applications that will not accept
|
Priority: Medium. Important on slow applications that will not accept
|
||||||
connections promptly.
|
connections promptly.
|
||||||
|
|
||||||
|
Title: PER DEVICE PORT NUMBERS
|
||||||
|
Description: TCP and UDP ports numbers are assigned as separater but global resources.
|
||||||
|
Separate meaning that a UDP and TCP socket with the same port number are
|
||||||
|
distinct. But global in the since that each TCP port number must be unique
|
||||||
|
and TCP sockets. UDP port numbers must be similarly unique.
|
||||||
|
|
||||||
|
This causes prorblems for the case where there multiple network devices
|
||||||
|
configured into the system. In that case, it should be possible to assign
|
||||||
|
the same TCP (or UDP) port number if the connection is associated with
|
||||||
|
different network devices. For example, if there are two instances of
|
||||||
|
a webserver, each listening for connections on a different device, each
|
||||||
|
should be able to use port 80 to listen for connections.
|
||||||
|
|
||||||
|
The solution is is move the TCP and UDP port related resources: They
|
||||||
|
should not be global but shoud, instead, by a part of the device structure,
|
||||||
|
struct net_drivers_s.
|
||||||
|
|
||||||
|
Status: Open
|
||||||
|
Priority: Very low if you have only a single network interface. Higher if you
|
||||||
|
have more than one. Very high if you need to have the same port numbers
|
||||||
|
on each network served by the device.
|
||||||
|
|
||||||
o USB (drivers/usbdev, drivers/usbhost)
|
o USB (drivers/usbdev, drivers/usbhost)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ FAR struct net_driver_s *netdev_findbyaddr(const net_ipaddr_t addr)
|
|||||||
/* No.. The address lies on an external network */
|
/* No.. The address lies on an external network */
|
||||||
|
|
||||||
#ifdef CONFIG_NET_ROUTE
|
#ifdef CONFIG_NET_ROUTE
|
||||||
/* If we have a routing table, then perhaps we can find the the local
|
/* If we have a routing table, then perhaps we can find the local
|
||||||
* address of a router that can forward packets to the external network.
|
* address of a router that can forward packets to the external network.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -202,6 +202,7 @@ FAR struct net_driver_s *netdev_findbyaddr(const net_ipaddr_t addr)
|
|||||||
{
|
{
|
||||||
dev = g_netdevices;
|
dev = g_netdevices;
|
||||||
}
|
}
|
||||||
|
|
||||||
netdev_semgive();
|
netdev_semgive();
|
||||||
|
|
||||||
/* If we will did not find the network device, then we might as well fail
|
/* If we will did not find the network device, then we might as well fail
|
||||||
|
|||||||
+15
-10
@@ -129,7 +129,7 @@ static FAR struct udp_conn_s *udp_find_conn(uint16_t portno)
|
|||||||
{
|
{
|
||||||
if (g_udp_connections[ i ].lport == portno)
|
if (g_udp_connections[ i ].lport == portno)
|
||||||
{
|
{
|
||||||
return &g_udp_connections[ i ];
|
return &g_udp_connections[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -365,7 +365,7 @@ FAR struct udp_conn_s *udp_nextconn(FAR struct udp_conn_s *conn)
|
|||||||
* Name: udp_bind()
|
* Name: udp_bind()
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function implements the UIP specific parts of the standard UDP
|
* This function implements the low level parts of the standard UDP
|
||||||
* bind() operation.
|
* bind() operation.
|
||||||
*
|
*
|
||||||
* Assumptions:
|
* Assumptions:
|
||||||
@@ -397,7 +397,7 @@ int udp_bind(FAR struct udp_conn_s *conn, FAR const struct sockaddr_in *addr)
|
|||||||
|
|
||||||
flags = net_lock();
|
flags = net_lock();
|
||||||
|
|
||||||
/* Is any other UDP connection bound to this port? */
|
/* Is any other UDP connection already bound to this port? */
|
||||||
|
|
||||||
if (!udp_find_conn(addr->sin_port))
|
if (!udp_find_conn(addr->sin_port))
|
||||||
{
|
{
|
||||||
@@ -417,14 +417,19 @@ int udp_bind(FAR struct udp_conn_s *conn, FAR const struct sockaddr_in *addr)
|
|||||||
* Name: udp_connect()
|
* Name: udp_connect()
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function sets up a new UDP connection. The function will
|
* This function simply assigns a remote address to UDP "connection"
|
||||||
* automatically allocate an unused local port for the new
|
* structure. This function is called as part of the implementation of:
|
||||||
* connection. However, another port can be chosen by using the
|
|
||||||
* udp_bind() call, after the udp_connect() function has been
|
|
||||||
* called.
|
|
||||||
*
|
*
|
||||||
* This function is called as part of the implementation of sendto
|
* - connect(). If connect() is called for a SOCK_DGRAM socket, then
|
||||||
* and recvfrom.
|
* this logic performs the moral equivalent of connec() operation
|
||||||
|
* for the UDP socket.
|
||||||
|
* - recvfrom() and sendto(). This function is called to set the
|
||||||
|
* remote address of the peer.
|
||||||
|
*
|
||||||
|
* The function will automatically allocate an unused local port for the
|
||||||
|
* new connection if the socket is not yet bound to a local address.
|
||||||
|
* However, another port can be chosen by using the udp_bind() call,
|
||||||
|
* after the udp_connect() function has been called.
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* conn - A reference to UDP connection structure
|
* conn - A reference to UDP connection structure
|
||||||
|
|||||||
Reference in New Issue
Block a user