src: extra: add prefix nfq_ to internal checksum functions
authorPablo Neira Ayuso <pablo@netfilter.org>
Tue, 13 Aug 2013 16:01:30 +0000 (18:01 +0200)
committerr.kubiak <r.kubiak@samsung.com>
Mon, 16 Nov 2015 13:12:06 +0000 (14:12 +0100)
These functions are internal and they belong to the libnetfilter_queue scope,
so let's add the corresponding nfq_ prefix.

Suggested-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/extra/checksum.c
src/extra/ipv4.c
src/extra/tcp.c
src/extra/udp.c
src/internal.h

index 6f07e71..f367f75 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "internal.h"
 
-uint16_t checksum(uint32_t sum, uint16_t *buf, int size)
+uint16_t nfq_checksum(uint32_t sum, uint16_t *buf, int size)
 {
        while (size > 1) {
                sum += *buf++;
@@ -35,7 +35,7 @@ uint16_t checksum(uint32_t sum, uint16_t *buf, int size)
        return (uint16_t)(~sum);
 }
 
-uint16_t checksum_tcpudp_ipv4(struct iphdr *iph)
+uint16_t nfq_checksum_tcpudp_ipv4(struct iphdr *iph)
 {
        uint32_t sum = 0;
        uint32_t iph_len = iph->ihl*4;
@@ -49,10 +49,10 @@ uint16_t checksum_tcpudp_ipv4(struct iphdr *iph)
        sum += htons(IPPROTO_TCP);
        sum += htons(len);
 
-       return checksum(sum, (uint16_t *)payload, len);
+       return nfq_checksum(sum, (uint16_t *)payload, len);
 }
 
-uint16_t checksum_tcpudp_ipv6(struct ip6_hdr *ip6h, void *transport_hdr)
+uint16_t nfq_checksum_tcpudp_ipv6(struct ip6_hdr *ip6h, void *transport_hdr)
 {
        uint32_t sum = 0;
        uint32_t hdr_len = (uint32_t *)transport_hdr - (uint32_t *)ip6h;
@@ -71,7 +71,7 @@ uint16_t checksum_tcpudp_ipv6(struct ip6_hdr *ip6h, void *transport_hdr)
        sum += htons(IPPROTO_TCP);
        sum += htons(ip6h->ip6_plen);
 
-       return checksum(sum, (uint16_t *)payload, len);
+       return nfq_checksum(sum, (uint16_t *)payload, len);
 }
 
 /**
index d7f1f69..0fe716b 100644 (file)
@@ -85,7 +85,7 @@ void nfq_ip_set_checksum(struct iphdr *iph)
        uint32_t iph_len = iph->ihl * 4;
 
        iph->check = 0;
-       iph->check = checksum(0, (uint16_t *)iph, iph_len);
+       iph->check = nfq_checksum(0, (uint16_t *)iph, iph_len);
 }
 EXPORT_SYMBOL(nfq_ip_set_checksum);
 
index 5318b07..2eb5763 100644 (file)
@@ -91,7 +91,7 @@ nfq_tcp_compute_checksum_ipv4(struct tcphdr *tcph, struct iphdr *iph)
 {
        /* checksum field in header needs to be zero for calculation. */
        tcph->check = 0;
-       tcph->check = checksum_tcpudp_ipv4(iph);
+       tcph->check = nfq_checksum_tcpudp_ipv4(iph);
 }
 EXPORT_SYMBOL(nfq_tcp_compute_checksum_ipv4);
 
@@ -105,7 +105,7 @@ nfq_tcp_compute_checksum_ipv6(struct tcphdr *tcph, struct ip6_hdr *ip6h)
 {
        /* checksum field in header needs to be zero for calculation. */
        tcph->check = 0;
-       tcph->check = checksum_tcpudp_ipv6(ip6h, tcph);
+       tcph->check = nfq_checksum_tcpudp_ipv6(ip6h, tcph);
 }
 EXPORT_SYMBOL(nfq_tcp_compute_checksum_ipv6);
 
index f0f6d2f..eee732e 100644 (file)
@@ -91,7 +91,7 @@ nfq_udp_compute_checksum_ipv4(struct udphdr *udph, struct iphdr *iph)
 {
        /* checksum field in header needs to be zero for calculation. */
        udph->check = 0;
-       udph->check = checksum_tcpudp_ipv4(iph);
+       udph->check = nfq_checksum_tcpudp_ipv4(iph);
 }
 EXPORT_SYMBOL(nfq_udp_compute_checksum_ipv4);
 
@@ -110,7 +110,7 @@ nfq_udp_compute_checksum_ipv6(struct udphdr *udph, struct ip6_hdr *ip6h)
 {
        /* checksum field in header needs to be zero for calculation. */
        udph->check = 0;
-       udph->check = checksum_tcpudp_ipv6(ip6h, udph);
+       udph->check = nfq_checksum_tcpudp_ipv6(ip6h, udph);
 }
 EXPORT_SYMBOL(nfq_udp_compute_checksum_ipv6);
 
index 7f9d5f4..558d267 100644 (file)
@@ -14,9 +14,9 @@
 struct iphdr;
 struct ip6_hdr;
 
-uint16_t checksum(uint32_t sum, uint16_t *buf, int size);
-uint16_t checksum_tcpudp_ipv4(struct iphdr *iph);
-uint16_t checksum_tcpudp_ipv6(struct ip6_hdr *ip6h, void *transport_hdr);
+uint16_t nfq_checksum(uint32_t sum, uint16_t *buf, int size);
+uint16_t nfq_checksum_tcpudp_ipv4(struct iphdr *iph);
+uint16_t nfq_checksum_tcpudp_ipv6(struct ip6_hdr *ip6h, void *transport_hdr);
 
 struct pkt_buff {
        uint8_t *mac_header;