Enable doxygen to generate Function Documentation
PATCH v3 1/1 Enable doxygen to generate Function Documentation
The C source files all contain doxygen documentation for each defined function but this was not appearing in the generated HTML or man pages. Fix is to move all EXPORT_SYMBOL macro calls to near the start of each file. Doxygen seems to otherwise forget the documentation on encountering EXPORT_SYMBOL which is flagged in the EXCLUDE_SYMBOLS tag in doxygen.cfg.in. I encountered this "feature" in doxygen 1.8.9.1 but it still appears to be present in 1.8.16
Tested against gcc and clang builds
Also fixed a missing doxygen section trailer in nlmsg.c
---
v2: - Move EXPORT_SYMBOL lines to after last #include line
- Slip in an extra fix for a missing doxygen section trailer (didn't think it warrantied an extra patch)
- Tweak commit message
src/attr.c | 71 +++++++++++++++++++++++++++++----------------------------- src/callback.c | 5 +++-- src/nlmsg.c | 45 ++++++++++++++++++++----------------- src/socket.c | 23 ++++++++++--------- 4 files changed, 76 insertions(+), 68 deletions(-)
src/attr.c +36 -35
@@ -12,6 +12,42 @@#include <errno.h> #include "internal.h" +EXPORT_SYMBOL (mnl_attr_get_type); +EXPORT_SYMBOL (mnl_attr_get_len); +EXPORT_SYMBOL (mnl_attr_get_payload_len); +EXPORT_SYMBOL (mnl_attr_get_payload); +EXPORT_SYMBOL (mnl_attr_ok); +EXPORT_SYMBOL (mnl_attr_next); +EXPORT_SYMBOL (mnl_attr_type_valid); +EXPORT_SYMBOL (mnl_attr_validate); +EXPORT_SYMBOL (mnl_attr_validate2); +EXPORT_SYMBOL (mnl_attr_parse); +EXPORT_SYMBOL (mnl_attr_parse_nested); +EXPORT_SYMBOL (mnl_attr_parse_payload); +EXPORT_SYMBOL (mnl_attr_get_u8); +EXPORT_SYMBOL (mnl_attr_get_u16); +EXPORT_SYMBOL (mnl_attr_get_u32); +EXPORT_SYMBOL (mnl_attr_get_u64); +EXPORT_SYMBOL (mnl_attr_get_str); +EXPORT_SYMBOL (mnl_attr_put); +EXPORT_SYMBOL (mnl_attr_put_u8); +EXPORT_SYMBOL (mnl_attr_put_u16); +EXPORT_SYMBOL (mnl_attr_put_u32); +EXPORT_SYMBOL (mnl_attr_put_u64); +EXPORT_SYMBOL (mnl_attr_put_str); +EXPORT_SYMBOL (mnl_attr_put_strz); +EXPORT_SYMBOL (mnl_attr_nest_start); +EXPORT_SYMBOL (mnl_attr_put_check); +EXPORT_SYMBOL (mnl_attr_put_u8_check); +EXPORT_SYMBOL (mnl_attr_put_u16_check); +EXPORT_SYMBOL (mnl_attr_put_u32_check); +EXPORT_SYMBOL (mnl_attr_put_u64_check); +EXPORT_SYMBOL (mnl_attr_put_str_check); +EXPORT_SYMBOL (mnl_attr_put_strz_check); +EXPORT_SYMBOL (mnl_attr_nest_start_check); +EXPORT_SYMBOL (mnl_attr_nest_end); +EXPORT_SYMBOL (mnl_attr_nest_cancel); +/** * \defgroup attr Netlink attribute helpers *
@@ -35,7 +71,6 @@* * This function returns the attribute type. */ -EXPORT_SYMBOL (mnl_attr_get_type);uint16_t mnl_attr_get_type (const struct nlattr *attr) {return attr->nla_type &NLA_TYPE_MASK ;
@@ -48,7 +83,6 @@ uint16_t mnl_attr_get_type(const struct nlattr *attr)* This function returns the attribute length that is the attribute header * plus the attribute payload. */ -EXPORT_SYMBOL (mnl_attr_get_len);uint16_t mnl_attr_get_len (const struct nlattr *attr) {return attr->nla_len;
@@ -60,7 +94,6 @@ uint16_t mnl_attr_get_len(const struct nlattr *attr)* * This function returns the attribute payload-value length. */ -EXPORT_SYMBOL (mnl_attr_get_payload_len);uint16_t mnl_attr_get_payload_len (const struct nlattr *attr) {return attr->nla_len -MNL_ATTR_HDRLEN ;
@@ -72,7 +105,6 @@ uint16_t mnl_attr_get_payload_len(const struct nlattr *attr)* * This function return a pointer to the attribute payload. */ -EXPORT_SYMBOL (mnl_attr_get_payload);void *mnl_attr_get_payload (const struct nlattr *attr) {return (void *)attr +MNL_ATTR_HDRLEN ;
@@ -94,7 +126,6 @@ void *mnl_attr_get_payload(const struct nlattr *attr)* The len parameter may be negative in the case of malformed messages during * attribute iteration, that is why we use a signed integer. */ -EXPORT_SYMBOL (mnl_attr_ok);bool mnl_attr_ok (const struct nlattr *attr,int len) { return len >= (int)sizeof(struct nlattr) &&
@@ -110,7 +141,6 @@ bool mnl_attr_ok(const struct nlattr *attr, int len)* as parameter. You have to use mnl_attr_ok() to ensure that the next * attribute is valid. */ -EXPORT_SYMBOL (mnl_attr_next);struct nlattr *mnl_attr_next (const struct nlattr *attr) {return (struct nlattr *)((void *)attr +MNL_ALIGN (attr->nla_len));
@@ -130,7 +160,6 @@ struct nlattr *mnl_attr_next(const struct nlattr *attr)* This leads to backward compatibility breakages in user-space. Better check * if you support an attribute, if not, skip it. */ -EXPORT_SYMBOL (mnl_attr_type_valid);int mnl_attr_type_valid (const struct nlattr *attr,uint16_t max) {if (mnl_attr_get_type (attr) > max) {
@@ -211,7 +240,6 @@ static const size_t mnl_attr_data_type_len[MNL_TYPE_MAX] = {* integers (u8, u16, u32 and u64) have enough room for them. This function * returns -1 in case of error, and errno is explicitly set. */ -EXPORT_SYMBOL (mnl_attr_validate);int mnl_attr_validate (const struct nlattr *attr,enum mnl_attr_data_type type) {int exp_len;
@@ -234,7 +262,6 @@ int mnl_attr_validate(const struct nlattr *attr, enum mnl_attr_data_type type)* whose size is variable. If the size of the attribute is not what we expect, * this functions returns -1 and errno is explicitly set. */ -EXPORT_SYMBOL (mnl_attr_validate2);int mnl_attr_validate2 (const struct nlattr *attr,enum mnl_attr_data_type type,size_t exp_len) {
@@ -260,7 +287,6 @@ int mnl_attr_validate2(const struct nlattr *attr, enum mnl_attr_data_type type,* This function propagates the return value of the callback, which can be * MNL_CB_ERROR, MNL_CB_OK or MNL_CB_STOP. */ -EXPORT_SYMBOL (mnl_attr_parse);int mnl_attr_parse (const struct nlmsghdr *nlh,unsigned int offset,mnl_attr_cb_t cb,void *data) {
@@ -287,7 +313,6 @@ int mnl_attr_parse(const struct nlmsghdr *nlh, unsigned int offset,* This function propagates the return value of the callback, which can be * MNL_CB_ERROR, MNL_CB_OK or MNL_CB_STOP. */ -EXPORT_SYMBOL (mnl_attr_parse_nested);int mnl_attr_parse_nested (const struct nlattr *nested,mnl_attr_cb_t cb,void *data) {
@@ -319,7 +344,6 @@ int mnl_attr_parse_nested(const struct nlattr *nested, mnl_attr_cb_t cb,* This function propagates the return value of the callback, which can be * MNL_CB_ERROR, MNL_CB_OK or MNL_CB_STOP. */ -EXPORT_SYMBOL (mnl_attr_parse_payload);int mnl_attr_parse_payload (const void *payload,size_t payload_len,mnl_attr_cb_t cb,void *data) {
@@ -338,7 +362,6 @@ int mnl_attr_parse_payload(const void *payload, size_t payload_len,* * This function returns the 8-bit value of the attribute payload. */ -EXPORT_SYMBOL (mnl_attr_get_u8);uint8_t mnl_attr_get_u8 (const struct nlattr *attr) {return *((uint8_t *)mnl_attr_get_payload (attr));
@@ -350,7 +373,6 @@ uint8_t mnl_attr_get_u8(const struct nlattr *attr)* * This function returns the 16-bit value of the attribute payload. */ -EXPORT_SYMBOL (mnl_attr_get_u16);uint16_t mnl_attr_get_u16 (const struct nlattr *attr) {return *((uint16_t *)mnl_attr_get_payload (attr));
@@ -362,7 +384,6 @@ uint16_t mnl_attr_get_u16(const struct nlattr *attr)* * This function returns the 32-bit value of the attribute payload. */ -EXPORT_SYMBOL (mnl_attr_get_u32);uint32_t mnl_attr_get_u32 (const struct nlattr *attr) {return *((uint32_t *)mnl_attr_get_payload (attr));
@@ -376,7 +397,6 @@ uint32_t mnl_attr_get_u32(const struct nlattr *attr)* function is align-safe, since accessing 64-bit Netlink attributes is a * common source of alignment issues. */ -EXPORT_SYMBOL (mnl_attr_get_u64);uint64_t mnl_attr_get_u64 (const struct nlattr *attr) {uint64_t tmp;
@@ -390,7 +410,6 @@ uint64_t mnl_attr_get_u64(const struct nlattr *attr)* * This function returns the payload of string attribute value. */ -EXPORT_SYMBOL (mnl_attr_get_str);const char *mnl_attr_get_str (const struct nlattr *attr) {return mnl_attr_get_payload (attr);
@@ -406,7 +425,6 @@ const char *mnl_attr_get_str(const struct nlattr *attr)* This function updates the length field of the Netlink message (nlmsg_len) * by adding the size (header + payload) of the new attribute. */ -EXPORT_SYMBOL (mnl_attr_put);void mnl_attr_put (struct nlmsghdr *nlh,uint16_t type,size_t len,const void *data) {
@@ -433,7 +451,6 @@ void mnl_attr_put(struct nlmsghdr *nlh, uint16_t type, size_t len,* This function updates the length field of the Netlink message (nlmsg_len) * by adding the size (header + payload) of the new attribute. */ -EXPORT_SYMBOL (mnl_attr_put_u8);void mnl_attr_put_u8 (struct nlmsghdr *nlh,uint16_t type,uint8_t data) {mnl_attr_put (nlh, type,sizeof (uint8_t ), &data);
@@ -448,7 +465,6 @@ void mnl_attr_put_u8(struct nlmsghdr *nlh, uint16_t type, uint8_t data)* This function updates the length field of the Netlink message (nlmsg_len) * by adding the size (header + payload) of the new attribute. */ -EXPORT_SYMBOL (mnl_attr_put_u16);void mnl_attr_put_u16 (struct nlmsghdr *nlh,uint16_t type,uint16_t data) {mnl_attr_put (nlh, type,sizeof (uint16_t ), &data);
@@ -463,7 +479,6 @@ void mnl_attr_put_u16(struct nlmsghdr *nlh, uint16_t type, uint16_t data)* This function updates the length field of the Netlink message (nlmsg_len) * by adding the size (header + payload) of the new attribute. */ -EXPORT_SYMBOL (mnl_attr_put_u32);void mnl_attr_put_u32 (struct nlmsghdr *nlh,uint16_t type,uint32_t data) {mnl_attr_put (nlh, type,sizeof (uint32_t ), &data);
@@ -478,7 +493,6 @@ void mnl_attr_put_u32(struct nlmsghdr *nlh, uint16_t type, uint32_t data)* This function updates the length field of the Netlink message (nlmsg_len) * by adding the size (header + payload) of the new attribute. */ -EXPORT_SYMBOL (mnl_attr_put_u64);void mnl_attr_put_u64 (struct nlmsghdr *nlh,uint16_t type,uint64_t data) {mnl_attr_put (nlh, type,sizeof (uint64_t ), &data);
@@ -493,7 +507,6 @@ void mnl_attr_put_u64(struct nlmsghdr *nlh, uint16_t type, uint64_t data)* This function updates the length field of the Netlink message (nlmsg_len) * by adding the size (header + payload) of the new attribute. */ -EXPORT_SYMBOL (mnl_attr_put_str);void mnl_attr_put_str (struct nlmsghdr *nlh,uint16_t type,const char *data) {mnl_attr_put (nlh, type,strlen (data), data);
@@ -511,7 +524,6 @@ void mnl_attr_put_str(struct nlmsghdr *nlh, uint16_t type, const char *data)* This function updates the length field of the Netlink message (nlmsg_len) * by adding the size (header + payload) of the new attribute. */ -EXPORT_SYMBOL (mnl_attr_put_strz);void mnl_attr_put_strz (struct nlmsghdr *nlh,uint16_t type,const char *data) {mnl_attr_put (nlh, type,strlen (data)+1 , data);
@@ -526,7 +538,6 @@ void mnl_attr_put_strz(struct nlmsghdr *nlh, uint16_t type, const char *data)* an attribute nest. This function always returns a valid pointer to the * beginning of the nest. */ -EXPORT_SYMBOL (mnl_attr_nest_start);struct nlattr *mnl_attr_nest_start (struct nlmsghdr *nlh,uint16_t type) {struct nlattr *start =mnl_nlmsg_get_payload_tail (nlh);
@@ -552,7 +563,6 @@ struct nlattr *mnl_attr_nest_start(struct nlmsghdr *nlh, uint16_t type)* attribute. The function returns true if the attribute could be added * to the message, otherwise false is returned. */ -EXPORT_SYMBOL (mnl_attr_put_check);bool mnl_attr_put_check (struct nlmsghdr *nlh,size_t buflen,uint16_t type,size_t len,const void *data) {
@@ -575,7 +585,6 @@ bool mnl_attr_put_check(struct nlmsghdr *nlh, size_t buflen,* attribute. The function returns true if the attribute could be added * to the message, otherwise false is returned. */ -EXPORT_SYMBOL (mnl_attr_put_u8_check);bool mnl_attr_put_u8_check (struct nlmsghdr *nlh,size_t buflen,uint16_t type,uint8_t data) {
@@ -597,7 +606,6 @@ bool mnl_attr_put_u8_check(struct nlmsghdr *nlh, size_t buflen,* This function updates the length field of the Netlink message (nlmsg_len) * by adding the size (header + payload) of the new attribute. */ -EXPORT_SYMBOL (mnl_attr_put_u16_check);bool mnl_attr_put_u16_check (struct nlmsghdr *nlh,size_t buflen,uint16_t type,uint16_t data) {
@@ -619,7 +627,6 @@ bool mnl_attr_put_u16_check(struct nlmsghdr *nlh, size_t buflen,* This function updates the length field of the Netlink message (nlmsg_len) * by adding the size (header + payload) of the new attribute. */ -EXPORT_SYMBOL (mnl_attr_put_u32_check);bool mnl_attr_put_u32_check (struct nlmsghdr *nlh,size_t buflen,uint16_t type,uint32_t data) {
@@ -641,7 +648,6 @@ bool mnl_attr_put_u32_check(struct nlmsghdr *nlh, size_t buflen,* This function updates the length field of the Netlink message (nlmsg_len) * by adding the size (header + payload) of the new attribute. */ -EXPORT_SYMBOL (mnl_attr_put_u64_check);bool mnl_attr_put_u64_check (struct nlmsghdr *nlh,size_t buflen,uint16_t type,uint64_t data) {
@@ -663,7 +669,6 @@ bool mnl_attr_put_u64_check(struct nlmsghdr *nlh, size_t buflen,* This function updates the length field of the Netlink message (nlmsg_len) * by adding the size (header + payload) of the new attribute. */ -EXPORT_SYMBOL (mnl_attr_put_str_check);bool mnl_attr_put_str_check (struct nlmsghdr *nlh,size_t buflen,uint16_t type,const char *data) {
@@ -686,7 +691,6 @@ bool mnl_attr_put_str_check(struct nlmsghdr *nlh, size_t buflen,* attribute. The function returns true if the attribute could be added * to the message, otherwise false is returned. */ -EXPORT_SYMBOL (mnl_attr_put_strz_check);bool mnl_attr_put_strz_check (struct nlmsghdr *nlh,size_t buflen,uint16_t type,const char *data) {
@@ -703,7 +707,6 @@ bool mnl_attr_put_strz_check(struct nlmsghdr *nlh, size_t buflen,* an attribute nest. If the nested attribute cannot be added then NULL, * otherwise valid pointer to the beginning of the nest is returned. */ -EXPORT_SYMBOL (mnl_attr_nest_start_check);struct nlattr *mnl_attr_nest_start_check (struct nlmsghdr *nlh,size_t buflen,uint16_t type) {
@@ -719,7 +722,6 @@ struct nlattr *mnl_attr_nest_start_check(struct nlmsghdr *nlh, size_t buflen,* * This function updates the attribute header that identifies the nest. */ -EXPORT_SYMBOL (mnl_attr_nest_end);void mnl_attr_nest_end (struct nlmsghdr *nlh,struct nlattr *start) { start->nla_len =mnl_nlmsg_get_payload_tail (nlh) - (void *)start;
@@ -732,7 +734,6 @@ void mnl_attr_nest_end(struct nlmsghdr *nlh, struct nlattr *start)* * This function updates the attribute header that identifies the nest. */ -EXPORT_SYMBOL (mnl_attr_nest_cancel);void mnl_attr_nest_cancel (struct nlmsghdr *nlh,struct nlattr *start) { nlh->nlmsg_len -=mnl_nlmsg_get_payload_tail (nlh) - (void *)start;
src/callback.c +3 -2
@@ -11,6 +11,9 @@#include <libmnl/libmnl.h> #include "internal.h" +EXPORT_SYMBOL (mnl_cb_run2); +EXPORT_SYMBOL (mnl_cb_run); +static int mnl_cb_noop (const struct nlmsghdr *nlh,void *data) {return MNL_CB_OK ;
@@ -127,7 +130,6 @@ out:* to EPROTO. If the dump was interrupted, errno is set to EINTR and you should * request a new fresh dump again. */ -EXPORT_SYMBOL (mnl_cb_run2);int mnl_cb_run2 (const void *buf,size_t numbytes,unsigned int seq,unsigned int portid,mnl_cb_t cb_data,void *data,const mnl_cb_t *cb_ctl_array,unsigned int cb_ctl_array_len)
@@ -155,7 +157,6 @@ int mnl_cb_run2(const void *buf, size_t numbytes, unsigned int seq,* * This function propagates the callback return value. */ -EXPORT_SYMBOL (mnl_cb_run);int mnl_cb_run (const void *buf,size_t numbytes,unsigned int seq,unsigned int portid,mnl_cb_t cb_data,void *data) {
src/nlmsg.c +25 -20
177 lines not on this page · raw message
src/socket.c +12 -11
@@ -16,6 +16,18 @@#include <errno.h> #include "internal.h" +EXPORT_SYMBOL (mnl_socket_get_fd); +EXPORT_SYMBOL (mnl_socket_get_portid); +EXPORT_SYMBOL (mnl_socket_open); +EXPORT_SYMBOL (mnl_socket_open2); +EXPORT_SYMBOL (mnl_socket_fdopen); +EXPORT_SYMBOL (mnl_socket_bind); +EXPORT_SYMBOL (mnl_socket_sendto); +EXPORT_SYMBOL (mnl_socket_recvfrom); +EXPORT_SYMBOL (mnl_socket_close); +EXPORT_SYMBOL (mnl_socket_setsockopt); +EXPORT_SYMBOL (mnl_socket_getsockopt); +/** * \mainpage *
@@ -82,7 +94,6 @@ struct mnl_socket {* * This function returns the file descriptor of a given netlink socket. */ -EXPORT_SYMBOL (mnl_socket_get_fd);int mnl_socket_get_fd (const struct mnl_socket *nl) {return nl->fd;
@@ -97,7 +108,6 @@ int mnl_socket_get_fd(const struct mnl_socket *nl)* which is not always true. This is the case if you open more than one * socket that is binded to the same Netlink subsystem from the same process. */ -EXPORT_SYMBOL (mnl_socket_get_portid);unsigned int mnl_socket_get_portid (const struct mnl_socket *nl) {return nl->addr.nl_pid;
@@ -127,7 +137,6 @@ static struct mnl_socket *__mnl_socket_open(int bus, int flags)* On error, it returns NULL and errno is appropriately set. Otherwise, it * returns a valid pointer to the mnl_socket structure. */ -EXPORT_SYMBOL (mnl_socket_open);struct mnl_socket *mnl_socket_open (int bus) {return __mnl_socket_open (bus,0 );
@@ -145,7 +154,6 @@ struct mnl_socket *mnl_socket_open(int bus)* On error, it returns NULL and errno is appropriately set. Otherwise, it * returns a valid pointer to the mnl_socket structure. */ -EXPORT_SYMBOL (mnl_socket_open2);struct mnl_socket *mnl_socket_open2 (int bus,int flags) {return __mnl_socket_open (bus, flags);
@@ -162,7 +170,6 @@ struct mnl_socket *mnl_socket_open2(int bus, int flags)* Note that mnl_socket_get_portid() returns 0 if this function is used with * non-netlink socket. */ -EXPORT_SYMBOL (mnl_socket_fdopen);struct mnl_socket *mnl_socket_fdopen (int fd) {int ret;
@@ -195,7 +202,6 @@ struct mnl_socket *mnl_socket_fdopen(int fd)* success, 0 is returned. You can use MNL_SOCKET_AUTOPID which is 0 for * automatic port ID selection. */ -EXPORT_SYMBOL (mnl_socket_bind);int mnl_socket_bind (struct mnl_socket *nl,unsigned int groups,pid_t pid) {int ret;
@@ -234,7 +240,6 @@ int mnl_socket_bind(struct mnl_socket *nl, unsigned int groups, pid_t pid)* On error, it returns -1 and errno is appropriately set. Otherwise, it * returns the number of bytes sent. */ -EXPORT_SYMBOL (mnl_socket_sendto);ssize_t mnl_socket_sendto (const struct mnl_socket *nl,const void *buf,size_t len) {
@@ -259,7 +264,6 @@ ssize_t mnl_socket_sendto(const struct mnl_socket *nl, const void *buf,* buffer size ensures that your buffer is big enough to store the netlink * message without truncating it. */ -EXPORT_SYMBOL (mnl_socket_recvfrom);ssize_t mnl_socket_recvfrom (const struct mnl_socket *nl,void *buf,size_t bufsiz) {
@@ -300,7 +304,6 @@ ssize_t mnl_socket_recvfrom(const struct mnl_socket *nl, void *buf,* On error, this function returns -1 and errno is appropriately set. * On success, it returns 0. */ -EXPORT_SYMBOL (mnl_socket_close);int mnl_socket_close (struct mnl_socket *nl) {int ret =close (nl->fd);
@@ -333,7 +336,6 @@ int mnl_socket_close(struct mnl_socket *nl)* * On error, this function returns -1 and errno is appropriately set. */ -EXPORT_SYMBOL (mnl_socket_setsockopt);int mnl_socket_setsockopt (const struct mnl_socket *nl,int type,void *buf,socklen_t len) {
@@ -349,7 +351,6 @@ int mnl_socket_setsockopt(const struct mnl_socket *nl, int type,* * On error, this function returns -1 and errno is appropriately set. */ -EXPORT_SYMBOL (mnl_socket_getsockopt);int mnl_socket_getsockopt (const struct mnl_socket *nl,int type,void *buf,socklen_t *len) {
Signature · 1 line
2.14.5