#include <linux/types.h>
#include <linux/timer.h>
#include <linux/netfilter.h>
#include <linux/in.h>
#include <linux/ip.h>
#include <linux/sctp.h>
#include <linux/string.h>
#include <linux/seq_file.h>
#include <linux/spinlock.h>
#include <linux/interrupt.h>
#include <net/sctp/checksum.h>
#include <net/netfilter/nf_log.h>
#include <net/netfilter/nf_conntrack.h>
#include <net/netfilter/nf_conntrack_l4proto.h>
#include <net/netfilter/nf_conntrack_ecache.h>
#include <net/netfilter/nf_conntrack_timeout.h>
static const char *const sctp_conntrack_names[] = …;
#define SECS …
#define MINS …
#define HOURS …
#define DAYS …
static const unsigned int sctp_timeouts[SCTP_CONNTRACK_MAX] = …;
#define SCTP_FLAG_HEARTBEAT_VTAG_FAILED …
#define sNO …
#define sCL …
#define sCW …
#define sCE …
#define sES …
#define sSS …
#define sSR …
#define sSA …
#define sHS …
#define sIV …
static const u8 sctp_conntracks[2][11][SCTP_CONNTRACK_MAX] = …;
#ifdef CONFIG_NF_CONNTRACK_PROCFS
static void sctp_print_conntrack(struct seq_file *s, struct nf_conn *ct)
{ … }
#endif
#define for_each_sctp_chunk(skb, sch, _sch, offset, dataoff, count) …
static int do_basic_checks(struct nf_conn *ct,
const struct sk_buff *skb,
unsigned int dataoff,
unsigned long *map,
const struct nf_hook_state *state)
{ … }
static int sctp_new_state(enum ip_conntrack_dir dir,
enum sctp_conntrack cur_state,
int chunk_type)
{ … }
static noinline bool
sctp_new(struct nf_conn *ct, const struct sk_buff *skb,
const struct sctphdr *sh, unsigned int dataoff)
{ … }
static bool sctp_error(struct sk_buff *skb,
unsigned int dataoff,
const struct nf_hook_state *state)
{ … }
int nf_conntrack_sctp_packet(struct nf_conn *ct,
struct sk_buff *skb,
unsigned int dataoff,
enum ip_conntrack_info ctinfo,
const struct nf_hook_state *state)
{ … }
static bool sctp_can_early_drop(const struct nf_conn *ct)
{ … }
#if IS_ENABLED(CONFIG_NF_CT_NETLINK)
#include <linux/netfilter/nfnetlink.h>
#include <linux/netfilter/nfnetlink_conntrack.h>
static int sctp_to_nlattr(struct sk_buff *skb, struct nlattr *nla,
struct nf_conn *ct, bool destroy)
{ … }
static const struct nla_policy sctp_nla_policy[CTA_PROTOINFO_SCTP_MAX+1] = …;
#define SCTP_NLATTR_SIZE …
static int nlattr_to_sctp(struct nlattr *cda[], struct nf_conn *ct)
{ … }
#endif
#ifdef CONFIG_NF_CONNTRACK_TIMEOUT
#include <linux/netfilter/nfnetlink.h>
#include <linux/netfilter/nfnetlink_cttimeout.h>
static int sctp_timeout_nlattr_to_obj(struct nlattr *tb[],
struct net *net, void *data)
{ … }
static int
sctp_timeout_obj_to_nlattr(struct sk_buff *skb, const void *data)
{ … }
static const struct nla_policy
sctp_timeout_nla_policy[CTA_TIMEOUT_SCTP_MAX+1] = …;
#endif
void nf_conntrack_sctp_init_net(struct net *net)
{ … }
const struct nf_conntrack_l4proto nf_conntrack_l4proto_sctp = …;