Skip to contentSkip to conversation

src: doc: revise doxygen for module "Netlink message helper functions"

PATCH Superseded Duncan Roe 1 participant 1 message Sep 7, 2021 netfilter

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Duncan Roe

author
#0 lore raw

PATCH v2 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/).

---
v2: Implement Pablo's suggestions

 include/libnetfilter_log/libnetfilter_log.h |  2 +-
 src/nlmsg.c                                 | 58 ++++++++++-----------
 utils/nf-log.c                              |  8 +--
 3 files changed, 33 insertions(+), 35 deletions(-)
include/libnetfilter_log/libnetfilter_log.h +1 -1
index c27149f..16c4748 100644
@@ -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 +28 -30

112 lines not on this page · raw message

utils/nf-log.c +4 -4
index ad8369c..e6832b0 100644
@@ -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