Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Functions | Variables
network.c File Reference
#include "common.h"
#include <linux/slab.h>

Go to the source code of this file.

Data Structures

struct  tomoyo_inet_addr_info
 
struct  tomoyo_unix_addr_info
 
struct  tomoyo_addr_info
 

Functions

bool tomoyo_parse_ipaddr_union (struct tomoyo_acl_param *param, struct tomoyo_ipaddr_union *ptr)
 
void tomoyo_print_ip (char *buf, const unsigned int size, const struct tomoyo_ipaddr_union *ptr)
 
int tomoyo_write_inet_network (struct tomoyo_acl_param *param)
 
int tomoyo_write_unix_network (struct tomoyo_acl_param *param)
 
int tomoyo_socket_listen_permission (struct socket *sock)
 
int tomoyo_socket_connect_permission (struct socket *sock, struct sockaddr *addr, int addr_len)
 
int tomoyo_socket_bind_permission (struct socket *sock, struct sockaddr *addr, int addr_len)
 
int tomoyo_socket_sendmsg_permission (struct socket *sock, struct msghdr *msg, int size)
 

Variables

const char *const tomoyo_proto_keyword [TOMOYO_SOCK_MAX]
 

Function Documentation

bool tomoyo_parse_ipaddr_union ( struct tomoyo_acl_param param,
struct tomoyo_ipaddr_union ptr 
)

tomoyo_parse_ipaddr_union - Parse an IP address.

Parameters
Pointer to "struct tomoyo_acl_param". : Pointer to "struct tomoyo_ipaddr_union".

Returns true on success, false otherwise.

Definition at line 49 of file network.c.

void tomoyo_print_ip ( char buf,
const unsigned int  size,
const struct tomoyo_ipaddr_union ptr 
)

tomoyo_print_ip - Print an IP address.

: Buffer to write to. : Size of . : Pointer to "struct ipaddr_union".

Returns nothing.

Definition at line 123 of file network.c.

int tomoyo_socket_bind_permission ( struct socket sock,
struct sockaddr addr,
int  addr_len 
)

tomoyo_socket_bind_permission - Check permission for setting the local address of a socket.

: Pointer to "struct socket". : Pointer to "struct sockaddr". : Size of .

Returns 0 on success, negative value otherwise.

Definition at line 717 of file network.c.

int tomoyo_socket_connect_permission ( struct socket sock,
struct sockaddr addr,
int  addr_len 
)

tomoyo_socket_connect_permission - Check permission for setting the remote address of a socket.

: Pointer to "struct socket". : Pointer to "struct sockaddr". : Size of .

Returns 0 on success, negative value otherwise.

Definition at line 680 of file network.c.

int tomoyo_socket_listen_permission ( struct socket sock)

tomoyo_socket_listen_permission - Check permission for listening a socket.

: Pointer to "struct socket".

Returns 0 on success, negative value otherwise.

Definition at line 645 of file network.c.

int tomoyo_socket_sendmsg_permission ( struct socket sock,
struct msghdr msg,
int  size 
)

tomoyo_socket_sendmsg_permission - Check permission for sending a datagram.

: Pointer to "struct socket". : Pointer to "struct msghdr". : Unused.

Returns 0 on success, negative value otherwise.

Definition at line 752 of file network.c.

int tomoyo_write_inet_network ( struct tomoyo_acl_param param)

tomoyo_write_inet_network - Write "struct tomoyo_inet_acl" list.

Parameters
Pointer to "struct tomoyo_acl_param".

Returns 0 on success, negative value otherwise.

Caller holds tomoyo_read_lock().

Definition at line 281 of file network.c.

int tomoyo_write_unix_network ( struct tomoyo_acl_param param)

tomoyo_write_unix_network - Write "struct tomoyo_unix_acl" list.

Parameters
Pointer to "struct tomoyo_acl_param".

Returns 0 on success, negative value otherwise.

Definition at line 326 of file network.c.

Variable Documentation

const char* const tomoyo_proto_keyword[TOMOYO_SOCK_MAX]
Initial value:
= {
[SOCK_STREAM] = "stream",
[SOCK_DGRAM] = "dgram",
[SOCK_RAW] = "raw",
[SOCK_SEQPACKET] = "seqpacket",
[0] = " ",
[4] = " ",
}

Definition at line 32 of file network.c.