* extension_header
* fix logic error.
* Re-purposing the size field to act as the "minor version". Additional validation checks are added.
* PR Feedback.
* fix break due to bad merge with PR #3372
* remove store km lib and code
* fix
* more cleanup
* Apply suggestions from code review
Co-authored-by: Dave Thaler <dthaler1968@gmail.com>
---------
Co-authored-by: Dave Thaler <dthaler1968@gmail.com>
* replace XDP guids with XDP_TEST guids
* updated missde instance
* update bpf2c
* leave xdp_hook as is
* remove extra files
* update with new XDP_TEST guid, update other tests to use sample_ext
* update some tests, update test_helper
* update fuzzer
* temporarily remove bpftool tests
* update execution context test
* replace XDP guids with XDP_TEST guids
* updated missde instance
* update bpf2c
* leave xdp_hook as is
* remove extra files
* update with new XDP_TEST guid, update other tests to use sample_ext
* update some tests, update test_helper
* update fuzzer
* temporarily remove bpftool tests
* update execution context test
* build failures
* update sample ext with context_allocate and destroy
* update vm script to use xdp_test
* switch api tests to use sample program
* rename to xdp_Test
* update sample ext
* update incorrect SAL, update netsh tests
* update sample, update tests to use sample where applicable
* update tests
* fix up tests
* fix libbpf tets
* revert unnecessary changes
* remove extra prints
* add back in bpftool tests
* update to use xdp instead of xdp_test for bpftool test
* update atomic_instructions_others.o
* extra debug logs
* updated expected, update bpftool tests
* correct bpftool tests
* more debug logs
* add reg debug
* clear program info
* Attempt fix of buffer overrun
* remove debug logs, minor cleanup, set XDP guids back to their original names
* update docs with xdp_test
* fix guid usage
* CR: remove program, update comments, fix commented out tests, update bpf_program__attach_xdp
* revert changes in libbpf, as they need to use the actual XDP guids
* update comment
* update some XDP tests to use sample ext, comment out some expected failing tests
* update bpftool tests
* fix up bpf prog test run expected output, move to #if instead of comments
* fix up return code issue
* fix bpftool testes
* add some failed xdp tests, set some params to null for sample tests
* update comment
* tmp commit - move to xdp mock
* update unit tests to use mock XDP where possible
* made some samples back to XDP type
* netebpfext unit tests should use xdp_test
* CR
* Export new sock_addr specific helper function (windows only)
* Revert PR 1827, export new sock_addr specific helper function (windows only)
This reverts commit 80bc1cb737.
* add step re. adding standard user credentials as well
* incorporate PR feedback
* documentation fix from PR feedback
* clean up code
* fixing the build
* Update libs/ebpfnetsh/elf.cpp
Co-authored-by: Dave Thaler <dthaler@microsoft.com>
* fixing the build
* fixing the build
* fixing the build
* fixing the build
* fixing the build
* fixing the build
* revert HRESULT
* change BOOL type
* change BOOL type
* change BOOL type
* change BOOL type
* change BOOL type
* change BOOL type
* revert LPSERVICE_MAIN_FUNCTION
* revert SERVICE_MAIN_FUNCTION*
* SAL annotation for svcmain.cpp
* revert some SAL annotation
* remove some extra spaces
* fix tests
* change to bool type
* Update map_dll.c
* fix according to dll_main prototype
* fix BOOL
* fix according to dll_main prototype
* BOOl type
* BOOl type
* modify doc for self host runner setup
* modify doc for self host runner setup
* update tests with bool
* Update tests/unit/wer_report_test_wrapper.cpp
Co-authored-by: Dave Thaler <dthaler@microsoft.com>
* Update libs/platform/user/ebpf_platform_user.cpp
Co-authored-by: Dave Thaler <dthaler@microsoft.com>
* Update libs/ebpfnetsh/programs.cpp
Co-authored-by: Dave Thaler <dthaler@microsoft.com>
* change _Null_terminated_ to _Field_z_
* address PR comment
---------
Co-authored-by: Dave Thaler <dthaler@microsoft.com>
Co-authored-by: Gianni Trevisiol <gtrevi@users.noreply.github.com>
Co-authored-by: Alan Jowett <alanjo@microsoft.com>
* Clean up order of includes
Fixes#1963
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Update clang-format
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Clean up headers
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Update sort
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* FIx various build errors
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix ordering if including a .c file
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix cmake build
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* More header cleanup
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Update expected bpf2c output
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* More header fixes
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Update expected bpf2c output for custom bpf.c
The generate script does not handle this file.
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix tests
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix more expected bpf2c output
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
---------
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
Co-authored-by: Anurag Saxena <43585259+saxena-anurag@users.noreply.github.com>
Co-authored-by: Alan Jowett <alanjo@microsoft.com>
* Fix code analysis annotations for _In_ and _In_opt_ parameters,
add const where appropriate or change to _Inout_ where appropriate.
The following regex expressions were used to find the problems:
Find _In_ or _In_opt_ that are not const and are not followed by _Post_invalid_ or _Frees_ptr_ or _Post_ptr_invalid_:
```_In_[ ]+(?!.*(const|_Post_invalid_|_Frees_ptr_|_Post_ptr_invalid_))```
```_In_opt_[ ]+(?!.*(const|_Post_invalid_|_Frees_ptr_|_Post_ptr_invalid_))```
Some of the _In_ and _In_opt_ parameters are not const due to required compatibility with the Windows API.
Pointers to functions are const by definition, so the const qualifier is not required.
Signed-off-by: Alan Jowett <alanjo@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alanjo@microsoft.com>
* Fix code analysis failure
Signed-off-by: Alan Jowett <alanjo@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alanjo@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alanjo@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alanjo@microsoft.com>
Signed-off-by: Alan Jowett <alanjo@microsoft.com>
* Refactor netebpfext (#1351)
* refactor netebpfext to allow unit and fuzzing
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Normalize parameter casing
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Normalize types
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Fix release build
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Fix CMake build
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Fix NetEbpfExt_headers CMake target
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Rename unit to user
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Switch netebpfext_unit -> netebpfext_user
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Flesh out kernel thunk
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* More canonical naming and W4 clean
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Fix prefast issue
* Fix CMake
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Fix code analysis
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
* Clean up fw_thunk.h (#1369)
* Clean up fw_thunk.h
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix SAL annotations
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Netebpf ext unit test (#1365)
* Add netebfpext start/stop unit tests
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Update NMR thunk and expand netebpf_ext helper
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Fix code-analysis issues
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
* Remove duplicate NMR includes (#1370)
* Remove duplicate NMR includes
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback and more header cleanup
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
* Refactor NMR user mode to be thread safe (#1371)
* Refactor NMR user mode to be thread safe
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
* Add a unit test that tests classify_packet in user mode (#1379)
* Add packet test scaffolding
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Add test
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* More of test
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Add dummy packet to test
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Add dummy program
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Cleanup
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix mock NMR bug
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Temporarily add printfs
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Incorporate fix for 1378
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix test bug
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Add a packet-drop case to the test
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Try fixing include path
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix double free of workitem
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Revert unrelated changes in ebpfcore and ebpfapi
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
Co-authored-by: Alan Jowett <alanjo@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
* remove dependabot from the fork.
* Revert "remove dependabot from the fork."
This reverts commit c542c6cd44.
* Program info and hook NPI providers for sock_addr.
* Program info and hook NPI providers for sock_addr.
* PR Feedback.
* PR Feedback 2.
* wfp callout for sock_addr hook.
* PR Feedback.
* fix build break.
* remove dependabot from the fork.
* Revert "remove dependabot from the fork."
This reverts commit c542c6cd44.
* Program info and hook NPI providers for sock_addr.
* fix analysis break.
* PR Feedback.
* PR Feedback 2.
* fix crash.
* use NMR APIs.
* program info provider; bind program info
rename attach provider as hook provider
function renaming
* refactor hook providers.
* async client detach.
* cicd automation and documentation.
* PR Feedback.
* switch to server 2019.
Co-authored-by: Dave Thaler <dthaler@microsoft.com>
Co-authored-by: Alan Jowett <alanjo@microsoft.com>
* Allow attaching an XDP program to a specific ifindex
* Update tests since droppacket.o changed
* Add ifindex use back to droppacket.c for testing purposes
* Verify xdp program to unlink is actually an XDP program
* Add comment re moving xdp fd replace logic to execution context
* Add libbpf test and add support for bpf_xdp_query_id
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* add ingress interface index to xdp context.
* Address PR feedback.
Co-authored-by: Dave Thaler <dthaler@microsoft.com>
Co-authored-by: Alan Jowett <alanjo@microsoft.com>