android_kernel_msm-6.1_noth.../include/uapi/linux
Jamal Hadi Salim ef6980b6be introduce IFE action
This action allows for a sending side to encapsulate arbitrary metadata
which is decapsulated by the receiving end.
The sender runs in encoding mode and the receiver in decode mode.
Both sender and receiver must specify the same ethertype.
At some point we hope to have a registered ethertype and we'll
then provide a default so the user doesnt have to specify it.
For now we enforce the user specify it.

Lets show example usage where we encode icmp from a sender towards
a receiver with an skbmark of 17; both sender and receiver use
ethertype of 0xdead to interop.

YYYY: Lets start with Receiver-side policy config:
xxx: add an ingress qdisc
sudo tc qdisc add dev $ETH ingress

xxx: any packets with ethertype 0xdead will be subjected to ife decoding
xxx: we then restart the classification so we can match on icmp at prio 3
sudo $TC filter add dev $ETH parent ffff: prio 2 protocol 0xdead \
u32 match u32 0 0 flowid 1:1 \
action ife decode reclassify

xxx: on restarting the classification from above if it was an icmp
xxx: packet, then match it here and continue to the next rule at prio 4
xxx: which will match based on skb mark of 17
sudo tc filter add dev $ETH parent ffff: prio 3 protocol ip \
u32 match ip protocol 1 0xff flowid 1:1 \
action continue

xxx: match on skbmark of 0x11 (decimal 17) and accept
sudo tc filter add dev $ETH parent ffff: prio 4 protocol ip \
handle 0x11 fw flowid 1:1 \
action ok

xxx: Lets show the decoding policy
sudo tc -s filter ls dev $ETH parent ffff: protocol 0xdead
xxx:
filter pref 2 u32
filter pref 2 u32 fh 800: ht divisor 1
filter pref 2 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:1  (rule hit 0 success 0)
  match 00000000/00000000 at 0 (success 0 )
        action order 1: ife decode action reclassify
         index 1 ref 1 bind 1 installed 14 sec used 14 sec
         type: 0x0
         Metadata: allow mark allow hash allow prio allow qmap
        Action statistics:
        Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
        backlog 0b 0p requeues 0
xxx:
Observe that above lists all metadatum it can decode. Typically these
submodules will already be compiled into a monolithic kernel or
loaded as modules

YYYY: Lets show the sender side now ..

xxx: Add an egress qdisc on the sender netdev
sudo tc qdisc add dev $ETH root handle 1: prio
xxx:
xxx: Match all icmp packets to 192.168.122.237/24, then
xxx: tag the packet with skb mark of decimal 17, then
xxx: Encode it with:
xxx:	ethertype 0xdead
xxx:	add skb->mark to whitelist of metadatum to send
xxx:	rewrite target dst MAC address to 02:15:15:15:15:15
xxx:
sudo $TC filter add dev $ETH parent 1: protocol ip prio 10  u32 \
match ip dst 192.168.122.237/24 \
match ip protocol 1 0xff \
flowid 1:2 \
action skbedit mark 17 \
action ife encode \
type 0xDEAD \
allow mark \
dst 02:15:15:15:15:15

xxx: Lets show the encoding policy
sudo tc -s filter ls dev $ETH parent 1: protocol ip
xxx:
filter pref 10 u32
filter pref 10 u32 fh 800: ht divisor 1
filter pref 10 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:2  (rule hit 0 success 0)
  match c0a87aed/ffffffff at 16 (success 0 )
  match 00010000/00ff0000 at 8 (success 0 )

	action order 1:  skbedit mark 17
	 index 6 ref 1 bind 1
 	Action statistics:
	Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
	backlog 0b 0p requeues 0

	action order 2: ife encode action pipe
	 index 3 ref 1 bind 1
	 dst MAC: 02:15:15:15:15:15 type: 0xDEAD
 	 Metadata: allow mark
 	Action statistics:
	Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
	backlog 0b 0p requeues 0
xxx:

test by sending ping from sender to destination

Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-03-01 17:15:22 -05:00
..
android
byteorder
caif
can can: avoid using timeval for uapi 2015-10-13 17:42:34 +02:00
cifs
dvb [media] include/uapi/linux/dvb/video.h: remove stdint.h include 2015-11-19 08:18:38 -02:00
genwqe
hdlc
hsi HSI: cmt_speech: fix timestamp interface 2015-06-23 02:40:03 +02:00
iio iio: resistance: add IIO_RESISTANCE channel type 2015-09-23 20:23:25 +01:00
isdn
mmc mmc: block: Add new ioctl to send multi commands 2015-10-26 16:00:00 +01:00
netfilter netfilter: nft_ct: add byte/packet counter support 2016-01-08 14:44:09 +01:00
netfilter_arp netfilter: fix include files for compilation 2015-11-23 17:54:38 +01:00
netfilter_bridge netfilter: fix include files for compilation 2015-11-23 17:54:38 +01:00
netfilter_ipv4 netfilter: fix include files for compilation 2015-11-23 17:54:38 +01:00
netfilter_ipv6 netfilter: fix include files for compilation 2015-11-23 17:54:38 +01:00
nfsd
raid drivers: md: use ktime_get_real_seconds() 2016-01-06 11:39:53 +11:00
spi
sunrpc
tc_act introduce IFE action 2016-03-01 17:15:22 -05:00
tc_ematch
usb [media] uvcvideo: Enable UVC 1.5 device detection 2015-11-19 11:13:19 -02:00
wimax
a.out.h
acct.h
adb.h
adfs_fs.h
affs_hardblocks.h
agpgart.h include/uapi/linux/agpgart.h: include stdlib.h in userspace 2015-12-10 12:33:23 +01:00
aio_abi.h
am437x-vpfe.h
apm_bios.h
arcfb.h
atalk.h
atm.h
atm_eni.h
atm_he.h
atm_idt77105.h
atm_nicstar.h
atm_tcp.h
atm_zatm.h atm: remove 'struct zatm_t_hist' 2015-10-05 03:16:46 -07:00
atmapi.h
atmarp.h
atmbr2684.h
atmclip.h
atmdev.h
atmioc.h
atmlec.h
atmmpc.h
atmppp.h
atmsap.h
atmsvc.h
audit.h Merge branch 'upstream' of git://git.infradead.org/users/pcmoore/audit 2015-09-08 13:34:59 -07:00
auto_fs.h
auto_fs4.h
auxvec.h
ax25.h
b1lli.h
baycom.h
bcache.h
bcm933xx_hcs.h
bfs_fs.h
binfmts.h
blkpg.h mtd: provide proper 32/64-bit compat_ioctl() support for BLKPG 2015-09-29 13:37:04 -07:00
blktrace_api.h
bpf.h bpf: fix csum update in bpf_l4_csum_replace helper for udp 2016-02-21 22:07:10 -05:00
bpf_common.h
bpqether.h
bsg.h
btrfs.h btrfs: extend balance filter usage to take minimum and maximum 2015-10-26 19:38:30 -07:00
can.h
capability.h
capi.h
cciss_defs.h
cciss_ioctl.h
cdrom.h
cgroupstats.h
chio.h
cm4000_cs.h
cn_proc.h
coda.h
coda_psdev.h
coff.h
connector.h
const.h
cramfs_fs.h
cryptouser.h crypto: user - Add CRYPTO_MSG_DELRNG 2015-06-22 15:49:27 +08:00
cuda.h
cyclades.h
cycx_cfm.h
dcbnl.h dcb : Fix incorrect documentation for struct dcb_app 2015-06-23 07:00:41 -07:00
dccp.h
devlink.h Introduce devlink infrastructure 2016-03-01 16:07:29 -05:00
dlm.h
dlm_device.h dlm: fix lvb copy for user locks 2015-08-25 14:41:50 -05:00
dlm_netlink.h
dlm_plock.h
dlmconstants.h
dm-ioctl.h dm: add support for passing through persistent reservations 2015-10-31 19:05:59 -04:00
dm-log-userspace.h
dn.h
dqblk_xfs.h
edd.h
efs_fs_sb.h
elf-em.h elf-em.h: move EM_MICROBLAZE to the common header 2015-09-10 06:54:15 +02:00
elf-fdpic.h
elf.h
elfcore.h
errno.h
errqueue.h
ethtool.h net: ethtool: add new ETHTOOL_xLINKSETTINGS API 2016-02-25 22:06:45 -05:00
eventpoll.h epoll: add EPOLLEXCLUSIVE flag 2016-01-20 17:09:18 -08:00
fadvise.h
falloc.h
fanotify.h
fb.h
fcntl.h
fd.h
fdreg.h
fib_rules.h fib: Add fib rule match on tunnel id 2015-07-21 10:39:06 -07:00
fiemap.h
filter.h
firewire-cdev.h
firewire-constants.h
flat.h
fou.h
fs.h block: revert runtime dax control of the raw block device 2016-01-30 13:35:31 -08:00
fsl_hypervisor.h
fuse.h fuse: add support for SEEK_HOLE and SEEK_DATA in lseek 2015-11-10 10:32:37 +01:00
futex.h
gameport.h
gen_stats.h
genetlink.h openvswitch: allow management from inside user namespaces 2016-02-11 09:53:19 -05:00
gfs2_ondisk.h gfs2: change gfs2 readdir cookie 2015-12-14 12:19:37 -06:00
gigaset_dev.h
gsmmux.h tty: linux/gsmmux.h needs linux/types.h 2015-07-23 17:48:43 -07:00
hash_info.h keys, trusted: select hash algorithm for TPM2 chips 2015-12-20 15:27:12 +02:00
hdlc.h
hdlcdrv.h
hdreg.h
hid.h
hiddev.h
hidraw.h
hpet.h
hsr_netlink.h
hw_breakpoint.h
hyperv.h tools: hv: report ENOSPC errors in hv_fcopy_daemon 2015-12-14 19:12:21 -08:00
hysdn_if.h
i2c-dev.h i2c-dev: Fix typo in ioctl name reference 2015-10-23 23:26:43 +02:00
i2c.h
i2o-dev.h
i8k.h
icmp.h
icmpv6.h
if.h
if_addr.h
if_addrlabel.h
if_alg.h
if_arcnet.h arcnet: fix indentation of if_arcnet.h 2015-09-23 08:44:22 +02:00
if_arp.h
if_bonding.h
if_bridge.h bridge: mcast: add support for more router port information dumping 2016-03-01 16:55:07 -05:00
if_cablemodem.h
if_eql.h
if_ether.h ether: add IEEE 1722 ethertype - TSN 2015-09-09 22:06:29 -07:00
if_fc.h
if_fddi.h
if_frad.h
if_hippi.h
if_infiniband.h
if_link.h net: Add support for fill_slave_info to VRF device 2016-02-07 14:02:22 -05:00
if_ltalk.h
if_packet.h packet: add extended BPF fanout mode 2015-08-17 14:22:48 -07:00
if_phonet.h
if_plip.h
if_ppp.h
if_pppol2tp.h
if_pppox.h
if_slip.h
if_team.h
if_tun.h macvtap/tun: cross-endian support for little-endian hosts 2015-06-01 15:48:56 +02:00
if_tunnel.h ip_gre: Add support to collect tunnel metadata. 2015-08-10 14:03:54 -07:00
if_vlan.h
if_x25.h
igmp.h
ila.h ila: Add generic ILA translation facility 2015-12-15 23:25:20 -05:00
in.h api: fix compatibility of linux/in.h with netinet/in.h 2015-06-29 18:56:21 -07:00
in6.h ipv6: add IPV6_HDRINCL option for raw sockets 2015-12-17 15:12:28 -05:00
in_route.h
inet_diag.h net: inet_diag: export IPV6_V6ONLY sockopt 2015-06-24 02:51:39 -07:00
inotify.h
input-event-codes.h Input: add input-event-codes header file 2015-10-16 15:32:05 -07:00
input.h Input: evdev - add event-mask API 2015-10-26 19:06:48 -07:00
ioctl.h
ip.h ipv4: add option to drop gratuitous ARP packets 2016-02-11 04:27:35 -05:00
ip6_tunnel.h
ip_vs.h ipvs: add more mcast parameters for the sync daemon 2015-08-21 09:10:11 -07:00
ipc.h
ipmi.h
ipmi_msgdefs.h
ipsec.h
ipv6.h net: ipv6: Make address flushing on ifdown optional 2016-02-25 21:45:15 -05:00
ipv6_route.h
ipx.h
irda.h
irqnr.h
isdn.h
isdn_divertif.h
isdn_ppp.h
isdnif.h
iso_fs.h
ivtv.h
ivtvfb.h
ixjuser.h
jffs2.h
joystick.h
Kbuild Merge branch 'for-4.5/nvme' of git://git.kernel.dk/linux-block 2016-01-21 19:58:02 -08:00
kcmp.h
kd.h
kdev_t.h
kernel-page-flags.h proc: export idle flag via kpageflags 2015-09-10 13:29:01 -07:00
kernel.h
kernelcapi.h
kexec.h
keyboard.h
keyctl.h
kfd_ioctl.h drm/amdkfd: add H/W debugger IOCTL set definitions 2015-06-03 11:32:07 +03:00
kvm.h KVM: s390: implement the RI support of guest 2016-01-07 14:48:26 +01:00
kvm_para.h
l2tp.h
libc-compat.h api: fix compatibility of linux/in.h with netinet/in.h 2015-06-29 18:56:21 -07:00
lightnvm.h lightnvm: introduce factory reset 2016-01-12 08:21:18 -07:00
limits.h
lirc.h [media] bz#75751: Move internal header file lirc.h to uapi/ 2015-11-17 06:47:43 -02:00
llc.h
loop.h block: loop: introduce ioctl command of LOOP_SET_DIRECT_IO 2015-09-23 11:01:16 -06:00
lp.h
lwtunnel.h lwtunnel: remove source and destination UDP port config option 2015-09-24 14:31:37 -07:00
magic.h Merge branch 'overlayfs-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs 2016-01-21 12:20:46 -08:00
major.h
map_to_7segment.h
matroxfb.h
mdio.h
media-bus-format.h
media.h [media] Postpone the addition of MEDIA_IOC_G_TOPOLOGY 2016-01-11 12:35:17 -02:00
mei.h mei: add async event notification ioctls 2015-08-03 17:30:00 -07:00
membarrier.h sys_membarrier(): system-wide memory barrier (generic, x86) 2015-09-11 15:21:34 -07:00
memfd.h
mempolicy.h
meye.h
mic_common.h misc: mic: Update MIC host daemon with COSM changes 2015-10-04 12:54:54 +01:00
mic_ioctl.h
mii.h
minix_fs.h
mman.h
mmtimer.h
module.h
mpls.h mpls: Use definition for reserved label checks 2015-08-03 22:35:00 -07:00
mpls_iptunnel.h mpls: ip tunnel support 2015-07-21 10:39:05 -07:00
mqueue.h
mroute.h net: ipmr: fix code and comment style 2015-11-23 15:06:38 -05:00
mroute6.h
msdos_fs.h
msg.h
mtio.h
n_r3964.h
nbd.h
ncp.h
ncp_fs.h
ncp_mount.h
ncp_no.h
ndctl.h libnvdimm: Add DSM support for Address Range Scrub commands 2015-07-27 22:53:19 -04:00
neighbour.h net: add explicit logging and stat for neighbour table overflow 2015-08-10 13:46:21 -07:00
net.h
net_dropmon.h
net_namespace.h
net_tstamp.h
netconf.h ipv4: add support for linkdown sysctl to netconf 2015-07-08 23:34:53 -07:00
netdevice.h
netfilter.h netfilter: don't pull include/linux/netfilter.h from netns headers 2015-06-18 21:14:31 +02:00
netfilter_arp.h
netfilter_bridge.h netfilter: fix include files for compilation 2015-11-23 17:54:38 +01:00
netfilter_decnet.h
netfilter_ipv4.h
netfilter_ipv6.h
netlink.h netlink: remove mmapped netlink support 2016-02-18 11:42:18 -05:00
netlink_diag.h netlink: remove mmapped netlink support 2016-02-18 11:42:18 -05:00
netrom.h
nfc.h NFC: netlink: Add missing NFC_ATTR comments 2015-10-27 03:55:10 +01:00
nfs.h nfs: use btrfs ioctl defintions for clone 2015-11-23 21:53:08 -05:00
nfs2.h
nfs3.h
nfs4.h NFS: Update NFS4_BITMAP_SIZE 2015-08-27 19:44:53 -04:00
nfs4_mount.h
nfs_fs.h
nfs_idmap.h
nfs_mount.h
nfsacl.h nfsd: Add macro NFS_ACL_MASK for ACL 2015-07-20 14:58:46 -04:00
nl80211.h cfg80211: Add global RRM capability 2016-02-24 09:04:41 +01:00
nubus.h
nvme_ioctl.h nvme: move hardware structures out of the uapi version of nvme.h 2015-10-09 10:40:37 -06:00
nvram.h
omap3isp.h
omapfb.h
oom.h
openvswitch.h openvswitch: fix trivial comment typo 2015-12-14 14:00:09 -05:00
packet_diag.h
param.h
parport.h
patchkey.h
pci.h
pci_regs.h PCI: Make Enhanced Allocation bitmasks more obvious 2015-10-29 17:35:40 -05:00
perf_event.h perf/x86: Add option to disable reading branch flags/cycles 2015-11-23 09:58:25 +01:00
personality.h
pfkeyv2.h
pg.h
phantom.h
phonet.h
pkt_cls.h net: sched: cls_u32 add bit to specify software only rules 2016-03-01 16:05:39 -05:00
pkt_sched.h net, sched: add clsact qdisc 2016-01-10 22:13:15 -05:00
pktcdvd.h
pmu.h
poll.h
posix_types.h
ppdev.h
ppp-comp.h
ppp-ioctl.h
ppp_defs.h
pps.h
pr.h block: add an API for Persistent Reservations 2015-10-21 14:46:56 -06:00
prctl.h capabilities: ambient capabilities 2015-09-04 16:54:41 -07:00
psci.h drivers: firmware: psci: add system suspend support 2015-10-02 14:35:17 +01:00
ptp_clock.h
ptrace.h seccomp, ptrace: add support for dumping seccomp filters 2015-10-27 19:55:13 -07:00
qnx4_fs.h
qnxtypes.h
quota.h
radeonfb.h
random.h
raw.h
rds.h net/rds: Declare SO_RDS_TRANSPORT and RDS_TRANS_* constants in uapi/linux/rds.h 2015-05-31 21:47:23 -07:00
reboot.h
reiserfs_fs.h
reiserfs_xattr.h
resource.h
rfkill.h rfkill: Update userspace API documentation 2016-02-24 09:04:25 +01:00
romfs_fs.h
rose.h
route.h
rtc.h
rtnetlink.h ipv6: allow routes to be configured with expire values 2015-12-17 15:08:51 -05:00
scc.h
sched.h
scif_ioctl.h misc: mic: SCIF RMA header file and IOCTL changes 2015-10-04 12:54:54 +01:00
screen_info.h efifb: Add support for 64-bit frame buffer addresses 2015-10-12 14:20:06 +01:00
sctp.h
sdla.h
seccomp.h
securebits.h capabilities: add a securebit to disable PR_CAP_AMBIENT_RAISE 2015-09-04 16:54:41 -07:00
selinux_netlink.h
sem.h
serial.h serial: support 16-bit register interface for console 2015-12-13 19:59:48 -08:00
serial_core.h serial: remove NWP serial support 2015-12-13 19:59:48 -08:00
serial_reg.h
serio.h Input: add eGalaxTouch serial touchscreen driver 2015-12-16 11:31:33 -08:00
shm.h
signal.h
signalfd.h
smiapp.h
snmp.h net: track success and failure of TCP PMTU probing 2015-07-21 22:36:33 -07:00
sock_diag.h net: diag: Add the ability to destroy a socket. 2015-12-15 23:26:51 -05:00
socket.h
sockios.h include/uapi/linux/sockios.h: mark SIOCRTMSG unused 2016-01-05 16:44:06 -05:00
sonet.h
sonypi.h
sound.h
soundcard.h
stat.h
stddef.h
stm.h stm class: Introduce an abstraction for System Trace Module devices 2015-10-04 20:28:58 +01:00
string.h
suspend_ioctls.h
swab.h
synclink.h
sysctl.h
sysinfo.h
target_core_user.h target: use stringify.h instead of own definition 2015-09-11 00:32:36 -07:00
taskstats.h
tcp.h tcp: add tcpi_min_rtt and tcpi_notsent_bytes to tcp_info 2016-02-16 20:27:35 -05:00
tcp_metrics.h
telephony.h
termios.h
thermal.h
time.h
times.h
timex.h
tiocl.h
tipc.h
tipc_config.h
tipc_netlink.h
toshiba.h toshiba_acpi: Add /dev/toshiba_acpi device 2015-07-24 14:15:10 -07:00
tty.h NFC: nci: add generic uart support 2015-06-11 23:37:37 +02:00
tty_flags.h
types.h
udf_fs_i.h
udp.h
uhid.h
uinput.h Input: uinput - rework ABS validation 2015-12-18 17:48:51 -08:00
uio.h
ultrasound.h
un.h
unistd.h
unix_diag.h
usbdevice_fs.h
usbip.h
userfaultfd.h userfaultfd: remove kernel header include from uapi header 2015-10-01 21:42:35 -04:00
userio.h Input: add userio module 2015-10-27 18:55:31 -07:00
utime.h
utsname.h
uuid.h
uvcvideo.h
v4l2-common.h
v4l2-controls.h [media] include/media: move driver interface headers to a separate dir 2015-11-17 06:57:29 -02:00
v4l2-dv-timings.h
v4l2-mediabus.h [media] videodev2.h: add support for transfer functions 2015-06-05 11:45:45 -03:00
v4l2-subdev.h
veth.h
vfio.h vfio: Include No-IOMMU mode 2015-12-21 15:28:11 -07:00
vhost.h vhost: cross-endian support for legacy devices 2015-06-01 15:48:55 +02:00
videodev2.h Revert "[media] UVC: Add support for ds4 depth camera" 2015-12-12 08:10:40 -02:00
virtio_9p.h
virtio_balloon.h include/uapi/linux/virtio_balloon.h: include linux/virtio_types.h 2015-06-01 15:46:54 +02:00
virtio_blk.h
virtio_config.h
virtio_console.h
virtio_gpu.h include/uapi/linux/virtio_gpu.h: use __u8 from <linux/types.h> 2015-12-10 12:33:23 +01:00
virtio_ids.h Revert "Merge branch 'vsock-virtio'" 2015-12-08 21:55:49 -05:00
virtio_input.h
virtio_net.h virtio_net: document VIRTIO_NET_CTRL_GUEST_OFFLOADS 2015-07-01 10:11:17 +02:00
virtio_pci.h virtio: define virtio_pci_cfg_cap in header. 2015-07-07 14:27:05 +03:00
virtio_ring.h virtio: Fix typecast of pointer in vring_init() 2015-07-07 14:27:04 +03:00
virtio_rng.h
virtio_scsi.h
virtio_types.h
vm_sockets.h
vsp1.h [media] media: uapi: vsp1: Use __u32 instead of u32 2015-07-06 08:25:50 -03:00
vt.h
wait.h
wanrouter.h
watchdog.h
wil6210_uapi.h
wimax.h
wireless.h
x25.h
xattr.h
xfrm.h
xilinx-v4l2-controls.h
zorro.h
zorro_ids.h