summaryrefslogtreecommitdiff
path: root/auto_tests/network_test.c
AgeCommit message (Collapse)Author
2017-01-04Portability fixesDavid Zero
- CFLAG gnu99 was changed to c99. - CXXFLAG c++98 was changed to c++11. - CFLAG -pedantic-errors was added so that non-ISO C now throws errors. - _XOPEN_SOURCE feature test macro added and set to 600 to expose SUSv3 and c99 definitions in modules that required them. - Fixed tests (and bootstrap daemon logging) that were failing due to the altered build flags. - Avoid string suffix misinterpretation; explicit narrowing conversion. - Misc. additions to .gitignore to make sure build artifacts don't wind up in version control.
2016-09-06Improve static and const correctness.iphydf
- Any non-externally-visible declarations should be `static`. - Casting away the `const` qualifier from pointers-to-const is dangerous. All but one instance of this are now correct. The one instance where we can't keep `const` is one where toxav code actually writes to a chunk of memory marked as `const`. This code also assumes 4 byte alignment of data packets. I don't know whether that is a valid assumption, but it's likely unportable, and *not* obviously correct. - Replaced empty parameter lists with `(void)` to avoid passing parameters to it. Empty parameter lists are old style declarations for unknown number and type of arguments. - Commented out (as `#if DHT_HARDENING` block) the hardening code that was never executed. - Minor style fix: don't use `default` in enum-switches unless the number of enumerators in the default case is very large. In this case, it was 2, so we want to list them both explicitly to be warned about missing one if we add one in the future. - Removed the only two function declarations from nTox.h and put them into nTox.c. They are not used outside and nTox is not a library.
2016-09-01Sort #includes in all source files.iphydf
2016-02-27Move argument comments to the end of lineRoman Yepishev
2016-02-27Remove unused main() argumentsRoman Yepishev
2016-02-27Remove magic numbers from addr_resolveRoman Yepishev
* Add #defines for INET/INET6 returns * Remove magic number 3 - exact AF_INET/INET6 result found. * Updated network_test.c
2014-09-26Removed now useless network sturct size tests.irungentoo
2014-08-09Remove DEFTESTCASE and DEFTESTCASE_SLOW redefinitionspyruvate
2014-04-15Major protocol changes, this commit breaks all network compatibility.irungentoo
Removed a bunch of useless space from various structs. pack_nodes() and unpack_nodes() are now used to transmit lists of nodes for the DHT and onion parts. They provide a way to transmit both ipv6 and ipv4 nodes in the same packet in a portable way that takes as little space as possible without compression. Using pack_nodes, merged the send nodes and send nodes ipv6 packets into one packet greatly reducing the risk of amplification attacks.
2014-02-18Astyled and added tests.irungentoo
2014-02-17Fixed test issue.irungentoo
2014-01-21random_nodes_path should return slightly better paths.irungentoo
Fixed test in network_test failing on some machines because of localhost ipv6 issues.
2013-12-07Added/updated some basic docs and cleaned up some things.irungentoo
2013-09-27Permit -Wshadow as useful warning.Coren[m]
2013-09-17astyled everything.irungentoo
2013-09-15Fix in ip_equal, plus testing code which led to that fix...Coren[m]
network.c: - use the correct macro for IPv4-in-IPv6 test network_test.c: - bunch of tests for addr_resolve() and ip_equal()