1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _NF_CONNTRACK_H323_H
3#define _NF_CONNTRACK_H323_H
4
5#ifdef __KERNEL__
6
7#include <linux/netfilter/nf_conntrack_h323_asn1.h>
8
9#define RAS_PORT 1719
10#define Q931_PORT 1720
11#define H323_RTP_CHANNEL_MAX 4 /* Audio, video, FAX and other */
12
13/* This structure exists only once per master */
14struct nf_ct_h323_master {
15
16 /* Original and NATed Q.931 or H.245 signal ports */
17 __be16 sig_port[IP_CT_DIR_MAX];
18
19 /* Original and NATed RTP ports */
20 __be16 rtp_port[H323_RTP_CHANNEL_MAX][IP_CT_DIR_MAX];
21
22 union {
23 /* RAS connection timeout */
24 u_int32_t timeout;
25
26 /* Next TPKT length (for separate TPKT header and data) */
27 u_int16_t tpkt_len[IP_CT_DIR_MAX];
28 };
29};
30
31struct nf_conn;
32
33int get_h225_addr(struct nf_conn *ct, unsigned char *data,
34 TransportAddress *taddr, union nf_inet_addr *addr,
35 __be16 *port);
36void nf_conntrack_h245_expect(struct nf_conn *new,
37 struct nf_conntrack_expect *this);
38void nf_conntrack_q931_expect(struct nf_conn *new,
39 struct nf_conntrack_expect *this);
40extern int (*set_h245_addr_hook) (struct sk_buff *skb, unsigned int protoff,
41 unsigned char **data, int dataoff,
42 H245_TransportAddress *taddr,
43 union nf_inet_addr *addr,
44 __be16 port);
45extern int (*set_h225_addr_hook) (struct sk_buff *skb, unsigned int protoff,
46 unsigned char **data, int dataoff,
47 TransportAddress *taddr,
48 union nf_inet_addr *addr,
49 __be16 port);
50extern int (*set_sig_addr_hook) (struct sk_buff *skb,
51 struct nf_conn *ct,
52 enum ip_conntrack_info ctinfo,
53 unsigned int protoff, unsigned char **data,
54 TransportAddress *taddr, int count);
55extern int (*set_ras_addr_hook) (struct sk_buff *skb,
56 struct nf_conn *ct,
57 enum ip_conntrack_info ctinfo,
58 unsigned int protoff, unsigned char **data,
59 TransportAddress *taddr, int count);
60extern int (*nat_rtp_rtcp_hook) (struct sk_buff *skb,
61 struct nf_conn *ct,
62 enum ip_conntrack_info ctinfo,
63 unsigned int protoff, unsigned char **data,
64 int dataoff,
65 H245_TransportAddress *taddr,
66 __be16 port, __be16 rtp_port,
67 struct nf_conntrack_expect *rtp_exp,
68 struct nf_conntrack_expect *rtcp_exp);
69extern int (*nat_t120_hook) (struct sk_buff *skb, struct nf_conn *ct,
70 enum ip_conntrack_info ctinfo,
71 unsigned int protoff,
72 unsigned char **data, int dataoff,
73 H245_TransportAddress *taddr, __be16 port,
74 struct nf_conntrack_expect *exp);
75extern int (*nat_h245_hook) (struct sk_buff *skb, struct nf_conn *ct,
76 enum ip_conntrack_info ctinfo,
77 unsigned int protoff,
78 unsigned char **data, int dataoff,
79 TransportAddress *taddr, __be16 port,
80 struct nf_conntrack_expect *exp);
81extern int (*nat_callforwarding_hook) (struct sk_buff *skb,
82 struct nf_conn *ct,
83 enum ip_conntrack_info ctinfo,
84 unsigned int protoff,
85 unsigned char **data, int dataoff,
86 TransportAddress *taddr,
87 __be16 port,
88 struct nf_conntrack_expect *exp);
89extern int (*nat_q931_hook) (struct sk_buff *skb, struct nf_conn *ct,
90 enum ip_conntrack_info ctinfo,
91 unsigned int protoff,
92 unsigned char **data, TransportAddress *taddr,
93 int idx, __be16 port,
94 struct nf_conntrack_expect *exp);
95
96#endif
97
98#endif
99