# BRCM_VERSION=3
[bcm963xx.git] / kernel / linux / include / linux / netfilter_ipv4 / ip_conntrack_rtsp.h
1 /*
2  * RTSP extension for IP connection tracking.
3  * (C) 2003 by Tom Marshall <tmarshall@real.com>
4  * based on ip_conntrack_irc.h
5  *
6  *      This program is free software; you can redistribute it and/or
7  *      modify it under the terms of the GNU General Public License
8  *      as published by the Free Software Foundation; either version
9  *      2 of the License, or (at your option) any later version.
10  */
11 #ifndef _IP_CONNTRACK_RTSP_H
12 #define _IP_CONNTRACK_RTSP_H
13
14 /* #define IP_NF_RTSP_DEBUG */
15 #define IP_NF_RTSP_VERSION "0.01"
16
17 /* port block types */
18 typedef enum {
19     pb_single,  /* client_port=x */
20     pb_range,   /* client_port=x-y */
21     pb_discon   /* client_port=x/y (rtspbis) */
22 } portblock_t;
23
24 /* We record seq number and length of rtsp headers here, all in host order. */
25
26 /*
27  * This structure is per expected connection.  It is a member of struct
28  * ip_conntrack_expect.  The TCP SEQ for the conntrack expect is stored
29  * there and we are expected to only store the length of the data which
30  * needs replaced.  If a packet contains multiple RTSP messages, we create
31  * one expected connection per message.
32  *
33  * We use these variables to mark the entire header block.  This may seem
34  * like overkill, but the nature of RTSP requires it.  A header may appear
35  * multiple times in a message.  We must treat two Transport headers the
36  * same as one Transport header with two entries.
37  */
38 struct ip_ct_rtsp_expect
39 {
40     u_int32_t   len;        /* length of header block */
41     portblock_t pbtype;     /* Type of port block that was requested */
42     u_int16_t   loport;     /* Port that was requested, low or first */
43     u_int16_t   hiport;     /* Port that was requested, high or second */
44 #if 0
45     uint        method;     /* RTSP method */
46     uint        cseq;       /* CSeq from request */
47 #endif
48 };
49
50 /* This structure exists only once per master */
51 struct ip_ct_rtsp_master
52 {
53     /* Empty (?) */
54 };
55
56
57 #ifdef __KERNEL__
58
59 #include <linux/netfilter_ipv4/lockhelp.h>
60
61 #define RTSP_PORT   554
62
63 /* Protects rtsp part of conntracks */
64 DECLARE_LOCK_EXTERN(ip_rtsp_lock);
65
66 #endif /* __KERNEL__ */
67
68 #endif /* _IP_CONNTRACK_RTSP_H */