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

Commit c17bbe27 authored by Harout Hedeshian's avatar Harout Hedeshian Committed by Gerrit - the friendly Code Review server
Browse files

net: sockev: Initial Commit



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:  626021
Change-Id: Id5c6808d972b69f5f065d7fba9094e75c6ad0b2c
Signed-off-by: default avatarHarout Hedeshian <harouth@codeaurora.org>
parent 9a248766
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -399,6 +399,7 @@ header-y += signalfd.h
header-y += snmp.h
header-y += sock_diag.h
header-y += socket.h
header-y += sockev.h
header-y += sockios.h
header-y += som.h
header-y += sonet.h
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@
#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		
+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
@@ -274,6 +274,15 @@ config BPF_JIT
	  packet sniffing (libpcap/tcpdump). Note : Admin should enable
	  this feature changing /proc/sys/net/core/bpf_jit_enable

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
@@ -22,3 +22,4 @@ obj-$(CONFIG_TRACEPOINTS) += net-traces.o
obj-$(CONFIG_NET_DROP_MONITOR) += drop_monitor.o
obj-$(CONFIG_NETWORK_PHY_TIMESTAMPING) += timestamping.o
obj-$(CONFIG_NETPRIO_CGROUP) += netprio_cgroup.o
obj-$(CONFIG_SOCKEV_NLMCAST) += sockev_nlmcast.o
 No newline at end of file
Loading