Commit Graph

146 Commits

Author SHA1 Message Date
Gregory Nutt
7467329a98 Eliminate CONFIG_NO_NOINTS. Lots of files changed -> lots of testing needed. 2016-12-03 16:28:19 -06:00
Gregory Nutt
00beb665f5 net/: Remove references to CONFIG_NET_MULTIBUFFER 2016-11-29 16:12:39 -06:00
Gregory Nutt
2d057c28c8 net: Disable priority inheritance on all semaphores used for signaling 2016-11-03 12:17:02 -06:00
Gregory Nutt
2a751068e6 Without lowsyslog() *llerr() is not useful. Eliminate and replace with *err(). 2016-06-20 12:44:38 -06:00
Gregory Nutt
43eb04bb8f Without lowsyslog() *llinfo() is not useful. Eliminate and replace with *info(). 2016-06-20 11:59:15 -06:00
Gregory Nutt
f4fcdcdb4d net/: Change some *err() message to *info() messages if what was a *dbg() message does not indicate and error condition. 2016-06-11 17:37:21 -06:00
Gregory Nutt
a1469a3e95 Add CONFIG_DEBUG_ERROR. Change names of *dbg() * *err() 2016-06-11 15:50:49 -06:00
Gregory Nutt
e99301d7c2 Rename *lldbg to *llerr 2016-06-11 14:55:27 -06:00
Gregory Nutt
1cdc746726 Rename CONFIG_DEBUG to CONFIG_DEBUG_FEATURES 2016-06-11 14:14:08 -06:00
Gregory Nutt
fc3540cffe Replace all occurrences of vdbg with vinfo 2016-06-11 11:59:51 -06:00
Gregory Nutt
4f208600aa Replace confusing references to uIP with just 'the network' 2016-05-30 09:31:44 -06:00
Steve
bd3ef36eda SUMMARY
-------
   This patch enhances networking support for the simulation under Linux.
   Includes updated support for Linux TUN/TAP, and the addition of support for
   Linux bridge devices.

CHANGES
-------
   o Check to see if the d_txavail callback is present before calling it in
     the arp send code.  This prevents a segfault when simulating the telnetd
     daemon with arp send enabled.

   o Adjust the simulation's netdriver_loop() so it will detect and respond to
     ARP requests.

   o Do not attempt to take the tap device's hardware address for use by the
     simulation.  That hardware address belongs to the host end of the link,
     not the simulation end.  Generate a randomized MAC address instead.

   o Do not assign an IP address to the interface on the host side of the TAP
     link.

   + Provide two modes: "host route" and "bridge".

   + In host route mode, maintain a host route that points any traffic for the
     simulation's IP address to the tap device.  In this mode, so long as the
     simulation's IP is a free address in the same subnet as the host, no
     additional configuration will be required to talk to it from the host.
     Note that address changes are handled automatically if they follow the
     rule of if-down/set-address/if-up, which everything seems to.

   + In bridge mode, add the tap device to the specified bridge instance.  See
     configs/sim/NETWORK-LINUX.txt for information and usage examples.  This
     enables much more flexible configurations (with fewer headaches), such as
     running multiple simulations on a single host, all of which can access
     the network the host is connected to.

   o Refresh configurations in configs/sim where CONFIG_NET=y.  They default
     to "host route" mode.

   o Add configs/sim/NETWORK-LINUX.txt

CAVEATS
-------
   - The MAC address generation code is extremely simplistic, and does not
     check for potential conflicts on the network.  Probably not an issue, but
     something to be aware of.

   - I was careful to leave it in a state where Cygwin/pcap should still work,
     but I don't have a Windows environment to test in.  This should be
     checked.

   - I don't know if this was ever intended to work with OS X.  I didn't even
     try to test it there.

NOTES
-----
   - Was able to get telnetd working and simulate nsh over telnet, but only so
     long as listen backlogs were disabled.

     There appears to be a bug in the backlog code where sockets are being
     returned in SYN_RCVD state instead of waiting until they're ESTABLISHED;
     if you perform an immediate send after accepting the connection, it will
     confuse the stack and the send will hang; additionally, the connection
     will never reach ESTABLISHED state.

     Can be worked around by adding a sleep(1) after the accept in telnetd.  I
     don't have the necessary knowledge of the IP stack to know what the
     correct fix is.
2016-05-20 17:36:14 -06:00
Gregory Nutt
b0ea870bcc Remove some empty code section comments 2016-02-25 18:34:36 -06:00
Gregory Nutt
d19e9cc448 networking: cosmetic changes 2016-02-24 16:10:20 -06:00
Gregory Nutt
aa3e778dc6 nuttx/net: Replace irqsave() with enter_critical_section(); replace irqrestore() with leave_critical_section() 2016-02-14 08:38:44 -06:00
Gregory Nutt
166ad58849 DHCPD no longer calls directly into the OS, but uses network IOCTL commands to modify the ARP table. Plus, fix a warning. 2016-02-08 12:08:18 -06:00
Gregory Nutt
0af9a197ac ARP: Add IOCTL commands to manage the ARP table 2016-02-08 11:17:22 -06:00
Gregory Nutt
dea24c503a Networking: Remove the HSEC argument from devif_timer. 2016-02-03 12:12:41 -06:00
Gregory Nutt
59b912477e Fix some warnings: Mismatched prototypes 2015-12-05 10:36:00 -06:00
Gregory Nutt
6209c51206 net/: More clean-up of spacing/alignment issues 2015-10-08 15:10:04 -06:00
Gregory Nutt
0b12dbf95d Fix some spacing problems 2015-10-04 15:04:00 -06:00
Gregory Nutt
9c66bde5b0 Fix typo in pre-processor command noted by Pierre-noel Bouteville. Also move # of pre-processior command to column 1 2015-09-05 09:10:48 -06:00
Gregory Nutt
fca919f3d2 Networking: Fix some compilation issues noted with network is build with CONFIG_BUILD_KERNEL 2015-07-05 11:18:56 -06:00
Gregory Nutt
342f5fe33d Fix references to the no-longer-existent misc/ directory in comments, README files, and documentation 2015-06-28 08:08:57 -06:00
Gregory Nutt
8f7752d956 Networking: Modify how callback structures are stored to avoid another potential use of a stal pointer. 2015-06-03 08:11:57 -06:00
Gregory Nutt
ab50e9d04d Networking: Get rid of g_ipv4_allzeroaddr and g_ipv4_alloneaddr. It is more efficient and more intuitive to use INADDR_ANY and INADDR_BROADCAST 2015-05-29 15:16:11 -06:00
Gregory Nutt
0bdf2d5360 UDP Networking: Misc fixes to get the last changes working + cleanup 2015-05-29 14:32:56 -06:00
Gregory Nutt
e81f279315 Networking: Modify event list handling: Now there are two event lists each device structure: (1) One is for ARP and ICMP data related evetns, the other is for device related events. Callback allocation/free routines no accept a device paramter as well as a list: If the device paramter is added, then the callback goes into both the connection-related liast AND the device event list. Thus each socket type can received both custom data-related events as well as common device related events. 2015-05-28 12:01:38 -06:00
Gregory Nutt
7d8e8bc188 Missed a place where NETDEV_DOWN needs to be added to notification flags 2015-05-27 12:22:07 -06:00
Gregory Nutt
b94321cfb4 Extend device specific callbacks to ICMPv6 and ARP. Fix some IPv6 compilation errors that have crept in 2015-05-27 11:39:44 -06:00
Gregory Nutt
cded7ea682 Fix some time value changes; mostly changing greater than 1000000000 to greater than or equal to 1000000000. From Juha Niskanen 2015-02-20 07:07:36 -06:00
Gregory Nutt
b756df982d net/: Lots of build problems introduced into multiple NIC support. Many places where conditional logic based on CONFIG_NETDEV_MULTINIC is confused with CONFIG_NET_MULTILINK. Lots of code changed with IPv6 that was never compiled with MULTINIC enabled. Still some problem with parameter passing. 2015-02-09 18:15:34 -06:00
Gregory Nutt
559f1ef825 Networking: Clean up and consolidate some clunky stuff by adding new net_timedwait() function 2015-02-09 07:50:10 -06:00
Gregory Nutt
e4c602747b Networking: Fixes another CONFIG_NET_NOINTS issues. When called sem_timedwait() with the network locked, the network stays logcked while we wait which is not what we want (without CONFIG_NET_NOINTS, interrupts are re-enabled while we wait and all is well). 2015-02-02 14:48:11 -06:00
Gregory Nutt
a07a764d42 ICMPv6: Adds basic logic to support verification that we have the IPv6 address in the Neighbor Table. This feature is important because otherwise the first packet sent to a remote peer will fail (it will be replaced with a Neighbor Solicitation). 2015-02-02 13:44:31 -06:00
Gregory Nutt
b1b8c0e47d IPv6: More framework for automatic neighbor solicition. I think this also corrects and error in a broadcast/multicast address chedk 2015-02-02 11:34:51 -06:00
Gregory Nutt
3385082b99 IPv6: Remove an unusd file (kruft from original IPv6 develoment); Add inital hooks to support automatic Neighbor Solitication 2015-02-02 10:49:50 -06:00
Gregory Nutt
3202819328 IPv6 -- various fixed from problems found in testing 2015-01-21 10:29:18 -06:00
Gregory Nutt
cdff532bfa Networking: When sending ICMPv6 advertisements and solicitations, set the NOARP bit so that we don't overwrite the destination MAC address 2015-01-20 15:59:52 -06:00
Gregory Nutt
41bb57efea Fix typo in function name 2015-01-20 13:48:42 -06:00
Gregory Nutt
6d901e4d8b Networking: Costmetic changes 2015-01-19 14:56:35 -06:00
Gregory Nutt
88a0e82934 Networking: Remove field d_sndata from the device structure. It is the same as d_appdata and unnecessary 2015-01-17 05:59:13 -06:00
Gregory Nutt
5e938941a6 Networking: Replace all references to net_ipaddr_t with either in_addr_t on net_ipv6addr_t. The goal is to support both IPv4 and IPv6 simultaneously. This requires that the two types be distinct and not conditionally typedef'ed to net_ipaddr_t. 2015-01-16 12:30:18 -06:00
Gregory Nutt
fe8b3c5220 Networking: More detangling of IPv6 logic. Next steps will be more invasive and will get moved to a branch 2015-01-16 08:51:18 -06:00
Gregory Nutt
5a441ce03b Networking: Misck IPv6 detanglement 2015-01-15 12:19:44 -06:00
Gregory Nutt
fcd65e9d7d Networking: Make a home for ICMPv6 2015-01-14 14:26:50 -06:00
Gregory Nutt
babe9cf08e Network: Add an IPv4 configuration option. Hardcoded to =y for now, but I would like to be able to select IPv4 and/or IPv6 in the future 2015-01-14 10:51:09 -06:00
Gregory Nutt
b36dbe1d89 Add logic to netdev_findbyaddr() to return the correct network device for the case where a broadcast address is used. This change caused trivial ripples through other files because additional parameters are required for netdev_findbyaddr() when CONFIG_NET_MULTINIC 2014-11-23 11:00:22 -06:00
Gregory Nutt
43d036f587 Network routing: Refuse to perform routing table lookups for the Broadcast IP address. From Brennan Ashton 2014-11-23 08:36:34 -06:00
Gregory Nutt
25d787ff12 Remove use of NET_LL_HDRLEN from net/arp logic. Use ETH_HDRLEN instead 2014-11-15 09:13:50 -06:00
Gregory Nutt
2b758537ea Network: Misc fixes for clean complete with both Ethernet and SLIP enabled 2014-11-15 08:55:50 -06:00
Gregory Nutt
388ef8db1a Netwoek: Ada a parameter to netdev_register() to indicate the link protocol supported by the driver. Use this value to replace some logic commited yesterday 2014-11-15 08:22:51 -06:00
Gregory Nutt
64d18bfe12 NET: Fix some some more ARP/Ethernet releated configuration 2014-11-14 21:22:45 -06:00
Gregory Nutt
0d7c378e4e Costmetic change 2014-11-14 18:51:57 -06:00
Gregory Nutt
ebdff66c8b ARP: Add support for the case where there are multiple networks: One being Etherenet and the other not (say slip or perhaps someday PPP). In that case, we need to suppress ARP-related operations on the SLIP/PPP interface only 2014-11-14 18:25:33 -06:00
Gregory Nutt
ad9b3f8ab8 wdog.h does not contain any application interface, only internal OS interface. Further, it is non-standard. Move wdog.h from include/ to include/nuttx. For the same reason, move the description of the watchdog timer interfaces from the Users Guide to the Porting Guide. 2014-08-21 11:16:55 -06:00
Gregory Nutt
21add71646 ARP reuestion logc needs to do the right thing if (1) the address is a broadcast or multicast address, and (2) if the IP address lies outside of the network. Thanks to Manuel Stuehn 2014-08-20 07:09:02 -06:00
Gregory Nutt
27cc2a3fc3 ARP request logic is no longer EXPERIMENTAL 2014-08-20 07:07:24 -06:00
Gregory Nutt
8e84282c05 ARP: Fix bid conversion from msec to nsec 2014-08-19 08:37:14 -06:00
Gregory Nutt
a9ca05266b Update ChangeLog 2014-08-19 07:52:52 -06:00
Gregory Nutt
9662f1750c ARP: Add signal logic so that we do not have to wait so long with the network responses to ARP requests quickly 2014-08-19 07:47:32 -06:00
Gregory Nutt
4bba611dc6 Move some internal networking function protoypes out of the public include/nuttx/net/arp.h into to the private net/arp/arp.h 2014-08-18 16:35:20 -06:00
Gregory Nutt
548fda7834 arp_poll(): inished the implementation of logic to send ARP requests. Complete, fully hooked into the networking logic, and ready for test (but still untested) 2014-08-18 15:24:51 -06:00
Gregory Nutt
b440fa18ca arp_send.c: Partial implementation of logic to send ARP requests to assure that an IP address mapping is present in the ARP table 2014-08-18 14:29:02 -06:00
Gregory Nutt
ec429fdf00 PKT sockets: Change how the IFF_NOARP flag is handled. This should be set only when data is moved into the buffer and cleared after tested by the ARP logic. Setting it globally can cause packets to be sent with no valid MAC addresses 2014-08-18 13:42:51 -06:00
Gregory Nutt
1a7e1fb93b arp_format.c: Move the logic that formats an ARP packet into a separate file where it can be re-used. 2014-08-18 12:37:40 -06:00
Gregory Nutt
1323ab9352 Move arp_arpin() from arp_inout.c to its own file. Rename arp_inout.c to arpipin.c because that is all that is left in the file 2014-08-18 11:36:39 -06:00
Gregory Nutt
6f1d354ef1 Move arp_out() from arp_inout.c to its own file 2014-08-18 11:21:53 -06:00
Gregory Nutt
985c016150 ARP: Add missing configuration option to select dumping of ARP packet headers. Move ARP dumping logic from arp_inout.c to its own file 2014-08-18 11:08:15 -06:00
Gregory Nutt
e89eac6365 NET: Fix a few problems after big merge of network reorganization 2014-07-06 17:58:36 -06:00
Gregory Nutt
1f11a452dd NET: Add a few missing configuration options to the Kconfig files 2014-07-06 13:04:27 -06:00
Gregory Nutt
9e87ab90b8 NET: Move private definitions from include/nuttx/net/arp.h to net/arp/arp.h 2014-07-06 11:05:28 -06:00
Gregory Nutt
c5fc24e110 NET: Standardize naming of all protocal header lengths 2014-07-05 13:04:48 -06:00
Gregory Nutt
60246e613b NET: emoved all includes of uip.h; added includes of ip.h wherever needed. Tried to fix problems of the now missing sneak inclusions because uip.h was removed. There are probably a few of these that were missed. 2014-07-04 19:13:08 -06:00
Gregory Nutt
cce35ce975 NET: More renaming 2014-07-04 15:40:49 -06:00
Gregory Nutt
3e0bd1f1b0 NET: Rename some address comparison macros 2014-07-01 18:11:05 -06:00
Gregory Nutt
ad3e39e53d NET: Rename uiphdr_ipaddr_copy to net_ipaddr_hdrcopy, uip_ip4addr_conv to net_ip4addr_conv32, and uip_ethaddr_cmp to eth_addr_cmp 2014-06-29 13:20:00 -06:00
Gregory Nutt
c362f21815 NET: Rename uip_ipaddr* to net_ipaddr* 2014-06-29 13:11:08 -06:00
Gregory Nutt
76fa58ee00 Move all socket-related files from net/ to net/socket. Move net/net.h to net/socket/socket.h 2014-06-28 17:25:18 -06:00
Gregory Nutt
64c8dba8c4 NET: Create net/sockets directory and hook into the build/configuration system 2014-06-28 16:41:55 -06:00
Gregory Nutt
fce2a79abd Rename uip_driver_s net_driver_s 2014-06-27 16:48:12 -06:00
Gregory Nutt
953764181e NET: Move net/netdev*.c to net/netdev/netdev*.c 2014-06-27 09:56:45 -06:00
Gregory Nutt
d120befd39 NET: Move routing table functions to net/route 2014-06-26 13:02:08 -06:00
Gregory Nutt
e1091251e6 NET: Move statistcs from uip.h to new netstats.h to remove nasty circular inclusion problem. 2014-06-26 09:32:39 -06:00
Gregory Nutt
1a2bcebb4a Clean up some networking configuration menus 2014-06-25 11:01:08 -06:00
Gregory Nutt
621097b6c8 Rename ip_eth_hdr to eth_hdr_s 2014-06-25 09:57:52 -06:00
Gregory Nutt
f57024406a Clean up IGMP naming 2014-06-25 09:52:36 -06:00
Gregory Nutt
5d1f8180d4 Move the remaining files from include/nuttx/net/uip to include/nuttx/net; Rename *_internal.h header files in net/ to just *.h 2014-06-24 10:14:15 -06:00
Gregory Nutt
37646044ac Move include/nuttx/net/uip/uip-arch.h to include/nuttx/net/netdev.h 2014-06-24 09:28:44 -06:00
Gregory Nutt
626469e30c Move include/nuttx/net/uipopt.h to include/nuttx/net/netconfig.h 2014-06-24 08:53:28 -06:00
Gregory Nutt
0520270733 Net PKT: Suppress ARP requests for packet socket transfers 2014-06-24 08:22:12 -06:00
Gregory Nutt
b395eab360 NET: Fix an error in networking Make.defs file 2014-06-03 12:41:06 -06:00
Gregory Nutt
da4277357c Move arp, icmp, and igmp configuration values into new Kconfig files in those directories 2014-05-30 14:44:07 -06:00
Gregory Nutt
6a766544cc Files that I forgot to add in the previous commits 2014-05-30 14:32:00 -06:00
Gregory Nutt
90e4b55e0c Move include/nuttx/net/uip/uip-arch.h to include/nuttx/net/arp.h; rename all uip_arp_ functions to arp_ 2014-05-30 12:13:06 -06:00
Gregory Nutt
649a61813c Move arp-related files from net/uip to net/arp 2014-05-30 11:14:06 -06:00