Linux Kernel
3.7.1
|
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <asm/uaccess.h>
#include <linux/mm.h>
#include <linux/interrupt.h>
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/inet.h>
#include <linux/netdevice.h>
#include <linux/rtnetlink.h>
#include <linux/poll.h>
#include <linux/highmem.h>
#include <linux/spinlock.h>
#include <linux/slab.h>
#include <net/protocol.h>
#include <linux/skbuff.h>
#include <net/checksum.h>
#include <net/sock.h>
#include <net/tcp_states.h>
#include <trace/events/skb.h>
Go to the source code of this file.
Definition at line 668 of file datagram.c.
Definition at line 654 of file datagram.c.
|
read |
__skb_recv_datagram - Receive a datagram skbuff : socket : MSG_ flags : an offset in bytes to peek skb from. Returns an offset within an skb where data actually starts : returns non-zero if this packet has been seen before : error code returned
Get a datagram skbuff, understands the peeking, nonblocking wakeups and possible races. This replaces identical code in packet, raw and udp, as well as the IPX AX.25 and Appletalk. It also finally fixes the long standing peek and read race for datagram sockets. If you alter this routine remember it must be re-entrant.
This function will lock the socket if a skb is returned, so the caller needs to unlock the socket in that case (usually by calling skb_free_datagram)
The order of the tests when we find no data waiting are specified quite explicitly by POSIX 1003.1g, don't change them without having the standard around please.
Definition at line 161 of file datagram.c.
Definition at line 741 of file datagram.c.
EXPORT_SYMBOL | ( | __skb_recv_datagram | ) |
EXPORT_SYMBOL | ( | skb_recv_datagram | ) |
EXPORT_SYMBOL | ( | skb_free_datagram | ) |
EXPORT_SYMBOL | ( | skb_free_datagram_locked | ) |
EXPORT_SYMBOL | ( | skb_kill_datagram | ) |
EXPORT_SYMBOL | ( | skb_copy_datagram_iovec | ) |
EXPORT_SYMBOL | ( | skb_copy_datagram_const_iovec | ) |
EXPORT_SYMBOL | ( | skb_copy_datagram_from_iovec | ) |
EXPORT_SYMBOL | ( | __skb_checksum_complete_head | ) |
EXPORT_SYMBOL | ( | __skb_checksum_complete | ) |
EXPORT_SYMBOL | ( | skb_copy_and_csum_datagram_iovec | ) |
EXPORT_SYMBOL | ( | datagram_poll | ) |
skb_copy_and_csum_datagram_iovec - Copy and checkum skb to user iovec. : skbuff : hardware length : io vector
Caller must check that skb will fit to this iovec.
Returns: 0 - success. -EINVAL - checksum failure. -EFAULT - fault during copy. Beware, in this case iovec can be modified!
Definition at line 687 of file datagram.c.
int skb_copy_datagram_const_iovec | ( | const struct sk_buff * | skb, |
int | offset, | ||
const struct iovec * | to, | ||
int | to_offset, | ||
int | len | ||
) |
skb_copy_datagram_const_iovec - Copy a datagram to an iovec. : buffer to copy : offset in the buffer to start copying from : io vector to copy to : offset in the io vector to start copying to : amount of data to copy from buffer to iovec
Returns 0 or -EFAULT. Note: the iovec is not modified during the copy.
Definition at line 394 of file datagram.c.
int skb_copy_datagram_from_iovec | ( | struct sk_buff * | skb, |
int | offset, | ||
const struct iovec * | from, | ||
int | from_offset, | ||
int | len | ||
) |
skb_copy_datagram_from_iovec - Copy a datagram from an iovec. : buffer to copy : offset in the buffer to start copying to : io vector to copy to : offset in the io vector to start copying from : amount of data to copy to buffer from iovec
Returns 0 or -EFAULT. Note: the iovec is not modified during the copy.
Definition at line 483 of file datagram.c.
skb_copy_datagram_iovec - Copy a datagram to an iovec. : buffer to copy : offset in the buffer to start copying from : io vector to copy to : amount of data to copy from buffer to iovec
Note: the iovec is modified during the copy.
Definition at line 308 of file datagram.c.
Definition at line 229 of file datagram.c.
Definition at line 236 of file datagram.c.
skb_kill_datagram - Free a datagram skbuff forcibly : socket : datagram skbuff : MSG_ flags
This function frees a datagram skbuff that was received by skb_recv_datagram. The flags argument must match the one used for skb_recv_datagram.
If the MSG_PEEK flag is set, and the packet is still on the receive queue of the socket, it will be taken off the queue before it is freed.
This function currently only disables BH when acquiring the sk_receive_queue lock. Therefore it must not be used in a context where that lock is acquired in an IRQ context.
It returns 0 if the packet was removed by us.
Definition at line 276 of file datagram.c.