[RFC][PATCH 4/7] exports

Török Edwin
2006-04-07T18:48:37Z

These symbols are exported, to be used by an iptables module.

---
exports.c | 33 +++++++++++++++++++++++++++++++++
fireflier.h | 9 +++++++++
2 files changed, 42 insertions(+)
diff -uprN null/exports.c fireflier_lsm/exports.c
--- null/exports.c 1970-01-01 02:00:00.000000000 +0200
+++ fireflier_lsm/exports.c 2006-04-07 14:39:27.000000000 +0300
@@ -0,0 +1,33 @@
+#include "fireflier.h"
+#include "structures.h"
+#include "autolabel.h"
+#include <linux/socket.h>
+#include <net/sock.h>
+void fireflier_sk_ctxid(struct sock *sk,u32 *sid)
+{
+ struct socket *sock;
+ sock = sk->sk_socket;
+ if (sock)
+ {
+ struct inode *inode;
+ inode = SOCK_INODE(sock);
+ if (inode)
+ {
+ struct fireflier_inode_security_struct *isec;
+ isec = inode->i_security;
+ if (sid && isec)
+ *sid = isec->sid;
+ // if (class)
+ // *class = isec->sclass;
+ }
+ }
+}
+
+int fireflier_available(void)
+{
+ return 1;
+}
+
+EXPORT_SYMBOL_GPL(fireflier_sk_ctxid);
+EXPORT_SYMBOL_GPL(fireflier_available);
+
diff -uprN null/fireflier.h fireflier_lsm/fireflier.h
--- null/fireflier.h 1970-01-01 02:00:00.000000000 +0200
+++ fireflier_lsm/fireflier.h 2006-03-29 23:07:46.000000000 +0300
@@ -0,0 +1,9 @@
+#ifndef _FIREFLIER_H
+#define _FIREFLIER_H
+#include <linux/types.h>
+#include <linux/module.h>
+struct sock;
+void fireflier_sk_ctxid(struct sock *sk,u32 *ctxid);
+int fireflier_available(void);
+int fireflier_ctx_to_id(const char* dev,unsigned long inode,u32 *ctxid);
+#endif