+obj-m += nf_conntrack_rtsp.o
--- /dev/null
+++ b/extensions/rtsp/netfilter_helpers.h
-@@ -0,0 +1,133 @@
+@@ -0,0 +1,144 @@
+/*
+ * Helpers for netfiler modules. This file provides implementations for basic
+ * functions such as strncasecmp(), etc.
+/* Only include these functions for kernel code. */
+#ifdef __KERNEL__
+
++#include <net/netfilter/nf_conntrack_expect.h>
++
+#include <linux/ctype.h>
+#define iseol(c) ( (c) == '\r' || (c) == '\n' )
+
+}
+#endif /* NF_NEED_NEXTLINE */
+
++static inline int rtsp_nf_ct_expect_related(struct nf_conntrack_expect *expect)
++{
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0)
++ return nf_ct_expect_related(expect, 0);
++#else
++ return nf_ct_expect_related(expect);
++#endif
++}
++
+#endif /* __KERNEL__ */
+
+#endif /* _NETFILTER_HELPERS_H */
+#endif /* _NETFILTER_MIME_H */
--- /dev/null
+++ b/extensions/rtsp/nf_conntrack_rtsp.c
-@@ -0,0 +1,761 @@
+@@ -0,0 +1,756 @@
+/*
+ * RTSP extension for IP connection tracking
+ * (C) 2003 by Tom Marshall <tmarshall at real.com>
+#include <net/tcp.h>
+
+#include <net/netfilter/nf_conntrack.h>
-+#include <net/netfilter/nf_conntrack_expect.h>
+#include <net/netfilter/nf_conntrack_helper.h>
+#include <net/netfilter/nf_conntrack_zones.h>
+#include "nf_conntrack_rtsp.h"
+MODULE_PARM_DESC(ports, "port numbers of RTSP servers");
+module_param(max_outstanding, int, 0400);
+MODULE_PARM_DESC(max_outstanding, "max number of outstanding SETUP requests per RTSP session");
-+module_param(setup_timeout, int, 0400);
++module_param(setup_timeout, uint, 0400);
+MODULE_PARM_DESC(setup_timeout, "timeout on for unestablished data channels");
+
+static char *rtsp_buffer;
+ &expinfo, rtp_exp, rtcp_exp);
+#endif
+ else {
-+ if (nf_ct_expect_related(rtp_exp) == 0) {
-+ if (rtcp_exp && nf_ct_expect_related(rtcp_exp) != 0) {
++ if (rtsp_nf_ct_expect_related(rtp_exp) == 0) {
++ if (rtcp_exp && rtsp_nf_ct_expect_related(rtcp_exp) != 0) {
+ nf_ct_unexpect_related(rtp_exp);
+ pr_info("nf_conntrack_expect_related failed for rtcp\n");
+ ret = NF_DROP;
+ printk("nf_conntrack_rtsp: max_outstanding must be a positive integer\n");
+ return -EBUSY;
+ }
-+ if (setup_timeout < 0) {
-+ printk("nf_conntrack_rtsp: setup_timeout must be a positive integer\n");
-+ return -EBUSY;
-+ }
+
+ rtsp_exp_policy.max_expected = max_outstanding;
+ rtsp_exp_policy.timeout = setup_timeout;
+#endif /* _IP_CONNTRACK_RTSP_H */
--- /dev/null
+++ b/extensions/rtsp/nf_nat_rtsp.c
-@@ -0,0 +1,636 @@
+@@ -0,0 +1,635 @@
+/*
+ * RTSP extension for TCP NAT alteration
+ * (C) 2003 by Tom Marshall <tmarshall at real.com>
+#endif
+#include <net/netfilter/nf_nat_helper.h>
+#include "nf_conntrack_rtsp.h"
-+#include <net/netfilter/nf_conntrack_expect.h>
+
+#include <linux/inet.h>
+#include <linux/ctype.h>
+ case pb_single:
+ for (loport = prtspexp->loport; loport != 0; loport++) { /* XXX: improper wrap? */
+ rtp_t->dst.u.udp.port = htons(loport);
-+ if (nf_ct_expect_related(rtp_exp) == 0) {
++ if (rtsp_nf_ct_expect_related(rtp_exp) == 0) {
+ pr_debug("using port %hu\n", loport);
+ break;
+ }
+ case pb_range:
+ for (loport = prtspexp->loport; loport != 0; loport += 2) { /* XXX: improper wrap? */
+ rtp_t->dst.u.udp.port = htons(loport);
-+ if (nf_ct_expect_related(rtp_exp) != 0) {
++ if (rtsp_nf_ct_expect_related(rtp_exp) != 0) {
+ continue;
+ }
+ hiport = loport + 1;
+ rtcp_exp->tuple.dst.u.udp.port = htons(hiport);
-+ if (nf_ct_expect_related(rtcp_exp) != 0) {
++ if (rtsp_nf_ct_expect_related(rtcp_exp) != 0) {
+ nf_ct_unexpect_related(rtp_exp);
+ continue;
+ }
+ case pb_discon:
+ for (loport = prtspexp->loport; loport != 0; loport++) { /* XXX: improper wrap? */
+ rtp_t->dst.u.udp.port = htons(loport);
-+ if (nf_ct_expect_related(rtp_exp) == 0) {
++ if (rtsp_nf_ct_expect_related(rtp_exp) == 0) {
+ pr_debug("using port %hu (1 of 2)\n", loport);
+ break;
+ }
+ }
+ for (hiport = prtspexp->hiport; hiport != 0; hiport++) { /* XXX: improper wrap? */
+ rtp_t->dst.u.udp.port = htons(hiport);
-+ if (nf_ct_expect_related(rtp_exp) == 0) {
++ if (rtsp_nf_ct_expect_related(rtp_exp) == 0) {
+ pr_debug("using port %hu (2 of 2)\n", hiport);
+ break;
+ }