* refs/heads/tmp-c71ad0f: BACKPORT: arm64: dts: juno: fix cluster sleep state entry latency on all SoC versions staging: android: ashmem: lseek failed due to no FMODE_LSEEK. ANDROID: sdcardfs: update module info ANDROID: sdcardfs: use d_splice_alias ANDROID: sdcardfs: add read_iter/write_iter opeations ANDROID: sdcardfs: fix ->llseek to update upper and lower offset ANDROID: sdcardfs: copy lower inode attributes in ->ioctl ANDROID: sdcardfs: remove unnecessary call to do_munmap Merge 4.4.59 into android-4.4 UPSTREAM: ipv6 addrconf: implement RFC7559 router solicitation backoff android: base-cfg: enable CONFIG_INET_DIAG_DESTROY ANDROID: android-base.cfg: add CONFIG_MODULES option ANDROID: android-base.cfg: add CONFIG_IKCONFIG option ANDROID: android-base.cfg: properly sort the file ANDROID: binder: add hwbinder,vndbinder to BINDER_DEVICES. ANDROID: sort android-recommended.cfg UPSTREAM: config/android: Remove CONFIG_IPV6_PRIVACY UPSTREAM: config: android: set SELinux as default security mode config: android: move device mapper options to recommended ANDROID: ARM64: Allow to choose appended kernel image UPSTREAM: arm64: vdso: constify vm_special_mapping used for aarch32 vectors page UPSTREAM: arm64: vdso: add __init section marker to alloc_vectors_page UPSTREAM: ARM: 8597/1: VDSO: put RO and RO after init objects into proper sections UPSTREAM: arm64: Add support for CLOCK_MONOTONIC_RAW in clock_gettime() vDSO UPSTREAM: arm64: Refactor vDSO time functions UPSTREAM: arm64: fix vdso-offsets.h dependency UPSTREAM: kbuild: drop FORCE from PHONY targets UPSTREAM: mm: add PHYS_PFN, use it in __phys_to_pfn() UPSTREAM: ARM: 8476/1: VDSO: use PTR_ERR_OR_ZERO for vma check Linux 4.4.58 crypto: algif_hash - avoid zero-sized array fbcon: Fix vc attr at deinit serial: 8250_pci: Detach low-level driver during PCI error recovery ACPI / blacklist: Make Dell Latitude 3350 ethernet work ACPI / blacklist: add _REV quirks for Dell Precision 5520 and 3520 uvcvideo: uvc_scan_fallback() for webcams with broken chain s390/zcrypt: Introduce CEX6 toleration block: allow WRITE_SAME commands with the SG_IO ioctl vfio/spapr: Postpone allocation of userspace version of TCE table PCI: Do any VF BAR updates before enabling the BARs PCI: Ignore BAR updates on virtual functions PCI: Update BARs using property bits appropriate for type PCI: Don't update VF BARs while VF memory space is enabled PCI: Decouple IORESOURCE_ROM_ENABLE and PCI_ROM_ADDRESS_ENABLE PCI: Add comments about ROM BAR updating PCI: Remove pci_resource_bar() and pci_iov_resource_bar() PCI: Separate VF BAR updates from standard BAR updates x86/hyperv: Handle unknown NMIs on one CPU when unknown_nmi_panic igb: add i211 to i210 PHY workaround igb: Workaround for igb i210 firmware issue xen: do not re-use pirq number cached in pci device msi msg data xfs: clear _XBF_PAGES from buffers when readahead page USB: usbtmc: add missing endpoint sanity check nl80211: fix dumpit error path RTNL deadlocks xfs: fix up xfs_swap_extent_forks inline extent handling xfs: don't allow di_size with high bit set libceph: don't set weight to IN when OSD is destroyed raid10: increment write counter after bio is split cpufreq: Restore policy min/max limits on CPU online ARM: dts: at91: sama5d2: add dma properties to UART nodes ARM: at91: pm: cpu_idle: switch DDR to power-down mode iommu/vt-d: Fix NULL pointer dereference in device_to_iommu xen/acpi: upload PM state from init-domain to Xen mmc: sdhci: Do not disable interrupts while waiting for clock ext4: mark inode dirty after converting inline directory parport: fix attempt to write duplicate procfiles iio: hid-sensor-trigger: Change get poll value function order to avoid sensor properties losing after resume from S3 iio: adc: ti_am335x_adc: fix fifo overrun recovery mmc: ushc: fix NULL-deref at probe uwb: hwa-rc: fix NULL-deref at probe uwb: i1480-dfu: fix NULL-deref at probe usb: hub: Fix crash after failure to read BOS descriptor usb: musb: cppi41: don't check early-TX-interrupt for Isoch transfer USB: wusbcore: fix NULL-deref at probe USB: idmouse: fix NULL-deref at probe USB: lvtest: fix NULL-deref at probe USB: uss720: fix NULL-deref at probe usb-core: Add LINEAR_FRAME_INTR_BINTERVAL USB quirk usb: gadget: f_uvc: Fix SuperSpeed companion descriptor's wBytesPerInterval ACM gadget: fix endianness in notifications USB: serial: qcserial: add Dell DW5811e USB: serial: option: add Quectel UC15, UC20, EC21, and EC25 modems ALSA: hda - Adding a group of pin definition to fix headset problem ALSA: ctxfi: Fix the incorrect check of dma_set_mask() call ALSA: seq: Fix racy cell insertions during snd_seq_pool_done() Input: sur40 - validate number of endpoints before using them Input: kbtab - validate number of endpoints before using them Input: cm109 - validate number of endpoints before using them Input: yealink - validate number of endpoints before using them Input: hanwang - validate number of endpoints before using them Input: ims-pcu - validate number of endpoints before using them Input: iforce - validate number of endpoints before using them Input: i8042 - add noloop quirk for Dell Embedded Box PC 3000 Input: elan_i2c - add ASUS EeeBook X205TA special touchpad fw tcp: initialize icsk_ack.lrcvtime at session start time socket, bpf: fix sk_filter use after free in sk_clone_lock ipv4: provide stronger user input validation in nl_fib_input() net: bcmgenet: remove bcmgenet_internal_phy_setup() net/mlx5e: Count LRO packets correctly net/mlx5: Increase number of max QPs in default profile net: unix: properly re-increment inflight counter of GC discarded candidates amd-xgbe: Fix jumbo MTU processing on newer hardware net: properly release sk_frag.page net: bcmgenet: Do not suspend PHY if Wake-on-LAN is enabled net/openvswitch: Set the ipv6 source tunnel key address attribute correctly Linux 4.4.57 ext4: fix fencepost in s_first_meta_bg validation percpu: acquire pcpu_lock when updating pcpu_nr_empty_pop_pages gfs2: Avoid alignment hole in struct lm_lockname isdn/gigaset: fix NULL-deref at probe target: Fix VERIFY_16 handling in sbc_parse_cdb scsi: libiscsi: add lock around task lists to fix list corruption regression scsi: lpfc: Add shutdown method for kexec target/pscsi: Fix TYPE_TAPE + TYPE_MEDIMUM_CHANGER export md/raid1/10: fix potential deadlock powerpc/boot: Fix zImage TOC alignment cpufreq: Fix and clean up show_cpuinfo_cur_freq() perf/core: Fix event inheritance on fork() give up on gcc ilog2() constant optimizations kernek/fork.c: allocate idle task for a CPU always on its local node hv_netvsc: use skb_get_hash() instead of a homegrown implementation tpm_tis: Use devm_free_irq not free_irq drm/amdgpu: add missing irq.h include s390/pci: fix use after free in dma_init KVM: PPC: Book3S PR: Fix illegal opcode emulation xen/qspinlock: Don't kick CPU if IRQ is not initialized Drivers: hv: avoid vfree() on crash Drivers: hv: balloon: don't crash when memory is added in non-sorted order pinctrl: cherryview: Do not mask all interrupts in probe ACPI / video: skip evaluating _DOD when it does not exist cxlflash: Increase cmd_per_lun for better throughput crypto: mcryptd - Fix load failure crypto: cryptd - Assign statesize properly crypto: ghash-clmulni - Fix load failure USB: don't free bandwidth_mutex too early usb: core: hub: hub_port_init lock controller instead of bus ANDROID: sdcardfs: Fix style issues in macros ANDROID: sdcardfs: Use seq_puts over seq_printf ANDROID: sdcardfs: Use to kstrout ANDROID: sdcardfs: Use pr_[...] instead of printk ANDROID: sdcardfs: remove unneeded null check ANDROID: sdcardfs: Fix style issues with comments ANDROID: sdcardfs: Fix formatting ANDROID: sdcardfs: correct order of descriptors fix the deadlock in xt_qtaguid when enable DDEBUG net: ipv6: Add sysctl for minimum prefix len acceptable in RIOs. Linux 4.4.56 futex: Add missing error handling to FUTEX_REQUEUE_PI futex: Fix potential use-after-free in FUTEX_REQUEUE_PI x86/perf: Fix CR4.PCE propagation to use active_mm instead of mm x86/kasan: Fix boot with KASAN=y and PROFILE_ANNOTATED_BRANCHES=y fscrypto: lock inode while setting encryption policy fscrypt: fix renaming and linking special files net sched actions: decrement module reference count after table flush. dccp: fix memory leak during tear-down of unsuccessful connection request dccp/tcp: fix routing redirect race bridge: drop netfilter fake rtable unconditionally ipv6: avoid write to a possibly cloned skb ipv6: make ECMP route replacement less greedy mpls: Send route delete notifications when router module is unloaded act_connmark: avoid crashing on malformed nlattrs with null parms uapi: fix linux/packet_diag.h userspace compilation error vrf: Fix use-after-free in vrf_xmit dccp: fix use-after-free in dccp_feat_activate_values net: fix socket refcounting in skb_complete_tx_timestamp() net: fix socket refcounting in skb_complete_wifi_ack() tcp: fix various issues for sockets morphing to listen state dccp: Unlock sock before calling sk_free() net: net_enable_timestamp() can be called from irq contexts net: don't call strlen() on the user buffer in packet_bind_spkt() l2tp: avoid use-after-free caused by l2tp_ip_backlog_recv ipv4: mask tos for input route vti6: return GRE_KEY for vti6 vxlan: correctly validate VXLAN ID against VXLAN_N_VID netlink: remove mmapped netlink support ANDROID: mmc: core: export emmc revision BACKPORT: mmc: core: Export device lifetime information through sysfs ANDROID: android-verity: do not compile as independent module ANDROID: sched: fix duplicate sched_group_energy const specifiers config: disable CONFIG_USELIB and CONFIG_FHANDLE ANDROID: power: align wakeup_sources format ANDROID: dm: android-verity: allow disable dm-verity for Treble VTS uid_sys_stats: change to use rt_mutex ANDROID: vfs: user permission2 in notify_change2 ANDROID: sdcardfs: Fix gid issue ANDROID: sdcardfs: Use tabs instead of spaces in multiuser.h ANDROID: sdcardfs: Remove uninformative prints ANDROID: sdcardfs: move path_put outside of spinlock ANDROID: sdcardfs: Use case insensitive hash function ANDROID: sdcardfs: declare MODULE_ALIAS_FS ANDROID: sdcardfs: Get the blocksize from the lower fs ANDROID: sdcardfs: Use d_invalidate instead of drop_recurisve ANDROID: sdcardfs: Switch to internal case insensitive compare ANDROID: sdcardfs: Use spin_lock_nested ANDROID: sdcardfs: Replace get/put with d_lock ANDROID: sdcardfs: rate limit warning print ANDROID: sdcardfs: Fix case insensitive lookup ANDROID: uid_sys_stats: account for fsync syscalls ANDROID: sched: add a counter to track fsync ANDROID: uid_sys_stats: fix negative write bytes. ANDROID: uid_sys_stats: allow writing same state ANDROID: uid_sys_stats: rename uid_cputime.c to uid_sys_stats.c ANDROID: uid_cputime: add per-uid IO usage accounting DTB: Add EAS compatible Juno Energy model to 'juno.dts' arm64: dts: juno: Add idle-states to device tree ANDROID: Replace spaces by '_' for some android filesystem tracepoints. usb: gadget: f_accessory: Fix for UsbAccessory clean unbind. android: binder: move global binder state into context struct. android: binder: add padding to binder_fd_array_object. binder: use group leader instead of open thread nf: IDLETIMER: Use fullsock when querying uid nf: IDLETIMER: Fix use after free condition during work ANDROID: dm: android-verity: fix table_make_digest() error handling ANDROID: usb: gadget: function: Fix commenting style cpufreq: interactive governor drops bits in time calculation ANDROID: sdcardfs: support direct-IO (DIO) operations ANDROID: sdcardfs: implement vm_ops->page_mkwrite ANDROID: sdcardfs: Don't bother deleting freelist ANDROID: sdcardfs: Add missing path_put ANDROID: sdcardfs: Fix incorrect hash ANDROID: ext4 crypto: Disables zeroing on truncation when there's no key ANDROID: ext4: add a non-reversible key derivation method ANDROID: ext4: allow encrypting filenames using HEH algorithm ANDROID: arm64/crypto: add ARMv8-CE optimized poly_hash algorithm ANDROID: crypto: heh - factor out poly_hash algorithm ANDROID: crypto: heh - Add Hash-Encrypt-Hash (HEH) algorithm ANDROID: crypto: gf128mul - Add ble multiplication functions ANDROID: crypto: gf128mul - Refactor gf128 overflow macros and tables UPSTREAM: crypto: gf128mul - Zero memory when freeing multiplication table ANDROID: crypto: shash - Add crypto_grab_shash() and crypto_spawn_shash_alg() ANDROID: crypto: allow blkcipher walks over ablkcipher data UPSTREAM: arm/arm64: crypto: assure that ECB modes don't require an IV ANDROID: Refactor fs readpage/write tracepoints. ANDROID: export security_path_chown Squashfs: optimize reading uncompressed data Squashfs: implement .readpages() Squashfs: replace buffer_head with BIO Squashfs: refactor page_actor Squashfs: remove the FILE_CACHE option ANDROID: android-recommended.cfg: CONFIG_CPU_SW_DOMAIN_PAN=y FROMLIST: 9p: fix a potential acl leak BACKPORT: posix_acl: Clear SGID bit when setting file permissions UPSTREAM: udp: properly support MSG_PEEK with truncated buffers UPSTREAM: arm64: Allow hw watchpoint of length 3,5,6 and 7 BACKPORT: arm64: hw_breakpoint: Handle inexact watchpoint addresses UPSTREAM: arm64: Allow hw watchpoint at varied offset from base address BACKPORT: hw_breakpoint: Allow watchpoint of length 3,5,6 and 7 ANDROID: sdcardfs: Switch strcasecmp for internal call ANDROID: sdcardfs: switch to full_name_hash and qstr ANDROID: sdcardfs: Add GID Derivation to sdcardfs ANDROID: sdcardfs: Remove redundant operation ANDROID: sdcardfs: add support for user permission isolation ANDROID: sdcardfs: Refactor configfs interface ANDROID: sdcardfs: Allow non-owners to touch ANDROID: binder: fix format specifier for type binder_size_t ANDROID: fs: Export vfs_rmdir2 ANDROID: fs: Export free_fs_struct and set_fs_pwd BACKPORT: Input: xpad - validate USB endpoint count during probe BACKPORT: Input: xpad - fix oops when attaching an unknown Xbox One gamepad ANDROID: mnt: remount should propagate to slaves of slaves ANDROID: sdcardfs: Switch ->d_inode to d_inode() ANDROID: sdcardfs: Fix locking issue with permision fix up ANDROID: sdcardfs: Change magic value ANDROID: sdcardfs: Use per mount permissions ANDROID: sdcardfs: Add gid and mask to private mount data ANDROID: sdcardfs: User new permission2 functions ANDROID: vfs: Add setattr2 for filesystems with per mount permissions ANDROID: vfs: Add permission2 for filesystems with per mount permissions ANDROID: vfs: Allow filesystems to access their private mount data ANDROID: mnt: Add filesystem private data to mount points ANDROID: sdcardfs: Move directory unlock before touch ANDROID: sdcardfs: fix external storage exporting incorrect uid ANDROID: sdcardfs: Added top to sdcardfs_inode_info ANDROID: sdcardfs: Switch package list to RCU ANDROID: sdcardfs: Fix locking for permission fix up ANDROID: sdcardfs: Check for other cases on path lookup ANDROID: sdcardfs: override umask on mkdir and create arm64: kernel: Fix build warning DEBUG: sched/fair: Fix sched_load_avg_cpu events for task_groups DEBUG: sched/fair: Fix missing sched_load_avg_cpu events UPSTREAM: l2tp: fix racy SOCK_ZAPPED flag check in l2tp_ip{,6}_bind() UPSTREAM: packet: fix race condition in packet_set_ring UPSTREAM: netlink: Fix dump skb leak/double free UPSTREAM: net: avoid signed overflows for SO_{SND|RCV}BUFFORCE MIPS: Prevent "restoration" of MSA context in non-MSA kernels net: socket: don't set sk_uid to garbage value in ->setattr() ANDROID: configs: CONFIG_ARM64_SW_TTBR0_PAN=y UPSTREAM: arm64: Disable PAN on uaccess_enable() UPSTREAM: arm64: Enable CONFIG_ARM64_SW_TTBR0_PAN UPSTREAM: arm64: xen: Enable user access before a privcmd hvc call UPSTREAM: arm64: Handle faults caused by inadvertent user access with PAN enabled BACKPORT: arm64: Disable TTBR0_EL1 during normal kernel execution BACKPORT: arm64: Introduce uaccess_{disable,enable} functionality based on TTBR0_EL1 BACKPORT: arm64: Factor out TTBR0_EL1 post-update workaround into a specific asm macro BACKPORT: arm64: Factor out PAN enabling/disabling into separate uaccess_* macros UPSTREAM: arm64: alternative: add auto-nop infrastructure UPSTREAM: arm64: barriers: introduce nops and __nops macros for NOP sequences Revert "FROMLIST: arm64: Factor out PAN enabling/disabling into separate uaccess_* macros" Revert "FROMLIST: arm64: Factor out TTBR0_EL1 post-update workaround into a specific asm macro" Revert "FROMLIST: arm64: Introduce uaccess_{disable,enable} functionality based on TTBR0_EL1" Revert "FROMLIST: arm64: Disable TTBR0_EL1 during normal kernel execution" Revert "FROMLIST: arm64: Handle faults caused by inadvertent user access with PAN enabled" Revert "FROMLIST: arm64: xen: Enable user access before a privcmd hvc call" Revert "FROMLIST: arm64: Enable CONFIG_ARM64_SW_TTBR0_PAN" ANDROID: sched/walt: fix build failure if FAIR_GROUP_SCHED=n ANDROID: trace: net: use %pK for kernel pointers ANDROID: android-base: Enable QUOTA related configs net: ipv4: Don't crash if passing a null sk to ip_rt_update_pmtu. net: inet: Support UID-based routing in IP protocols. net: core: add UID to flows, rules, and routes net: core: Add a UID field to struct sock. Revert "net: core: Support UID-based routing." UPSTREAM: efi/arm64: Don't apply MEMBLOCK_NOMAP to UEFI memory map mapping UPSTREAM: arm64: mm: always take dirty state from new pte in ptep_set_access_flags UPSTREAM: arm64: Implement pmdp_set_access_flags() for hardware AF/DBM UPSTREAM: arm64: Fix typo in the pmdp_huge_get_and_clear() definition UPSTREAM: arm64: enable CONFIG_DEBUG_RODATA by default goldfish: enable CONFIG_INET_DIAG_DESTROY sched/walt: kill {min,max}_capacity sched: fix wrong truncation of walt_avg build: fix build config kernel_dir ANDROID: dm verity: add minimum prefetch size build: add build server configs for goldfish usb: gadget: Fix compilation problem with tx_qlen field Conflicts: android/configs/android-base.cfg arch/arm64/Makefile arch/arm64/include/asm/cpufeature.h arch/arm64/kernel/vdso/gettimeofday.S arch/arm64/mm/cache.S drivers/md/Kconfig drivers/misc/Makefile drivers/mmc/host/sdhci.c drivers/usb/core/hcd.c drivers/usb/gadget/function/u_ether.c fs/sdcardfs/derived_perm.c fs/sdcardfs/file.c fs/sdcardfs/inode.c fs/sdcardfs/lookup.c fs/sdcardfs/main.c fs/sdcardfs/multiuser.h fs/sdcardfs/packagelist.c fs/sdcardfs/sdcardfs.h fs/sdcardfs/super.c include/linux/mmc/card.h include/linux/mmc/mmc.h include/trace/events/android_fs.h include/trace/events/android_fs_template.h drivers/android/binder.c fs/exec.c fs/ext4/crypto_key.c fs/ext4/ext4.h fs/ext4/inline.c fs/ext4/inode.c fs/ext4/readpage.c fs/f2fs/data.c fs/f2fs/inline.c fs/mpage.c include/linux/dcache.h include/trace/events/sched.h include/uapi/linux/ipv6.h net/ipv4/tcp_ipv4.c net/netfilter/xt_IDLETIMER.c Change-Id: Ie345db6a14869fe0aa794aef4b71b5d0d503690b Signed-off-by: Blagovest Kolenichev <bkolenichev@codeaurora.org>
193 lines
5.9 KiB
C
193 lines
5.9 KiB
C
#ifndef _UAPI__LINUX_NETLINK_H
|
|
#define _UAPI__LINUX_NETLINK_H
|
|
|
|
#include <linux/kernel.h>
|
|
#include <linux/socket.h> /* for __kernel_sa_family_t */
|
|
#include <linux/types.h>
|
|
|
|
#define NETLINK_ROUTE 0 /* Routing/device hook */
|
|
#define NETLINK_UNUSED 1 /* Unused number */
|
|
#define NETLINK_USERSOCK 2 /* Reserved for user mode socket protocols */
|
|
#define NETLINK_FIREWALL 3 /* Unused number, formerly ip_queue */
|
|
#define NETLINK_SOCK_DIAG 4 /* socket monitoring */
|
|
#define NETLINK_NFLOG 5 /* netfilter/iptables ULOG */
|
|
#define NETLINK_XFRM 6 /* ipsec */
|
|
#define NETLINK_SELINUX 7 /* SELinux event notifications */
|
|
#define NETLINK_ISCSI 8 /* Open-iSCSI */
|
|
#define NETLINK_AUDIT 9 /* auditing */
|
|
#define NETLINK_FIB_LOOKUP 10
|
|
#define NETLINK_CONNECTOR 11
|
|
#define NETLINK_NETFILTER 12 /* netfilter subsystem */
|
|
#define NETLINK_IP6_FW 13
|
|
#define NETLINK_DNRTMSG 14 /* DECnet routing messages */
|
|
#define NETLINK_KOBJECT_UEVENT 15 /* Kernel messages to userspace */
|
|
#define NETLINK_GENERIC 16
|
|
/* leave room for NETLINK_DM (DM Events) */
|
|
#define NETLINK_SCSITRANSPORT 18 /* SCSI Transports */
|
|
#define NETLINK_ECRYPTFS 19
|
|
#define NETLINK_RDMA 20
|
|
#define NETLINK_CRYPTO 21 /* Crypto layer */
|
|
#define NETLINK_SOCKEV 22 /* Socket Administrative Events */
|
|
#define NETLINK_INET_DIAG NETLINK_SOCK_DIAG
|
|
|
|
#define MAX_LINKS 32
|
|
|
|
struct sockaddr_nl {
|
|
__kernel_sa_family_t nl_family; /* AF_NETLINK */
|
|
unsigned short nl_pad; /* zero */
|
|
__u32 nl_pid; /* port ID */
|
|
__u32 nl_groups; /* multicast groups mask */
|
|
};
|
|
|
|
struct nlmsghdr {
|
|
__u32 nlmsg_len; /* Length of message including header */
|
|
__u16 nlmsg_type; /* Message content */
|
|
__u16 nlmsg_flags; /* Additional flags */
|
|
__u32 nlmsg_seq; /* Sequence number */
|
|
__u32 nlmsg_pid; /* Sending process port ID */
|
|
};
|
|
|
|
/* Flags values */
|
|
|
|
#define NLM_F_REQUEST 1 /* It is request message. */
|
|
#define NLM_F_MULTI 2 /* Multipart message, terminated by NLMSG_DONE */
|
|
#define NLM_F_ACK 4 /* Reply with ack, with zero or error code */
|
|
#define NLM_F_ECHO 8 /* Echo this request */
|
|
#define NLM_F_DUMP_INTR 16 /* Dump was inconsistent due to sequence change */
|
|
#define NLM_F_DUMP_FILTERED 32 /* Dump was filtered as requested */
|
|
|
|
/* Modifiers to GET request */
|
|
#define NLM_F_ROOT 0x100 /* specify tree root */
|
|
#define NLM_F_MATCH 0x200 /* return all matching */
|
|
#define NLM_F_ATOMIC 0x400 /* atomic GET */
|
|
#define NLM_F_DUMP (NLM_F_ROOT|NLM_F_MATCH)
|
|
|
|
/* Modifiers to NEW request */
|
|
#define NLM_F_REPLACE 0x100 /* Override existing */
|
|
#define NLM_F_EXCL 0x200 /* Do not touch, if it exists */
|
|
#define NLM_F_CREATE 0x400 /* Create, if it does not exist */
|
|
#define NLM_F_APPEND 0x800 /* Add to end of list */
|
|
|
|
/*
|
|
4.4BSD ADD NLM_F_CREATE|NLM_F_EXCL
|
|
4.4BSD CHANGE NLM_F_REPLACE
|
|
|
|
True CHANGE NLM_F_CREATE|NLM_F_REPLACE
|
|
Append NLM_F_CREATE
|
|
Check NLM_F_EXCL
|
|
*/
|
|
|
|
#define NLMSG_ALIGNTO 4U
|
|
#define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) )
|
|
#define NLMSG_HDRLEN ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr)))
|
|
#define NLMSG_LENGTH(len) ((len) + NLMSG_HDRLEN)
|
|
#define NLMSG_SPACE(len) NLMSG_ALIGN(NLMSG_LENGTH(len))
|
|
#define NLMSG_DATA(nlh) ((void*)(((char*)nlh) + NLMSG_LENGTH(0)))
|
|
#define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \
|
|
(struct nlmsghdr*)(((char*)(nlh)) + NLMSG_ALIGN((nlh)->nlmsg_len)))
|
|
#define NLMSG_OK(nlh,len) ((len) >= (int)sizeof(struct nlmsghdr) && \
|
|
(nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && \
|
|
(nlh)->nlmsg_len <= (len))
|
|
#define NLMSG_PAYLOAD(nlh,len) ((nlh)->nlmsg_len - NLMSG_SPACE((len)))
|
|
|
|
#define NLMSG_NOOP 0x1 /* Nothing. */
|
|
#define NLMSG_ERROR 0x2 /* Error */
|
|
#define NLMSG_DONE 0x3 /* End of a dump */
|
|
#define NLMSG_OVERRUN 0x4 /* Data lost */
|
|
|
|
#define NLMSG_MIN_TYPE 0x10 /* < 0x10: reserved control messages */
|
|
|
|
struct nlmsgerr {
|
|
int error;
|
|
struct nlmsghdr msg;
|
|
};
|
|
|
|
#define NETLINK_ADD_MEMBERSHIP 1
|
|
#define NETLINK_DROP_MEMBERSHIP 2
|
|
#define NETLINK_PKTINFO 3
|
|
#define NETLINK_BROADCAST_ERROR 4
|
|
#define NETLINK_NO_ENOBUFS 5
|
|
#ifndef __KERNEL__
|
|
#define NETLINK_RX_RING 6
|
|
#define NETLINK_TX_RING 7
|
|
#endif
|
|
#define NETLINK_LISTEN_ALL_NSID 8
|
|
#define NETLINK_LIST_MEMBERSHIPS 9
|
|
#define NETLINK_CAP_ACK 10
|
|
|
|
struct nl_pktinfo {
|
|
__u32 group;
|
|
};
|
|
|
|
struct nl_mmap_req {
|
|
unsigned int nm_block_size;
|
|
unsigned int nm_block_nr;
|
|
unsigned int nm_frame_size;
|
|
unsigned int nm_frame_nr;
|
|
};
|
|
|
|
struct nl_mmap_hdr {
|
|
unsigned int nm_status;
|
|
unsigned int nm_len;
|
|
__u32 nm_group;
|
|
/* credentials */
|
|
__u32 nm_pid;
|
|
__u32 nm_uid;
|
|
__u32 nm_gid;
|
|
};
|
|
|
|
#ifndef __KERNEL__
|
|
enum nl_mmap_status {
|
|
NL_MMAP_STATUS_UNUSED,
|
|
NL_MMAP_STATUS_RESERVED,
|
|
NL_MMAP_STATUS_VALID,
|
|
NL_MMAP_STATUS_COPY,
|
|
NL_MMAP_STATUS_SKIP,
|
|
};
|
|
|
|
#define NL_MMAP_MSG_ALIGNMENT NLMSG_ALIGNTO
|
|
#define NL_MMAP_MSG_ALIGN(sz) __ALIGN_KERNEL(sz, NL_MMAP_MSG_ALIGNMENT)
|
|
#define NL_MMAP_HDRLEN NL_MMAP_MSG_ALIGN(sizeof(struct nl_mmap_hdr))
|
|
#endif
|
|
|
|
#define NET_MAJOR 36 /* Major 36 is reserved for networking */
|
|
|
|
enum {
|
|
NETLINK_UNCONNECTED = 0,
|
|
NETLINK_CONNECTED,
|
|
};
|
|
|
|
/*
|
|
* <------- NLA_HDRLEN ------> <-- NLA_ALIGN(payload)-->
|
|
* +---------------------+- - -+- - - - - - - - - -+- - -+
|
|
* | Header | Pad | Payload | Pad |
|
|
* | (struct nlattr) | ing | | ing |
|
|
* +---------------------+- - -+- - - - - - - - - -+- - -+
|
|
* <-------------- nlattr->nla_len -------------->
|
|
*/
|
|
|
|
struct nlattr {
|
|
__u16 nla_len;
|
|
__u16 nla_type;
|
|
};
|
|
|
|
/*
|
|
* nla_type (16 bits)
|
|
* +---+---+-------------------------------+
|
|
* | N | O | Attribute Type |
|
|
* +---+---+-------------------------------+
|
|
* N := Carries nested attributes
|
|
* O := Payload stored in network byte order
|
|
*
|
|
* Note: The N and O flag are mutually exclusive.
|
|
*/
|
|
#define NLA_F_NESTED (1 << 15)
|
|
#define NLA_F_NET_BYTEORDER (1 << 14)
|
|
#define NLA_TYPE_MASK ~(NLA_F_NESTED | NLA_F_NET_BYTEORDER)
|
|
|
|
#define NLA_ALIGNTO 4
|
|
#define NLA_ALIGN(len) (((len) + NLA_ALIGNTO - 1) & ~(NLA_ALIGNTO - 1))
|
|
#define NLA_HDRLEN ((int) NLA_ALIGN(sizeof(struct nlattr)))
|
|
|
|
|
|
#endif /* _UAPI__LINUX_NETLINK_H */
|