mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nigel Cunningham <nigel@suspend2.net>
To: linux-kernel@vger.kernel.org
Subject: [Suspend2][ 13/13] [Suspend2] Netlink header.
Date: Tue, 27 Jun 2006 14:40:07 +1000	[thread overview]
Message-ID: <20060627044006.14630.94937.stgit@nigel.suspend2.net> (raw)
In-Reply-To: <20060627043923.14630.565.stgit@nigel.suspend2.net>

Header file describing userspace helper data, generic message numbers and
exported functions.

Signed-off-by: Nigel Cunningham <nigel@suspend2.net>

 kernel/power/netlink.h |   59 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 59 insertions(+), 0 deletions(-)

diff --git a/kernel/power/netlink.h b/kernel/power/netlink.h
new file mode 100644
index 0000000..e55533a
--- /dev/null
+++ b/kernel/power/netlink.h
@@ -0,0 +1,59 @@
+/*
+ * kernel/power/netlink.h
+ *
+ * Copyright (C) 2004-2006 Nigel Cunningham <nigel@suspend2.net>
+ *
+ * This file is released under the GPLv2.
+ *
+ * Declarations for functions for communicating with a userspace helper
+ * via netlink.
+ */
+
+#include <linux/netlink.h>
+#include <net/sock.h>
+
+#define NETLINK_MSG_BASE 0x10
+
+#define NETLINK_MSG_READY 0x10
+#define	NETLINK_MSG_NOFREEZE_ME 0x16
+#define NETLINK_MSG_GET_DEBUGGING 0x19
+#define NETLINK_MSG_CLEANUP 0x24
+#define NETLINK_MSG_NOFREEZE_ACK 0x27
+#define NETLINK_MSG_IS_DEBUGGING 0x28
+
+struct user_helper_data {
+	int (*rcv_msg) (struct sk_buff *skb, struct nlmsghdr *nlh);
+	void (* not_ready) (void);
+	struct sock *nl;
+	u32 sock_seq;
+	pid_t pid;
+	char *comm;
+	char program[256];
+	int pool_level;
+	int pool_limit;
+	struct sk_buff *emerg_skbs;
+	int skb_size;
+	int netlink_id;	
+	char *name;
+	struct user_helper_data *next;
+	struct completion wait_for_process;
+	int interface_version;
+	int must_init;
+};
+
+
+#ifdef CONFIG_NET
+int suspend_netlink_setup(struct user_helper_data *uhd);
+void suspend_netlink_close(struct user_helper_data *uhd);
+void suspend_send_netlink_message(struct user_helper_data *uhd,
+		int type, void* params, size_t len);
+#else
+static inline int suspend_netlink_setup(struct user_helper_data *uhd)
+{
+	return 0;
+}
+
+static inline void suspend_netlink_close(struct user_helper_data *uhd) { };
+static inline void suspend_send_netlink_message(struct user_helper_data *uhd,
+		int type, void* params, size_t len) { };
+#endif

--
Nigel Cunningham		nigel at suspend2 dot net

      parent reply	other threads:[~2006-06-27  5:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-27  4:39 [Suspend2][ 00/13] Generic netlink support Nigel Cunningham
2006-06-27  4:39 ` [Suspend2][ 01/13] [Suspend2] Netlink.c header Nigel Cunningham
2006-06-27  4:39 ` [Suspend2][ 02/13] [Suspend2] Fill skb pool Nigel Cunningham
2006-06-27  4:39 ` [Suspend2][ 03/13] [Suspend2] Get and put skbs Nigel Cunningham
2006-06-27  4:39 ` [Suspend2][ 04/13] [Suspend2] Notify userspace of a new message Nigel Cunningham
2006-06-27  4:39 ` [Suspend2][ 05/13] [Suspend2] Send netlink message to userspace helper Nigel Cunningham
2006-06-27  4:39 ` [Suspend2][ 06/13] [Suspend2] Tell userui whether debugging is enabled Nigel Cunningham
2006-06-27  4:39 ` [Suspend2][ 07/13] [Suspend2] Set NoFreeze flag on a userspace helper Nigel Cunningham
2006-06-27  4:39 ` [Suspend2][ 08/13] [Suspend2] Userspace is ready! Nigel Cunningham
2006-06-27  4:39 ` [Suspend2][ 09/13] [Suspend2] Netlink receive message routines Nigel Cunningham
2006-06-27  4:39 ` [Suspend2][ 10/13] [Suspend2] Prepare/cleanup netlink connections Nigel Cunningham
2006-06-27  4:40 ` [Suspend2][ 11/13] [Suspend2] Launch a userspace helper Nigel Cunningham
2006-06-27  4:40 ` [Suspend2][ 12/13] [Suspend2] Start " Nigel Cunningham
2006-06-27  4:40 ` Nigel Cunningham [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060627044006.14630.94937.stgit@nigel.suspend2.net \
    --to=nigel@suspend2.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome