summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2013-08-13 18:01:30 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2013-08-13 18:11:27 +0200
commit361b71de33e6498a704cfa5c6c7afb696d5d90e3 (patch)
treea2546cfa9b70a66e99382e6c0898282e66ddfa18 /src
parent7983983a2912165aaa3b9fff2f7aa42421d2f730 (diff)
src: extra: add prefix nfq_ to internal checksum functions
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>
Diffstat (limited to 'src')
-rw-r--r--src/extra/checksum.c10
-rw-r--r--src/extra/ipv4.c2
-rw-r--r--src/extra/tcp.c4
-rw-r--r--src/extra/udp.c4
-rw-r--r--src/internal.h6
5 files changed, 13 insertions, 13 deletions
diff --git a/src/extra/checksum.c b/src/extra/checksum.c
index 6f07e71..f367f75 100644
--- a/src/extra/checksum.c
+++ b/src/extra/checksum.c
@@ -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);
}
/**
diff --git a/src/extra/ipv4.c b/src/extra/ipv4.c
index d7f1f69..0fe716b 100644
--- a/src/extra/ipv4.c
+++ b/src/extra/ipv4.c
@@ -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);
diff --git a/src/extra/tcp.c b/src/extra/tcp.c
index 5318b07..2eb5763 100644
--- a/src/extra/tcp.c
+++ b/src/extra/tcp.c
@@ -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);
diff --git a/src/extra/udp.c b/src/extra/udp.c
index f0f6d2f..eee732e 100644
--- a/src/extra/udp.c
+++ b/src/extra/udp.c
@@ -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);
diff --git a/src/internal.h b/src/internal.h
index 7f9d5f4..558d267 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -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;