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

21 Коммитов

Автор SHA1 Сообщение Дата
Dave Thaler 90eee8717e
Expose interface luid and compartment id to sock_ops and sock_addr hooks (#1222)
* Add interface luid to bpf_sock_addr and bpf_sock_ops

And also add compartment id to bpf_sock_ops for consistency with
bpf_sock_addr, so that it is available to eBPF programs.

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Expose interface luid and compartment id to sock_ops and sock_addr hooks

* compartment_id was exposed to sock_addr but not sock_ops
* interface_luid was not exposed to either

Exposing the interface_luid should be a performant way to compensate for
lack of scope_id in the hooks, since the interface luid is available
in the WFP callout, and is more specific than a scope id (so a scope id
can always be looked up from the interface luid in the future if
needed).

Fixes #1129

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Update expected bpf2c output

Signed-off-by: Dave Thaler <dthaler@microsoft.com>
2022-06-17 09:31:48 -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 a1a2c6ad92
Sockops 1 (#952)
* remove dependabot from the fork.

* Revert "remove dependabot from the fork."

This reverts commit c542c6cd44.

* add sock_ops program and attach types.

* PR Feedback.
2022-04-14 15:09:54 -07:00
Dave Thaler 4cd7d96b99
Fix doxygen output (#940)
Several fields were missing descriptions in the generated docs.
This PR fixes the docs to actually show the relevant descriptions.

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

Co-authored-by: Alan Jowett <alanjo@microsoft.com>
2022-04-13 12:29:41 -06:00
Dave Thaler 2f5ac3fbe9
Add some header file names included by typical eBPF programs (#916)
* Add some header file names included by typical eBPF programs

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* PR feedback

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix test

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Remove unneeded include

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Add _MSC_VER checks around pragma warnings in ebpf program headers

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Use full path to avoid requiring an include path

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

Co-authored-by: Alan Jowett <alanjo@microsoft.com>
2022-04-11 13:26:49 -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 f896c5244e
Add BPF_PROG_TYPE_CGROUP_SOCK_ADDR support (#858)
* Add BPF_PROG_TYPE_CGROUP_SOCK_ADDR program type and CGROUP_INET4/6_CONNECT/RECV_ACCEPT attach types.

* PR Feedback #1.

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2022-03-31 19:49:13 -07:00
Dave Thaler 08c2cbb9a7
Add support for bpf_printk helper without additional arguments (#796)
* Initial version of bpf_printk support

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Convert printk.c sample to use bind hook instead of xdp hook

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Add wprp file to deployment script

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Unify UM and KM platforms as much as possible for printk support

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix annotation

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Work around compiler warning

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix comment

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix keyword

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix test when -s is used

Signed-off-by: Dave Thaler <dthaler@microsoft.com>
2022-03-08 16:38:48 -08:00
Shankar Seal 91e74be955
ring buffer map. (#659)
* ring buffer map.

* PR Feedback iteration 0.

* PR Feedback iteration 1

* Fix race.

* PR Feedback iteration 2

* bugfix.

* Bug fix.

* Fix test issue

* PR Feedback.

* Update libs/api_common/device_helper.cpp

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2021-12-03 13:19:21 -08:00
Dave Thaler b771bac9bd
Update docs (#665)
* Update docs

Fixes #651
Fixes #655

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix xdp_hook_t documentation

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Address CR comment

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

Co-authored-by: Alan Jowett <alanjo@microsoft.com>
2021-11-19 17:10:49 -08: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
saxena-anurag deea7819c9
fix (#615)
Co-authored-by: Alan Jowett <alanjo@microsoft.com>
2021-09-30 09:37:46 -07: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 acb6859758
Support for xdp_tx. (#498)
* xdp_tx

* Fix analysis error.

* update documentation.

* IPv6 tests.

* Apply suggestions from code review
2021-09-09 22:34:03 -07:00
Dave Thaler 569da02a8f
Add main API reference page (#329)
Which will fill in content visible at https://microsoft.github.io/ebpf-for-windows/

Fixes #259

Signed-off-by: Dave Thaler <dthaler@microsoft.com>
2021-07-07 10:39:59 -07:00
Dave Thaler e4da7ee04a
Update hook prototypes to be usable by eBPF programs for sanity checking (#327)
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
2021-07-01 17:21:33 -06:00
Dave Thaler 213620aead
Add doxygen docs on hooks (#326)
This PR is the second of three steps towards fully addressing #259

The doxygen \ref annotation tells doxygen to make the following word
be linked to the appropriate location in the generated docs.

Signed-off-by: Dave Thaler <dthaler@microsoft.com>
2021-07-01 15:27:24 -06:00
Dave Thaler e825caaa8e
Add doxygen documentation on enum values (#322)
* Make all enum values have a description in the generated API docs
* Also remove SAL annotation from the generated docs, since SAL
  breaks doxygen type detection

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

Co-authored-by: Alan Jowett <alanjo@microsoft.com>
2021-06-30 10:22:40 -06:00
Dave Thaler b2a41eae21
Put hook and helper APIs in common headers (#142)
Fixes #138

Signed-off-by: Dave Thaler <dthaler@ntdev.microsoft.com>
2021-05-06 13:47:09 -07:00