This patch updates the doxygen documentation for the new API.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
-EXCLUDE_SYMBOLS =
+EXCLUDE_SYMBOLS = EXPORT_SYMBOL
EXAMPLE_PATH =
EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = NO
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)
{
* 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.
*/
}
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)
*
* This library provides the user-space network packet buffer. This abstraction
* is strongly inspired by Linux kernel network buffer, the so-called sk_buff.
+ *
+ * @{
*/
/**
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;
}
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;
}
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,
}
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,
#include "internal.h"
/**
- * \defgroup nfq_verd Queue verdict object handling
+ * \defgroup nfq_verd Verdict helpers
* @{
*/
*/
/**
- * \defgroup nfq_cfg Queue config object handling
+ * \defgroup nfq_cfg Config helpers
* @{
*/