linux/net/dccp/ipv4.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *  net/dccp/ipv4.c
 *
 *  An implementation of the DCCP protocol
 *  Arnaldo Carvalho de Melo <[email protected]>
 */

#include <linux/dccp.h>
#include <linux/icmp.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/skbuff.h>
#include <linux/random.h>

#include <net/icmp.h>
#include <net/inet_common.h>
#include <net/inet_hashtables.h>
#include <net/inet_sock.h>
#include <net/protocol.h>
#include <net/sock.h>
#include <net/timewait_sock.h>
#include <net/tcp_states.h>
#include <net/xfrm.h>
#include <net/secure_seq.h>
#include <net/netns/generic.h>
#include <net/rstreason.h>

#include "ackvec.h"
#include "ccid.h"
#include "dccp.h"
#include "feat.h"

struct dccp_v4_pernet {};

static unsigned int dccp_v4_pernet_id __read_mostly;

/*
 * The per-net v4_ctl_sk socket is used for responding to
 * the Out-of-the-blue (OOTB) packets. A control sock will be created
 * for this socket at the initialization time.
 */

int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
{}
EXPORT_SYMBOL_GPL();

/*
 * This routine does path mtu discovery as defined in RFC1191.
 */
static inline void dccp_do_pmtu_discovery(struct sock *sk,
					  const struct iphdr *iph,
					  u32 mtu)
{}

static void dccp_do_redirect(struct sk_buff *skb, struct sock *sk)
{}

void dccp_req_err(struct sock *sk, u64 seq)
	{}
EXPORT_SYMBOL();

/*
 * This routine is called by the ICMP module when it gets some sort of error
 * condition. If err < 0 then the socket should be closed and the error
 * returned to the user. If err > 0 it's just the icmp type << 8 | icmp code.
 * After adjustment header points to the first 8 bytes of the tcp header. We
 * need to find the appropriate port.
 *
 * The locking strategy used here is very "optimistic". When someone else
 * accesses the socket the ICMP is just dropped and for some paths there is no
 * check at all. A more general error queue to queue errors for later handling
 * is probably better.
 */
static int dccp_v4_err(struct sk_buff *skb, u32 info)
{}

static inline __sum16 dccp_v4_csum_finish(struct sk_buff *skb,
				      __be32 src, __be32 dst)
{}

void dccp_v4_send_check(struct sock *sk, struct sk_buff *skb)
{}
EXPORT_SYMBOL_GPL();

static inline u64 dccp_v4_init_sequence(const struct sk_buff *skb)
{}

/*
 * The three way handshake has completed - we got a valid ACK or DATAACK -
 * now create the new socket.
 *
 * This is the equivalent of TCP's tcp_v4_syn_recv_sock
 */
struct sock *dccp_v4_request_recv_sock(const struct sock *sk,
				       struct sk_buff *skb,
				       struct request_sock *req,
				       struct dst_entry *dst,
				       struct request_sock *req_unhash,
				       bool *own_req)
{}
EXPORT_SYMBOL_GPL();

static struct dst_entry* dccp_v4_route_skb(struct net *net, struct sock *sk,
					   struct sk_buff *skb)
{}

static int dccp_v4_send_response(const struct sock *sk, struct request_sock *req)
{}

static void dccp_v4_ctl_send_reset(const struct sock *sk, struct sk_buff *rxskb,
				   enum sk_rst_reason reason)
{}

static void dccp_v4_reqsk_destructor(struct request_sock *req)
{}

void dccp_syn_ack_timeout(const struct request_sock *req)
{}
EXPORT_SYMBOL();

static struct request_sock_ops dccp_request_sock_ops __read_mostly =;

int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
{}
EXPORT_SYMBOL_GPL();

int dccp_v4_do_rcv(struct sock *sk, struct sk_buff *skb)
{}
EXPORT_SYMBOL_GPL();

/**
 *	dccp_invalid_packet  -  check for malformed packets
 *	@skb: Packet to validate
 *
 *	Implements RFC 4340, 8.5:  Step 1: Check header basics
 *	Packets that fail these checks are ignored and do not receive Resets.
 */
int dccp_invalid_packet(struct sk_buff *skb)
{}
EXPORT_SYMBOL_GPL();

/* this is called when real data arrives */
static int dccp_v4_rcv(struct sk_buff *skb)
{}

static const struct inet_connection_sock_af_ops dccp_ipv4_af_ops =;

static int dccp_v4_init_sock(struct sock *sk)
{}

static struct timewait_sock_ops dccp_timewait_sock_ops =;

static struct proto dccp_v4_prot =;

static const struct net_protocol dccp_v4_protocol =;

static const struct proto_ops inet_dccp_ops =;

static struct inet_protosw dccp_v4_protosw =;

static int __net_init dccp_v4_init_net(struct net *net)
{}

static void __net_exit dccp_v4_exit_net(struct net *net)
{}

static void __net_exit dccp_v4_exit_batch(struct list_head *net_exit_list)
{}

static struct pernet_operations dccp_v4_ops =;

static int __init dccp_v4_init(void)
{}

static void __exit dccp_v4_exit(void)
{}

module_init();
module_exit(dccp_v4_exit);

/*
 * __stringify doesn't likes enums, so use SOCK_DCCP (6) and IPPROTO_DCCP (33)
 * values directly, Also cover the case where the protocol is not specified,
 * i.e. net-pf-PF_INET-proto-0-type-SOCK_DCCP
 */
MODULE_ALIAS_NET_PF_PROTO_TYPE();
MODULE_ALIAS_NET_PF_PROTO_TYPE();
MODULE_LICENSE();
MODULE_AUTHOR();
MODULE_DESCRIPTION();