* libmnl: genl patches @ 2011-01-08 3:09 Jan Engelhardt 2011-01-08 3:09 ` [PATCH 1/2] examples/genl: fix newline imbalance Jan Engelhardt ` (2 more replies) 0 siblings, 3 replies; 4+ messages in thread From: Jan Engelhardt @ 2011-01-08 3:09 UTC (permalink / raw) To: pablo; +Cc: netfilter-devel The following changes since commit 89bb1e00f921a4e8b0e1e3b3e6aea5d26ccd0435: Merge branch 'master' of git://dev.medozas.de/libmnl (2011-01-06 03:19:29 +0100) are available in the git repository at: git://dev.medozas.de/libmnl master Jan Engelhardt (2): examples/genl: fix newline imbalance examples/genl: support dumping the genl families examples/genl/genl-family-get.c | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] examples/genl: fix newline imbalance 2011-01-08 3:09 libmnl: genl patches Jan Engelhardt @ 2011-01-08 3:09 ` Jan Engelhardt 2011-01-08 3:09 ` [PATCH 2/2] examples/genl: support dumping the genl families Jan Engelhardt 2011-01-09 18:57 ` libmnl: genl patches Pablo Neira Ayuso 2 siblings, 0 replies; 4+ messages in thread From: Jan Engelhardt @ 2011-01-08 3:09 UTC (permalink / raw) To: pablo; +Cc: netfilter-devel Running `genl-family-get VFS_DQUOT` forgets to print a newline. Signed-off-by: Jan Engelhardt <jengelh@medozas.de> --- examples/genl/genl-family-get.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/genl/genl-family-get.c b/examples/genl/genl-family-get.c index ba8291e..1ad1a04 100644 --- a/examples/genl/genl-family-get.c +++ b/examples/genl/genl-family-get.c @@ -169,12 +169,13 @@ static int data_cb(const struct nlmsghdr *nlh, void *data) printf("maxattr=%u\t", mnl_attr_get_u32(tb[CTRL_ATTR_MAXATTR])); } + printf("\n"); if (tb[CTRL_ATTR_OPS]) { - printf("\nops:\n"); + printf("ops:\n"); parse_genl_family_ops(tb[CTRL_ATTR_OPS]); } if (tb[CTRL_ATTR_MCAST_GROUPS]) { - printf("\ngrps:\n"); + printf("grps:\n"); parse_genl_mc_grps(tb[CTRL_ATTR_MCAST_GROUPS]); } return MNL_CB_OK; -- 1.7.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] examples/genl: support dumping the genl families 2011-01-08 3:09 libmnl: genl patches Jan Engelhardt 2011-01-08 3:09 ` [PATCH 1/2] examples/genl: fix newline imbalance Jan Engelhardt @ 2011-01-08 3:09 ` Jan Engelhardt 2011-01-09 18:57 ` libmnl: genl patches Pablo Neira Ayuso 2 siblings, 0 replies; 4+ messages in thread From: Jan Engelhardt @ 2011-01-08 3:09 UTC (permalink / raw) To: pablo; +Cc: netfilter-devel The usage text already specified [family] as optional, now implement it :-) Signed-off-by: Jan Engelhardt <jengelh@medozas.de> --- examples/genl/genl-family-get.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/genl/genl-family-get.c b/examples/genl/genl-family-get.c index 1ad1a04..b16f7b6 100644 --- a/examples/genl/genl-family-get.c +++ b/examples/genl/genl-family-get.c @@ -178,6 +178,7 @@ static int data_cb(const struct nlmsghdr *nlh, void *data) printf("grps:\n"); parse_genl_mc_grps(tb[CTRL_ATTR_MCAST_GROUPS]); } + printf("\n"); return MNL_CB_OK; } @@ -190,7 +191,7 @@ int main(int argc, char *argv[]) int ret; unsigned int seq, portid; - if (argc != 2) { + if (argc > 2) { printf("%s [family name]\n", argv[0]); exit(EXIT_FAILURE); } @@ -205,7 +206,10 @@ int main(int argc, char *argv[]) genl->version = 1; mnl_attr_put_u32(nlh, CTRL_ATTR_FAMILY_ID, GENL_ID_CTRL); - mnl_attr_put_strz(nlh, CTRL_ATTR_FAMILY_NAME, argv[1]); + if (argc >= 2) + mnl_attr_put_strz(nlh, CTRL_ATTR_FAMILY_NAME, argv[1]); + else + nlh->nlmsg_flags |= NLM_F_DUMP; nl = mnl_socket_open(NETLINK_GENERIC); if (nl == NULL) { -- 1.7.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: libmnl: genl patches 2011-01-08 3:09 libmnl: genl patches Jan Engelhardt 2011-01-08 3:09 ` [PATCH 1/2] examples/genl: fix newline imbalance Jan Engelhardt 2011-01-08 3:09 ` [PATCH 2/2] examples/genl: support dumping the genl families Jan Engelhardt @ 2011-01-09 18:57 ` Pablo Neira Ayuso 2 siblings, 0 replies; 4+ messages in thread From: Pablo Neira Ayuso @ 2011-01-09 18:57 UTC (permalink / raw) To: Jan Engelhardt; +Cc: netfilter-devel On 08/01/11 04:09, Jan Engelhardt wrote: > The following changes since commit 89bb1e00f921a4e8b0e1e3b3e6aea5d26ccd0435: > > Merge branch 'master' of git://dev.medozas.de/libmnl (2011-01-06 03:19:29 +0100) > > are available in the git repository at: > > git://dev.medozas.de/libmnl master Pulled and applied, thanks Jan. ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-01-09 18:57 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-01-08 3:09 libmnl: genl patches Jan Engelhardt 2011-01-08 3:09 ` [PATCH 1/2] examples/genl: fix newline imbalance Jan Engelhardt 2011-01-08 3:09 ` [PATCH 2/2] examples/genl: support dumping the genl families Jan Engelhardt 2011-01-09 18:57 ` libmnl: genl patches Pablo Neira Ayuso
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).