lkml.org 
[lkml]   [2006]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[RFC][PATCH 4/7] exports
    Date
    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
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/
    \
     
     \ /
      Last update: 2006-04-07 20:51    [W:4.152 / U:0.320 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site