From 361b71de33e6498a704cfa5c6c7afb696d5d90e3 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Tue, 13 Aug 2013 18:01:30 +0200 Subject: 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 Signed-off-by: Pablo Neira Ayuso --- src/extra/checksum.c | 10 +++++----- src/extra/ipv4.c | 2 +- src/extra/tcp.c | 4 ++-- src/extra/udp.c | 4 ++-- src/internal.h | 6 +++--- 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; -- cgit v1.2.3