diff options
author | Duncan Roe <duncan_roe@optusnet.com.au> | 2019-10-08 11:49:44 +1100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2019-10-08 12:01:28 +0200 |
commit | ae497107eb8b44e2ad8429a0ffa971ded1fe801c (patch) | |
tree | dda1f42c60a16d5802595c40d269d912d84972a2 /src/extra/pktbuff.c | |
parent | a0b7cc0d20429ca1b62f551a4bd528ef7a0ea09b (diff) |
src: doc: Miscellaneous updates
(These updates only cover functions used in a recent project)
src/extra/ipv4.c: - nfq_ip_set_transport_header(): Add explanatory notes
- nfq_ip_mangle()
- Advise that there is a return code
- Note that IPv4 length is updated as well as checksum
src/extra/pktbuff.c: - pktb_alloc(): Minor rewording (English usage)
- pktb_mangle(): Document
src/extra/udp.c: - nfq_udp_get_hdr(): Fix params
- nfq_udp_get_payload(): Fix params
- nfq_udp_get_payload_len(): Fix params
- nfq_udp_mangle_ipv4(): Rewrite documentation
src/nlmsg.c: - nfq_nlmsg_verdict_put(): Document
- nfq_nlmsg_cfg_put_cmd():
- Change name (was: nfq_nlmsg_cfg_build_request)
- Fix params
- Delete function return documentation (void fn)
- nfq_nlmsg_cfg_put_params(); Document (params only)
- nfq_nlmsg_cfg_put_qmaxlen(): Document (params only)
- nfq_nlmsg_parse:
- Change name (was: nfq_pkt_parse)
- Fix params
Signed-off-by: Duncan Roe <duncan_roe@optusnet.com.au>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/extra/pktbuff.c')
-rw-r--r-- | src/extra/pktbuff.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/extra/pktbuff.c b/src/extra/pktbuff.c index 1c15a00..25b173b 100644 --- a/src/extra/pktbuff.c +++ b/src/extra/pktbuff.c @@ -36,7 +36,7 @@ * \param extra Extra memory in the tail to be allocated (for mangling) * * This function returns a packet buffer that contains the packet data and - * some extra memory room in the tail (in case of requested). + * some extra memory room in the tail (if requested). * * \return a pointer to a new queue handle or NULL on failure. */ @@ -224,6 +224,19 @@ static int enlarge_pkt(struct pkt_buff *pkt, unsigned int extra) return 1; } +/** + * pktb_mangle - adjust contents of a packet + * \param pkt Pointer to packet buffer + * \param dataoff Offset to layer 3 header. Specify zero to access layer 2 (IP) + * header + * \param match_offset Further 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 + * \returns 1 for success and 0 for failure. Failure will occur if the \b extra + * argument to the pktb_alloc() call that created \b pkt is less than the excess + * of \b rep_len over \b match_len + */ int pktb_mangle(struct pkt_buff *pkt, unsigned int dataoff, unsigned int match_offset, |