Граф коммитов

46 Коммитов

Автор SHA1 Сообщение Дата
Shankar Seal e9fdc9ed84
fixes. (#3422) 2024-04-03 15:44:59 +00:00
Shankar Seal fc973542c9
extension_header (#3326)
* 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
2024-03-30 17:27:09 +00:00
Dhiren Vispute a2ece4ba26
Bail if we can't enter rundown (not a fatal error in some instances) (#3148)
Co-authored-by: Dhiren Vispute <Dhiren.Vispute@microsoft.com>
2024-01-09 05:53:21 +00:00
Anurag Saxena f6a478842a
Remove store km lib and code (#3109)
* 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>
2023-12-12 13:53:04 +00:00
Anurag Saxena 3f5e0ba1ba
Separate out undocked components. (#3055)
* remove not-needed includes

* fix

* fix

* update sample extension

* change include path

* export store APIs from ebpfapi.dll

* fix analyze build

* update dependencies

* add undocked projects

* undock sample_ext driver

* fix build

* more undocking

* fix build

* remove undocked projects from fuzzerdebug

* fix nuget

* remove usersim from export_program_info

* fix configuration manager

* fix tests

* skip building undocked samples for FuzzerDebug builds

* fix build

* try cicd changes

* fix cicd yml

* update export_program_info to not clean up all entries

* code cleanup

* delete global helpers from the store

* code cleanup

* export *delete* store APIs from ebpfapi

* code cleanup

* CR comments

* cr comments

* remove ansi APIs

* CR comments

* cr comments

* fix CI failure

* fix rebase build issues

* change default custom type to bind

* some more fixes

* fix tests

* fix tests

* update expected files

* fix bpf2c tests

* run export_program_info

* fix headers

* CR comments
2023-12-07 21:10:19 +00:00
Matthew Ige 2000dafc4e
Remove XDP hook support from netebpfext.sys (#3040)
* 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
2023-12-06 17:12:17 +00:00
Dhiren Vispute aa07ff485f
Add rundown protection for filter_context (#3017)
Co-authored-by: Dhiren Vispute <Dhiren.Vispute@microsoft.com>
2023-11-30 00:07:44 +00:00
Dhiren Vispute 2ce05511f0
Add missing traces, some drive-by clean-up (#2750)
Co-authored-by: Dhiren Vispute <dhiren.vispute@microsoft.com>
2023-08-29 19:26:03 +00:00
Gianni Trevisiol 4cb79e547d
Isolate eBPF store APIs into atomic km & um libraries. (#2690)
* draft

* wip

* wip

* wip

* wip

* wip - km & um compile

* fix

* fix include order

* wip

* wip

* wip

* wip - api_common

* wip - updated projects

* wip

* wip

* fix merge issues

* wip

* fix C28196/C6387

* wip

* wip

* fix SAL

* cleanup

* fix SAL bugs

* wip - cmake

* add cmake files

* wip

* wip

* update msi artifacts

* wip

* cleanup

* collapse null-checks

* clean-up headers

* refactor return types to ebpf_result_t

* replace ebpf_registry_result_t with ebpf_result_t

* update header

* remove cpp wrapper, misc cleanup.

* rename um/km registry helpers

* cleanup

* cleanup

* update

* nit

* fix

* Added KERNEL_MODE var, so to default to USER_MODE.

* fix cmake

* align result var names with ebpf_result_t

* pr feedback

* add project refs

* Add NativeOnly* cfgs to ebpf_store_helper_km

* Update docs, API reordering in source.

* pr feedback

* Rename types to abstract use of registry

* Normalize all registry API names.

* rename

* merge sln

* fix var typo

* refactor store root keys

* feedback

* doc/comments

* remove KERNEL_MODE

* Force ignore format on all preprocessor code paths.
2023-08-07 19:53:24 +00:00
Shankar Seal 2ef233b09f
trace_refactor. (#2371)
* trace_refactor.

* Fix.
2023-05-02 06:24:46 +00:00
Sharmi 817b2e2b68
Add fault injection in ndis_um.cpp (#2359) 2023-04-21 15:49:19 +00:00
Dave Thaler 35f909deb9
Allow various structs to be const (#2306)
Fixes #2145

Signed-off-by: Dave Thaler <dthaler@microsoft.com>
2023-04-12 17:47:39 +00:00
Alan Jowett 240fbb16d8
Convert single line if to if with braces (#2224)
Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2023-03-27 15:01:21 +00:00
Anurag Saxena caa05287b1
Enable low memory simulation for netebpfext unit tests. (#2170)
* add test

* bugfix

* bugfix

* add low_memory_full test

* cr comments

* fix cicd.yml error

* fix, cr comments

* fix build break

* cr comments

* update environment
2023-03-13 18:38:41 +00:00
Gianni Trevisiol 1f6d85c999
Wrap registry APIs behind store APIs. (#2114)
* Wrap registry APIs

* pr feedback

* PR feedback: revert splitting implementation from .

* nit

* nit

* nit

* rev

* fix unicode size calc

* remove redundant success check

* revert string length calculation, var rename

* var rename for clarity

* revise store api location, reorg externals

* add error trace, fix cmake

* convert error codes
2023-03-06 23:10:51 +00:00
Dhiren Vispute bebb9a14cd
Export new sock_addr specific helper function (windows only) (#2091)
* 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
2023-02-22 20:43:23 +00:00
Michael Friesen 2d5d3175b5
XDP: complete TX clones upon injection failure (#2013)
* complete TX clones upon inject failure

* satisfy static analyzer

* fix dispatch input parameter, and ignore output

---------

Co-authored-by: Alan Jowett <alanjo@microsoft.com>
Co-authored-by: Anurag Saxena <43585259+saxena-anurag@users.noreply.github.com>
2023-02-17 18:59:13 +00:00
Delaram Amiri 4283733f25
Replace Windows style type names with types names that match the coding guidelines (#2019)
* 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>
2023-02-16 11:56:32 -08:00
Dave Thaler 3d626ff9c1
Clean up order of includes (#2015)
* 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>
2023-02-07 18:32:19 +00:00
Michael Friesen 096f10f7b1
perform a default action if the XDP program fails (#2003)
* perform a default action if the XDP program fails

* drop instead of pass upon program failure
2023-02-03 21:13:36 +00:00
Alan Jowett 9f46c2ad90
Implement context handling for netebpfext (#1840)
Signed-off-by: Alan Jowett <alanjo@microsoft.com>

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2023-01-10 19:22:20 +00:00
Anurag Saxena 80bc1cb737
Support for extension to get the program context (#1827)
* fix

* update doc

* cleanup

* Apply suggestions from code review

Co-authored-by: Dave Thaler <dthaler@microsoft.com>

* fix build break

* cr comments

* fix netebpfext um

* Update netebpfext/net_ebpf_ext_prog_info_provider.c

Co-authored-by: Dave Thaler <dthaler@microsoft.com>

* fix break

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2023-01-09 20:38:16 +00:00
Alan Jowett 0b293ad804
Fix code analysis annotations for In and In_opt parameters by adding const where appropriate or changing to Inout where appropriate. (#1749)
* 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>
2022-12-15 15:58:33 -08:00
Anurag Saxena 8fd3acf528
Connect redirect implementation (#1651)
* draft fix

* fix

* demo

* fix initial ref counts

* fix

* cleanup

* backup

* checkpoint

* backup

* tests working

* fix analyze errors

* fix netebpfext build / bad merge

* sln file update

* v6 tests

* fix netebpfext user build

* refactor connect_redirect tests

* netebpfext changes

* fix tests

* fix netebpfext user tests

* fix sal

* add sublayer, remove filter_instance

* fix

* fix

* driver_tests

* fix bad merge

* fix scripts

* fix driver tests script

* driver tests script

* script fix

* add trace to debug failure

* fix driver test script

* create context only on allow, and create 2 contexts

* fix script

* netsh fix

* fix scripts

* add tests for pure v4 and v6 sockets

* fix test

* v6 test vm addresses

* remove commented code

* code cleanup

* cleanup

* remove bad_map_name files

* cleanup

* fix tests print statements

* Apply suggestions from code review

Co-authored-by: Dave Thaler <dthaler@microsoft.com>

* CR comments, fixes

* update connection context key, address CR comments

* fix build break, cr comments

* cr comments

* cr comments

* rename

* fix test script

* CR comments

* cleanup

* Apply suggestions from code review

Co-authored-by: Dave Thaler <dthaler@microsoft.com>

* fix

* cr comments

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2022-11-29 20:49:42 +00:00
Dhiren Vispute a96025afd4
Replace KdPrintEx calls (n NetEbpfExt) with Trace logging calls (#1466) (#1536)
Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2022-10-31 16:47:32 -07:00
Dave Thaler 0543c810a7
Refactor netebpfext in preparation for fuzz testing (#1464)
* 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>
2022-10-18 13:21:54 -06:00
Shankar Seal e4ccdc8b1c
Implement `bpf_prog_detach` and `bpf_prog_detach2` APIs. (#1311)
* Implement bpf_prog_detach and bpf_prog_detach2 APIs.

* fix SAL break.

* PR feedback.

* PR feedback and test changes.

* PR feedback.
2022-08-07 17:21:23 -07:00
saxena-anurag 02f4bf016f
Clean up hard coded program type in EC (#1294)
* fix

* update documentation

* add bpf_obj_get_info_by_fd tests for cgroup_sock_addr

* fix

* cr comment
2022-07-15 13:48:45 -07:00
saxena-anurag 1160f7914e
Registry changes for program and section data. (#1192)
* fix

* backup

* fix backup

* msbuild compiling

* fix release build

* fixes

* cmake build fix

* fix cmake build

* fix analyse build

* fix

Signed-off-by: Anurag Saxena <43585259+saxena-anurag@users.noreply.github.com>

* fix expected output

* add pre step for tests

* add pre step for tests

* add -s option, revert this later

* Revert "add -s option, revert this later"

This reverts commit 1f42d100e4.

* code cleanup

Signed-off-by: Anurag Saxena <anusa@microsoft.com>

* rename driver_registry_helper.h

* delete bpf_structs.h

* fix

* hardcode HKLM

* code cleanup

* fix

* backup

* fix backup

* msbuild compiling

* fix release build

* fixes

* cmake build fix

* fix cmake build

* fix analyse build

* fix

Signed-off-by: Anurag Saxena <43585259+saxena-anurag@users.noreply.github.com>

* add pre step for tests

* add pre step for tests

* add -s option, revert this later

* Revert "add -s option, revert this later"

This reverts commit 1f42d100e4.

* code cleanup

Signed-off-by: Anurag Saxena <anusa@microsoft.com>

* rename driver_registry_helper.h

* delete bpf_structs.h

* fix

* hardcode HKLM

* code cleanup

* fix build break

* fix build break, enable warning

* fix bad merge

* cleanup

* fix

* fix tests

* add tests, make ebpf_store_helper platform agnostic

* fixes, cleanup, common code for store APIs

* fix cmake build, driver tests

* cleanup

* code cleanup

* cr comments

* code cleanup

* cleanup

* bugfix

* Apply suggestions from code review

Co-authored-by: Dave Thaler <dthaler@microsoft.com>

* cr comments

* fix build break

* move UM read store APIs to a different file

* cr comments

* cr comments

* cr comments

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2022-06-30 16:53:03 -07:00
Shankar Seal 26624388ea
Add tracelog to netebpfext. (#1247)
* Add tracelog to netebpfext.

* Apply suggestions from code review

Co-authored-by: Dave Thaler <dthaler@microsoft.com>

* PR feedback.

* Fix.

* PR feedback.

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2022-06-30 15:08:02 -07:00
Shankar Seal 025639ba33
Use EX_RUNDOWN_REF for netebpfext rundown. (#1251)
* fix

* fix

* fix.

* fix.

* fix.
2022-06-28 17:52:54 -07:00
Shankar Seal ec26f5d273
WFP ALE Flow established callout, tests etc. (#978)
* WFP ALE Flow established callout, tests etc.

* PR Feedback.

* bug fixes.

* PR feedback 2.
2022-04-20 16:48:20 -07:00
Shankar Seal 745bac282e
Sock addr hook callout test (#922)
* remove dependabot from the fork.

* Revert "remove dependabot from the fork."

This reverts commit c542c6cd44.

* Program info and hook NPI providers for sock_addr.

* PR Feedback.

* PR Feedback 2.

* sock_addr hook tests.

* PR feedback.

* PR Feedback 2.

* fix.
2022-04-12 11:37:44 -07:00
Shankar Seal a9ab3370d5
`bpf_prog_attach` API and other changes. (#891)
* 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.
2022-04-07 18:18:53 -07:00
Shankar Seal 04582d3f50
Sock addr hook (#871)
* 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.
2022-04-05 16:37:34 -07:00
Shankar Seal ecea57b4d8
Change extensions npiid (#841)
* remove dependabot from the fork.

* change extension provider NPI IDs.

* PR feedback.

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2022-03-28 11:26:19 -07:00
Shankar Seal a8e3a30767
Support attaching XDP program per NIC. (#803)
* Support attaching XDP program per NIC.

* PR Feedback.

* fix bug.

* PR Feedback.
2022-03-14 15:16:11 -07:00
Shankar Seal 40915b0d15
Netebpfext refactor (#776)
* 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>
2022-02-25 17:53:12 -08:00
Dave Thaler 59c0b4e185
Allow attaching an XDP program to a specific ifindex (#755)
* 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>
2022-02-14 16:40:56 -08:00
saxena-anurag 3b118fa779
netebpfext fix (#663) 2021-11-18 14:24:55 -08:00
Shankar Seal 01384c7880
Add filter in outbound L2 layer. (#641)
* Add filter in outbound L2 layer.

* PR Feedback.

* Apply suggestions from code review

Co-authored-by: Dave Thaler <dthaler@microsoft.com>

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2021-10-20 21:18:31 -07:00
Shankar Seal 4dfff59f49
make bpf_csum_diff a global helper. (#625)
* make bpf_csum_diff a global helper.
2021-10-04 11:29:36 -07:00
Shankar Seal 97bd9cf7f6
add ingress interface index to xdp context. (#623)
* 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>
2021-10-04 10:53:42 -06:00
Shankar Seal b04620eeee
bpf_xdp_adjust_head Part 2 (#566)
* bpf_xdp_adjust_head Part 2

* PR Feedback.

* Fix csum_diff algorithm to use 1's complement arithmetic.
2021-09-21 09:46:35 -06:00
Shankar Seal e84efdf092
Xdp adjust head part1 (#522)
xdp_adjust_head : Part 1
2021-09-13 17:46:23 -07:00
Shankar Seal 4d4c5b5cc7
refactor net_ebpf_ext (#520)
* refactor net_ebpf_ext
2021-09-13 14:46:43 -07:00