Make TCPFragmenter take into account IP & TCP header lengths

TCPFragmenter breaks TCP/IP packets into chunks no larger than MTU.
However, it does not take into account the length of the TCP or IP headers
when doing this.  This commit make it take them into account when
calculating the size of the TCP payload.

Reviewed-By: cliff@meraki.com

git-svn-id: svn+ssh://svn.meraki.net/var/local/svnbase/meraki/trunk/router@102016 291e08f9-2c14-0410-acb0-c89b6de265c5
Make TCPFragmenter honor an MTU_ANNO

This is similar to the functionality in IPFragmenter, where you can either
set an MTU or use an MTU_ANNO or both.

Reviewed-By: cliff@meraki.com

git-svn-id: svn+ssh://svn.meraki.net/var/local/svnbase/meraki/trunk/router@102017 291e08f9-2c14-0410-acb0-c89b6de265c5
Make TCPFragmenter work correctly with FIN

Since TCPFragmenter copies all of a packet's headers to the fragmented
packets, each fragment inherits the original packet's flags.  This includes
the FIN flag, so if FIN were set each fragment will look like a FIN; this
prematurely terminates the flow.

This change modifies the behaviour to only allow a FIN on the last fragment.

Reviewed-By: cliff@meraki.com

git-svn-id: svn+ssh://svn.meraki.net/var/local/svnbase/meraki/trunk/router@102018 291e08f9-2c14-0410-acb0-c89b6de265c5
Configury nit.
NS: Fetch defines from the NS simulator.

Requires very recent versions of ns-3, but works anywhere.

Signed-off-by: Eddie Kohler <ekohler@gmail.com>
Revert "linuxmodule/todevce: don't attempt to defer packet after dev_queue_xmit"

This reverts commit de6f12a2cd40714f304dd0f1b6c4e12e7a5ccff6.
Revert "Don't lock the TX queue of a device in newer Linux kernels."

This reverts commit ccd9937401f5d590d261dc3ba6f3775028aade3b.
Revert "ToDevice/linuxmodule: Transmit skb with dev_queue_xmit()"

This reverts commit d65bfe4054a23468c808e95df4ab6b4a5ef9d9a3.
linuxmodule/todevice: fix logic for calling ndo_start_xmit

It seems much cleaner to me to directly call ndo_start_xmit rather than
dev_queue_xmit, as it avoids an extra layer of queueing and improves
backpressure behavior.  This should fix the NETDEV WATCHDOG issue that
Joonwoo fixed in d65bfe40, but in a different way.

In general, the logic in todevice.cc should be the same as
linux/net/core/pktgen.c.  This brings the code up to match that.
Merge pull request #75 from clifffrey/todevice-reversion

Todevice reversion
linuxmodule/todevice: fix silly bug for linux 2.6.33+
Add counters to TCPFragmenter

This element now counts

	* count -- the total number of packets
	* fragmented_count -- the number of packets fragmented
	* fragments -- the number of fragments produced

Thanks to Cliff Frey for the suggestion.

Reviewed-By: cliff@meraki.com

git-svn-id: svn+ssh://svn.meraki.net/var/local/svnbase/meraki/trunk/router@102019 291e08f9-2c14-0410-acb0-c89b6de265c5
Don't report a spurious error when writing an empty dump.

From Spencer Rathbun.

Signed-off-by: Eddie Kohler <ekohler@gmail.com>
Merge pull request #74 from pallas/master

Fun with TCPFragmenter
Merge branch 'master' of git://github.com/kohler/click