summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-11-07Take into account CRC field for framingHEADmasterFrediano Ziglio1-2/+2
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2023-11-07Avoid possible bug with strict aliasingFrediano Ziglio1-4/+11
Tell code we are breaking strict aliasing. Most of the time works but with some strong optimisation compiler could produce not working code because of the aliasing breakage. Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2023-11-07Remove useless assert in codeFrediano Ziglio1-2/+0
Always true, it would be better to write a test instead. Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2019-12-18Use calloc instead of malloc+memsetFrediano Ziglio1-3/+1
Result is the same, allocator can do some optimization. Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2019-03-19Bump release version to 1.3Frediano Ziglio1-1/+1
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2019-03-19Add compiler dependency to SPEC fileFrediano Ziglio1-0/+2
Required since Fedora 29. Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2019-03-19Check TCP/UDP packet field presenceFrediano Ziglio2-0/+20
Some system uses "th_sum" and "uh_sum" for checksum fields while other use "check". Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2018-10-03Start porting to FreeBSD systemFrediano Ziglio2-26/+28
Adding missing include headers. Use compatibles IP structures. Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2017-11-24Bump release version to 1.2v1.2Frediano Ziglio1-1/+1
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2016-11-15Use err instead of perror/exitFrediano Ziglio3-40/+23
More or less perror+exit does the same of err call so simplify code using err function. Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2016-10-12Distribute shell testFrediano Ziglio1-0/+2
Allow to run make check from distribution Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2016-10-12Initialise variable in testsFrediano Ziglio1-1/+1
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2016-10-12README: Fix some typosPavel Grunt1-5/+5
2016-10-12ronn not required to build RPMFrediano Ziglio1-2/+0
Make dist take care to generate manual page so the .tar.gz already contain the generated version. Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2016-10-11Bump release version to 1.1Frediano Ziglio1-1/+1
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2016-10-11Use ppoll and different threadingFrediano Ziglio1-174/+120
Instead of using a thread for reading from tun(s)/remote use a thread for every direction. This remove a lot of synchronisation from the code. Some test I did prove that this implementation although using a single thread for a direction is faster allowing to use higher speed. Also this make easier to reduce the internal queue at a minimum emulating better a real card and allowing to do some tests with QoS settings. Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2016-10-11Make test work even for remote caseFrediano Ziglio5-24/+186
Use network namespaces to test the remote case using a single machine. Server is run in a subprocess with a different namespace. Client and server are connected with a veth interface. Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2016-10-11Avoid bytes_from_first_read to be set again to 0 while transferingFrediano Ziglio1-1/+1
This could potentially sligthly change the speed while transfering data. Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2016-10-10Add --framing-bytes option and take it into accountFrediano Ziglio5-5/+22
Allows to take into account possible framing for the physical layer. Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2016-10-09Allows to specify a capture file at command lineFrediano Ziglio2-1/+8
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2016-10-09Allow to use a capture file to record packetsFrediano Ziglio2-1/+35
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2016-10-09Add code to write IP packets to pcap fileFrediano Ziglio3-0/+123
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2016-10-09Use 2 tun devices for local caseFrediano Ziglio6-30/+129
This is required to better handle 2 network queue (back and forth) improving network emulation. In real case there are 2 queue, one on local machine and another in the remote one. This will also allow to reduce the queue. Another problem is that using a single queue there was a single flow and the combined bandwidth (forth and back) was limited using a single flow. Now two flows are correctly used for the local case. This require some more complicate NAT fixing the checksums. Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2016-10-09Add the old test_closure test to the automatic testsFrediano Ziglio2-8/+11
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2016-10-09Add ping testFrediano Ziglio3-0/+16
Test that ping utility works Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2016-10-09Simplify code checkFrediano Ziglio1-12/+15
Add and use check_res function Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2016-10-09Assure all bandwidth is used with all settingsFrediano Ziglio1-5/+5
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2016-10-09Fix file commentFrediano Ziglio1-1/+5
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2016-10-09Distribute missing header fileFrediano Ziglio1-0/+1
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2016-10-08Add bandwidth testFrediano Ziglio3-0/+139
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2016-10-08Add some automatic testsFrediano Ziglio7-2/+297
Add test infrastructure. Add a "delay" test checking delay introduced is correct. Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2016-10-07Wait proper writer thread terminationFrediano Ziglio1-1/+16
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2016-10-07Use autoconf tools in spec fileFrediano Ziglio1-4/+3
Instead of manually building/installing use configure and make install. Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2016-10-04Convert project to autoconfFrediano Ziglio5-33/+49
Allow more complicated rules. Avoid duplication of version. Use more standard settings in Makefiles. Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2016-09-28Allows to build rpm packageFrediano Ziglio3-3/+48
Added spec file and some Makefile target like "dist" and "rpm". Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2016-09-28Extend README/man pageFrediano Ziglio1-1/+41
Add some notes and history Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2016-09-28Add some comments and notesFrediano Ziglio1-3/+29
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2016-09-26Remove obsolete declarationsFrediano Ziglio1-3/+0
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2016-09-26Check setuid return valueFrediano Ziglio1-3/+10
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2016-09-25Use 2 ip address instead of 4Frediano Ziglio1-1/+1
Just an optimisation, configure routing to direct only 2 ip addresses to the tun interface. Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2016-09-25Fix test for old versions of ncFrediano Ziglio1-1/+1
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2016-09-19Add speed specification in gigabytes/bitsFrediano Ziglio2-0/+6
Although you should not use high speed you can specify speeds like 0.01G. Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2016-09-17Produce manual page using README.md and ronn utilityFrediano Ziglio3-13/+27
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2016-09-17Fix typo in README.mdFrediano Ziglio1-1/+1
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2016-07-29fix local modeFrediano Ziglio1-5/+4
2016-07-28change completely client/server protocolFrediano Ziglio4-33/+209
Allows to specify options only on one end making easier to change them. Also one UDP port is automatically assigned.
2016-07-28initial client/server implementationFrediano Ziglio3-4/+86
Allows to restrict latency/bandwidth between 2 machines. This require to setup both machines pointing to each other. Works but it's hard to change parameters. To do that both end encapsulate packets in a UDP packet (the UDP data it's just the packet received from tun interface). Quite easy but works. Would be easier if server will be launched just with a port specification while client with all parameters so to make easier to change.
2016-07-27use an IP macro to make easier to understand the constant ip usedFrediano Ziglio2-1/+3
2016-07-27use same indentation for functionsFrediano Ziglio1-3/+6
2016-07-19Make tun_fd variable staticFrediano Ziglio3-11/+9
tun functions use global state in tun.c anyway. Signed-off-by: Frediano Ziglio <fziglio@redhat.com>