nf_conntrack_rtsp.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * RTSP extension for IP connection tracking.
  3. * (C) 2003 by Tom Marshall <tmarshall at 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. //#define IP_NF_RTSP_DEBUG 1
  14. #define IP_NF_RTSP_VERSION "0.6.21"
  15. #ifdef __KERNEL__
  16. /* port block types */
  17. typedef enum {
  18. pb_single, /* client_port=x */
  19. pb_range, /* client_port=x-y */
  20. pb_discon /* client_port=x/y (rtspbis) */
  21. } portblock_t;
  22. /* We record seq number and length of rtsp headers here, all in host order. */
  23. /*
  24. * This structure is per expected connection. It is a member of struct
  25. * ip_conntrack_expect. The TCP SEQ for the conntrack expect is stored
  26. * there and we are expected to only store the length of the data which
  27. * needs replaced. If a packet contains multiple RTSP messages, we create
  28. * one expected connection per message.
  29. *
  30. * We use these variables to mark the entire header block. This may seem
  31. * like overkill, but the nature of RTSP requires it. A header may appear
  32. * multiple times in a message. We must treat two Transport headers the
  33. * same as one Transport header with two entries.
  34. */
  35. struct ip_ct_rtsp_expect
  36. {
  37. u_int32_t len; /* length of header block */
  38. portblock_t pbtype; /* Type of port block that was requested */
  39. u_int16_t loport; /* Port that was requested, low or first */
  40. u_int16_t hiport; /* Port that was requested, high or second */
  41. #if 0
  42. uint method; /* RTSP method */
  43. uint cseq; /* CSeq from request */
  44. #endif
  45. };
  46. extern unsigned int (*nf_nat_rtsp_hook)(struct sk_buff *skb,
  47. enum ip_conntrack_info ctinfo,
  48. unsigned int matchoff, unsigned int matchlen,
  49. struct ip_ct_rtsp_expect *prtspexp,
  50. struct nf_conntrack_expect *exp);
  51. extern void (*nf_nat_rtsp_hook_expectfn)(struct nf_conn *ct, struct nf_conntrack_expect *exp);
  52. #define RTSP_PORT 554
  53. #endif /* __KERNEL__ */
  54. #endif /* _IP_CONNTRACK_RTSP_H */