bpf: sockmap sample program
authorJohn Fastabend <john.fastabend@gmail.com>
Wed, 16 Aug 2017 05:33:32 +0000 (22:33 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 Aug 2017 18:27:53 +0000 (11:27 -0700)
commit69e8cc134bcbf0ccfcf852c400b8e6788d1d0038
tree181f7fc9d1a8204f93aa705e2725e7c5b766610c
parent8a31db5615667956c513d205cfb06885c3ec6d0b
bpf: sockmap sample program

This program binds a program to a cgroup and then matches hard
coded IP addresses and adds these to a sockmap.

This will receive messages from the backend and send them to
the client.

     client:X <---> frontend:10000 client:X <---> backend:10001

To keep things simple this is only designed for 1:1 connections
using hard coded values. A more complete example would allow many
backends and clients.

To run,

 # sockmap <cgroup2_dir>

Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
samples/bpf/bpf_load.c
samples/sockmap/Makefile [new file with mode: 0644]
samples/sockmap/sockmap_kern.c [new file with mode: 0644]
samples/sockmap/sockmap_user.c [new file with mode: 0644]
tools/include/uapi/linux/bpf.h
tools/lib/bpf/bpf.c
tools/lib/bpf/bpf.h
tools/testing/selftests/bpf/bpf_helpers.h