Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
udp.c File Reference
#include <asm/uaccess.h>
#include <asm/ioctls.h>
#include <linux/bootmem.h>
#include <linux/highmem.h>
#include <linux/swap.h>
#include <linux/types.h>
#include <linux/fcntl.h>
#include <linux/module.h>
#include <linux/socket.h>
#include <linux/sockios.h>
#include <linux/igmp.h>
#include <linux/in.h>
#include <linux/errno.h>
#include <linux/timer.h>
#include <linux/mm.h>
#include <linux/inet.h>
#include <linux/netdevice.h>
#include <linux/slab.h>
#include <net/tcp_states.h>
#include <linux/skbuff.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <net/net_namespace.h>
#include <net/icmp.h>
#include <net/route.h>
#include <net/checksum.h>
#include <net/xfrm.h>
#include <trace/events/udp.h>
#include <linux/static_key.h>
#include <trace/events/skb.h>
#include "udp_impl.h"

Go to the source code of this file.

Macros

#define pr_fmt(fmt)   "UDP: " fmt
 
#define MAX_UDP_PORTS   65536
 
#define PORTS_PER_CHAIN   (MAX_UDP_PORTS / UDP_HTABLE_SIZE_MIN)
 
#define SCORE2_MAX   (1 + 2 + 2 + 2)
 

Functions

 EXPORT_SYMBOL (udp_table)
 
 EXPORT_SYMBOL (sysctl_udp_mem)
 
 EXPORT_SYMBOL (sysctl_udp_rmem_min)
 
 EXPORT_SYMBOL (sysctl_udp_wmem_min)
 
 EXPORT_SYMBOL (udp_memory_allocated)
 
int udp_lib_get_port (struct sock *sk, unsigned short snum, int(*saddr_comp)(const struct sock *sk1, const struct sock *sk2), unsigned int hash2_nulladdr)
 
 EXPORT_SYMBOL (udp_lib_get_port)
 
int udp_v4_get_port (struct sock *sk, unsigned short snum)
 
struct sock__udp4_lib_lookup (struct net *net, __be32 saddr, __be16 sport, __be32 daddr, __be16 dport, int dif, struct udp_table *udptable)
 
 EXPORT_SYMBOL_GPL (__udp4_lib_lookup)
 
struct sockudp4_lib_lookup (struct net *net, __be32 saddr, __be16 sport, __be32 daddr, __be16 dport, int dif)
 
 EXPORT_SYMBOL_GPL (udp4_lib_lookup)
 
void __udp4_lib_err (struct sk_buff *skb, u32 info, struct udp_table *udptable)
 
void udp_err (struct sk_buff *skb, u32 info)
 
void udp_flush_pending_frames (struct sock *sk)
 
 EXPORT_SYMBOL (udp_flush_pending_frames)
 
int udp_sendmsg (struct kiocb *iocb, struct sock *sk, struct msghdr *msg, size_t len)
 
 EXPORT_SYMBOL (udp_sendmsg)
 
int udp_sendpage (struct sock *sk, struct page *page, int offset, size_t size, int flags)
 
int udp_ioctl (struct sock *sk, int cmd, unsigned long arg)
 
 EXPORT_SYMBOL (udp_ioctl)
 
int udp_recvmsg (struct kiocb *iocb, struct sock *sk, struct msghdr *msg, size_t len, int noblock, int flags, int *addr_len)
 
int udp_disconnect (struct sock *sk, int flags)
 
 EXPORT_SYMBOL (udp_disconnect)
 
void udp_lib_unhash (struct sock *sk)
 
 EXPORT_SYMBOL (udp_lib_unhash)
 
void udp_lib_rehash (struct sock *sk, u16 newhash)
 
 EXPORT_SYMBOL (udp_lib_rehash)
 
void udp_encap_enable (void)
 
 EXPORT_SYMBOL (udp_encap_enable)
 
int udp_queue_rcv_skb (struct sock *sk, struct sk_buff *skb)
 
int __udp4_lib_rcv (struct sk_buff *skb, struct udp_table *udptable, int proto)
 
int udp_rcv (struct sk_buff *skb)
 
void udp_destroy_sock (struct sock *sk)
 
int udp_lib_setsockopt (struct sock *sk, int level, int optname, char __user *optval, unsigned int optlen, int(*push_pending_frames)(struct sock *))
 
 EXPORT_SYMBOL (udp_lib_setsockopt)
 
int udp_setsockopt (struct sock *sk, int level, int optname, char __user *optval, unsigned int optlen)
 
int udp_lib_getsockopt (struct sock *sk, int level, int optname, char __user *optval, int __user *optlen)
 
 EXPORT_SYMBOL (udp_lib_getsockopt)
 
int udp_getsockopt (struct sock *sk, int level, int optname, char __user *optval, int __user *optlen)
 
unsigned int udp_poll (struct file *file, struct socket *sock, poll_table *wait)
 
 EXPORT_SYMBOL (udp_poll)
 
 EXPORT_SYMBOL (udp_prot)
 
 __setup ("uhash_entries=", set_uhash_entries)
 
void __init udp_table_init (struct udp_table *table, const char *name)
 
void __init udp_init (void)
 
int udp4_ufo_send_check (struct sk_buff *skb)
 
struct sk_buffudp4_ufo_fragment (struct sk_buff *skb, netdev_features_t features)
 

Variables

struct udp_table udp_table __read_mostly
 
atomic_long_t udp_memory_allocated
 
struct proto udp_prot
 

Macro Definition Documentation

#define MAX_UDP_PORTS   65536

Definition at line 129 of file udp.c.

#define PORTS_PER_CHAIN   (MAX_UDP_PORTS / UDP_HTABLE_SIZE_MIN)

Definition at line 130 of file udp.c.

#define pr_fmt (   fmt)    "UDP: " fmt

Definition at line 80 of file udp.c.

#define SCORE2_MAX   (1 + 2 + 2 + 2)

Definition at line 368 of file udp.c.

Function Documentation

__setup ( )
void __udp4_lib_err ( struct sk_buff skb,
u32  info,
struct udp_table udptable 
)

Definition at line 583 of file udp.c.

struct sock* __udp4_lib_lookup ( struct net net,
__be32  saddr,
__be16  sport,
__be32  daddr,
__be16  dport,
int  dif,
struct udp_table udptable 
)
read

Definition at line 451 of file udp.c.

int __udp4_lib_rcv ( struct sk_buff skb,
struct udp_table udptable,
int  proto 
)

Definition at line 1640 of file udp.c.

EXPORT_SYMBOL ( udp_table  )
EXPORT_SYMBOL ( sysctl_udp_mem  )
EXPORT_SYMBOL ( sysctl_udp_rmem_min  )
EXPORT_SYMBOL ( sysctl_udp_wmem_min  )
EXPORT_SYMBOL ( udp_memory_allocated  )
EXPORT_SYMBOL ( udp_lib_get_port  )
EXPORT_SYMBOL ( udp_flush_pending_frames  )
EXPORT_SYMBOL ( udp_sendmsg  )
EXPORT_SYMBOL ( udp_ioctl  )
EXPORT_SYMBOL ( udp_disconnect  )
EXPORT_SYMBOL ( udp_lib_unhash  )
EXPORT_SYMBOL ( udp_lib_rehash  )
EXPORT_SYMBOL ( udp_encap_enable  )
EXPORT_SYMBOL ( udp_lib_setsockopt  )
EXPORT_SYMBOL ( udp_lib_getsockopt  )
EXPORT_SYMBOL ( udp_poll  )
EXPORT_SYMBOL ( udp_prot  )
EXPORT_SYMBOL_GPL ( __udp4_lib_lookup  )
EXPORT_SYMBOL_GPL ( udp4_lib_lookup  )
struct sock* udp4_lib_lookup ( struct net net,
__be32  saddr,
__be16  sport,
__be32  daddr,
__be16  dport,
int  dif 
)
read

Definition at line 535 of file udp.c.

struct sk_buff* udp4_ufo_fragment ( struct sk_buff skb,
netdev_features_t  features 
)
read

Definition at line 2266 of file udp.c.

int udp4_ufo_send_check ( struct sk_buff skb)

Definition at line 2247 of file udp.c.

void udp_destroy_sock ( struct sock sk)

Definition at line 1738 of file udp.c.

int udp_disconnect ( struct sock sk,
int  flags 
)

Definition at line 1277 of file udp.c.

void udp_encap_enable ( void  )

Definition at line 1396 of file udp.c.

void udp_err ( struct sk_buff skb,
u32  info 
)

Definition at line 654 of file udp.c.

void udp_flush_pending_frames ( struct sock sk)

Definition at line 662 of file udp.c.

int udp_getsockopt ( struct sock sk,
int  level,
int  optname,
char __user optval,
int __user optlen 
)

Definition at line 1896 of file udp.c.

void __init udp_init ( void  )

Definition at line 2232 of file udp.c.

int udp_ioctl ( struct sock sk,
int  cmd,
unsigned long  arg 
)

Definition at line 1132 of file udp.c.

int udp_lib_get_port ( struct sock sk,
unsigned short  snum,
int(*)(const struct sock *sk1, const struct sock *sk2)  saddr_comp,
unsigned int  hash2_nulladdr 
)

udp_lib_get_port - UDP/-Lite port lookup for IPv4 and IPv6

: socket struct in question : port number to look up : AF-dependent comparison of bound local IP addresses : AF-dependent hash value in secondary hash chains, with NULL address

Definition at line 199 of file udp.c.

int udp_lib_getsockopt ( struct sock sk,
int  level,
int  optname,
char __user optval,
int __user optlen 
)

Definition at line 1851 of file udp.c.

void udp_lib_rehash ( struct sock sk,
u16  newhash 
)

Definition at line 1330 of file udp.c.

int udp_lib_setsockopt ( struct sock sk,
int  level,
int  optname,
char __user optval,
unsigned int  optlen,
int(*)(struct sock *)  push_pending_frames 
)

Definition at line 1748 of file udp.c.

void udp_lib_unhash ( struct sock sk)

Definition at line 1301 of file udp.c.

unsigned int udp_poll ( struct file file,
struct socket sock,
poll_table wait 
)

Definition at line 1926 of file udp.c.

int udp_queue_rcv_skb ( struct sock sk,
struct sk_buff skb 
)

Definition at line 1411 of file udp.c.

int udp_rcv ( struct sk_buff skb)

Definition at line 1733 of file udp.c.

int udp_recvmsg ( struct kiocb iocb,
struct sock sk,
struct msghdr msg,
size_t  len,
int  noblock,
int  flags,
int addr_len 
)

Definition at line 1170 of file udp.c.

int udp_sendmsg ( struct kiocb iocb,
struct sock sk,
struct msghdr msg,
size_t  len 
)

Definition at line 797 of file udp.c.

int udp_sendpage ( struct sock sk,
struct page page,
int  offset,
size_t  size,
int  flags 
)

Definition at line 1040 of file udp.c.

int udp_setsockopt ( struct sock sk,
int  level,
int  optname,
char __user optval,
unsigned int  optlen 
)

Definition at line 1831 of file udp.c.

void __init udp_table_init ( struct udp_table table,
const char name 
)

Definition at line 2205 of file udp.c.

int udp_v4_get_port ( struct sock sk,
unsigned short  snum 
)

Definition at line 318 of file udp.c.

Variable Documentation

struct static_key udp_encap_needed __read_mostly

Definition at line 114 of file udp.c.

atomic_long_t udp_memory_allocated

Definition at line 126 of file udp.c.

struct proto udp_prot

Definition at line 1941 of file udp.c.