Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
netlabel_unlabeled.c File Reference
#include <linux/types.h>
#include <linux/rcupdate.h>
#include <linux/list.h>
#include <linux/spinlock.h>
#include <linux/socket.h>
#include <linux/string.h>
#include <linux/skbuff.h>
#include <linux/audit.h>
#include <linux/in.h>
#include <linux/in6.h>
#include <linux/ip.h>
#include <linux/ipv6.h>
#include <linux/notifier.h>
#include <linux/netdevice.h>
#include <linux/security.h>
#include <linux/slab.h>
#include <net/sock.h>
#include <net/netlink.h>
#include <net/genetlink.h>
#include <net/ip.h>
#include <net/ipv6.h>
#include <net/net_namespace.h>
#include <net/netlabel.h>
#include <asm/bug.h>
#include <linux/atomic.h>
#include "netlabel_user.h"
#include "netlabel_addrlist.h"
#include "netlabel_domainhash.h"
#include "netlabel_unlabeled.h"
#include "netlabel_mgmt.h"

Go to the source code of this file.

Data Structures

struct  netlbl_unlhsh_tbl
 
struct  netlbl_unlhsh_addr4
 
struct  netlbl_unlhsh_addr6
 
struct  netlbl_unlhsh_iface
 
struct  netlbl_unlhsh_walk_arg
 

Macros

#define netlbl_unlhsh_addr4_entry(iter)   container_of(iter, struct netlbl_unlhsh_addr4, list)
 
#define netlbl_unlhsh_addr6_entry(iter)   container_of(iter, struct netlbl_unlhsh_addr6, list)
 
#define netlbl_unlhsh_rcu_deref(p)   rcu_dereference_check(p, lockdep_is_held(&netlbl_unlhsh_lock))
 

Functions

int netlbl_unlhsh_add (struct net *net, const char *dev_name, const void *addr, const void *mask, u32 addr_len, u32 secid, struct netlbl_audit *audit_info)
 
int netlbl_unlhsh_remove (struct net *net, const char *dev_name, const void *addr, const void *mask, u32 addr_len, struct netlbl_audit *audit_info)
 
int __init netlbl_unlabel_genl_init (void)
 
int __init netlbl_unlabel_init (u32 size)
 
int netlbl_unlabel_getattr (const struct sk_buff *skb, u16 family, struct netlbl_lsm_secattr *secattr)
 
int __init netlbl_unlabel_defconf (void)
 

Macro Definition Documentation

#define netlbl_unlhsh_addr4_entry (   iter)    container_of(iter, struct netlbl_unlhsh_addr4, list)

Definition at line 81 of file netlabel_unlabeled.c.

#define netlbl_unlhsh_addr6_entry (   iter)    container_of(iter, struct netlbl_unlhsh_addr6, list)

Definition at line 89 of file netlabel_unlabeled.c.

#define netlbl_unlhsh_rcu_deref (   p)    rcu_dereference_check(p, lockdep_is_held(&netlbl_unlhsh_lock))

Definition at line 118 of file netlabel_unlabeled.c.

Function Documentation

int __init netlbl_unlabel_defconf ( void  )

netlbl_unlabel_defconf - Set the default config to allow unlabeled packets

Description: Set the default NetLabel configuration to allow incoming unlabeled packets and to send unlabeled network traffic by default.

Definition at line 1534 of file netlabel_unlabeled.c.

int __init netlbl_unlabel_genl_init ( void  )

netlbl_unlabel_genl_init - Register the Unlabeled NetLabel component

Description: Register the unlabeled packet NetLabel component with the Generic NETLINK mechanism. Returns zero on success, negative values on failure.

Definition at line 1403 of file netlabel_unlabeled.c.

int netlbl_unlabel_getattr ( const struct sk_buff skb,
u16  family,
struct netlbl_lsm_secattr secattr 
)

netlbl_unlabel_getattr - Get the security attributes for an unlabled packet : the packet : protocol family : the security attributes

Description: Determine the security attributes, if any, for an unlabled packet and return them in . Returns zero on success and negative values on failure.

Definition at line 1470 of file netlabel_unlabeled.c.

int __init netlbl_unlabel_init ( u32  size)

netlbl_unlabel_init - Initialize the unlabeled connection hash table : the number of bits to use for the hash buckets

Description: Initializes the unlabeled connection hash table and registers a network device notification handler. This function should only be called by the NetLabel subsystem itself during initialization. Returns zero on success, non-zero values on error.

Definition at line 1428 of file netlabel_unlabeled.c.

int netlbl_unlhsh_add ( struct net net,
const char dev_name,
const void addr,
const void mask,
u32  addr_len,
u32  secid,
struct netlbl_audit audit_info 
)

netlbl_unlhsh_add - Adds a new entry to the unlabeled connection hash table : network namespace : interface name : IP address in network byte order : address mask in network byte order : length of address/mask (4 for IPv4, 16 for IPv6) : LSM secid value for the entry : NetLabel audit information

Description: Adds a new entry to the unlabeled connection hash table. Returns zero on success, negative values on failure.

Definition at line 384 of file netlabel_unlabeled.c.

int netlbl_unlhsh_remove ( struct net net,
const char dev_name,
const void addr,
const void mask,
u32  addr_len,
struct netlbl_audit audit_info 
)

netlbl_unlhsh_remove - Remove an entry from the unlabeled hash table : network namespace : interface name : IP address in network byte order : address mask in network byte order : length of address/mask (4 for IPv4, 16 for IPv6) : NetLabel audit information

Description: Removes and existing entry from the unlabeled connection hash table. Returns zero on success, negative values on failure.

Definition at line 648 of file netlabel_unlabeled.c.