]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[NETFILTER]: h323 annotations
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 28 Sep 2006 21:22:51 +0000 (14:22 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Fri, 29 Sep 2006 01:03:03 +0000 (18:03 -0700)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/netfilter_ipv4/ip_conntrack_h323.h
net/ipv4/netfilter/ip_conntrack_helper_h323.c
net/ipv4/netfilter/ip_nat_helper_h323.c

index 3cbff7379002ced59a07d65ab88587767df8b59e..943cc6a4871d172d96ffc19f622ae5edc226c32f 100644 (file)
@@ -30,7 +30,7 @@ struct ip_ct_h323_master {
 struct ip_conntrack_expect;
 
 extern int get_h225_addr(unsigned char *data, TransportAddress * addr,
-                        u_int32_t * ip, u_int16_t * port);
+                        __be32 * ip, u_int16_t * port);
 extern void ip_conntrack_h245_expect(struct ip_conntrack *new,
                                     struct ip_conntrack_expect *this);
 extern void ip_conntrack_q931_expect(struct ip_conntrack *new,
@@ -38,11 +38,11 @@ extern void ip_conntrack_q931_expect(struct ip_conntrack *new,
 extern int (*set_h245_addr_hook) (struct sk_buff ** pskb,
                                  unsigned char **data, int dataoff,
                                  H245_TransportAddress * addr,
-                                 u_int32_t ip, u_int16_t port);
+                                 __be32 ip, u_int16_t port);
 extern int (*set_h225_addr_hook) (struct sk_buff ** pskb,
                                  unsigned char **data, int dataoff,
                                  TransportAddress * addr,
-                                 u_int32_t ip, u_int16_t port);
+                                 __be32 ip, u_int16_t port);
 extern int (*set_sig_addr_hook) (struct sk_buff ** pskb,
                                 struct ip_conntrack * ct,
                                 enum ip_conntrack_info ctinfo,
index 9a39e2969712701d0ab45b9bb0dcd1d3c6ccf0e6..7b7441202bfd6e14505142a6b0d270c77f73042f 100644 (file)
@@ -49,11 +49,11 @@ MODULE_PARM_DESC(callforward_filter, "only create call forwarding expectations "
 int (*set_h245_addr_hook) (struct sk_buff ** pskb,
                           unsigned char **data, int dataoff,
                           H245_TransportAddress * addr,
-                          u_int32_t ip, u_int16_t port);
+                          __be32 ip, u_int16_t port);
 int (*set_h225_addr_hook) (struct sk_buff ** pskb,
                           unsigned char **data, int dataoff,
                           TransportAddress * addr,
-                          u_int32_t ip, u_int16_t port);
+                          __be32 ip, u_int16_t port);
 int (*set_sig_addr_hook) (struct sk_buff ** pskb,
                          struct ip_conntrack * ct,
                          enum ip_conntrack_info ctinfo,
@@ -209,7 +209,7 @@ static int get_tpkt_data(struct sk_buff **pskb, struct ip_conntrack *ct,
 
 /****************************************************************************/
 static int get_h245_addr(unsigned char *data, H245_TransportAddress * addr,
-                        u_int32_t * ip, u_int16_t * port)
+                        __be32 * ip, u_int16_t * port)
 {
        unsigned char *p;
 
@@ -232,7 +232,7 @@ static int expect_rtp_rtcp(struct sk_buff **pskb, struct ip_conntrack *ct,
 {
        int dir = CTINFO2DIR(ctinfo);
        int ret = 0;
-       u_int32_t ip;
+       __be32 ip;
        u_int16_t port;
        u_int16_t rtp_port;
        struct ip_conntrack_expect *rtp_exp;
@@ -254,10 +254,10 @@ static int expect_rtp_rtcp(struct sk_buff **pskb, struct ip_conntrack *ct,
        rtp_exp->tuple.dst.ip = ct->tuplehash[!dir].tuple.dst.ip;
        rtp_exp->tuple.dst.u.udp.port = htons(rtp_port);
        rtp_exp->tuple.dst.protonum = IPPROTO_UDP;
-       rtp_exp->mask.src.ip = 0xFFFFFFFF;
+       rtp_exp->mask.src.ip = htonl(0xFFFFFFFF);
        rtp_exp->mask.src.u.udp.port = 0;
-       rtp_exp->mask.dst.ip = 0xFFFFFFFF;
-       rtp_exp->mask.dst.u.udp.port = 0xFFFF;
+       rtp_exp->mask.dst.ip = htonl(0xFFFFFFFF);
+       rtp_exp->mask.dst.u.udp.port = htons(0xFFFF);
        rtp_exp->mask.dst.protonum = 0xFF;
        rtp_exp->flags = 0;
 
@@ -271,10 +271,10 @@ static int expect_rtp_rtcp(struct sk_buff **pskb, struct ip_conntrack *ct,
        rtcp_exp->tuple.dst.ip = ct->tuplehash[!dir].tuple.dst.ip;
        rtcp_exp->tuple.dst.u.udp.port = htons(rtp_port + 1);
        rtcp_exp->tuple.dst.protonum = IPPROTO_UDP;
-       rtcp_exp->mask.src.ip = 0xFFFFFFFF;
+       rtcp_exp->mask.src.ip = htonl(0xFFFFFFFF);
        rtcp_exp->mask.src.u.udp.port = 0;
-       rtcp_exp->mask.dst.ip = 0xFFFFFFFF;
-       rtcp_exp->mask.dst.u.udp.port = 0xFFFF;
+       rtcp_exp->mask.dst.ip = htonl(0xFFFFFFFF);
+       rtcp_exp->mask.dst.u.udp.port = htons(0xFFFF);
        rtcp_exp->mask.dst.protonum = 0xFF;
        rtcp_exp->flags = 0;
 
@@ -325,7 +325,7 @@ static int expect_t120(struct sk_buff **pskb,
 {
        int dir = CTINFO2DIR(ctinfo);
        int ret = 0;
-       u_int32_t ip;
+       __be32 ip;
        u_int16_t port;
        struct ip_conntrack_expect *exp = NULL;
 
@@ -342,10 +342,10 @@ static int expect_t120(struct sk_buff **pskb,
        exp->tuple.dst.ip = ct->tuplehash[!dir].tuple.dst.ip;
        exp->tuple.dst.u.tcp.port = htons(port);
        exp->tuple.dst.protonum = IPPROTO_TCP;
-       exp->mask.src.ip = 0xFFFFFFFF;
+       exp->mask.src.ip = htonl(0xFFFFFFFF);
        exp->mask.src.u.tcp.port = 0;
-       exp->mask.dst.ip = 0xFFFFFFFF;
-       exp->mask.dst.u.tcp.port = 0xFFFF;
+       exp->mask.dst.ip = htonl(0xFFFFFFFF);
+       exp->mask.dst.u.tcp.port = htons(0xFFFF);
        exp->mask.dst.protonum = 0xFF;
        exp->flags = IP_CT_EXPECT_PERMANENT;    /* Accept multiple channels */
 
@@ -626,7 +626,7 @@ void ip_conntrack_h245_expect(struct ip_conntrack *new,
 
 /****************************************************************************/
 int get_h225_addr(unsigned char *data, TransportAddress * addr,
-                 u_int32_t * ip, u_int16_t * port)
+                 __be32 * ip, u_int16_t * port)
 {
        unsigned char *p;
 
@@ -648,7 +648,7 @@ static int expect_h245(struct sk_buff **pskb, struct ip_conntrack *ct,
 {
        int dir = CTINFO2DIR(ctinfo);
        int ret = 0;
-       u_int32_t ip;
+       __be32 ip;
        u_int16_t port;
        struct ip_conntrack_expect *exp = NULL;
 
@@ -665,10 +665,10 @@ static int expect_h245(struct sk_buff **pskb, struct ip_conntrack *ct,
        exp->tuple.dst.ip = ct->tuplehash[!dir].tuple.dst.ip;
        exp->tuple.dst.u.tcp.port = htons(port);
        exp->tuple.dst.protonum = IPPROTO_TCP;
-       exp->mask.src.ip = 0xFFFFFFFF;
+       exp->mask.src.ip = htonl(0xFFFFFFFF);
        exp->mask.src.u.tcp.port = 0;
-       exp->mask.dst.ip = 0xFFFFFFFF;
-       exp->mask.dst.u.tcp.port = 0xFFFF;
+       exp->mask.dst.ip = htonl(0xFFFFFFFF);
+       exp->mask.dst.u.tcp.port = htons(0xFFFF);
        exp->mask.dst.protonum = 0xFF;
        exp->flags = 0;
 
@@ -709,7 +709,7 @@ static int expect_callforwarding(struct sk_buff **pskb,
 {
        int dir = CTINFO2DIR(ctinfo);
        int ret = 0;
-       u_int32_t ip;
+       __be32 ip;
        u_int16_t port;
        struct ip_conntrack_expect *exp = NULL;
 
@@ -751,10 +751,10 @@ static int expect_callforwarding(struct sk_buff **pskb,
        exp->tuple.dst.ip = ip;
        exp->tuple.dst.u.tcp.port = htons(port);
        exp->tuple.dst.protonum = IPPROTO_TCP;
-       exp->mask.src.ip = 0xFFFFFFFF;
+       exp->mask.src.ip = htonl(0xFFFFFFFF);
        exp->mask.src.u.tcp.port = 0;
-       exp->mask.dst.ip = 0xFFFFFFFF;
-       exp->mask.dst.u.tcp.port = 0xFFFF;
+       exp->mask.dst.ip = htonl(0xFFFFFFFF);
+       exp->mask.dst.u.tcp.port = htons(0xFFFF);
        exp->mask.dst.protonum = 0xFF;
        exp->flags = 0;
 
@@ -791,7 +791,7 @@ static int process_setup(struct sk_buff **pskb, struct ip_conntrack *ct,
        int dir = CTINFO2DIR(ctinfo);
        int ret;
        int i;
-       u_int32_t ip;
+       __be32 ip;
        u_int16_t port;
 
        DEBUGP("ip_ct_q931: Setup\n");
@@ -1188,7 +1188,7 @@ static unsigned char *get_udp_data(struct sk_buff **pskb, int *datalen)
 
 /****************************************************************************/
 static struct ip_conntrack_expect *find_expect(struct ip_conntrack *ct,
-                                              u_int32_t ip, u_int16_t port)
+                                              __be32 ip, u_int16_t port)
 {
        struct ip_conntrack_expect *exp;
        struct ip_conntrack_tuple tuple;
@@ -1228,7 +1228,7 @@ static int expect_q931(struct sk_buff **pskb, struct ip_conntrack *ct,
        int dir = CTINFO2DIR(ctinfo);
        int ret = 0;
        int i;
-       u_int32_t ip;
+       __be32 ip;
        u_int16_t port;
        struct ip_conntrack_expect *exp;
 
@@ -1251,10 +1251,10 @@ static int expect_q931(struct sk_buff **pskb, struct ip_conntrack *ct,
        exp->tuple.dst.ip = ct->tuplehash[!dir].tuple.dst.ip;
        exp->tuple.dst.u.tcp.port = htons(port);
        exp->tuple.dst.protonum = IPPROTO_TCP;
-       exp->mask.src.ip = gkrouted_only ? 0xFFFFFFFF : 0;
+       exp->mask.src.ip = gkrouted_only ? htonl(0xFFFFFFFF) : 0;
        exp->mask.src.u.tcp.port = 0;
-       exp->mask.dst.ip = 0xFFFFFFFF;
-       exp->mask.dst.u.tcp.port = 0xFFFF;
+       exp->mask.dst.ip = htonl(0xFFFFFFFF);
+       exp->mask.dst.u.tcp.port = htons(0xFFFF);
        exp->mask.dst.protonum = 0xFF;
        exp->flags = IP_CT_EXPECT_PERMANENT;    /* Accept multiple calls */
 
@@ -1307,7 +1307,7 @@ static int process_gcf(struct sk_buff **pskb, struct ip_conntrack *ct,
 {
        int dir = CTINFO2DIR(ctinfo);
        int ret = 0;
-       u_int32_t ip;
+       __be32 ip;
        u_int16_t port;
        struct ip_conntrack_expect *exp;
 
@@ -1333,10 +1333,10 @@ static int process_gcf(struct sk_buff **pskb, struct ip_conntrack *ct,
        exp->tuple.dst.ip = ip;
        exp->tuple.dst.u.tcp.port = htons(port);
        exp->tuple.dst.protonum = IPPROTO_UDP;
-       exp->mask.src.ip = 0xFFFFFFFF;
+       exp->mask.src.ip = htonl(0xFFFFFFFF);
        exp->mask.src.u.tcp.port = 0;
-       exp->mask.dst.ip = 0xFFFFFFFF;
-       exp->mask.dst.u.tcp.port = 0xFFFF;
+       exp->mask.dst.ip = htonl(0xFFFFFFFF);
+       exp->mask.dst.u.tcp.port = htons(0xFFFF);
        exp->mask.dst.protonum = 0xFF;
        exp->flags = 0;
        exp->expectfn = ip_conntrack_ras_expect;
@@ -1477,7 +1477,7 @@ static int process_arq(struct sk_buff **pskb, struct ip_conntrack *ct,
 {
        struct ip_ct_h323_master *info = &ct->help.ct_h323_info;
        int dir = CTINFO2DIR(ctinfo);
-       u_int32_t ip;
+       __be32 ip;
        u_int16_t port;
 
        DEBUGP("ip_ct_ras: ARQ\n");
@@ -1513,7 +1513,7 @@ static int process_acf(struct sk_buff **pskb, struct ip_conntrack *ct,
 {
        int dir = CTINFO2DIR(ctinfo);
        int ret = 0;
-       u_int32_t ip;
+       __be32 ip;
        u_int16_t port;
        struct ip_conntrack_expect *exp;
 
@@ -1538,10 +1538,10 @@ static int process_acf(struct sk_buff **pskb, struct ip_conntrack *ct,
        exp->tuple.dst.ip = ip;
        exp->tuple.dst.u.tcp.port = htons(port);
        exp->tuple.dst.protonum = IPPROTO_TCP;
-       exp->mask.src.ip = 0xFFFFFFFF;
+       exp->mask.src.ip = htonl(0xFFFFFFFF);
        exp->mask.src.u.tcp.port = 0;
-       exp->mask.dst.ip = 0xFFFFFFFF;
-       exp->mask.dst.u.tcp.port = 0xFFFF;
+       exp->mask.dst.ip = htonl(0xFFFFFFFF);
+       exp->mask.dst.u.tcp.port = htons(0xFFFF);
        exp->mask.dst.protonum = 0xFF;
        exp->flags = IP_CT_EXPECT_PERMANENT;
        exp->expectfn = ip_conntrack_q931_expect;
@@ -1581,7 +1581,7 @@ static int process_lcf(struct sk_buff **pskb, struct ip_conntrack *ct,
 {
        int dir = CTINFO2DIR(ctinfo);
        int ret = 0;
-       u_int32_t ip;
+       __be32 ip;
        u_int16_t port;
        struct ip_conntrack_expect *exp = NULL;
 
@@ -1598,10 +1598,10 @@ static int process_lcf(struct sk_buff **pskb, struct ip_conntrack *ct,
        exp->tuple.dst.ip = ip;
        exp->tuple.dst.u.tcp.port = htons(port);
        exp->tuple.dst.protonum = IPPROTO_TCP;
-       exp->mask.src.ip = 0xFFFFFFFF;
+       exp->mask.src.ip = htonl(0xFFFFFFFF);
        exp->mask.src.u.tcp.port = 0;
-       exp->mask.dst.ip = 0xFFFFFFFF;
-       exp->mask.dst.u.tcp.port = 0xFFFF;
+       exp->mask.dst.ip = htonl(0xFFFFFFFF);
+       exp->mask.dst.u.tcp.port = htons(0xFFFF);
        exp->mask.dst.protonum = 0xFF;
        exp->flags = IP_CT_EXPECT_PERMANENT;
        exp->expectfn = ip_conntrack_q931_expect;
index 419b878fb467276ac3f885fdae6f1228118591a3..4a7d34466ee2a9485a6ad3082af4b5eb5a6ad618 100644 (file)
 /****************************************************************************/
 static int set_addr(struct sk_buff **pskb,
                    unsigned char **data, int dataoff,
-                   unsigned int addroff, u_int32_t ip, u_int16_t port)
+                   unsigned int addroff, __be32 ip, u_int16_t port)
 {
        enum ip_conntrack_info ctinfo;
        struct ip_conntrack *ct = ip_conntrack_get(*pskb, &ctinfo);
        struct {
-               u_int32_t ip;
-               u_int16_t port;
+               __be32 ip;
+               __be16 port;
        } __attribute__ ((__packed__)) buf;
        struct tcphdr _tcph, *th;
 
@@ -86,7 +86,7 @@ static int set_addr(struct sk_buff **pskb,
 static int set_h225_addr(struct sk_buff **pskb,
                         unsigned char **data, int dataoff,
                         TransportAddress * addr,
-                        u_int32_t ip, u_int16_t port)
+                        __be32 ip, u_int16_t port)
 {
        return set_addr(pskb, data, dataoff, addr->ipAddress.ip, ip, port);
 }
@@ -95,7 +95,7 @@ static int set_h225_addr(struct sk_buff **pskb,
 static int set_h245_addr(struct sk_buff **pskb,
                         unsigned char **data, int dataoff,
                         H245_TransportAddress * addr,
-                        u_int32_t ip, u_int16_t port)
+                        __be32 ip, u_int16_t port)
 {
        return set_addr(pskb, data, dataoff,
                        addr->unicastAddress.iPAddress.network, ip, port);
@@ -110,7 +110,7 @@ static int set_sig_addr(struct sk_buff **pskb, struct ip_conntrack *ct,
        struct ip_ct_h323_master *info = &ct->help.ct_h323_info;
        int dir = CTINFO2DIR(ctinfo);
        int i;
-       u_int32_t ip;
+       __be32 ip;
        u_int16_t port;
 
        for (i = 0; i < count; i++) {
@@ -164,7 +164,7 @@ static int set_ras_addr(struct sk_buff **pskb, struct ip_conntrack *ct,
 {
        int dir = CTINFO2DIR(ctinfo);
        int i;
-       u_int32_t ip;
+       __be32 ip;
        u_int16_t port;
 
        for (i = 0; i < count; i++) {
@@ -433,7 +433,7 @@ static int nat_q931(struct sk_buff **pskb, struct ip_conntrack *ct,
        struct ip_ct_h323_master *info = &ct->help.ct_h323_info;
        int dir = CTINFO2DIR(ctinfo);
        u_int16_t nated_port = port;
-       u_int32_t ip;
+       __be32 ip;
 
        /* Set expectations for NAT */
        exp->saved_proto.tcp.port = exp->tuple.dst.u.tcp.port;