#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/checksum.h>
#if IS_ENABLED(CONFIG_IPV6)
#include <net/transp_v6.h>
#endif
#include <net/ip_fib.h>
#include <linux/errqueue.h>
#include <linux/uaccess.h>
static void ip_cmsg_recv_pktinfo(struct msghdr *msg, struct sk_buff *skb)
{ … }
static void ip_cmsg_recv_ttl(struct msghdr *msg, struct sk_buff *skb)
{ … }
static void ip_cmsg_recv_tos(struct msghdr *msg, struct sk_buff *skb)
{ … }
static void ip_cmsg_recv_opts(struct msghdr *msg, struct sk_buff *skb)
{ … }
static void ip_cmsg_recv_retopts(struct net *net, struct msghdr *msg,
struct sk_buff *skb)
{ … }
static void ip_cmsg_recv_fragsize(struct msghdr *msg, struct sk_buff *skb)
{ … }
static void ip_cmsg_recv_checksum(struct msghdr *msg, struct sk_buff *skb,
int tlen, int offset)
{ … }
static void ip_cmsg_recv_security(struct msghdr *msg, struct sk_buff *skb)
{ … }
static void ip_cmsg_recv_dstaddr(struct msghdr *msg, struct sk_buff *skb)
{ … }
void ip_cmsg_recv_offset(struct msghdr *msg, struct sock *sk,
struct sk_buff *skb, int tlen, int offset)
{ … }
EXPORT_SYMBOL(…);
int ip_cmsg_send(struct sock *sk, struct msghdr *msg, struct ipcm_cookie *ipc,
bool allow_ipv6)
{ … }
static void ip_ra_destroy_rcu(struct rcu_head *head)
{ … }
int ip_ra_control(struct sock *sk, unsigned char on,
void (*destructor)(struct sock *))
{ … }
static void ipv4_icmp_error_rfc4884(const struct sk_buff *skb,
struct sock_ee_data_rfc4884 *out)
{ … }
void ip_icmp_error(struct sock *sk, struct sk_buff *skb, int err,
__be16 port, u32 info, u8 *payload)
{ … }
EXPORT_SYMBOL_GPL(…);
void ip_local_error(struct sock *sk, int err, __be32 daddr, __be16 port, u32 info)
{ … }
static inline bool ipv4_datagram_support_addr(struct sock_exterr_skb *serr)
{ … }
static bool ipv4_datagram_support_cmsg(const struct sock *sk,
struct sk_buff *skb,
int ee_origin)
{ … }
int ip_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len)
{ … }
void __ip_sock_set_tos(struct sock *sk, int val)
{ … }
void ip_sock_set_tos(struct sock *sk, int val)
{ … }
EXPORT_SYMBOL(…);
void ip_sock_set_freebind(struct sock *sk)
{ … }
EXPORT_SYMBOL(…);
void ip_sock_set_recverr(struct sock *sk)
{ … }
EXPORT_SYMBOL(…);
int ip_sock_set_mtu_discover(struct sock *sk, int val)
{ … }
EXPORT_SYMBOL(…);
void ip_sock_set_pktinfo(struct sock *sk)
{ … }
EXPORT_SYMBOL(…);
static bool setsockopt_needs_rtnl(int optname)
{ … }
static int set_mcast_msfilter(struct sock *sk, int ifindex,
int numsrc, int fmode,
struct sockaddr_storage *group,
struct sockaddr_storage *list)
{ … }
static int copy_group_source_from_sockptr(struct group_source_req *greqs,
sockptr_t optval, int optlen)
{ … }
static int do_mcast_group_source(struct sock *sk, int optname,
sockptr_t optval, int optlen)
{ … }
static int ip_set_mcast_msfilter(struct sock *sk, sockptr_t optval, int optlen)
{ … }
static int compat_ip_set_mcast_msfilter(struct sock *sk, sockptr_t optval,
int optlen)
{ … }
static int ip_mcast_join_leave(struct sock *sk, int optname,
sockptr_t optval, int optlen)
{ … }
static int compat_ip_mcast_join_leave(struct sock *sk, int optname,
sockptr_t optval, int optlen)
{ … }
DEFINE_STATIC_KEY_FALSE(ip4_min_ttl);
int do_ip_setsockopt(struct sock *sk, int level, int optname,
sockptr_t optval, unsigned int optlen)
{ … }
void ipv4_pktinfo_prepare(const struct sock *sk, struct sk_buff *skb, bool drop_dst)
{ … }
int ip_setsockopt(struct sock *sk, int level, int optname, sockptr_t optval,
unsigned int optlen)
{ … }
EXPORT_SYMBOL(…);
static bool getsockopt_needs_rtnl(int optname)
{ … }
static int ip_get_mcast_msfilter(struct sock *sk, sockptr_t optval,
sockptr_t optlen, int len)
{ … }
static int compat_ip_get_mcast_msfilter(struct sock *sk, sockptr_t optval,
sockptr_t optlen, int len)
{ … }
int do_ip_getsockopt(struct sock *sk, int level, int optname,
sockptr_t optval, sockptr_t optlen)
{ … }
int ip_getsockopt(struct sock *sk, int level,
int optname, char __user *optval, int __user *optlen)
{ … }
EXPORT_SYMBOL(…);