Skip to contentSkip to conversation

NetLabel

RFC In review Paul Moore 1 participant 1 message May 25, 2006

Subsystems (4)
lore
Share & tools
lore

Paul Moore

author
#0 lore raw

RFC 2/4 NetLabel

This patch is the core NetLabel subsystem.

include/linux/netlink.h            |    1
include/net/netlabel.h             |  355 +++++++++++++++
net/Kconfig                        |    2
net/Makefile                       |    1
net/ipv4/Makefile                  |    1
net/netlabel/Kconfig               |   47 +
net/netlabel/Makefile              |   15
net/netlabel/netlabel_domainhash.c |  629 ++++++++++++++++++++++++++
net/netlabel/netlabel_domainhash.h |   64 ++
net/netlabel/netlabel_kapi.c       |  374 +++++++++++++++
net/netlabel/netlabel_mgmt.c       |  686 +++++++++++++++++++++++++++++
net/netlabel/netlabel_mgmt.h       |  265 +++++++++++
net/netlabel/netlabel_unlabeled.c  |  289 ++++++++++++
net/netlabel/netlabel_unlabeled.h  |   90 +++
net/netlabel/netlabel_user.c       |  166 +++++++
net/netlabel/netlabel_user.h       |   42 +
16 files changed, 3027 insertions(+)
include/linux/netlink.h +0 -0
@@ -21,6 +21,7 @@

#define NETLINK_DNRTMSG 14 /* DECnet routing messages */
#define NETLINK_KOBJECT_UEVENT 15 /* Kernel messages to userspace */
#define NETLINK_GENERIC 16
+#define NETLINK_NETLABEL 17 /* Network packet labeling */

#define MAX_LINKS 32

include/net/netlabel.h +339 -0

339 lines not on this page · raw message

net/ipv4/Makefile +0 -0
@@ -42,6 +42,7 @@ obj-$(CONFIG_TCP_CONG_HYBLA) += tcp_hybl

obj-$(CONFIG_TCP_CONG_HTCP) += tcp_htcp.o
obj-$(CONFIG_TCP_CONG_VEGAS) += tcp_vegas.o
obj-$(CONFIG_TCP_CONG_SCALABLE) += tcp_scalable.o
+obj-$(CONFIG_NETLABEL_CIPSOV4) += cipso_ipv4.o

obj-$(CONFIG_XFRM) += xfrm4_policy.o xfrm4_state.o xfrm4_input.o \
xfrm4_output.o

net/Kconfig +0 -0
@@ -228,6 +228,8 @@ source "net/tux/Kconfig"

config WIRELESS_EXT
bool

+source "net/netlabel/Kconfig"
+
endif # if NET
endmenu # Networking

net/Makefile +0 -0
@@ -47,6 +47,7 @@ obj-$(CONFIG_IP_DCCP)		+= dccp/

obj-$(CONFIG_IP_SCTP) += sctp/
obj-$(CONFIG_IEEE80211) += ieee80211/
obj-$(CONFIG_TIPC) += tipc/
+obj-$(CONFIG_NETLABEL) += netlabel/

ifeq ($(CONFIG_NET),y)
obj-$(CONFIG_SYSCTL) += sysctl_net.o

net/netlabel/Kconfig +47 -0

47 lines not on this page · raw message

net/netlabel/Makefile +15 -0
@@ -0,0 +1,15 @@
+#
+# Makefile for the NetLabel subsystem.
+#
+# Feb 9, 2006, Paul Moore <[email protected]>
+#
+
+# base objects
+obj-y	:= netlabel_user.o netlabel_kapi.o netlabel_domainhash.o
+
+# management objects
+obj-y	+= netlabel_mgmt.o
+
+# protocol modules
+obj-$(CONFIG_NETLABEL_UNLABELED)	+= netlabel_unlabeled.o
+obj-$(CONFIG_NETLABEL_CIPSOV4)		+= netlabel_cipso_v4.o
net/netlabel/netlabel_domainhash.c +625 -0

625 lines not on this page · raw message

net/netlabel/netlabel_domainhash.h +63 -0

63 lines not on this page · raw message

net/netlabel/netlabel_kapi.c +368 -0

368 lines not on this page · raw message

net/netlabel/netlabel_mgmt.c +678 -0

678 lines not on this page · raw message

net/netlabel/netlabel_mgmt.h +263 -0

263 lines not on this page · raw message

net/netlabel/netlabel_unlabeled.c +285 -0

285 lines not on this page · raw message

net/netlabel/netlabel_unlabeled.h +88 -0

88 lines not on this page · raw message

net/netlabel/netlabel_user.c +159 -0

159 lines not on this page · raw message

net/netlabel/netlabel_user.h +39 -0
@@ -0,0 +1,42 @@
+/*
+ * NetLabel NETLINK Interface
+ *
+ * This file defines the NETLINK interface for the NetLabel system.  The
+ * NetLabel system manages static and dynamic label mappings for network + * protocols such as CIPSO and RIPSO.
+ * + * Author: Paul Moore <[email protected]>
+ *
+ */
+
+/*
+ * (c) Copyright Hewlett-Packard Development Company, L.P., 2006
+ *
+ * This program is free software;  you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY;  without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+ * the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program;  if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef _NETLABEL_USER_H
+#define _NETLABEL_USER_H
+
+/* NetLabel NETLINK I/O functions */
+int netlbl_netlink_init(void);
+int netlbl_netlink_exit(void);
+int netlbl_netlink_snd(struct sk_buff *skb, const u32 pid);
+int netlbl_netlink_snd_multicast(struct sk_buff *skb, +				 const u32 pid,
+				 const u32 group);
+
+#endif