summaryrefslogtreecommitdiff
path: root/server/IptablesBaseTest.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [NETD-TC#6] Clean up the dependency between FirewallController andwaynema2021-12-021-1/+1
| | | | | | | | TrafficController. Test: m; flash; boot Test: atest FirewallControllerTest TrafficControllerTest Change-Id: I0a8f3f2e9c1f4510021570e7894a56e4998f3ede
* Modernize codebase by replacing NULL with nullptrYi Kong2018-07-251-2/+2
| | | | | | | | Fixes -Wzero-as-null-pointer-constant warning. Test: m Bug: 68236239 Change-Id: I226a0599db4f7c3557e55cade7869d00bd314949
* netd: Enable clang-tidy and fix all warningsBernie Innocenti2018-06-071-1/+1
| | | | | | Bug: 65246407 Test: m netd && system/netd/tests/runtests.sh Change-Id: I1d22b2bc317fe7218ccde78859ed0623d6a1f8df
* Rename <cutils/log.h> to <log/log.h>Logan Chien2018-04-231-1/+1
| | | | | | Bug: 78370064 Test: lunch aosp_walleye-userdebug && cd system/netd && mma Change-Id: I495f7cdc3f2aab26947f10041fc559700367f2ea
* Move all tethering functionality into TetherController.Lorenzo Colitti2017-08-311-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This includes the entirety of NatController and relevant parts of BandwidthController (specifically, getTetherStats and its dependencies). This will make the code easier to understand and allow netd to privide a simpler API to the framework (e.g., by providing higher-level methods that perform what today are multiple operations from the framework's point of view). It will also reduce duplication of state (e.g., interface pairs kept by NatController partially overlap with downstream interfaces kept by TetherController) and avoid dependencies between controllers. This CL makes no functional changes. The only code changes are the ones necessary for compilation. Specifically: - Move some methods into IptablesBaseTest.cpp so they can be used from two test classes. - Change TetherController::iptablesRestoreFunction to the three-argument used by the erstwhile BandwidthController tests. Where appropriate, variable names have been changed, but strings that actually appear on device, such as iptables rule names, are left as is and will be changed in a future CL. Bug: 32163131 Bug: 64995262 Test: bullhead builds, boots Test: netd_{unit,integration}_test pass Change-Id: Idc80bfd424ce011826305f84b1cc98e741698601
* Delete all remaining callers of iptables.Lorenzo Colitti2017-08-191-77/+0
| | | | | | | | | | Also move to binder_test.cpp some string constants that are used only there. Bug: 28362720 Test: bullhead builds,boots Test: netd_{unit,integration}_test pass Change-Id: I9eee599aafa696cbf3a1f65c3814a33ed99d65fc
* Convert NatController to iptables-restore.Lorenzo Colitti2017-08-191-4/+4
| | | | | | | | | | | | | | | | | | | | | This conversion is a bit more involved than previous ones, mostly due to all the error unwinding. For the sake of readability, this change limits itself to converting mostly maintaining their order, with the exception that it puts the rpfilter rule before all the LOCAL_FORWARD rules to simplify error handling. It also groups commands together as much as possible to simplify error handling: because a set of iptables commands between "*<table>" and "COMMIT" will either all succeed or all fail, grouping commands together limits the number of required error handling paths. Bug: 28362720 Test: bullhead builds,boots Test: netd_{unit,integration}_test pass Change-Id: Idc0ef937583574ceb5b7a8b12ecbaf4c00a49f6d
* Merge "Va_end should be used with va_start"Treehugger Robot2017-06-191-0/+1
|\
| * Va_end should be used with va_startMikhail Lappo2017-03-231-0/+1
| | | | | | | | | | | | | | va_start is used and va_end should be invoked accordingly Change-Id: Ib894c5d20fa07d2e89859f04b4ac0d52d4aca51c
* | Use iptables-restore to set the incoming packet mark rule.Lorenzo Colitti2017-03-271-1/+11
|/ | | | | | | | | | | This speeds up network switching because one rule needs to be added/removed per interface. Bug: 28362720 Test: bullhead builds, boots Test: netd_{unit,integration}_test pass Test: watch -n1 "adb shell iptables -v -n -t mangle -L INPUT" while switching networks Change-Id: Ie536db6a50d018c88bb03c5f069965e99e0d162e
* Support pretending that certain iptables commands failed.Lorenzo Colitti2017-02-281-2/+17
| | | | | | Bug: 28362720 Test: see subsequent CL. Change-Id: Id4db5f481bd94ae04d2a5cf7c5c97be1f000c3c9
* Support reading output from IptablesRestoreController.Lorenzo Colitti2017-02-101-1/+14
| | | | | | | | | | | | | | | | Add the ability to IptablesRestoreController to return the output of a command. This is useful to run commands that list chains or return counters through the ip[6]tables-restore. Also enable unsigned-integer-overflow sanitization the unit tests because their behaviour should be representative of actual code. Having address sanitization enabled would have saved a fair amount of time debugging an on-device abort() that did not affect the tests. Test: new unit test passes Bug: 32323979 Change-Id: I70726ebbade0cb792aba38787c57378df177f2d8
* Add a test for NatController.Lorenzo Colitti2016-07-101-1/+13
| | | | | Bug: 9580643 Change-Id: I6ac3b754ec0b720674c6221e3a776314e86fe58c
* Add a test for getTetherStats.Lorenzo Colitti2016-07-081-0/+17
| | | | | Bug: 9580643 Change-Id: I26f7adb9639f1ddf4eda0c98bcc6cd3a83d3ba0b
* Don't crash the test if expecting more commands than were run.Lorenzo Colitti2016-05-161-1/+14
| | | | | Bug: 26675191 Change-Id: I54860c7cf7b79bb6ace89c3130467ba7c0473e03
* Use iptables-restore in StrictController startup.Lorenzo Colitti2016-03-301-4/+14
| | | | | Bug: 21725996 Change-Id: I2c049a934189f3c87ee15f052abc07d35814f0c9
* Add a test for StrictController.Lorenzo Colitti2016-03-301-4/+46
| | | | | | Bug: 21725996 Bug: 25691379 Change-Id: I24b838161eaf98dede2ae897157ba42414fc926f
* Move iptables test code to a new IptablesBaseTest class.Lorenzo Colitti2016-03-281-0/+68
Bug: 25691379 Bug: 21725996 Change-Id: Ia0598e60ad24714d53470e05849929831ba9dbf6