src: update doxygen documentation for new API for libmnl
authorPablo Neira Ayuso <pablo@netfilter.org>
Mon, 20 Aug 2012 17:48:05 +0000 (19:48 +0200)
committerr.kubiak <r.kubiak@samsung.com>
Mon, 16 Nov 2015 13:12:06 +0000 (14:12 +0100)
This patch updates the doxygen documentation for the new API.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
doxygen.cfg.in
src/extra/ipv4.c
src/extra/pktbuff.c
src/extra/tcp.c
src/extra/udp.c
src/nlmsg.c

index 37bfa7c..a7378ca 100644 (file)
@@ -72,7 +72,7 @@ RECURSIVE              = YES
 EXCLUDE                = 
 EXCLUDE_SYMLINKS       = NO
 EXCLUDE_PATTERNS       = 
-EXCLUDE_SYMBOLS        = 
+EXCLUDE_SYMBOLS        = EXPORT_SYMBOL
 EXAMPLE_PATH           = 
 EXAMPLE_PATTERNS       = 
 EXAMPLE_RECURSIVE      = NO
index ce101ef..d7f1f69 100644 (file)
@@ -56,9 +56,9 @@ struct iphdr *nfq_ip_get_hdr(struct pkt_buff *pktb)
 EXPORT_SYMBOL(nfq_ip_get_hdr);
 
 /**
- * nfq_ip_get_payload - get the IPv4 packet payload
+ * nfq_ip_set_transport_header - set transport header
  * \param pktb: pointer to network packet buffer
- * \param iph: the pointer to the IPv4 header
+ * \param iph: pointer to the IPv4 header
  */
 int nfq_ip_set_transport_header(struct pkt_buff *pktb, struct iphdr *iph)
 {
@@ -77,8 +77,6 @@ EXPORT_SYMBOL(nfq_ip_set_transport_header);
  * nfq_ip_set_checksum - set IPv4 checksum
  * \param iph: pointer to the IPv4 header
  *
- * \returns the checksum of the ip packet.
- *
  * \note Call to this function if you modified the IPv4 header to update the
  * checksum.
  */
@@ -91,6 +89,17 @@ void nfq_ip_set_checksum(struct iphdr *iph)
 }
 EXPORT_SYMBOL(nfq_ip_set_checksum);
 
+/**
+ * nfq_ip_mangle - mangle IPv4 packet buffer
+ * \param pktb: pointer to network packet buffer
+ * \param dataoff: offset to layer 4 header
+ * \param match_offset: offset to content that you want to mangle
+ * \param match_len: length of the existing content you want to mangle
+ * \param rep_buffer: pointer to data you want to use to replace current content
+ * \param rep_len: length of data you want to use to replace current content
+ *
+ * \note This function recalculates the IPv4 checksum (if needed).
+ */
 int nfq_ip_mangle(struct pkt_buff *pkt, unsigned int dataoff,
                  unsigned int match_offset, unsigned int match_len,
                  const char *rep_buffer, unsigned int rep_len)
index 0989f60..0bd778d 100644 (file)
@@ -24,6 +24,8 @@
  *
  * This library provides the user-space network packet buffer. This abstraction
  * is strongly inspired by Linux kernel network buffer, the so-called sk_buff.
+ *
+ * @{
  */
 
 /**
@@ -83,59 +85,103 @@ pktb_alloc(int family, void *data, size_t len, size_t extra)
        return pktb;
 }
 
+/**
+ * pktb_data - return pointer to the beginning of the packet buffer
+ * \param pktb Pointer to packet buffer
+ */
 uint8_t *pktb_data(struct pkt_buff *pktb)
 {
        return pktb->data;
 }
 
+/**
+ * pktb_len - return length of the packet buffer
+ * \param pktb Pointer to packet buffer
+ */
 uint32_t pktb_len(struct pkt_buff *pktb)
 {
        return pktb->len;
 }
 
+/**
+ * pktb_free - release packet buffer
+ * \param pktb Pointer to packet buffer
+ */
 void pktb_free(struct pkt_buff *pktb)
 {
        free(pktb);
 }
 
+/**
+ * pktb_push - update pointer to the beginning of the packet buffer
+ * \param pktb Pointer to packet buffer
+ */
 void pktb_push(struct pkt_buff *pktb, unsigned int len)
 {
        pktb->data -= len;
        pktb->len += len;
 }
 
+/**
+ * pktb_pull - update pointer to the beginning of the packet buffer
+ * \param pktb Pointer to packet buffer
+ */
 void pktb_pull(struct pkt_buff *pktb, unsigned int len)
 {
        pktb->data += len;
        pktb->len -= len;
 }
 
+/**
+ * pktb_put - add extra bytes to the tail of the packet buffer
+ * \param pktb Pointer to packet buffer
+ */
 void pktb_put(struct pkt_buff *pktb, unsigned int len)
 {
        pktb->tail += len;
        pktb->len += len;
 }
 
+/**
+ * pktb_trim - set new length for this packet buffer
+ * \param pktb Pointer to packet buffer
+ */
 void pktb_trim(struct pkt_buff *pktb, unsigned int len)
 {
        pktb->len = len;
 }
 
+/**
+ * pktb_tailroom - get room in bytes in the tail of the packet buffer
+ * \param pktb Pointer to packet buffer
+ */
 unsigned int pktb_tailroom(struct pkt_buff *pktb)
 {
        return pktb->data_len - pktb->len;
 }
 
+/**
+ * pktb_mac_header - return pointer to layer 2 header (if any)
+ * \param pktb Pointer to packet buffer
+ */
 uint8_t *pktb_mac_header(struct pkt_buff *pktb)
 {
        return pktb->mac_header;
 }
 
+/**
+ * pktb_network_header - return pointer to layer 3 header
+ * \param pktb Pointer to packet buffer
+ */
 uint8_t *pktb_network_header(struct pkt_buff *pktb)
 {
        return pktb->network_header;
 }
 
+/**
+ * pktb_transport_header - return pointer to layer 4 header (if any)
+ * \param pktb Pointer to packet buffer
+ */
 uint8_t *pktb_transport_header(struct pkt_buff *pktb)
 {
        return pktb->transport_header;
@@ -202,6 +248,10 @@ int pktb_mangle(struct pkt_buff *pkt,
 }
 EXPORT_SYMBOL(pktb_mangle);
 
+/**
+ * pktb_mangled - return true if packet has been mangled
+ * \param pktb Pointer to packet buffer
+ */
 bool pktb_mangled(const struct pkt_buff *pkt)
 {
        return pkt->mangled;
index 2ea0d8a..5318b07 100644 (file)
@@ -174,6 +174,16 @@ int nfq_tcp_snprintf(char *buf, size_t size, const struct tcphdr *tcph)
 }
 EXPORT_SYMBOL(nfq_tcp_snprintf);
 
+/**
+ * nfq_tcp_mangle_ipv4 - mangle TCP/IPv4 packet buffer
+ * \param pktb: pointer to network packet buffer
+ * \param match_offset: offset to content that you want to mangle
+ * \param match_len: length of the existing content you want to mangle
+ * \param rep_buffer: pointer to data you want to use to replace current content
+ * \param rep_len: length of data you want to use to replace current content
+ *
+ * \note This function recalculates the IPv4 and TCP checksums for you.
+ */
 int
 nfq_tcp_mangle_ipv4(struct pkt_buff *pkt,
                    unsigned int match_offset, unsigned int match_len,
index 5f7f9ec..f0f6d2f 100644 (file)
@@ -114,6 +114,16 @@ nfq_udp_compute_checksum_ipv6(struct udphdr *udph, struct ip6_hdr *ip6h)
 }
 EXPORT_SYMBOL(nfq_udp_compute_checksum_ipv6);
 
+/**
+ * nfq_tcp_mangle_ipv4 - mangle TCP/IPv4 packet buffer
+ * \param pktb: pointer to network packet buffer
+ * \param match_offset: offset to content that you want to mangle
+ * \param match_len: length of the existing content you want to mangle
+ * \param rep_buffer: pointer to data you want to use to replace current content 
+ * \param rep_len: length of data you want to use to replace current content
+ *
+ * \note This function recalculates the IPv4 and TCP checksums for you.
+ */
 int
 nfq_udp_mangle_ipv4(struct pkt_buff *pkt,
                    unsigned int match_offset, unsigned int match_len,
index 4637fd5..6c4a139 100644 (file)
@@ -26,7 +26,7 @@
 #include "internal.h"
 
 /**
- * \defgroup nfq_verd Queue verdict object handling
+ * \defgroup nfq_verd Verdict helpers
  * @{
  */
 
@@ -58,7 +58,7 @@ EXPORT_SYMBOL(nfq_nlmsg_verdict_put_pkt);
  */
 
 /**
- * \defgroup nfq_cfg Queue config object handling
+ * \defgroup nfq_cfg Config helpers
  * @{
  */