add thermal symbol to the generic .25 config
[openwrt.git] / target / linux / generic-2.6 / patches-2.6.24 / 190-netfilter_rtsp.patch
index 0dc8596e5d22f0036d6fdd584ff893075102269a..6e6abc73aff673f5311c4dd77b02e6a6d5d00a2c 100644 (file)
@@ -1,7 +1,5 @@
-Index: linux-2.6.23-rc9/include/linux/netfilter/nf_conntrack_rtsp.h
-===================================================================
---- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.23-rc9/include/linux/netfilter/nf_conntrack_rtsp.h       2007-10-05 21:26:39.000000000 +0800
+--- /dev/null
++++ b/include/linux/netfilter/nf_conntrack_rtsp.h
 @@ -0,0 +1,63 @@
 +/*
 + * RTSP extension for IP connection tracking.
@@ -53,7 +51,7 @@ Index: linux-2.6.23-rc9/include/linux/netfilter/nf_conntrack_rtsp.h
 +#endif
 +};
 +
-+extern unsigned int (*nf_nat_rtsp_hook)(struct sk_buff **pskb,
++extern unsigned int (*nf_nat_rtsp_hook)(struct sk_buff *skb,
 +                               enum ip_conntrack_info ctinfo,
 +                               unsigned int matchoff, unsigned int matchlen,
 +                               struct ip_ct_rtsp_expect *prtspexp,
@@ -66,10 +64,8 @@ Index: linux-2.6.23-rc9/include/linux/netfilter/nf_conntrack_rtsp.h
 +#endif /* __KERNEL__ */
 +
 +#endif /* _IP_CONNTRACK_RTSP_H */
-Index: linux-2.6.23-rc9/include/linux/netfilter_helpers.h
-===================================================================
---- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.23-rc9/include/linux/netfilter_helpers.h 2007-10-05 21:26:39.000000000 +0800
+--- /dev/null
++++ b/include/linux/netfilter_helpers.h
 @@ -0,0 +1,133 @@
 +/*
 + * Helpers for netfiler modules.  This file provides implementations for basic
@@ -204,10 +200,8 @@ Index: linux-2.6.23-rc9/include/linux/netfilter_helpers.h
 +#endif /* __KERNEL__ */
 +
 +#endif /* _NETFILTER_HELPERS_H */
-Index: linux-2.6.23-rc9/include/linux/netfilter_mime.h
-===================================================================
---- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.23-rc9/include/linux/netfilter_mime.h    2007-10-05 21:26:39.000000000 +0800
+--- /dev/null
++++ b/include/linux/netfilter_mime.h
 @@ -0,0 +1,89 @@
 +/*
 + * MIME functions for netfilter modules.  This file provides implementations
@@ -298,10 +292,8 @@ Index: linux-2.6.23-rc9/include/linux/netfilter_mime.h
 +#endif /* __KERNEL__ */
 +
 +#endif /* _NETFILTER_MIME_H */
-Index: linux-2.6.23-rc9/net/ipv4/netfilter/Makefile
-===================================================================
---- linux-2.6.23-rc9.orig/net/ipv4/netfilter/Makefile  2007-10-05 21:26:39.000000000 +0800
-+++ linux-2.6.23-rc9/net/ipv4/netfilter/Makefile       2007-10-05 21:26:39.000000000 +0800
+--- a/net/ipv4/netfilter/Makefile
++++ b/net/ipv4/netfilter/Makefile
 @@ -23,6 +23,7 @@
  obj-$(CONFIG_NF_NAT_FTP) += nf_nat_ftp.o
  obj-$(CONFIG_NF_NAT_H323) += nf_nat_h323.o
@@ -310,10 +302,8 @@ Index: linux-2.6.23-rc9/net/ipv4/netfilter/Makefile
  obj-$(CONFIG_NF_NAT_PPTP) += nf_nat_pptp.o
  obj-$(CONFIG_NF_NAT_SIP) += nf_nat_sip.o
  obj-$(CONFIG_NF_NAT_SNMP_BASIC) += nf_nat_snmp_basic.o
-Index: linux-2.6.23-rc9/net/netfilter/Kconfig
-===================================================================
---- linux-2.6.23-rc9.orig/net/netfilter/Kconfig        2007-10-05 21:26:39.000000000 +0800
-+++ linux-2.6.23-rc9/net/netfilter/Kconfig     2007-10-05 21:26:39.000000000 +0800
+--- a/net/netfilter/Kconfig
++++ b/net/netfilter/Kconfig
 @@ -249,6 +249,16 @@
  
          To compile it as a module, choose M here.  If unsure, say N.
@@ -331,10 +321,8 @@ Index: linux-2.6.23-rc9/net/netfilter/Kconfig
  config NF_CT_NETLINK
        tristate 'Connection tracking netlink interface (EXPERIMENTAL)'
        depends on EXPERIMENTAL && NF_CONNTRACK && NETFILTER_NETLINK
-Index: linux-2.6.23-rc9/net/netfilter/Makefile
-===================================================================
---- linux-2.6.23-rc9.orig/net/netfilter/Makefile       2007-10-05 21:26:39.000000000 +0800
-+++ linux-2.6.23-rc9/net/netfilter/Makefile    2007-10-05 21:26:39.000000000 +0800
+--- a/net/netfilter/Makefile
++++ b/net/netfilter/Makefile
 @@ -33,6 +33,7 @@
  obj-$(CONFIG_NF_CONNTRACK_SANE) += nf_conntrack_sane.o
  obj-$(CONFIG_NF_CONNTRACK_SIP) += nf_conntrack_sip.o
@@ -343,11 +331,9 @@ Index: linux-2.6.23-rc9/net/netfilter/Makefile
  
  # generic X tables 
  obj-$(CONFIG_NETFILTER_XTABLES) += x_tables.o xt_tcpudp.o
-Index: linux-2.6.23-rc9/net/ipv4/netfilter/Kconfig
-===================================================================
---- linux-2.6.23-rc9.orig/net/ipv4/netfilter/Kconfig   2007-10-05 21:26:39.000000000 +0800
-+++ linux-2.6.23-rc9/net/ipv4/netfilter/Kconfig        2007-10-05 21:26:39.000000000 +0800
-@@ -314,6 +314,11 @@
+--- a/net/ipv4/netfilter/Kconfig
++++ b/net/ipv4/netfilter/Kconfig
+@@ -296,6 +296,11 @@
        depends on IP_NF_IPTABLES && NF_CONNTRACK && NF_NAT
        default NF_NAT && NF_CONNTRACK_IRC
  
@@ -359,10 +345,8 @@ Index: linux-2.6.23-rc9/net/ipv4/netfilter/Kconfig
  config NF_NAT_TFTP
        tristate
        depends on IP_NF_IPTABLES && NF_CONNTRACK && NF_NAT
-Index: linux-2.6.23-rc9/net/netfilter/nf_conntrack_rtsp.c
-===================================================================
---- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.23-rc9/net/netfilter/nf_conntrack_rtsp.c 2007-10-05 21:46:43.000000000 +0800
+--- /dev/null
++++ b/net/netfilter/nf_conntrack_rtsp.c
 @@ -0,0 +1,513 @@
 +/*
 + * RTSP extension for IP connection tracking
@@ -441,7 +425,7 @@ Index: linux-2.6.23-rc9/net/netfilter/nf_conntrack_rtsp.c
 +static char *rtsp_buffer;
 +static DEFINE_SPINLOCK(rtsp_buffer_lock);
 +
-+unsigned int (*nf_nat_rtsp_hook)(struct sk_buff **pskb,
++unsigned int (*nf_nat_rtsp_hook)(struct sk_buff *skb,
 +                               enum ip_conntrack_info ctinfo,
 +                               unsigned int matchoff, unsigned int matchlen,struct ip_ct_rtsp_expect* prtspexp,
 +                               struct nf_conntrack_expect *exp);
@@ -635,7 +619,7 @@ Index: linux-2.6.23-rc9/net/netfilter/nf_conntrack_rtsp.c
 +/* outbound packet: client->server */
 +
 +static inline int
-+help_out(struct sk_buff **pskb, unsigned char *rb_ptr, unsigned int datalen,
++help_out(struct sk_buff *skb, unsigned char *rb_ptr, unsigned int datalen,
 +                struct nf_conn *ct, enum ip_conntrack_info ctinfo)
 +{
 +      struct ip_ct_rtsp_expect expinfo;
@@ -717,7 +701,7 @@ Index: linux-2.6.23-rc9/net/netfilter/nf_conntrack_rtsp.c
 +
 +              if (nf_nat_rtsp_hook)
 +                      /* pass the request off to the nat helper */
-+                      ret = nf_nat_rtsp_hook(pskb, ctinfo, hdrsoff, hdrslen, &expinfo, exp);
++                      ret = nf_nat_rtsp_hook(skb, ctinfo, hdrsoff, hdrslen, &expinfo, exp);
 +              else if (nf_ct_expect_related(exp) != 0) {
 +                      INFOP("nf_ct_expect_related failed\n");
 +                      ret  = NF_DROP;
@@ -732,13 +716,13 @@ Index: linux-2.6.23-rc9/net/netfilter/nf_conntrack_rtsp.c
 +
 +
 +static inline int
-+help_in(struct sk_buff **pskb, size_t pktlen,
++help_in(struct sk_buff *skb, size_t pktlen,
 + struct nf_conn* ct, enum ip_conntrack_info ctinfo)
 +{
 + return NF_ACCEPT;
 +}
 +
-+static int help(struct sk_buff **pskb, unsigned int protoff,
++static int help(struct sk_buff *skb, unsigned int protoff,
 +              struct nf_conn *ct, enum ip_conntrack_info ctinfo) 
 +{
 +      struct tcphdr _tcph, *th;
@@ -754,20 +738,20 @@ Index: linux-2.6.23-rc9/net/netfilter/nf_conntrack_rtsp.c
 +      }
 +
 +      /* Not whole TCP header? */
-+      th = skb_header_pointer(*pskb,protoff, sizeof(_tcph), &_tcph);
++      th = skb_header_pointer(skb, protoff, sizeof(_tcph), &_tcph);
 +
 +      if (!th)
 +              return NF_ACCEPT;
 +   
 +      /* No data ? */
 +      dataoff = protoff + th->doff*4;
-+      datalen = (*pskb)->len - dataoff;
-+      if (dataoff >= (*pskb)->len)
++      datalen = skb->len - dataoff;
++      if (dataoff >= skb->len)
 +              return NF_ACCEPT;
 +
 +      spin_lock_bh(&rtsp_buffer_lock);
-+      rb_ptr = skb_header_pointer(*pskb, dataoff,
-+                                  (*pskb)->len - dataoff, rtsp_buffer);
++      rb_ptr = skb_header_pointer(skb, dataoff,
++                                  skb->len - dataoff, rtsp_buffer);
 +      BUG_ON(rb_ptr == NULL);
 +
 +#if 0
@@ -784,7 +768,7 @@ Index: linux-2.6.23-rc9/net/netfilter/nf_conntrack_rtsp.c
 +
 +      switch (CTINFO2DIR(ctinfo)) {
 +      case IP_CT_DIR_ORIGINAL:
-+              ret = help_out(pskb, rb_ptr, datalen, ct, ctinfo);
++              ret = help_out(skb, rb_ptr, datalen, ct, ctinfo);
 +              break;
 +      case IP_CT_DIR_REPLY:
 +              DEBUGP("IP_CT_DIR_REPLY\n");
@@ -877,10 +861,8 @@ Index: linux-2.6.23-rc9/net/netfilter/nf_conntrack_rtsp.c
 +
 +EXPORT_SYMBOL(nf_nat_rtsp_hook_expectfn);
 +
-Index: linux-2.6.23-rc9/net/ipv4/netfilter/nf_nat_rtsp.c
-===================================================================
---- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.23-rc9/net/ipv4/netfilter/nf_nat_rtsp.c  2007-10-05 21:41:16.000000000 +0800
+--- /dev/null
++++ b/net/ipv4/netfilter/nf_nat_rtsp.c
 @@ -0,0 +1,496 @@
 +/*
 + * RTSP extension for TCP NAT alteration
@@ -978,7 +960,7 @@ Index: linux-2.6.23-rc9/net/ipv4/netfilter/nf_nat_rtsp.c
 + *
 + * In:
 + *   ct, ctinfo = conntrack context
-+ *   pskb       = packet
++ *   skb        = packet
 + *   tranoff    = Transport header offset from TCP data
 + *   tranlen    = Transport header length (incl. CRLF)
 + *   rport_lo   = replacement low  port (host endian)
@@ -992,7 +974,7 @@ Index: linux-2.6.23-rc9/net/ipv4/netfilter/nf_nat_rtsp.c
 +rtsp_mangle_tran(enum ip_conntrack_info ctinfo,
 +                 struct nf_conntrack_expect* exp,
 +                                                               struct ip_ct_rtsp_expect* prtspexp,
-+                 struct sk_buff** pskb, uint tranoff, uint tranlen)
++                 struct sk_buff* skb, uint tranoff, uint tranlen)
 +{
 +    char*       ptcp;
 +    uint        tcplen;
@@ -1013,7 +995,7 @@ Index: linux-2.6.23-rc9/net/ipv4/netfilter/nf_nat_rtsp.c
 +    uint    extaddrlen;
 +    int     is_stun;
 +
-+    get_skb_tcpdata(*pskb, &ptcp, &tcplen);
++    get_skb_tcpdata(skb, &ptcp, &tcplen);
 +    ptran = ptcp+tranoff;
 +
 +    if (tranoff+tranlen > tcplen || tcplen-tranoff < tranlen ||
@@ -1145,14 +1127,14 @@ Index: linux-2.6.23-rc9/net/ipv4/netfilter/nf_nat_rtsp.c
 +                if (dstact == DSTACT_STRIP || (dstact == DSTACT_AUTO && !is_stun))
 +                {
 +                    diff = nextfieldoff-off;
-+                    if (!nf_nat_mangle_tcp_packet(pskb, ct, ctinfo,
++                    if (!nf_nat_mangle_tcp_packet(skb, ct, ctinfo,
 +                                                         off, diff, NULL, 0))
 +                    {
 +                        /* mangle failed, all we can do is bail */
 +                      nf_ct_unexpect_related(exp);
 +                        return 0;
 +                    }
-+                    get_skb_tcpdata(*pskb, &ptcp, &tcplen);
++                    get_skb_tcpdata(skb, &ptcp, &tcplen);
 +                    ptran = ptcp+tranoff;
 +                    tranlen -= diff;
 +                    nextparamoff -= diff;
@@ -1215,14 +1197,14 @@ Index: linux-2.6.23-rc9/net/ipv4/netfilter/nf_nat_rtsp.c
 +                     * parameter 4 below is offset from start of tcp data.
 +                     */
 +                    diff = origlen-rbuflen;
-+                    if (!nf_nat_mangle_tcp_packet(pskb, ct, ctinfo,
++                    if (!nf_nat_mangle_tcp_packet(skb, ct, ctinfo,
 +                                              origoff, origlen, rbuf, rbuflen))
 +                    {
 +                        /* mangle failed, all we can do is bail */
 +                      nf_ct_unexpect_related(exp);
 +                        return 0;
 +                    }
-+                    get_skb_tcpdata(*pskb, &ptcp, &tcplen);
++                    get_skb_tcpdata(skb, &ptcp, &tcplen);
 +                    ptran = ptcp+tranoff;
 +                    tranlen -= diff;
 +                    nextparamoff -= diff;
@@ -1240,7 +1222,7 @@ Index: linux-2.6.23-rc9/net/ipv4/netfilter/nf_nat_rtsp.c
 +}
 +
 +static uint
-+help_out(struct sk_buff **pskb, enum ip_conntrack_info ctinfo,
++help_out(struct sk_buff *skb, enum ip_conntrack_info ctinfo,
 +       unsigned int matchoff, unsigned int matchlen, struct ip_ct_rtsp_expect* prtspexp, 
 +       struct nf_conntrack_expect* exp)
 +{
@@ -1252,10 +1234,10 @@ Index: linux-2.6.23-rc9/net/ipv4/netfilter/nf_nat_rtsp.c
 +    uint    linelen;
 +    uint    off;
 +
-+    //struct iphdr* iph = (struct iphdr*)(*pskb)->nh.iph;
++    //struct iphdr* iph = (struct iphdr*)skb->nh.iph;
 +    //struct tcphdr* tcph = (struct tcphdr*)((void*)iph + iph->ihl*4);
 +
-+    get_skb_tcpdata(*pskb, &ptcp, &tcplen);
++    get_skb_tcpdata(skb, &ptcp, &tcplen);
 +    hdrsoff = matchoff;//exp->seq - ntohl(tcph->seq);
 +    hdrslen = matchlen;
 +    off = hdrsoff;
@@ -1278,12 +1260,12 @@ Index: linux-2.6.23-rc9/net/ipv4/netfilter/nf_nat_rtsp.c
 +        {
 +            uint oldtcplen = tcplen;
 +          DEBUGP("hdr: Transport\n");
-+            if (!rtsp_mangle_tran(ctinfo, exp, prtspexp, pskb, lineoff, linelen))
++            if (!rtsp_mangle_tran(ctinfo, exp, prtspexp, skb, lineoff, linelen))
 +            {
 +              DEBUGP("hdr: Transport mangle failed");
 +                break;
 +            }
-+            get_skb_tcpdata(*pskb, &ptcp, &tcplen);
++            get_skb_tcpdata(skb, &ptcp, &tcplen);
 +            hdrslen -= (oldtcplen-tcplen);
 +            off -= (oldtcplen-tcplen);
 +            lineoff -= (oldtcplen-tcplen);
@@ -1296,7 +1278,7 @@ Index: linux-2.6.23-rc9/net/ipv4/netfilter/nf_nat_rtsp.c
 +}
 +
 +static unsigned int
-+help(struct sk_buff **pskb, enum ip_conntrack_info ctinfo, 
++help(struct sk_buff *skb, enum ip_conntrack_info ctinfo, 
 +     unsigned int matchoff, unsigned int matchlen, struct ip_ct_rtsp_expect* prtspexp,
 +     struct nf_conntrack_expect* exp)
 +{
@@ -1306,7 +1288,7 @@ Index: linux-2.6.23-rc9/net/ipv4/netfilter/nf_nat_rtsp.c
 +    switch (dir)
 +    {
 +    case IP_CT_DIR_ORIGINAL:
-+        rc = help_out(pskb, ctinfo, matchoff, matchlen, prtspexp, exp);
++        rc = help_out(skb, ctinfo, matchoff, matchlen, prtspexp, exp);
 +        break;
 +    case IP_CT_DIR_REPLY:
 +      DEBUGP("unmangle ! %u\n", ctinfo);