Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f7f2e20b authored by Tejaswi Tanikella's avatar Tejaswi Tanikella Committed by Gerrit - the friendly Code Review server
Browse files

net: Add snapshot of sockev module



This is a snapshot of the sockev module taken as of msm-4.4
commit 33193859886dd87 ("net: core: Send only BIND and LISTEN events.").

Added module which subscribes to socket notifier events. Notifier events
are then converted to a multicast netlink message for user space
applications to consume.

CRs-Fixed: 1078373
Change-Id: If72b7c9a127d3861d276b681b052be3619bc6562
Acked-by: default avatarManoj Basapathi <manojbm@qti.qualcomm.com>
Signed-off-by: default avatarSubash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Signed-off-by: default avatarTejaswi Tanikella <tejaswit@codeaurora.org>
parent b2bdf7dc
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -13,3 +13,5 @@ endif
ifeq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/uapi/asm/kvm_para.h),)
no-export-headers += kvm_para.h
endif

header-y += sockev.h
+1 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@
#define NETLINK_RDMA		20
#define NETLINK_CRYPTO		21	/* Crypto layer */
#define NETLINK_SMC		22	/* SMC monitoring */

#define NETLINK_SOCKEV		23	/* Socket Administrative Events */
#define NETLINK_INET_DIAG	NETLINK_SOCK_DIAG

#define MAX_LINKS 32		
+31 −0
Original line number Diff line number Diff line
#ifndef _SOCKEV_H_
#define _SOCKEV_H_

#include <linux/types.h>
#include <linux/netlink.h>
#include <linux/socket.h>

enum sknetlink_groups {
	SKNLGRP_UNICAST,
	SKNLGRP_SOCKEV,
	__SKNLGRP_MAX
};

#define SOCKEV_STR_MAX 32

/********************************************************************
 *		Socket operation messages
 ****/

struct sknlsockevmsg {
	__u8 event[SOCKEV_STR_MAX];
	__u32 pid; /* (struct task_struct*)->pid */
	__u16 skfamily; /* (struct socket*)->sk->sk_family */
	__u8 skstate; /* (struct socket*)->sk->sk_state */
	__u8 skprotocol; /* (struct socket*)->sk->sk_protocol */
	__u16 sktype; /* (struct socket*)->sk->sk_type */
	__u64 skflags; /* (struct socket*)->sk->sk_flags */
};

#endif /* _SOCKEV_H_ */
+9 −0
Original line number Diff line number Diff line
@@ -326,6 +326,15 @@ config NET_FLOW_LIMIT
	  with many clients some protection against DoS by a single (spoofed)
	  flow that greatly exceeds average workload.

config SOCKEV_NLMCAST
	bool "Enable SOCKEV Netlink Multicast"
	default n
	---help---
	  Default client for SOCKEV notifier events. Sends multicast netlink
	  messages whenever the socket event notifier is invoked. Enable if
	  user space entities need to be notified of socket events without
	  having to poll /proc

menu "Network testing"

config NET_PKTGEN
+1 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ obj-$(CONFIG_CGROUP_NET_PRIO) += netprio_cgroup.o
obj-$(CONFIG_CGROUP_NET_CLASSID) += netclassid_cgroup.o
obj-$(CONFIG_LWTUNNEL) += lwtunnel.o
obj-$(CONFIG_LWTUNNEL_BPF) += lwt_bpf.o
obj-$(CONFIG_SOCKEV_NLMCAST) += sockev_nlmcast.o
obj-$(CONFIG_DST_CACHE) += dst_cache.o
obj-$(CONFIG_HWBM) += hwbm.o
obj-$(CONFIG_NET_DEVLINK) += devlink.o
Loading