src: doc: revise doxygen for module "Netlink message helper functions"
PATCH v3 1/1 src: doc: revise doxygen for module "Netlink message helper functions"
Adjust style to work better in a man page.
Document actual return values.
Replace qnum with gnum (and in .h and utils/).
Show possible copy modes (rather than refer users to header file)
Signed-off-by Duncan Roe <[email protected]>
---
v2: Implement Pablo's suggestions
v3: Show possible modes for nflog_attr_put_cfg_mode
include/libnetfilter_log/libnetfilter_log.h | 2 +- src/nlmsg.c | 61 ++++++++++----------- utils/nf-log.c | 8 +-- 3 files changed, 35 insertions(+), 36 deletions(-)
include/libnetfilter_log/libnetfilter_log.h +1 -1
@@ -88,7 +88,7 @@ enum {extern int nflog_snprintf_xml (char *buf,size_t len,struct nflog_data *tb,int flags);extern struct nlmsghdr * -nflog_nlmsg_put_header (char *buf,uint8_t type,uint8_t family,uint16_t qnum); +nflog_nlmsg_put_header (char *buf,uint8_t type,uint8_t family,uint16_t gnum);extern int nflog_attr_put_cfg_mode (struct nlmsghdr *nlh,uint8_t mode,uint32_t range);extern int nflog_attr_put_cfg_cmd (struct nlmsghdr *nlh,uint8_t cmd);extern int nflog_nlmsg_parse (const struct nlmsghdr *nlh,struct nlattr **attr);
src/nlmsg.c +30 -31
114 lines not on this page · raw message
utils/nf-log.c +4 -4
@@ -144,13 +144,13 @@ int main(int argc, char *argv[])char buf[MNL_SOCKET_BUFFER_SIZE ];struct nlmsghdr *nlh;int ret; -unsigned int portid, qnum; +unsigned int portid, gnum;if (argc !=2 ) {printf ("Usage: %s [queue_num]\n" , argv[0 ]);exit (EXIT_FAILURE ); } - qnum =atoi (argv[1 ]); + gnum =atoi (argv[1 ]); nl =mnl_socket_open (NETLINK_NETFILTER );if (nl ==NULL ) {
@@ -188,7 +188,7 @@ int main(int argc, char *argv[])exit (EXIT_FAILURE ); } - nlh =nflog_nlmsg_put_header (buf,NFULNL_MSG_CONFIG ,AF_INET , qnum); + nlh =nflog_nlmsg_put_header (buf,NFULNL_MSG_CONFIG ,AF_INET , gnum);if (nflog_attr_put_cfg_cmd (nlh,NFULNL_CFG_CMD_BIND ) <0 ) {perror ("nflog_attr_put_cfg_cmd" );exit (EXIT_FAILURE );
@@ -199,7 +199,7 @@ int main(int argc, char *argv[])exit (EXIT_FAILURE ); } - nlh =nflog_nlmsg_put_header (buf,NFULNL_MSG_CONFIG ,AF_UNSPEC , qnum); + nlh =nflog_nlmsg_put_header (buf,NFULNL_MSG_CONFIG ,AF_UNSPEC , gnum);if (nflog_attr_put_cfg_mode (nlh,NFULNL_COPY_PACKET ,0xffff ) <0 ) {perror ("nflog_attr_put_cfg_mode" );exit (EXIT_FAILURE );
Signature · 1 line
2.17.5
Quoted 4 lines · Duncan Roe
Adjust style to work better in a man page.
Document actual return values.
Replace qnum with gnum (and in .h and utils/).
Show possible copy modes (rather than refer users to header file)
Applied, thanks.