diff options
author | Thomas Haller <thaller@redhat.com> | 2018-10-08 11:46:19 (GMT) |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-10-10 10:16:16 (GMT) |
commit | 08160f0555f988db1ec3de65fa188a9d48ebff9d (patch) | |
tree | 4a382374c3ef7a0cc83c9ecc0ab7a0eec2c6d449 /lib | |
parent | 470b98354627eb4ab9eeb67308bc2f2c746e83eb (diff) | |
download | libnl-08160f0555f988db1ec3de65fa188a9d48ebff9d.zip libnl-08160f0555f988db1ec3de65fa188a9d48ebff9d.tar.gz libnl-08160f0555f988db1ec3de65fa188a9d48ebff9d.tar.bz2 |
route/macvlan: style fixes in "lib/route/link/macvlan.c"
Diffstat (limited to 'lib')
-rw-r--r-- | lib/route/link/macvlan.c | 112 |
1 files changed, 56 insertions, 56 deletions
diff --git a/lib/route/link/macvlan.c b/lib/route/link/macvlan.c index dbcea44..a23fe6d 100644 --- a/lib/route/link/macvlan.c +++ b/lib/route/link/macvlan.c @@ -1,10 +1,10 @@ /* - * lib/route/link/macvlan.c MACVLAN Link Info + * lib/route/link/macvlan.c MACVLAN Link Info * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation version 2.1 + * of the License. * * Copyright (c) 2013 Michael Braun <michael-dev@fami-braun.de> */ @@ -36,29 +36,29 @@ #include <linux/if_link.h> /** @cond SKIP */ -#define MACVLAN_HAS_MODE (1<<0) -#define MACVLAN_HAS_FLAGS (1<<1) -#define MACVLAN_HAS_MACADDR (1<<2) +#define MACVLAN_HAS_MODE (1<<0) +#define MACVLAN_HAS_FLAGS (1<<1) +#define MACVLAN_HAS_MACADDR (1<<2) struct macvlan_info { - uint32_t mvi_mode; - uint16_t mvi_flags; // there currently is only one flag and kernel has no flags_mask yet - uint32_t mvi_mask; - uint32_t mvi_maccount; - uint32_t mvi_macmode; - struct nl_addr **mvi_macaddr; + uint32_t mvi_mode; + uint16_t mvi_flags; // there currently is only one flag and kernel has no flags_mask yet + uint32_t mvi_mask; + uint32_t mvi_maccount; + uint32_t mvi_macmode; + struct nl_addr **mvi_macaddr; }; /** @endcond */ static struct nla_policy macvlan_policy[IFLA_MACVLAN_MAX+1] = { - [IFLA_MACVLAN_MODE] = { .type = NLA_U32 }, - [IFLA_MACVLAN_FLAGS] = { .type = NLA_U16 }, - [IFLA_MACVLAN_MACADDR_MODE] = { .type = NLA_U32 }, - [IFLA_MACVLAN_MACADDR] = { .type = NLA_UNSPEC }, - [IFLA_MACVLAN_MACADDR_DATA] = { .type = NLA_NESTED }, - [IFLA_MACVLAN_MACADDR_COUNT] = { .type = NLA_U32 }, + [IFLA_MACVLAN_MODE] = { .type = NLA_U32 }, + [IFLA_MACVLAN_FLAGS] = { .type = NLA_U16 }, + [IFLA_MACVLAN_MACADDR_MODE] = { .type = NLA_U32 }, + [IFLA_MACVLAN_MACADDR] = { .type = NLA_UNSPEC }, + [IFLA_MACVLAN_MACADDR_DATA] = { .type = NLA_NESTED }, + [IFLA_MACVLAN_MACADDR_COUNT] = { .type = NLA_U32 }, }; static int macvlan_alloc(struct rtnl_link *link) @@ -122,7 +122,7 @@ static int macvlan_parse(struct rtnl_link *link, struct nlattr *data, len = nla_len(tb[IFLA_MACVLAN_MACADDR_DATA]); mvi->mvi_macaddr = calloc(mvi->mvi_maccount, - sizeof(*(mvi->mvi_macaddr))); + sizeof(*(mvi->mvi_macaddr))); i = 0; for (; nla_ok(nla, len); nla = nla_next(nla, &len)) { @@ -176,13 +176,13 @@ static void macvlan_dump_details(struct rtnl_link *link, struct nl_dump_params * if (mvi->mvi_mask & MACVLAN_HAS_MACADDR) { nl_dump(p, " macvlan-count %u", (unsigned) mvi->mvi_maccount); - + if (mvi->mvi_maccount) nl_dump(p, " macvlan-sourcemac"); for (i = 0; i < mvi->mvi_maccount; i++) { nl_dump(p, " %s", nl_addr2str(mvi->mvi_macaddr[i], buf, - sizeof(buf))); + sizeof(buf))); } } nl_dump(p, "\n"); @@ -207,7 +207,7 @@ static int macvlan_clone(struct rtnl_link *dst, struct rtnl_link *src) if ( vsrc->mvi_mask & MACVLAN_HAS_MACADDR && vsrc->mvi_maccount > 0) { vdst->mvi_macaddr = calloc(vdst->mvi_maccount, - sizeof(*(vdst->mvi_macaddr))); + sizeof(*(vdst->mvi_macaddr))); for (i = 0; i < vdst->mvi_maccount; i++) vdst->mvi_macaddr[i] = nl_addr_clone(vsrc->mvi_macaddr[i]); } else @@ -241,7 +241,7 @@ static int macvlan_put_attrs(struct nl_msg *msg, struct rtnl_link *link) for (i = 0; i < mvi->mvi_maccount; i++) { NLA_PUT_ADDR(msg, IFLA_MACVLAN_MACADDR, - mvi->mvi_macaddr[i]); + mvi->mvi_macaddr[i]); } } @@ -322,7 +322,7 @@ struct rtnl_link *rtnl_link_macvlan_alloc(void) /** * Check if link is a MACVLAN link - * @arg link Link object + * @arg link Link object * * @return True if link is a MACVLAN link, otherwise false is returned. */ @@ -333,8 +333,8 @@ int rtnl_link_is_macvlan(struct rtnl_link *link) /** * Set MACVLAN MODE - * @arg link Link object - * @arg mode MACVLAN mode + * @arg link Link object + * @arg mode MACVLAN mode * * @return 0 on success or a negative error code */ @@ -363,7 +363,7 @@ int rtnl_link_macvlan_set_mode(struct rtnl_link *link, uint32_t mode) /** * Get MACVLAN Mode - * @arg link Link object + * @arg link Link object * * @return MACVLAN mode, 0 if not set or a negative error code. */ @@ -381,8 +381,8 @@ uint32_t rtnl_link_macvlan_get_mode(struct rtnl_link *link) /** * Set MACVLAN MACMODE - * @arg link Link object - * @arg mode MACVLAN mac list modification mode + * @arg link Link object + * @arg mode MACVLAN mac list modification mode * * Only for macvlan SOURCE mode. * @@ -406,8 +406,8 @@ int rtnl_link_macvlan_set_macmode(struct rtnl_link *link, uint32_t macmode) /** * Get MACVLAN MACMODE - * @arg link Link object - * @arg out_macmode mac list modification mode + * @arg link Link object + * @arg out_macmode mac list modification mode * * Only for SOURCE mode. * @@ -433,8 +433,8 @@ int rtnl_link_macvlan_get_macmode(struct rtnl_link *link, uint32_t *out_macmode) /** * Set MACVLAN flags - * @arg link Link object - * @arg flags MACVLAN flags + * @arg link Link object + * @arg flags MACVLAN flags * * @return 0 on success or a negative error code. */ @@ -452,8 +452,8 @@ int rtnl_link_macvlan_set_flags(struct rtnl_link *link, uint16_t flags) /** * Unset MACVLAN flags - * @arg link Link object - * @arg flags MACVLAN flags + * @arg link Link object + * @arg flags MACVLAN flags * * Note: kernel currently only has a single flag and lacks flags_mask to * indicate which flags shall be changed (it always all). @@ -474,7 +474,7 @@ int rtnl_link_macvlan_unset_flags(struct rtnl_link *link, uint16_t flags) /** * Get MACVLAN flags - * @arg link Link object + * @arg link Link object * * @return MACVLAN flags, 0 if none set, or a negative error code. */ @@ -489,8 +489,8 @@ uint16_t rtnl_link_macvlan_get_flags(struct rtnl_link *link) /** * Get number of MAC-Addr for MACVLAN device in source mode - * @arg link Link object - * @arg out_count number of mac addresses + * @arg link Link object + * @arg out_count number of mac addresses * * @return 0 on success or a negative error code. */ @@ -514,7 +514,7 @@ int rtnl_link_macvlan_count_macaddr(struct rtnl_link *link, uint32_t *out_count) /** * Get configured remote MAC-Addr from MACVLAN device in source mode - * @arg link Link object + * @arg link Link object * @arg out_addr address object * * The returned nl_addr struct needs NOT to be released using nl_addr_put. @@ -524,7 +524,7 @@ int rtnl_link_macvlan_count_macaddr(struct rtnl_link *link, uint32_t *out_count) * @return 0 on success or negative error code */ int rtnl_link_macvlan_get_macaddr(struct rtnl_link *link, uint32_t idx, - const struct nl_addr **out_addr) + const struct nl_addr **out_addr) { struct macvlan_info *mvi = link->l_info; @@ -546,8 +546,8 @@ int rtnl_link_macvlan_get_macaddr(struct rtnl_link *link, uint32_t idx, /** * Add MAC-Addr to MACVLAN device in source mode - * @arg link Link object - * @arg addr MAC-Addr + * @arg link Link object + * @arg addr MAC-Addr * * addr is not release but cloned by this method. * @@ -590,8 +590,8 @@ int rtnl_link_macvlan_add_macaddr(struct rtnl_link *link, struct nl_addr *addr) /** * Remove MAC-Addr from MACVLAN device in source mode - * @arg link Link object - * @arg addr MAC-Addr + * @arg link Link object + * @arg addr MAC-Addr * * addr is not release by this method. * @@ -668,7 +668,7 @@ struct rtnl_link *rtnl_link_macvtap_alloc(void) /** * Check if link is a MACVTAP link - * @arg link Link object + * @arg link Link object * * @return True if link is a MACVTAP link, otherwise false is returned. */ @@ -679,8 +679,8 @@ int rtnl_link_is_macvtap(struct rtnl_link *link) /** * Set MACVTAP MODE - * @arg link Link object - * @arg mode MACVTAP mode + * @arg link Link object + * @arg mode MACVTAP mode * * @return 0 on success or a negative error code */ @@ -698,7 +698,7 @@ int rtnl_link_macvtap_set_mode(struct rtnl_link *link, uint32_t mode) /** * Get MACVTAP Mode - * @arg link Link object + * @arg link Link object * * @return MACVTAP mode, 0 if not set or a negative error code. */ @@ -716,8 +716,8 @@ uint32_t rtnl_link_macvtap_get_mode(struct rtnl_link *link) /** * Set MACVTAP flags - * @arg link Link object - * @arg flags MACVTAP flags + * @arg link Link object + * @arg flags MACVTAP flags * * @return 0 on success or a negative error code. */ @@ -735,8 +735,8 @@ int rtnl_link_macvtap_set_flags(struct rtnl_link *link, uint16_t flags) /** * Unset MACVTAP flags - * @arg link Link object - * @arg flags MACVTAP flags + * @arg link Link object + * @arg flags MACVTAP flags * * Note: kernel currently only has a single flag and lacks flags_mask to * indicate which flags shall be changed (it always all). @@ -757,7 +757,7 @@ int rtnl_link_macvtap_unset_flags(struct rtnl_link *link, uint16_t flags) /** * Get MACVTAP flags - * @arg link Link object + * @arg link Link object * * @return MACVTAP flags, 0 if none set, or a negative error code. */ @@ -837,7 +837,7 @@ int rtnl_link_macvlan_str2mode(const char *name) char *rtnl_link_macvlan_macmode2str(int mode, char *buf, size_t len) { return __type2str(mode, buf, len, macvlan_macmodes, - ARRAY_SIZE(macvlan_macmodes)); + ARRAY_SIZE(macvlan_macmodes)); } int rtnl_link_macvlan_str2macmode(const char *name) |