summaryrefslogtreecommitdiffstats
path: root/src/extra/pktbuff.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2012-08-20 19:48:05 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2012-08-20 19:48:05 +0200
commit1eab5bedb6f024e5512d485ffd81d18d978ef3e3 (patch)
treeb29a78b7bd4593ca5441ba7a4889056e164ae2c8 /src/extra/pktbuff.c
parent3c42a36f3f170860b28d47ef028301276b78378b (diff)
src: update doxygen documentation for new API for libmnl
This patch updates the doxygen documentation for the new API. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/extra/pktbuff.c')
-rw-r--r--src/extra/pktbuff.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/extra/pktbuff.c b/src/extra/pktbuff.c
index 0989f60..0bd778d 100644
--- a/src/extra/pktbuff.c
+++ b/src/extra/pktbuff.c
@@ -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;