Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
ip_sockglue.c File Reference
#include <linux/module.h>
#include <linux/types.h>
#include <linux/mm.h>
#include <linux/skbuff.h>
#include <linux/ip.h>
#include <linux/icmp.h>
#include <linux/inetdevice.h>
#include <linux/netdevice.h>
#include <linux/slab.h>
#include <net/sock.h>
#include <net/ip.h>
#include <net/icmp.h>
#include <net/tcp_states.h>
#include <linux/udp.h>
#include <linux/igmp.h>
#include <linux/netfilter.h>
#include <linux/route.h>
#include <linux/mroute.h>
#include <net/inet_ecn.h>
#include <net/route.h>
#include <net/xfrm.h>
#include <net/compat.h>
#include <net/ip_fib.h>
#include <linux/errqueue.h>
#include <asm/uaccess.h>

Go to the source code of this file.

Macros

#define IP_CMSG_PKTINFO   1
 
#define IP_CMSG_TTL   2
 
#define IP_CMSG_TOS   4
 
#define IP_CMSG_RECVOPTS   8
 
#define IP_CMSG_RETOPTS   16
 
#define IP_CMSG_PASSSEC   32
 
#define IP_CMSG_ORIGDSTADDR   64
 
#define PKTINFO_SKB_CB(__skb)   ((struct in_pktinfo *)((__skb)->cb))
 

Functions

void ip_cmsg_recv (struct msghdr *msg, struct sk_buff *skb)
 
 EXPORT_SYMBOL (ip_cmsg_recv)
 
int ip_cmsg_send (struct net *net, struct msghdr *msg, struct ipcm_cookie *ipc)
 
int ip_ra_control (struct sock *sk, unsigned char on, void(*destructor)(struct sock *))
 
void ip_icmp_error (struct sock *sk, struct sk_buff *skb, int err, __be16 port, u32 info, u8 *payload)
 
void ip_local_error (struct sock *sk, int err, __be32 daddr, __be16 port, u32 info)
 
int ip_recv_error (struct sock *sk, struct msghdr *msg, int len)
 
void ipv4_pktinfo_prepare (struct sk_buff *skb)
 
int ip_setsockopt (struct sock *sk, int level, int optname, char __user *optval, unsigned int optlen)
 
 EXPORT_SYMBOL (ip_setsockopt)
 
int ip_getsockopt (struct sock *sk, int level, int optname, char __user *optval, int __user *optlen)
 
 EXPORT_SYMBOL (ip_getsockopt)
 

Variables

struct ip_ra_chain __rcuip_ra_chain
 

Macro Definition Documentation

#define IP_CMSG_ORIGDSTADDR   64

Definition at line 54 of file ip_sockglue.c.

#define IP_CMSG_PASSSEC   32

Definition at line 53 of file ip_sockglue.c.

#define IP_CMSG_PKTINFO   1

Definition at line 48 of file ip_sockglue.c.

#define IP_CMSG_RECVOPTS   8

Definition at line 51 of file ip_sockglue.c.

#define IP_CMSG_RETOPTS   16

Definition at line 52 of file ip_sockglue.c.

#define IP_CMSG_TOS   4

Definition at line 50 of file ip_sockglue.c.

#define IP_CMSG_TTL   2

Definition at line 49 of file ip_sockglue.c.

#define PKTINFO_SKB_CB (   __skb)    ((struct in_pktinfo *)((__skb)->cb))

Definition at line 59 of file ip_sockglue.c.

Function Documentation

EXPORT_SYMBOL ( ip_cmsg_recv  )
EXPORT_SYMBOL ( ip_setsockopt  )
EXPORT_SYMBOL ( ip_getsockopt  )
void ip_cmsg_recv ( struct msghdr msg,
struct sk_buff skb 
)

Definition at line 148 of file ip_sockglue.c.

int ip_cmsg_send ( struct net net,
struct msghdr msg,
struct ipcm_cookie ipc 
)

Definition at line 190 of file ip_sockglue.c.

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

Definition at line 1340 of file ip_sockglue.c.

void ip_icmp_error ( struct sock sk,
struct sk_buff skb,
int  err,
__be16  port,
u32  info,
u8 payload 
)

Definition at line 302 of file ip_sockglue.c.

void ip_local_error ( struct sock sk,
int  err,
__be32  daddr,
__be16  port,
u32  info 
)

Definition at line 331 of file ip_sockglue.c.

int ip_ra_control ( struct sock sk,
unsigned char  on,
void(*)(struct sock *)  destructor 
)

Definition at line 248 of file ip_sockglue.c.

int ip_recv_error ( struct sock sk,
struct msghdr msg,
int  len 
)

Definition at line 371 of file ip_sockglue.c.

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

Definition at line 1050 of file ip_sockglue.c.

void ipv4_pktinfo_prepare ( struct sk_buff skb)

ipv4_pktinfo_prepare - transfert some info from rtable to skb : socket : buffer

To support IP_CMSG_PKTINFO option, we store rt_iif and specific destination in skb->cb[] before dst drop. This way, receiver doesnt make cache line misses to read rtable.

Definition at line 1036 of file ip_sockglue.c.

Variable Documentation

Definition at line 236 of file ip_sockglue.c.