]> granicus.if.org Git - libnl/commitdiff
trivial: whitespace-only fixes for src and lib
authorPeter Wu <peter@lekensteyn.nl>
Mon, 8 Aug 2016 10:04:01 +0000 (12:04 +0200)
committerThomas Haller <thaller@redhat.com>
Fri, 12 Aug 2016 21:06:27 +0000 (23:06 +0200)
Fixes alignment, lines with just whitespace and mixed tab/space
indentation. Searched, reviewed and optionally fixed in vim using
regex ^\t* [\t ]*\([^*us ]\|$\)\|\t\+$

http://lists.infradead.org/pipermail/libnl/2016-August/002183.html

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
Signed-off-by: Thomas Haller <thaller@redhat.com>
54 files changed:
lib/cache.c
lib/cli/cls/basic.c
lib/cli/cls/cgroup.c
lib/cli/qdisc/bfifo.c
lib/cli/qdisc/blackhole.c
lib/cli/qdisc/fq_codel.c
lib/cli/qdisc/htb.c
lib/cli/qdisc/pfifo.c
lib/cli/qdisc/plug.c
lib/idiag/idiag.c
lib/netfilter/ct.c
lib/netfilter/ct_obj.c
lib/netfilter/exp_obj.c
lib/nl.c
lib/object.c
lib/route/act.c
lib/route/cls/ematch_syntax.y
lib/route/link.c
lib/route/link/ipgre.c
lib/route/link/ipvti.c
lib/route/link/sit.c
lib/route/neightbl.c
lib/route/qdisc/htb.c
lib/route/qdisc/netem.c
lib/route/route_obj.c
lib/socket.c
lib/utils.c
lib/xfrm/ae.c
lib/xfrm/sa.c
lib/xfrm/selector.c
lib/xfrm/sp.c
lib/xfrm/template.c
src/genl-ctrl-list.c
src/nf-ct-list.c
src/nf-exp-add.c
src/nf-exp-delete.c
src/nf-exp-list.c
src/nl-addr-add.c
src/nl-addr-delete.c
src/nl-class-add.c
src/nl-class-delete.c
src/nl-class-list.c
src/nl-classid-lookup.c
src/nl-cls-add.c
src/nl-cls-delete.c
src/nl-cls-list.c
src/nl-neigh-add.c
src/nl-neigh-delete.c
src/nl-neigh-list.c
src/nl-neightbl-list.c
src/nl-pktloc-lookup.c
src/nl-qdisc-add.c
src/nl-qdisc-delete.c
src/nl-qdisc-list.c

index 9aba0c96053262cc91e94424cc32329b5a9a3744..d8592b6c6825119865c40be5f5eeb574c5e4e020 100644 (file)
@@ -235,7 +235,7 @@ int nl_cache_alloc_and_fill(struct nl_cache_ops *ops, struct nl_sock *sock,
 {
        struct nl_cache *cache;
        int err;
-       
+
        if (!(cache = nl_cache_alloc(ops)))
                return -NLE_NOMEM;
 
@@ -527,7 +527,7 @@ int nl_cache_move(struct nl_cache *cache, struct nl_object *obj)
 
        NL_DBG(3, "Moving object %p from cache %p to cache %p\n",
               obj, obj->ce_cache, cache);
-       
+
        /* Acquire reference, if already in a cache this will be
         * reverted during removal */
        nl_object_get(obj);
@@ -589,7 +589,7 @@ void nl_cache_remove(struct nl_object *obj)
  */
 void nl_cache_set_arg1(struct nl_cache *cache, int arg)
 {
-        cache->c_iarg1 = arg;
+       cache->c_iarg1 = arg;
 }
 
 /**
@@ -602,7 +602,7 @@ void nl_cache_set_arg1(struct nl_cache *cache, int arg)
  */
 void nl_cache_set_arg2(struct nl_cache *cache, int arg)
 {
-        cache->c_iarg2 = arg;
+       cache->c_iarg2 = arg;
 }
 
 /**
@@ -1038,8 +1038,8 @@ static struct nl_object *__cache_fast_lookup(struct nl_cache *cache,
 
        obj = nl_hash_table_lookup(cache->hashtable, needle);
        if (obj) {
-           nl_object_get(obj);
-           return obj;
+               nl_object_get(obj);
+               return obj;
        }
 
        return NULL;
index 1939988a441567da95a87eaa5bf5e92fca64c16a..1a6b188719bb47d1c6f49f12b4b868e79c6df69e 100644 (file)
@@ -49,7 +49,7 @@ static void parse_argv(struct rtnl_tc *tc, int argc, char **argv)
                        { "ematch", 1, 0, 'e' },
                        { 0, 0, 0, 0 }
                };
-       
+
                c = getopt_long(argc, argv, "ht:e:", long_opts, &optidx);
                if (c == -1)
                        break;
@@ -72,7 +72,7 @@ static void parse_argv(struct rtnl_tc *tc, int argc, char **argv)
                        rtnl_basic_set_ematch(cls, tree);
                        break;
                }
-       }
+       }
 }
 
 static struct nl_cli_tc_module basic_module =
index fae620853d14f512b319ca2a57bc2813c4789379..9e1443c222d73650f10f53c8c095127a387cb5e9 100644 (file)
@@ -39,7 +39,7 @@ static void parse_argv(struct rtnl_tc *tc, int argc, char **argv)
                        { "ematch", 1, 0, 'e' },
                        { 0, 0, 0, 0 }
                };
-       
+
                c = getopt_long(argc, argv, "he:", long_opts, &optidx);
                if (c == -1)
                        break;
@@ -54,7 +54,7 @@ static void parse_argv(struct rtnl_tc *tc, int argc, char **argv)
                        rtnl_cgroup_set_ematch(cls, tree);
                        break;
                }
-       }
+       }
 }
 
 static struct nl_cli_tc_module cgroup_module =
index 1ee477735b62865fa68e429610ea1017b0752537..6b0206f26ebebd2cdcf4621911dd45afbaee524c 100644 (file)
@@ -42,7 +42,7 @@ static void bfifo_parse_argv(struct rtnl_tc *tc, int argc, char **argv)
                        { "limit", 1, 0, ARG_LIMIT },
                        { 0, 0, 0, 0 }
                };
-       
+
                c = getopt_long(argc, argv, "h", long_opts, &optidx);
                if (c == -1)
                        break;
@@ -62,7 +62,7 @@ static void bfifo_parse_argv(struct rtnl_tc *tc, int argc, char **argv)
                        rtnl_qdisc_fifo_set_limit(qdisc, limit);
                        break;
                }
-       }
+       }
 }
 
 static struct nl_cli_tc_module bfifo_module =
index af9dc6d88197ed37403b1fbec6c7021e1b9c72f2..372855f8c1c99b0496b88390d52187d8efafefa5 100644 (file)
@@ -33,7 +33,7 @@ static void blackhole_parse_argv(struct rtnl_tc *tc, int argc, char **argv)
                        { "help", 0, 0, 'h' },
                        { 0, 0, 0, 0 }
                };
-       
+
                c = getopt_long(argc, argv, "h", long_opts, &optidx);
                if (c == -1)
                        break;
@@ -43,7 +43,7 @@ static void blackhole_parse_argv(struct rtnl_tc *tc, int argc, char **argv)
                        print_usage();
                        return;
                }
-       }
+       }
 }
 
 static struct nl_cli_tc_module blackhole_module =
index 1602bcbaff060b60cd3ea44662dae57ca0578780..a592f903f5234c20285ad0c3aeb6df6a2c5a2eeb 100644 (file)
@@ -55,7 +55,7 @@ static void fq_codel_parse_argv(struct rtnl_tc *tc, int argc, char **argv)
                        { "target", 1, 0, ARG_TARGET},
                        { 0, 0, 0, 0 }
                };
-       
+
                c = getopt_long(argc, argv, "h", long_opts, &optidx);
                if (c == -1)
                        break;
@@ -91,7 +91,7 @@ static void fq_codel_parse_argv(struct rtnl_tc *tc, int argc, char **argv)
                        break;
 
                }
-       }
+       }
 }
 
 static struct nl_cli_tc_module fq_codel_module =
index 1751595ec784d638d1b0e16d8d927af98f233c61..628e6ccbab73c84d80cfdf46eeea893b010edc5c 100644 (file)
@@ -44,7 +44,7 @@ static void htb_parse_qdisc_argv(struct rtnl_tc *tc, int argc, char **argv)
                        { "default", 1, 0, ARG_DEFAULT },
                        { 0, 0, 0, 0 }
                };
-       
+
                c = getopt_long(argc, argv, "hv", long_opts, &optidx);
                if (c == -1)
                        break;
@@ -62,7 +62,7 @@ static void htb_parse_qdisc_argv(struct rtnl_tc *tc, int argc, char **argv)
                        rtnl_htb_set_defcls(qdisc, nl_cli_parse_u32(optarg));
                        break;
                }
-       }
+       }
 }
 
 static void print_class_usage(void)
@@ -109,7 +109,7 @@ static void htb_parse_class_argv(struct rtnl_tc *tc, int argc, char **argv)
                        { "cburst", 1, 0, ARG_CBURST },
                        { 0, 0, 0, 0 }
                };
-       
+
                c = getopt_long(argc, argv, "h", long_opts, &optidx);
                if (c == -1)
                        break;
@@ -173,7 +173,7 @@ static void htb_parse_class_argv(struct rtnl_tc *tc, int argc, char **argv)
                        rtnl_htb_set_cbuffer(class, rate);
                        break;
                }
-       }
+       }
 }
 
 static struct nl_cli_tc_module htb_qdisc_module =
index 02c4d2296a502fd05a12989035dd3d0a474d347a..7aac7df9fae15a067904e129c3128864072717fb 100644 (file)
@@ -42,7 +42,7 @@ static void pfifo_parse_argv(struct rtnl_tc *tc, int argc, char **argv)
                        { "limit", 1, 0, ARG_LIMIT },
                        { 0, 0, 0, 0 }
                };
-       
+
                c = getopt_long(argc, argv, "h", long_opts, &optidx);
                if (c == -1)
                        break;
@@ -56,7 +56,7 @@ static void pfifo_parse_argv(struct rtnl_tc *tc, int argc, char **argv)
                        rtnl_qdisc_fifo_set_limit(qdisc, nl_cli_parse_u32(optarg));
                        break;
                }
-       }
+       }
 }
 
 static struct nl_cli_tc_module pfifo_module =
index 2b8d5d65ac3a71bc4af5e32de92bd0eaadd86a77..227082d4ab051e87524575859a013d7b0f8eb7e1 100644 (file)
@@ -66,7 +66,7 @@ static void plug_parse_argv(struct rtnl_tc *tc, int argc, char **argv)
                        { "release-indefinite", 0, 0, ARG_RELEASE_INDEFINITE },
                        { 0, 0, 0, 0 }
                };
-       
+
                c = getopt_long(argc, argv, "h", long_opts, &optidx);
                if (c == -1)
                        break;
@@ -85,14 +85,14 @@ static void plug_parse_argv(struct rtnl_tc *tc, int argc, char **argv)
                        break;
 
                case ARG_RELEASE_ONE:
-                       rtnl_qdisc_plug_release_one(qdisc);
+                       rtnl_qdisc_plug_release_one(qdisc);
                        break;
 
                case ARG_RELEASE_INDEFINITE:
                        rtnl_qdisc_plug_release_indefinite(qdisc);
                        break;
                }
-       }
+       }
 }
 
 static struct nl_cli_tc_module plug_module =
index 26681c7e206879cacc228992fc947bae62ce32a4..5fd74471887549fa3e09254fcebea987b12d5d78 100644 (file)
@@ -259,18 +259,18 @@ char *idiagnl_tcpopts2str(uint8_t attrs, char *buf, size_t len)
  */
 char * idiagnl_shutdown2str(uint8_t shutdown, char *buf, size_t len)
 {
-  if (shutdown == 0) {
-         snprintf(buf, len, " ");
-         return buf;
-  } else if (shutdown == 1) {
-         snprintf(buf, len, "receive shutdown");
-         return buf;
-  } else if (shutdown == 2) {
-         snprintf(buf, len, "send shutdown");
-         return buf;
-  }
+       if (shutdown == 0) {
+               snprintf(buf, len, " ");
+               return buf;
+       } else if (shutdown == 1) {
+               snprintf(buf, len, "receive shutdown");
+               return buf;
+       } else if (shutdown == 2) {
+               snprintf(buf, len, "send shutdown");
+               return buf;
+       }
 
-  return NULL;
+       return NULL;
 }
 
 /** @} */
index d589790e6a82d8933129127dd43ea4d671370f8c..62ee77f3b5144d245ad58fc7e4c3393de7d3d879 100644 (file)
@@ -114,7 +114,7 @@ static int ct_parse_ip(struct nfnl_ct *ct, int repl, struct nlattr *attr)
        struct nl_addr *addr;
        int err;
 
-        err = nla_parse_nested(tb, CTA_IP_MAX, attr, ct_ip_policy);
+       err = nla_parse_nested(tb, CTA_IP_MAX, attr, ct_ip_policy);
        if (err < 0)
                goto errout;
 
index 1079ec0a4b07ac32932e624a6413853ab08f34af..0cc87be8866c89a3a536e46dee5aa3e10189e3f4 100644 (file)
@@ -477,7 +477,7 @@ char *nfnl_ct_tcp_state2str(uint8_t state, char *buf, size_t len)
 
 int nfnl_ct_str2tcp_state(const char *name)
 {
-        return __str2type(name, tcp_states, ARRAY_SIZE(tcp_states));
+       return __str2type(name, tcp_states, ARRAY_SIZE(tcp_states));
 }
 
 void nfnl_ct_set_status(struct nfnl_ct *ct, uint32_t status)
index aef43b73acfa03cc562b2e1cb18f21b8b503567b..cf61209bcbd1b2a67afda64b3f38b82b23c80f59 100644 (file)
@@ -132,7 +132,7 @@ static int exp_clone(struct nl_object *_dst, struct nl_object *_src)
                dst->exp_mask.dst = addr;
        }
 
-    // NAT
+       // NAT
        if (src->exp_nat.src) {
                addr = nl_addr_clone(src->exp_nat.src);
                if (!addr)
@@ -200,7 +200,7 @@ static void exp_dump_tuples(struct nfnl_exp *exp, struct nl_dump_params *p)
                if (nfnl_exp_test_dst(exp, i))
                        tuple_dst = nfnl_exp_get_dst(exp, i);
 
-        // Don't have tests for individual ports/types/codes/ids,
+               // Don't have tests for individual ports/types/codes/ids,
                if (nfnl_exp_test_l4protonum(exp, i)) {
                        nl_dump(p, "%s ",
                                nl_ip_proto2str(nfnl_exp_get_l4protonum(exp, i), buf, sizeof(buf)));
@@ -286,17 +286,17 @@ static int exp_cmp_l4proto_ports (union nfnl_exp_protodata *a, union nfnl_exp_pr
        // Must return 0 for match, 1 for mismatch
        int d = 0;
        d = ( (a->port.src != b->port.src) ||
-                 (a->port.dst != b->port.dst) );
+             (a->port.dst != b->port.dst) );
 
        return d;
 }
 
 static int exp_cmp_l4proto_icmp (union nfnl_exp_protodata *a, union nfnl_exp_protodata *b) {
-    // Must return 0 for match, 1 for mismatch
+       // Must return 0 for match, 1 for mismatch
        int d = 0;
        d = ( (a->icmp.code != b->icmp.code) ||
-                 (a->icmp.type != b->icmp.type) ||
-                 (a->icmp.id != b->icmp.id) );
+             (a->icmp.type != b->icmp.type) ||
+             (a->icmp.id != b->icmp.id) );
 
        return d;
 }
index 2d1ce81cca3284937fad5da473a9ae43d18ec397..123f657ab3322908c9a690c1b1c1ea463ef4c76a 100644 (file)
--- a/lib/nl.c
+++ b/lib/nl.c
@@ -761,7 +761,7 @@ retry:
                goto retry;
        }
 
-        if (flags != 0) {
+       if (flags != 0) {
                /* Buffer is big enough, do the actual reading */
                flags = 0;
                goto retry;
@@ -988,7 +988,7 @@ continue_reading:
                                /* Error message reported back from kernel. */
                                if (cb->cb_err) {
                                        err = cb->cb_err(&nla, e,
-                                                          cb->cb_err_arg);
+                                                        cb->cb_err_arg);
                                        if (err < 0)
                                                goto out;
                                        else if (err == NL_SKIP)
@@ -1206,7 +1206,7 @@ int nl_pickup_keep_syserr(struct nl_sock *sk,
        struct nl_cb *cb;
        int err;
        struct pickup_param pp = {
-               .parser = parser,
+               .parser = parser,
        };
 
        cb = nl_cb_clone(sk->s_cb);
index 06c2a95a91835cece175361c3a2c9cfa809f1036..64e3b07ad11a8d6993bc2853f029dc3558f474ad 100644 (file)
@@ -295,12 +295,12 @@ void nl_object_dump(struct nl_object *obj, struct nl_dump_params *params)
 
 void nl_object_dump_buf(struct nl_object *obj, char *buf, size_t len)
 {
-        struct nl_dump_params dp = {
-                .dp_buf = buf,
-                .dp_buflen = len,
-        };
+       struct nl_dump_params dp = {
+               .dp_buf = buf,
+               .dp_buflen = len,
+       };
 
-        return nl_object_dump(obj, &dp);
+       return nl_object_dump(obj, &dp);
 }
 
 /**
index 7ec91baac4499c033f0600fbf5a9fb0328047023..e429e00a34ff58ab9493091d898981090a81204c 100644 (file)
@@ -54,14 +54,14 @@ int rtnl_act_remove(struct rtnl_act **head, struct rtnl_act *act)
 {
        struct rtnl_act *a, **ap;
 
-        for (ap = head; (a = *ap) != NULL; ap = &a->a_next)
-                if (a == act)
-                        break;
-        if (a) {
-                *ap = a->a_next;
-                a->a_next = NULL;
-                return 0;
-        }
+       for (ap = head; (a = *ap) != NULL; ap = &a->a_next)
+               if (a == act)
+                       break;
+       if (a) {
+               *ap = a->a_next;
+               a->a_next = NULL;
+               return 0;
+       }
 
        return -NLE_OBJ_NOTFOUND;
 }
index da2103928e55cc9821f8d38eed63324b6f6272f4..b28eb3cfe418a397b706a1b79250a143b7ebad8f 100644 (file)
@@ -53,9 +53,9 @@ extern int ematch_lex(YYSTYPE *, void *);
 static void yyerror(void *scanner, char **errp, struct nl_list_head *root, const char *msg)
 {
        if (msg)
-            *errp = strdup(msg);
-        else
-           *errp = NULL;
+               *errp = strdup(msg);
+       else
+               *errp = NULL;
 }
 %}
 
index 4f86b0e01157dd09b2a63a5290fba55c38cf5e43..a18e885d915ed8527daaa454c8e5c3354c7c3954 100644 (file)
@@ -364,7 +364,7 @@ int rtnl_link_info_parse(struct rtnl_link *link, struct nlattr **tb)
 
                nla_memcpy(&st, tb[IFLA_STATS64], 
                           sizeof(struct rtnl_link_stats64));
-               
+
                link->l_stats[RTNL_LINK_RX_PACKETS]     = st.rx_packets;
                link->l_stats[RTNL_LINK_TX_PACKETS]     = st.tx_packets;
                link->l_stats[RTNL_LINK_RX_BYTES]       = st.rx_bytes;
@@ -523,8 +523,8 @@ static int link_msg_parser(struct nl_cache_ops *ops, struct sockaddr_nl *who,
        link->l_flags = ifi->ifi_flags;
        link->l_change = ifi->ifi_change;
        link->ce_mask = (LINK_ATTR_IFNAME | LINK_ATTR_FAMILY |
-                         LINK_ATTR_ARPTYPE| LINK_ATTR_IFINDEX |
-                         LINK_ATTR_FLAGS | LINK_ATTR_CHANGE);
+                        LINK_ATTR_ARPTYPE| LINK_ATTR_IFINDEX |
+                        LINK_ATTR_FLAGS | LINK_ATTR_CHANGE);
 
        if ((af_ops_family = af_ops = af_lookup_and_alloc(link, family))) {
                if (af_ops->ao_protinfo_policy) {
@@ -835,7 +835,7 @@ static void link_dump_stats(struct nl_object *obj, struct nl_dump_params *p)
        struct rtnl_link *link = (struct rtnl_link *) obj;
        char *unit, fmt[64];
        float res;
-       
+
        link_dump_details(obj, p);
 
        nl_dump_line(p, "    Stats:    bytes    packets     errors "
@@ -845,7 +845,7 @@ static void link_dump_stats(struct nl_object *obj, struct nl_dump_params *p)
 
        strcpy(fmt, "     RX %X.2f %s %10" PRIu64 " %10" PRIu64 " %10" PRIu64 " %10" PRIu64 " %10" PRIu64 "\n");
        fmt[9] = *unit == 'B' ? '9' : '7';
-       
+
        nl_dump_line(p, fmt, res, unit,
                link->l_stats[RTNL_LINK_RX_PACKETS],
                link->l_stats[RTNL_LINK_RX_ERRORS],
@@ -857,7 +857,7 @@ static void link_dump_stats(struct nl_object *obj, struct nl_dump_params *p)
 
        strcpy(fmt, "     TX %X.2f %s %10" PRIu64 " %10" PRIu64 " %10" PRIu64 " %10" PRIu64 " %10" PRIu64 "\n");
        fmt[9] = *unit == 'B' ? '9' : '7';
-       
+
        nl_dump_line(p, fmt, res, unit,
                link->l_stats[RTNL_LINK_TX_PACKETS],
                link->l_stats[RTNL_LINK_TX_ERRORS],
@@ -880,7 +880,7 @@ static void link_dump_stats(struct nl_object *obj, struct nl_dump_params *p)
 
        nl_dump_line(p, "            aborted    carrier  heartbeat "
                        "    window  collision\n");
-       
+
        nl_dump_line(p, "     TX  %10" PRIu64 " %10" PRIu64 " %10"
                        PRIu64 " %10" PRIu64 " %10" PRIu64 "\n",
                link->l_stats[RTNL_LINK_TX_ABORT_ERR],
@@ -1093,7 +1093,7 @@ int rtnl_link_alloc_cache_flags(struct nl_sock *sk, int family,
 {
        struct nl_cache * cache;
        int err;
-       
+
        cache = nl_cache_alloc(&rtnl_link_ops);
        if (!cache)
                return -NLE_NOMEM;
@@ -1316,8 +1316,8 @@ int rtnl_link_get_kernel(struct nl_sock *sk, int ifindex, const char *name,
        *result = (struct rtnl_link *) obj;
 
        /* If an object has been returned, we also need to wait for the ACK */
-        if (err == 0 && obj)
-                wait_for_ack(sk);
+       if (err == 0 && obj)
+               wait_for_ack(sk);
 
        return 0;
 }
@@ -1363,7 +1363,7 @@ int rtnl_link_name2i(struct nl_cache *cache, const char *name)
 {
        int ifindex = 0;
        struct rtnl_link *link;
-       
+
        link = rtnl_link_get_by_name(cache, name);
        if (link) {
                ifindex = link->l_index;
@@ -1540,7 +1540,7 @@ int rtnl_link_add(struct nl_sock *sk, struct rtnl_link *link, int flags)
 {
        struct nl_msg *msg;
        int err;
-       
+
        err = rtnl_link_build_add_request(link, flags, &msg);
        if (err < 0)
                return err;
@@ -1641,7 +1641,7 @@ int rtnl_link_change(struct nl_sock *sk, struct rtnl_link *orig,
 {
        struct nl_msg *msg;
        int err;
-       
+
        err = rtnl_link_build_change_request(orig, changes, flags, &msg);
        if (err < 0)
                return err;
@@ -1740,7 +1740,7 @@ int rtnl_link_delete(struct nl_sock *sk, const struct rtnl_link *link)
 {
        struct nl_msg *msg;
        int err;
-       
+
        if ((err = rtnl_link_build_delete_request(link, &msg)) < 0)
                return err;
 
@@ -2578,7 +2578,7 @@ int rtnl_link_enslave_ifindex(struct nl_sock *sock, int master, int slave)
 
        rtnl_link_set_ifindex(link, slave);
        rtnl_link_set_master(link, master);
-       
+
        if ((err = rtnl_link_change(sock, link, link, 0)) < 0)
                goto errout;
 
index 7be311af5168a9c6f914b25d22ac92ff72b625fd..7dca4d596182138c6e353d3569d215fab73b5cd6 100644 (file)
@@ -159,7 +159,7 @@ static int ipgre_parse(struct rtnl_link *link, struct nlattr *data,
 
        err = 0;
 
- errout:
+errout:
        return err;
 }
 
@@ -204,7 +204,7 @@ static int ipgre_put_attrs(struct nl_msg *msg, struct rtnl_link *link)
 
        nla_nest_end(msg, data);
 
- nla_put_failure:
+nla_put_failure:
 
        return 0;
 }
index 7021a94febd5ceeb3cc09f751f677c6841f33616..edf71f55c1061966b19cc8bfd47fa99fabe54ae1 100644 (file)
@@ -1,4 +1,4 @@
- /*
+/*
  * lib/route/link/ipvti.c       IPVTI Link Info
  *
  *     This library is free software; you can redistribute it and/or
@@ -118,7 +118,7 @@ static int ipvti_parse(struct rtnl_link *link, struct nlattr *data,
 
        err = 0;
 
- errout:
+errout:
        return err;
 }
 
index c64cbf53fd4a2dbd59be3a5437e83ef7e2be886c..88565137190e4bfc489a8c6935336bbdf065e6da 100644 (file)
@@ -176,7 +176,7 @@ static int sit_parse(struct rtnl_link *link, struct nlattr *data,
 
        err = 0;
 
- errout:
+errout:
        return err;
 }
 
index 7fd106b9362593d68db8506aebe55ca6e4e4658b..e381249a724ae336e843ee6cbf0f2c90552555d5 100644 (file)
@@ -135,7 +135,7 @@ static int neightbl_msg_parser(struct nl_cache_ops *ops,
 
        ntbl->ce_msgtype = n->nlmsg_type;
        rtmsg = nlmsg_data(n);
-       
+
        err = nlmsg_parse(n, sizeof(*rtmsg), tb, NDTA_MAX, neightbl_policy);
        if (err < 0)
                goto errout;
@@ -236,7 +236,7 @@ static void neightbl_dump_line(struct nl_object *arg, struct nl_dump_params *p)
 
        if (ntbl->nt_parms.ntp_mask & NEIGHTBLPARM_ATTR_IFINDEX) {
                struct nl_cache *link_cache;
-               
+
                link_cache = nl_cache_mngt_require_safe("route/link");
 
                if (link_cache) {
@@ -278,10 +278,10 @@ static void neightbl_dump_details(struct nl_object *arg, struct nl_dump_params *
                        ntbl->nt_config.ndtc_key_len,
                        ntbl->nt_config.ndtc_entry_size,
                        nl_msec2str(ntbl->nt_config.ndtc_last_flush,
-                                     x, sizeof(x)));
+                                   x, sizeof(x)));
 
                nl_dump_line(p, "    gc threshold %u/%u/%u interval %s " \
-                           "chain-position %u\n",
+                               "chain-position %u\n",
                        ntbl->nt_gc_thresh1, ntbl->nt_gc_thresh2,
                        ntbl->nt_gc_thresh3,
                        nl_msec2str(ntbl->nt_gc_interval, x, sizeof(x)),
@@ -291,33 +291,33 @@ static void neightbl_dump_details(struct nl_object *arg, struct nl_dump_params *
                        ntbl->nt_config.ndtc_hash_rnd,
                        ntbl->nt_config.ndtc_hash_mask,
                        nl_msec2str(ntbl->nt_config.ndtc_last_rand,
-                                     x, sizeof(x)));
+                                   x, sizeof(x)));
        }
 
        if (ntbl->ce_mask & NEIGHTBL_ATTR_PARMS) {
                struct rtnl_neightbl_parms *pa = &ntbl->nt_parms;
 
                nl_dump_line(p, "    refcnt %u pending-queue-limit %u " \
-                           "proxy-delayed-queue-limit %u\n",
+                               "proxy-delayed-queue-limit %u\n",
                        pa->ntp_refcnt,
                        pa->ntp_queue_len,
                        pa->ntp_proxy_qlen);
 
                nl_dump_line(p, "    num-userspace-probes %u num-unicast-probes " \
-                           "%u num-multicast-probes %u\n",
+                               "%u num-multicast-probes %u\n",
                        pa->ntp_app_probes,
                        pa->ntp_ucast_probes,
                        pa->ntp_mcast_probes);
 
                nl_dump_line(p, "    min-age %s base-reachable-time %s " \
-                           "stale-check-interval %s\n",
+                               "stale-check-interval %s\n",
                        nl_msec2str(pa->ntp_locktime, x, sizeof(x)),
                        nl_msec2str(pa->ntp_base_reachable_time,
-                                     y, sizeof(y)),
+                                   y, sizeof(y)),
                        nl_msec2str(pa->ntp_gc_stale_time, z, sizeof(z)));
 
                nl_dump_line(p, "    initial-probe-delay %s answer-delay %s " \
-                           "proxy-answer-delay %s\n",
+                               "proxy-answer-delay %s\n",
                        nl_msec2str(pa->ntp_probe_delay, x, sizeof(x)),
                        nl_msec2str(pa->ntp_anycast_delay, y, sizeof(y)),
                        nl_msec2str(pa->ntp_proxy_delay, z, sizeof(z)));
@@ -334,12 +334,12 @@ static void neightbl_dump_stats(struct nl_object *arg, struct nl_dump_params *p)
                return;
 
        nl_dump_line(p, "   " \
-                    " lookups %" PRIu64 \
-                    " hits %" PRIu64 \
-                    " failed %" PRIu64 \
-                   " allocations %" PRIu64 \
-                    " destroys %" PRIu64 \
-                    "\n",
+                       " lookups %" PRIu64 \
+                       " hits %" PRIu64 \
+                       " failed %" PRIu64 \
+                       " allocations %" PRIu64 \
+                       " destroys %" PRIu64 \
+                       "\n",
                ntbl->nt_stats.ndts_lookups,
                ntbl->nt_stats.ndts_hits,
                ntbl->nt_stats.ndts_res_failed,
@@ -347,18 +347,18 @@ static void neightbl_dump_stats(struct nl_object *arg, struct nl_dump_params *p)
                ntbl->nt_stats.ndts_destroys);
 
        nl_dump_line(p, "   " \
-                        " hash-grows %" PRIu64 \
-                        " forced-gc-runs %" PRIu64 \
-                        " periodic-gc-runs %" PRIu64 \
-                        "\n",
+                       " hash-grows %" PRIu64 \
+                       " forced-gc-runs %" PRIu64 \
+                       " periodic-gc-runs %" PRIu64 \
+                       "\n",
                ntbl->nt_stats.ndts_hash_grows,
                ntbl->nt_stats.ndts_forced_gc_runs,
                ntbl->nt_stats.ndts_periodic_gc_runs);
 
        nl_dump_line(p, "   " \
-                        " rcv-unicast-probes %" PRIu64 \
-                        " rcv-multicast-probes %" PRIu64 \
-                        "\n",
+                       " rcv-unicast-probes %" PRIu64 \
+                       " rcv-multicast-probes %" PRIu64 \
+                       "\n",
                ntbl->nt_stats.ndts_rcv_probes_ucast,
                ntbl->nt_stats.ndts_rcv_probes_mcast);
 }
index 0277000f07905bbf1c82a9742ed642257b1583f2..c1e323076961606ef367f2345a13f4a8b0a1b7bc 100644 (file)
@@ -55,7 +55,7 @@ static int htb_qdisc_msg_parser(struct rtnl_tc *tc, void *data)
 
        if ((err = tca_parse(tb, TCA_HTB_MAX, tc, htb_policy)) < 0)
                return err;
-       
+
        if (tb[TCA_HTB_INIT]) {
                struct tc_htb_glob opts;
 
@@ -78,7 +78,7 @@ static int htb_class_msg_parser(struct rtnl_tc *tc, void *data)
 
        if ((err = tca_parse(tb, TCA_HTB_MAX, tc, htb_policy)) < 0)
                return err;
-       
+
        if (tb[TCA_HTB_PARMS]) {
                struct tc_htb_opt opts;
 
@@ -191,9 +191,9 @@ static int htb_qdisc_msg_fill(struct rtnl_tc *tc, void *data,
 {
        struct rtnl_htb_qdisc *htb = data;
        struct tc_htb_glob opts = {
-               .version = TC_HTB_PROTOVER,
-               .rate2quantum = 10,
-        };
+               .version = TC_HTB_PROTOVER,
+               .rate2quantum = 10,
+       };
 
        if (htb) {
                if (htb->qh_mask & SCH_HTB_HAS_RATE2QUANTUM)
index abca85561745267e89a58611dd0da51cd6cb5fa9..399fd2c629a9b4d9eade741b7ffa8e91f4a8033a 100644 (file)
@@ -106,18 +106,18 @@ static int netem_msg_parser(struct rtnl_tc *tc, void *data)
                        netem->qnm_mask |= (SCH_NETEM_ATTR_RO_PROB |
                                            SCH_NETEM_ATTR_RO_CORR);
                }
-                       
+
                if (tb[TCA_NETEM_CORRUPT]) {
                        struct tc_netem_corrupt corrupt;
-                                               
+
                        nla_memcpy(&corrupt, tb[TCA_NETEM_CORRUPT], sizeof(corrupt));
                        netem->qnm_crpt.nmcr_probability = corrupt.probability;
                        netem->qnm_crpt.nmcr_correlation = corrupt.correlation;
-       
+
                        netem->qnm_mask |= (SCH_NETEM_ATTR_CORRUPT_PROB |
                                                SCH_NETEM_ATTR_CORRUPT_CORR);
                }
-               
+
                /* sch_netem does not currently dump TCA_NETEM_DELAY_DIST */
                netem->qnm_dist.dist_data = NULL;
                netem->qnm_dist.dist_size = 0;
@@ -129,10 +129,10 @@ static int netem_msg_parser(struct rtnl_tc *tc, void *data)
 static void netem_free_data(struct rtnl_tc *tc, void *data)
 {
        struct rtnl_netem *netem = data;
-       
+
        if (!netem)
                return;
-       
+
        free(netem->qnm_dist.dist_data);
 }
 
@@ -211,7 +211,7 @@ static int netem_msg_fill_raw(struct rtnl_tc *tc, void *data,
        struct tc_netem_reorder reorder;
        struct tc_netem_corrupt corrupt;
        struct rtnl_netem *netem = data;
-       
+
        unsigned char set_correlation = 0, set_reorder = 0,
                set_corrupt = 0, set_dist = 0;
 
@@ -224,7 +224,7 @@ static int netem_msg_fill_raw(struct rtnl_tc *tc, void *data,
        memset(&corrupt, 0, sizeof(corrupt));
 
        msg->nm_nlh->nlmsg_flags |= NLM_F_REQUEST;
-       
+
        if ( netem->qnm_ro.nmro_probability != 0 ) {
                if (netem->qnm_latency == 0) {
                        return -NLE_MISSING_ATTR;
@@ -241,7 +241,7 @@ static int netem_msg_fill_raw(struct rtnl_tc *tc, void *data,
                }
                set_correlation = 1;
        }
-       
+
        if ( netem->qnm_corr.nmc_loss != 0 ) {
                if ( netem->qnm_loss == 0 ) {
                        return -NLE_MISSING_ATTR;
@@ -255,17 +255,17 @@ static int netem_msg_fill_raw(struct rtnl_tc *tc, void *data,
                }
                set_correlation = 1;
        }
-       
+
        if ( netem->qnm_ro.nmro_probability != 0 ) set_reorder = 1;
        else if ( netem->qnm_ro.nmro_correlation != 0 ) {
                        return -NLE_MISSING_ATTR;
        }
-       
+
        if ( netem->qnm_crpt.nmcr_probability != 0 ) set_corrupt = 1;
        else if ( netem->qnm_crpt.nmcr_correlation != 0 ) {
                        return -NLE_MISSING_ATTR;
        }
-       
+
        if ( netem->qnm_dist.dist_data && netem->qnm_dist.dist_size ) {
                if (netem->qnm_latency == 0 || netem->qnm_jitter == 0) {
                        return -NLE_MISSING_ATTR;
@@ -274,7 +274,7 @@ static int netem_msg_fill_raw(struct rtnl_tc *tc, void *data,
                /* Resize to accomodate the large distribution table */
                int new_msg_len = msg->nm_size + netem->qnm_dist.dist_size *
                        sizeof(netem->qnm_dist.dist_data[0]);
-               
+
                msg->nm_nlh = (struct nlmsghdr *) realloc(msg->nm_nlh, new_msg_len);
                if ( msg->nm_nlh == NULL )
                        return -NLE_NOMEM;
@@ -282,16 +282,16 @@ static int netem_msg_fill_raw(struct rtnl_tc *tc, void *data,
                        set_dist = 1;
                }
        }
-       
+
        opts.latency = netem->qnm_latency;
        opts.limit = netem->qnm_limit ? netem->qnm_limit : 1000;
        opts.loss = netem->qnm_loss;
        opts.gap = netem->qnm_gap;
        opts.duplicate = netem->qnm_duplicate;
        opts.jitter = netem->qnm_jitter;
-       
+
        NLA_PUT(msg, TCA_OPTIONS, sizeof(opts), &opts);
-       
+
        if ( set_correlation ) {
                cor.delay_corr = netem->qnm_corr.nmc_delay;
                cor.loss_corr = netem->qnm_corr.nmc_loss;
@@ -299,21 +299,21 @@ static int netem_msg_fill_raw(struct rtnl_tc *tc, void *data,
 
                NLA_PUT(msg, TCA_NETEM_CORR, sizeof(cor), &cor);
        }
-       
+
        if ( set_reorder ) {
                reorder.probability = netem->qnm_ro.nmro_probability;
                reorder.correlation = netem->qnm_ro.nmro_correlation;
 
                NLA_PUT(msg, TCA_NETEM_REORDER, sizeof(reorder), &reorder);
        }
-       
+
        if ( set_corrupt ) {
                corrupt.probability = netem->qnm_crpt.nmcr_probability;
                corrupt.correlation = netem->qnm_crpt.nmcr_correlation;
 
                NLA_PUT(msg, TCA_NETEM_CORRUPT, sizeof(corrupt), &corrupt);
        }
-       
+
        if ( set_dist ) {
                NLA_PUT(msg, TCA_NETEM_DELAY_DIST,
                        netem->qnm_dist.dist_size * sizeof(netem->qnm_dist.dist_data[0]),
@@ -326,14 +326,14 @@ static int netem_msg_fill_raw(struct rtnl_tc *tc, void *data,
         */
        struct nlattr* head = (struct nlattr *)(NLMSG_DATA(msg->nm_nlh) +
                NLMSG_LENGTH(sizeof(struct tcmsg)) - NLMSG_ALIGNTO);
-               
+
        struct nlattr* tail = (struct nlattr *)(((void *) (msg->nm_nlh)) +
                NLMSG_ALIGN(msg->nm_nlh->nlmsg_len));
-       
+
        int old_len = head->nla_len;
        head->nla_len = (void *)tail - (void *)head;
        msg->nm_nlh->nlmsg_len += (head->nla_len - old_len);
-       
+
        return err;
 nla_put_failure:
        return -NLE_MSGSIZE;
@@ -356,7 +356,7 @@ void rtnl_netem_set_limit(struct rtnl_qdisc *qdisc, int limit)
 
        if (!(netem = rtnl_tc_data(TC_CAST(qdisc))))
                BUG();
-       
+
        netem->qnm_limit = limit;
        netem->qnm_mask |= SCH_NETEM_ATTR_LIMIT;
 }
@@ -497,7 +497,7 @@ int rtnl_netem_get_reorder_correlation(struct rtnl_qdisc *qdisc)
  * @name Corruption
  * @{
  */
+
 /**
  * Set corruption probability of netem qdisc.
  * @arg qdisc          Netem qdisc to be modified.
@@ -882,7 +882,7 @@ int rtnl_netem_set_delay_distribution(struct rtnl_qdisc *qdisc, const char *dist
 
        if (!(netem = rtnl_tc_data(TC_CAST(qdisc))))
                BUG();
-               
+
        FILE *f;
        int n = 0;
        size_t i;
@@ -890,31 +890,31 @@ int rtnl_netem_set_delay_distribution(struct rtnl_qdisc *qdisc, const char *dist
        char *line;
        char name[NAME_MAX];
        char dist_suffix[] = ".dist";
-       
+
        /* If the given filename already ends in .dist, don't append it later */
        char *test_suffix = strstr(dist_type, dist_suffix);
        if (test_suffix != NULL && strlen(test_suffix) == 5)
                strcpy(dist_suffix, "");
-       
+
        /* Check several locations for the dist file */
        char *test_path[] = { "", "./", "/usr/lib/tc/", "/usr/local/lib/tc/" };
-       
+
        for (i = 0; i < ARRAY_SIZE(test_path); i++) {
                snprintf(name, NAME_MAX, "%s%s%s", test_path[i], dist_type, dist_suffix);
                if ((f = fopen(name, "r")))
                        break;
        }
-       
+
        if ( f == NULL )
                return -nl_syserr2nlerr(errno);
-       
+
        netem->qnm_dist.dist_data = (int16_t *) calloc (MAXDIST, sizeof(int16_t));
-       
+
        line = (char *) calloc (sizeof(char), len + 1);
-       
+
        while (getline(&line, &len, f) != -1) {
                char *p, *endp;
-               
+
                if (*line == '\n' || *line == '#')
                        continue;
 
@@ -928,16 +928,16 @@ int rtnl_netem_set_delay_distribution(struct rtnl_qdisc *qdisc, const char *dist
                                return -NLE_INVAL;
                        }
                        netem->qnm_dist.dist_data[n++] = x;
-               }               
+               }
        }
-       
+
        free(line);
-       
+
        netem->qnm_dist.dist_size = n;
        netem->qnm_mask |= SCH_NETEM_ATTR_DIST;
-       
+
        fclose(f);
-       return 0;       
+       return 0;
 }
 
 /** @} */
index 0f52e00db86e052e5def1fea9bfcecad4032fd08..7347ed2edcee8ad3b0ef2d28c6eca0a4efb90e12 100644 (file)
@@ -682,7 +682,7 @@ int rtnl_route_set_dst(struct rtnl_route *route, struct nl_addr *addr)
 
        nl_addr_get(addr);
        route->rt_dst = addr;
-       
+
        route->ce_mask |= (ROUTE_ATTR_DST | ROUTE_ATTR_FAMILY);
 
        return 0;
@@ -868,10 +868,10 @@ void rtnl_route_foreach_nexthop(struct rtnl_route *r,
                                 void *arg)
 {
        struct rtnl_nexthop *nh;
-    
+
        if (r->ce_mask & ROUTE_ATTR_MULTIPATH) {
                nl_list_for_each_entry(nh, &r->rt_nexthops, rtnh_list) {
-                        cb(nh, arg);
+                       cb(nh, arg);
                }
        }
 }
@@ -880,15 +880,15 @@ struct rtnl_nexthop *rtnl_route_nexthop_n(struct rtnl_route *r, int n)
 {
        struct rtnl_nexthop *nh;
        uint32_t i;
-    
+
        if (r->ce_mask & ROUTE_ATTR_MULTIPATH && r->rt_nr_nh > n) {
                i = 0;
                nl_list_for_each_entry(nh, &r->rt_nexthops, rtnh_list) {
-                        if (i == n) return nh;
+                       if (i == n) return nh;
                        i++;
                }
        }
-        return NULL;
+       return NULL;
 }
 
 /** @} */
@@ -986,7 +986,7 @@ static int parse_multipath(struct rtnl_route *route, struct nlattr *attr)
 
                        if (ntb[RTA_FLOW]) {
                                uint32_t realms;
-                               
+
                                realms = nla_get_u32(ntb[RTA_FLOW]);
                                rtnl_route_nh_set_realms(nh, realms);
                        }
index 109c416a6c9f4601f6035078fc6cd92427a5c051..97b2f697db75cb2b15273e1421f8f89691775a27 100644 (file)
@@ -204,18 +204,18 @@ static struct nl_sock *__alloc_socket(struct nl_cb *cb)
 struct nl_sock *nl_socket_alloc(void)
 {
        struct nl_cb *cb;
-        struct nl_sock *sk;
+       struct nl_sock *sk;
 
        cb = nl_cb_alloc(default_cb);
        if (!cb)
                return NULL;
 
-        /* will increment cb reference count on success */
+       /* will increment cb reference count on success */
        sk = __alloc_socket(cb);
 
-        nl_cb_put(cb);
+       nl_cb_put(cb);
 
-        return sk;
+       return sk;
 }
 
 /**
@@ -751,8 +751,8 @@ struct nl_cb *nl_socket_get_cb(const struct nl_sock *sk)
 
 void nl_socket_set_cb(struct nl_sock *sk, struct nl_cb *cb)
 {
-        if (cb == NULL)
-                BUG();
+       if (cb == NULL)
+               BUG();
 
        nl_cb_put(sk->s_cb);
        sk->s_cb = nl_cb_get(cb);
@@ -823,7 +823,7 @@ int nl_socket_set_buffer_size(struct nl_sock *sk, int rxbuf, int txbuf)
 
        if (sk->s_fd == -1)
                return -NLE_BAD_SOCK;
-       
+
        err = setsockopt(sk->s_fd, SOL_SOCKET, SO_SNDBUF,
                         &txbuf, sizeof(txbuf));
        if (err < 0) {
index 3399c033d2db5d823bf2cadf9b0381b5ff4b3a19..7bcc25136c3d0ed2a153c0074ead47b07bf2bf37 100644 (file)
@@ -57,7 +57,7 @@ struct nl_dump_params nl_debug_dp = {
 static void __init nl_debug_init(void)
 {
        char *nldbg, *end;
-       
+
        if ((nldbg = getenv("NLDBG"))) {
                long level = strtol(nldbg, &end, 0);
                if (nldbg != end)
@@ -202,11 +202,11 @@ int nl_rate2str(unsigned long long rate, int type, char *buf, size_t len)
        case NL_BYTE_RATE:
                frac = nl_cancel_down_bytes(rate, &unit);
                break;
-       
+
        case NL_BIT_RATE:
                frac = nl_cancel_down_bits(rate, &unit);
                break;
-       
+
        default:
                BUG();
        }
@@ -435,19 +435,19 @@ static void __init get_psched_settings(void)
                                 getenv("PROC_ROOT"));
                else
                        strncpy(name, "/proc/net/psched", sizeof(name) - 1);
-               
+
                if ((fd = fopen(name, "r"))) {
                        unsigned int ns_per_usec, ns_per_tick, nom, denom;
 
                        if (fscanf(fd, "%08x %08x %08x %08x",
                               &ns_per_usec, &ns_per_tick, &nom, &denom) != 4) {
-                            NL_DBG(1, "Fatal error: can not read psched settings from \"%s\". " \
-                                    "Try to set TICKS_PER_USEC, PROC_NET_PSCHED or PROC_ROOT " \
-                                    "environment variables\n", name);
-                            exit(1);
-                        }
+                               NL_DBG(1, "Fatal error: can not read psched settings from \"%s\". " \
+                                         "Try to set TICKS_PER_USEC, PROC_NET_PSCHED or PROC_ROOT " \
+                                         "environment variables\n", name);
+                               exit(1);
+                       }
 
-                       ticks_per_usec = (double) ns_per_usec / 
+                       ticks_per_usec = (double) ns_per_usec /
                                         (double) ns_per_tick;
 
                        if (nom == 1000000)
@@ -1066,7 +1066,7 @@ int __str2flags(const char *buf, const struct trans_tbl *tbl, size_t tbl_len)
        for (;;) {
                if (*p == ' ')
                        p++;
-       
+
                t = strchr(p, ',');
                len = t ? t - p : strlen(p);
                for (i = 0; i < tbl_len; i++)
index bfe481f76eaec9512dc3d70316e880abcd178407..e802d7aa7afbf7f69d1310fe494cb1c2cefe9ccd 100644 (file)
@@ -648,8 +648,8 @@ int xfrmnl_ae_get_kernel(struct nl_sock* sock, struct nl_addr* daddr, unsigned i
        *result = (struct xfrmnl_ae *) obj;
 
        /* If an object has been returned, we also need to wait for the ACK */
-        if (err == 0 && obj)
-                nl_wait_for_ack(sock);
+       if (err == 0 && obj)
+               nl_wait_for_ack(sock);
 
        return 0;
 }
index 1c0888b9acbc31ba80986169bca73736a42951f4..74b7ee9883fc8dadd0b6e090c9f0fbbdd6a6d685 100644 (file)
@@ -1067,8 +1067,8 @@ int xfrmnl_sa_get_kernel(struct nl_sock* sock, struct nl_addr* daddr, unsigned i
        *result = (struct xfrmnl_sa *) obj;
 
        /* If an object has been returned, we also need to wait for the ACK */
-        if (err == 0 && obj)
-                nl_wait_for_ack(sock);
+       if (err == 0 && obj)
+               nl_wait_for_ack(sock);
 
        return 0;
 }
index d52d8dffa627f6e213889b40403f8507aa0b00b0..f3bc7370adee99634114cce6b87dc78b9d60b913 100644 (file)
@@ -198,7 +198,7 @@ void xfrmnl_sel_dump(struct xfrmnl_sel* sel, struct nl_dump_params *p)
  */
 struct nl_addr* xfrmnl_sel_get_daddr (struct xfrmnl_sel* sel)
 {
-   return sel->daddr;
+       return sel->daddr;
 }
 
 int xfrmnl_sel_set_daddr (struct xfrmnl_sel* sel, struct nl_addr* addr)
@@ -214,7 +214,7 @@ int xfrmnl_sel_set_daddr (struct xfrmnl_sel* sel, struct nl_addr* addr)
 
 struct nl_addr* xfrmnl_sel_get_saddr (struct xfrmnl_sel* sel)
 {
-   return sel->saddr;
+       return sel->saddr;
 }
 
 int xfrmnl_sel_set_saddr (struct xfrmnl_sel* sel, struct nl_addr* addr)
index cc2fcb1c60a157fb8e2aa45e7197e850a927c0a8..85581504b966bbd6af40beb77c9d653fed33cafa 100644 (file)
@@ -409,7 +409,7 @@ static void xfrm_sp_dump_line(struct nl_object *a, struct nl_dump_params *p)
                nl_dump_line(p, "\tUser template: \n");
 
                nl_list_for_each_entry(utmpl, &sp->usertmpl_list, utmpl_list)
-               xfrmnl_user_tmpl_dump (utmpl, p);
+                       xfrmnl_user_tmpl_dump (utmpl, p);
        }
 
        if (sp->ce_mask & XFRM_SP_ATTR_MARK)
@@ -750,8 +750,8 @@ int xfrmnl_sp_get_kernel(struct nl_sock* sock, unsigned int index, unsigned int
        *result = (struct xfrmnl_sp *) obj;
 
        /* If an object has been returned, we also need to wait for the ACK */
-        if (err == 0 && obj)
-                nl_wait_for_ack(sock);
+       if (err == 0 && obj)
+               nl_wait_for_ack(sock);
 
        return 0;
 }
index fdfa4c21cdcf2e4004052ba751c8c561d3fe4285..21cfb2deada6c0278cb68e7f4399b3e6d2a656d4 100644 (file)
@@ -186,7 +186,7 @@ void xfrmnl_user_tmpl_dump(struct xfrmnl_user_tmpl* tmpl, struct nl_dump_params
  */
 struct nl_addr* xfrmnl_user_tmpl_get_daddr (struct xfrmnl_user_tmpl* utmpl)
 {
-   return utmpl->id.daddr;
+       return utmpl->id.daddr;
 }
 
 int xfrmnl_user_tmpl_set_daddr (struct xfrmnl_user_tmpl* utmpl, struct nl_addr* addr)
@@ -238,7 +238,7 @@ int xfrmnl_user_tmpl_set_family(struct xfrmnl_user_tmpl *utmpl, int family)
 
 struct nl_addr* xfrmnl_user_tmpl_get_saddr (struct xfrmnl_user_tmpl* utmpl)
 {
-   return utmpl->saddr;
+       return utmpl->saddr;
 }
 
 int xfrmnl_user_tmpl_set_saddr (struct xfrmnl_user_tmpl* utmpl, struct nl_addr* addr)
index 0895bcceda4cd810b5a5a1d7a1997b0f3104d770..078c30c751f3bb123774d2d2239c8eced7b0752c 100644 (file)
@@ -14,7 +14,7 @@
 static struct nl_cache *alloc_genl_family_cache(struct nl_sock *sk)
 {
        return nl_cli_alloc_cache(sk, "generic netlink family",
-                          genl_ctrl_alloc_cache);
+                                 genl_ctrl_alloc_cache);
 }
 
 static void print_usage(void)
@@ -38,11 +38,11 @@ int main(int argc, char *argv[])
                .dp_type = NL_DUMP_LINE,
                .dp_fd = stdout,
        };
+
        sock = nl_cli_alloc_socket();
        nl_cli_connect(sock, NETLINK_GENERIC);
        family_cache = alloc_genl_family_cache(sock);
+
        for (;;) {
                int c, optidx = 0;
                static struct option long_opts[] = {
@@ -52,7 +52,7 @@ int main(int argc, char *argv[])
                        { "version", 0, 0, 'v' },
                        { 0, 0, 0, 0 }
                };
-       
+
                c = getopt_long(argc, argv, "df:hv", long_opts, &optidx);
                if (c == -1)
                        break;
@@ -63,7 +63,7 @@ int main(int argc, char *argv[])
                case 'h': print_usage(); break;
                case 'v': nl_cli_print_version(); break;
                }
-       }
+       }
 
        nl_cache_dump(family_cache, &params);
 
index 5f72998896bea71e94f0844ce324789c509b528d..bc6a3375f3916c9035efed9e421c4a0c832d967c 100644 (file)
@@ -54,9 +54,9 @@ int main(int argc, char *argv[])
                .dp_type = NL_DUMP_LINE,
                .dp_fd = stdout,
        };
-       ct = nl_cli_ct_alloc();
+
+       ct = nl_cli_ct_alloc();
+
        for (;;) {
                int c, optidx = 0;
                enum {
@@ -95,7 +95,7 @@ int main(int argc, char *argv[])
                        { "refcnt", 1, 0, ARG_REFCNT },
                        { 0, 0, 0, 0 }
                };
-       
+
                c = getopt_long(argc, argv, "46f:hvi:p:F:", long_opts, &optidx);
                if (c == -1)
                        break;
@@ -124,7 +124,7 @@ int main(int argc, char *argv[])
                case ARG_REFCNT: nl_cli_ct_parse_use(ct, optarg); break;
                case ARG_FLAGS: nl_cli_ct_parse_status(ct, optarg); break;
                }
-       }
+       }
 
        sock = nl_cli_alloc_socket();
        nl_cli_connect(sock, NETLINK_NETFILTER);
index 4b7f9d9886f50fe5c3493f7ca0e61bec4534d2e3..a81147e8672837b47f9b001c0b2b59446b587f1e 100644 (file)
@@ -64,8 +64,8 @@ int main(int argc, char *argv[])
        };
        int err, nlflags = NLM_F_CREATE;
 
-       exp = nl_cli_exp_alloc();
+       exp = nl_cli_exp_alloc();
+
        for (;;) {
                int c, optidx = 0;
                enum {
@@ -86,12 +86,12 @@ int main(int argc, char *argv[])
                        ARG_MASK_SPORT,
                        ARG_MASK_DST,
                        ARG_MASK_DPORT,
-            ARG_NAT_PROTO,
-            ARG_NAT_SRC,
-            ARG_NAT_SPORT,
-            ARG_NAT_DST,
-            ARG_NAT_DPORT,
-            ARG_NAT_DIR,
+                       ARG_NAT_PROTO,
+                       ARG_NAT_SRC,
+                       ARG_NAT_SPORT,
+                       ARG_NAT_DST,
+                       ARG_NAT_DPORT,
+                       ARG_NAT_DIR,
                        ARG_TIMEOUT,
                        ARG_HELPER_NAME,
                        ARG_REPLACE,
@@ -118,19 +118,19 @@ int main(int argc, char *argv[])
                        { "mask-sport", 1, 0, ARG_MASK_SPORT },
                        { "mask-dst", 1, 0, ARG_MASK_DST },
                        { "mask-dport", 1, 0, ARG_MASK_DPORT },
-            { "nat-proto", 1, 0, ARG_NAT_PROTO },
-            { "nat-src", 1, 0, ARG_NAT_SRC },
-            { "nat-sport", 1, 0, ARG_NAT_SPORT },
-            { "nat-dst", 1, 0, ARG_NAT_DST },
-            { "nat-dport", 1, 0, ARG_NAT_DPORT },
-            { "nat-dir", 1, 0, ARG_NAT_DIR },
+                       { "nat-proto", 1, 0, ARG_NAT_PROTO },
+                       { "nat-src", 1, 0, ARG_NAT_SRC },
+                       { "nat-sport", 1, 0, ARG_NAT_SPORT },
+                       { "nat-dst", 1, 0, ARG_NAT_DST },
+                       { "nat-dport", 1, 0, ARG_NAT_DPORT },
+                       { "nat-dir", 1, 0, ARG_NAT_DIR },
                        { "family", 1, 0, 'F' },
                        { "timeout", 1, 0, ARG_TIMEOUT },
                        { "helper", 1, 0, ARG_HELPER_NAME },
                        { "flags", 1, 0, ARG_FLAGS},
                        { 0, 0, 0, 0 }
                };
-       
+
                c = getopt_long(argc, argv, "46f:hvi:p:F:", long_opts, &optidx);
                if (c == -1)
                        break;
@@ -159,18 +159,18 @@ int main(int argc, char *argv[])
                case ARG_MASK_SPORT: nl_cli_exp_parse_src_port(exp, NFNL_EXP_TUPLE_MASK, optarg); break;
                case ARG_MASK_DST: nl_cli_exp_parse_dst(exp, NFNL_EXP_TUPLE_MASK, optarg); break;
                case ARG_MASK_DPORT: nl_cli_exp_parse_dst_port(exp, NFNL_EXP_TUPLE_MASK, optarg); break;
-        case ARG_NAT_PROTO: nl_cli_exp_parse_l4protonum(exp, NFNL_EXP_TUPLE_NAT, optarg); break;
-        case ARG_NAT_SRC: nl_cli_exp_parse_src(exp, NFNL_EXP_TUPLE_NAT, optarg); break;
-        case ARG_NAT_SPORT: nl_cli_exp_parse_src_port(exp, NFNL_EXP_TUPLE_NAT, optarg); break;
-        case ARG_NAT_DST: nl_cli_exp_parse_dst(exp, NFNL_EXP_TUPLE_NAT, optarg); break;
-        case ARG_NAT_DPORT: nl_cli_exp_parse_dst_port(exp, NFNL_EXP_TUPLE_NAT, optarg); break;
-        case ARG_NAT_DIR: nl_cli_exp_parse_nat_dir(exp, optarg); break;
+               case ARG_NAT_PROTO: nl_cli_exp_parse_l4protonum(exp, NFNL_EXP_TUPLE_NAT, optarg); break;
+               case ARG_NAT_SRC: nl_cli_exp_parse_src(exp, NFNL_EXP_TUPLE_NAT, optarg); break;
+               case ARG_NAT_SPORT: nl_cli_exp_parse_src_port(exp, NFNL_EXP_TUPLE_NAT, optarg); break;
+               case ARG_NAT_DST: nl_cli_exp_parse_dst(exp, NFNL_EXP_TUPLE_NAT, optarg); break;
+               case ARG_NAT_DPORT: nl_cli_exp_parse_dst_port(exp, NFNL_EXP_TUPLE_NAT, optarg); break;
+               case ARG_NAT_DIR: nl_cli_exp_parse_nat_dir(exp, optarg); break;
                case 'F': nl_cli_exp_parse_family(exp, optarg); break;
                case ARG_TIMEOUT: nl_cli_exp_parse_timeout(exp, optarg); break;
                case ARG_HELPER_NAME: nl_cli_exp_parse_helper_name(exp, optarg); break;
                case ARG_FLAGS: nl_cli_exp_parse_flags(exp, optarg); break;
                }
-       }
+       }
 
        sock = nl_cli_alloc_socket();
        nl_cli_connect(sock, NETLINK_NETFILTER);
index 2ec45aea187232b8e7faa990d8dc96d01c731e4c..0965e90bbdf0c48ce7dc5193dc0b1826c8803f88 100644 (file)
@@ -63,8 +63,8 @@ int main(int argc, char *argv[])
        };
        int err, nlflags = 0;
 
-       exp = nl_cli_exp_alloc();
+       exp = nl_cli_exp_alloc();
+
        for (;;) {
                int c, optidx = 0;
                enum {
@@ -80,17 +80,17 @@ int main(int argc, char *argv[])
                        ARG_MASTER_SPORT,
                        ARG_MASTER_DST,
                        ARG_MASTER_DPORT,
-                       ARG_MASK_PROTO,
-                       ARG_MASK_SRC,
+                       ARG_MASK_PROTO,
+                       ARG_MASK_SRC,
                        ARG_MASK_SPORT,
                        ARG_MASK_DST,
                        ARG_MASK_DPORT,
                        ARG_TIMEOUT,
-                       ARG_HELPER_NAME,
+                       ARG_HELPER_NAME,
                        ARG_FLAGS,
                };
                static struct option long_opts[] = {
-                       { "quiet", 0, 0, 'q' },
+                       { "quiet", 0, 0, 'q' },
                        { "help", 0, 0, 'h' },
                        { "version", 0, 0, 'v' },
                        { "id", 1, 0, 'i' },
@@ -105,17 +105,17 @@ int main(int argc, char *argv[])
                        { "master-dst", 1, 0, ARG_MASTER_DST },
                        { "master-dport", 1, 0, ARG_MASTER_DPORT },
                        { "mask-proto", 1, 0, ARG_MASK_PROTO },
-                       { "mask-src", 1, 0, ARG_MASK_SRC },
-                       { "mask-sport", 1, 0, ARG_MASK_SPORT },
-                       { "mask-dst", 1, 0, ARG_MASK_DST },
-                       { "mask-dport", 1, 0, ARG_MASK_DPORT },
+                       { "mask-src", 1, 0, ARG_MASK_SRC },
+                       { "mask-sport", 1, 0, ARG_MASK_SPORT },
+                       { "mask-dst", 1, 0, ARG_MASK_DST },
+                       { "mask-dport", 1, 0, ARG_MASK_DPORT },
                        { "family", 1, 0, 'F' },
                        { "timeout", 1, 0, ARG_TIMEOUT },
                        { "helper", 1, 0, ARG_HELPER_NAME },
-                       { "flags", 1, 0, ARG_FLAGS},
+                       { "flags", 1, 0, ARG_FLAGS},
                        { 0, 0, 0, 0 }
                };
-       
+
                c = getopt_long(argc, argv, "46f:hvi:p:F:", long_opts, &optidx);
                if (c == -1)
                        break;
@@ -142,13 +142,13 @@ int main(int argc, char *argv[])
                case ARG_MASK_SRC: nl_cli_exp_parse_src(exp, NFNL_EXP_TUPLE_MASK, optarg); break;
                case ARG_MASK_SPORT: nl_cli_exp_parse_src_port(exp, NFNL_EXP_TUPLE_MASK, optarg); break;
                case ARG_MASK_DST: nl_cli_exp_parse_dst(exp, NFNL_EXP_TUPLE_MASK, optarg); break;
-               case ARG_MASK_DPORT: nl_cli_exp_parse_dst_port(exp, NFNL_EXP_TUPLE_MASK, optarg); break;
+               case ARG_MASK_DPORT: nl_cli_exp_parse_dst_port(exp, NFNL_EXP_TUPLE_MASK, optarg); break;
                case 'F': nl_cli_exp_parse_family(exp, optarg); break;
                case ARG_TIMEOUT: nl_cli_exp_parse_timeout(exp, optarg); break;
                case ARG_HELPER_NAME: nl_cli_exp_parse_helper_name(exp, optarg); break;
                case ARG_FLAGS: nl_cli_exp_parse_flags(exp, optarg); break;
                }
-       }
+       }
 
        sock = nl_cli_alloc_socket();
        nl_cli_connect(sock, NETLINK_NETFILTER);
index 1c6ec690cca3d59b6f2669b56fba027dfe9aeadd..7f5624d146b99d19dd1ae51f0d90ffa55ace400f 100644 (file)
@@ -54,9 +54,9 @@ int main(int argc, char *argv[])
                .dp_type = NL_DUMP_LINE,
                .dp_fd = stdout,
        };
-       exp = nl_cli_exp_alloc();
+
+       exp = nl_cli_exp_alloc();
+
        for (;;) {
                int c, optidx = 0;
                enum {
@@ -73,7 +73,7 @@ int main(int argc, char *argv[])
                        ARG_MASTER_DST,
                        ARG_MASTER_DPORT,
                        ARG_TIMEOUT,
-                       ARG_HELPER_NAME,
+                       ARG_HELPER_NAME,
                        ARG_FLAGS,
                };
                static struct option long_opts[] = {
@@ -97,7 +97,7 @@ int main(int argc, char *argv[])
                        { "flags", 1, 0, ARG_FLAGS},
                        { 0, 0, 0, 0 }
                };
-       
+
                c = getopt_long(argc, argv, "46f:hvi:p:F:", long_opts, &optidx);
                if (c == -1)
                        break;
@@ -125,7 +125,7 @@ int main(int argc, char *argv[])
                case ARG_HELPER_NAME: nl_cli_exp_parse_helper_name(exp, optarg); break;
                case ARG_FLAGS: nl_cli_exp_parse_flags(exp, optarg); break;
                }
-       }
+       }
 
        sock = nl_cli_alloc_socket();
        nl_cli_connect(sock, NETLINK_NETFILTER);
index 52995ec68a37639839111253e8eb44bc1c2a9014..19d07b3ace93ae761f9646d6101d7348e4feeb24 100644 (file)
@@ -50,12 +50,12 @@ int main(int argc, char *argv[])
                .dp_fd = stdout,
        };
        int err, nlflags = NLM_F_CREATE;
+
        sock = nl_cli_alloc_socket();
        nl_cli_connect(sock, NETLINK_ROUTE);
        link_cache = nl_cli_link_alloc_cache(sock);
-       addr = nl_cli_addr_alloc();
+       addr = nl_cli_addr_alloc();
+
        for (;;) {
                int c, optidx = 0;
                enum {
@@ -84,7 +84,7 @@ int main(int argc, char *argv[])
                        { "valid", 1, 0, ARG_VALID },
                        { 0, 0, 0, 0 }
                };
-       
+
                c = getopt_long(argc, argv, "qhva:d:", long_opts, &optidx);
                if (c == -1)
                        break;
@@ -105,7 +105,7 @@ int main(int argc, char *argv[])
                case ARG_PREFERRED: nl_cli_addr_parse_preferred(addr, optarg); break;
                case ARG_VALID: nl_cli_addr_parse_valid(addr, optarg); break;
                }
-       }
+       }
 
        if ((err = rtnl_addr_add(sock, addr, nlflags)) < 0)
                nl_cli_fatal(err, "Unable to add address: %s",
@@ -114,7 +114,7 @@ int main(int argc, char *argv[])
        if (!quiet) {
                printf("Added ");
                nl_object_dump(OBJ_CAST(addr), &dp);
-       }
+       }
 
        return 0;
 }
index 2849c017d8c28ac205b39c17833c36839be70544..981930fff3c67041d197cba04032e22bfa060a35 100644 (file)
@@ -108,7 +108,7 @@ int main(int argc, char *argv[])
                        { "valid", 1, 0, ARG_VALID },
                        { 0, 0, 0, 0 }
                };
-       
+
                c = getopt_long(argc, argv, "iqhva:d:", long_opts, &optidx);
                if (c == -1)
                        break;
@@ -129,7 +129,7 @@ int main(int argc, char *argv[])
                case ARG_PREFERRED: nl_cli_addr_parse_preferred(addr, optarg); break;
                case ARG_VALID: nl_cli_addr_parse_valid(addr, optarg); break;
                }
-       }
+       }
 
        nl_cache_foreach_filter(addr_cache, OBJ_CAST(addr), delete_cb, NULL);
 
index b9a17dc62a080654c03aa40d9e0673e597a627bf..4593471369dcde2d3136a93e3e19a5772bfc66cd 100644 (file)
@@ -62,15 +62,15 @@ int main(int argc, char *argv[])
        struct rtnl_tc_ops *ops;
        int err, flags = NLM_F_CREATE | NLM_F_EXCL;
        char *kind, *id = NULL;
+
        sock = nl_cli_alloc_socket();
        nl_cli_connect(sock, NETLINK_ROUTE);
 
        link_cache = nl_cli_link_alloc_cache(sock);
 
-       class = nl_cli_class_alloc();
+       class = nl_cli_class_alloc();
        tc = (struct rtnl_tc *) class;
+
        for (;;) {
                int c, optidx = 0;
                enum {
@@ -96,7 +96,7 @@ int main(int argc, char *argv[])
                        { "linktype", 1, 0, ARG_LINKTYPE },
                        { 0, 0, 0, 0 }
                };
-       
+
                c = getopt_long(argc, argv, "+qhvd:p:i:",
                                long_opts, &optidx);
                if (c == -1)
@@ -116,7 +116,7 @@ int main(int argc, char *argv[])
                case ARG_OVERHEAD: nl_cli_tc_parse_overhead(tc, optarg); break;
                case ARG_LINKTYPE: nl_cli_tc_parse_linktype(tc, optarg); break;
                }
-       }
+       }
 
        if (optind >= argc)
                print_usage();
@@ -146,7 +146,7 @@ int main(int argc, char *argv[])
        if (!quiet) {
                printf("Adding ");
                nl_object_dump(OBJ_CAST(class), &dp);
-       }
+       }
 
        if ((err = rtnl_class_add(sock, class, flags)) < 0)
                nl_cli_fatal(EINVAL, "Unable to add class: %s", nl_geterror(err));
index 37657a47bcce4d94dd5b50a3f6af56be2eb0aa2f..e4be2c077ba522f573b02f0f8bb4a44344c4a9b3 100644 (file)
@@ -70,13 +70,13 @@ int main(int argc, char *argv[])
        struct rtnl_class *class;
        struct rtnl_tc *tc;
        struct nl_cache *link_cache, *class_cache;
+
        sock = nl_cli_alloc_socket();
        nl_cli_connect(sock, NETLINK_ROUTE);
        link_cache = nl_cli_link_alloc_cache(sock);
-       class = nl_cli_class_alloc();
+       class = nl_cli_class_alloc();
        tc = (struct rtnl_tc *) class;
+
        for (;;) {
                int c, optidx = 0;
                enum {
@@ -95,7 +95,7 @@ int main(int argc, char *argv[])
                        { "kind", 1, 0, 'k' },
                        { 0, 0, 0, 0 }
                };
-       
+
                c = getopt_long(argc, argv, "qhvd:p:i:k:", long_opts, &optidx);
                if (c == -1)
                        break;
@@ -112,7 +112,7 @@ int main(int argc, char *argv[])
                case 'i': nl_cli_tc_parse_handle(tc, optarg, 0); break;
                case 'k': nl_cli_tc_parse_kind(tc, optarg); break;
                }
-       }
+       }
 
        if (!rtnl_tc_get_ifindex(tc))
                nl_cli_fatal(EINVAL, "You must specify a network device (--dev=XXX)");
index c2423fbfb599c25fe17d4f80dd61eb522a36f785..e8cc71a4f86d3dfcf31fa488752d21aeeeec352e 100644 (file)
@@ -65,15 +65,15 @@ int main(int argc, char *argv[])
        struct rtnl_tc *tc;
        struct nl_cache *link_cache;
        int ifindex;
+
        sock = nl_cli_alloc_socket();
        nl_cli_connect(sock, NETLINK_ROUTE);
        link_cache = nl_cli_link_alloc_cache(sock);
-       class = nl_cli_class_alloc();
+       class = nl_cli_class_alloc();
        tc = (struct rtnl_tc *) class;
 
        params.dp_fd = stdout;
+
        for (;;) {
                int c, optidx = 0;
                enum {
@@ -91,7 +91,7 @@ int main(int argc, char *argv[])
                        { "kind", 1, 0, 'k' },
                        { 0, 0, 0, 0 }
                };
-       
+
                c = getopt_long(argc, argv, "hvd:p:i:k:", long_opts, &optidx);
                if (c == -1)
                        break;
@@ -106,11 +106,11 @@ int main(int argc, char *argv[])
                case 'i': nl_cli_tc_parse_handle(tc, optarg, 0); break;
                case 'k': nl_cli_tc_parse_kind(tc, optarg); break;
                }
-       }
+       }
 
        if ((ifindex = rtnl_tc_get_ifindex(tc)))
                __dump_class(ifindex, class);
-        else
+       else
                nl_cache_foreach(link_cache, dump_class, class);
 
        return 0;
index 1d45d0b22858a62ba716e5fd592320344819b4f6..1493ebffac09cf4d5680cb0d0a2b83e0f86fb45e 100644 (file)
@@ -48,7 +48,7 @@ int main(int argc, char *argv[])
                        { "raw", 0, 0, ARG_RAW },
                        { 0, 0, 0, 0 }
                };
-       
+
                c = getopt_long(argc, argv, "hvr", long_opts, &optidx);
                if (c == -1)
                        break;
@@ -59,7 +59,7 @@ int main(int argc, char *argv[])
                case 'r': reverse = 1; break;
                case ARG_RAW: raw = 1; break;
                }
-       }
+       }
 
        if (optind >= argc)
                print_usage();
index ada234dc54057aa97b525ea33e2aeb58cfaf20d4..6ac85900c67e11c7e8b1278b8adda44e512f4ebc 100644 (file)
@@ -62,15 +62,15 @@ int main(int argc, char *argv[])
        struct rtnl_tc_ops *ops;
        int err, flags = NLM_F_CREATE | NLM_F_EXCL;
        char *kind, *id = NULL;
+
        sock = nl_cli_alloc_socket();
        nl_cli_connect(sock, NETLINK_ROUTE);
 
        link_cache = nl_cli_link_alloc_cache(sock);
 
-       cls = nl_cli_cls_alloc();
+       cls = nl_cli_cls_alloc();
        tc = (struct rtnl_tc *) cls;
+
        for (;;) {
                int c, optidx = 0;
                enum {
@@ -100,7 +100,7 @@ int main(int argc, char *argv[])
                        { "linktype", 1, 0, ARG_LINKTYPE },
                        { 0, 0, 0, 0 }
                };
-       
+
                c = getopt_long(argc, argv, "+qhvd:p:i:",
                                long_opts, &optidx);
                if (c == -1)
@@ -124,7 +124,7 @@ int main(int argc, char *argv[])
                        rtnl_cls_set_prio(cls, nl_cli_parse_u32(optarg));
                        break;
                }
-       }
+       }
 
        if (optind >= argc)
                print_usage();
@@ -154,7 +154,7 @@ int main(int argc, char *argv[])
        if (!quiet) {
                printf("Adding ");
                nl_object_dump(OBJ_CAST(cls), &dp);
-       }
+       }
 
        if ((err = rtnl_cls_add(sock, cls, flags)) < 0)
                nl_cli_fatal(EINVAL, "Unable to add classifier: %s", nl_geterror(err));
index c6abac77cf748b30334010a318243a9176178645..78b93ecf75de1919016aff3bae4dfb455f85e876 100644 (file)
@@ -91,13 +91,13 @@ int main(int argc, char *argv[])
        struct rtnl_tc *tc;
        struct nl_cache *link_cache;
        int ifindex;
+
        sock = nl_cli_alloc_socket();
        nl_cli_connect(sock, NETLINK_ROUTE);
        link_cache = nl_cli_link_alloc_cache(sock);
-       cls = nl_cli_cls_alloc();
+       cls = nl_cli_cls_alloc();
        tc = (struct rtnl_tc *) cls;
+
        for (;;) {
                int c, optidx = 0;
                enum {
@@ -120,7 +120,7 @@ int main(int argc, char *argv[])
                        { "prio", 1, 0, ARG_PRIO },
                        { 0, 0, 0, 0 }
                };
-       
+
                c = getopt_long(argc, argv, "qhvd:p:i:k:", long_opts, &optidx);
                if (c == -1)
                        break;
@@ -141,11 +141,11 @@ int main(int argc, char *argv[])
                        rtnl_cls_set_prio(cls, nl_cli_parse_u32(optarg));
                        break;
                }
-       }
+       }
 
        if ((ifindex = rtnl_tc_get_ifindex(tc)))
                __delete_link(ifindex, cls);
-        else
+       else
                nl_cache_foreach(link_cache, delete_link, cls);
 
        if (!quiet)
index cae7e272c5142fb5e377388d93ab2a4d81fd6a04..08956e0923637cd2d26430f3ca0ce6f63df87eeb 100644 (file)
@@ -69,15 +69,15 @@ int main(int argc, char *argv[])
        struct rtnl_tc *tc;
        struct nl_cache *link_cache;
        int ifindex;
+
        sock = nl_cli_alloc_socket();
        nl_cli_connect(sock, NETLINK_ROUTE);
        link_cache = nl_cli_link_alloc_cache(sock);
-       cls = nl_cli_cls_alloc();
+       cls = nl_cli_cls_alloc();
        tc = (struct rtnl_tc *) cls;
 
        params.dp_fd = stdout;
+
        for (;;) {
                int c, optidx = 0;
                enum {
@@ -99,7 +99,7 @@ int main(int argc, char *argv[])
                        { "prio", 1, 0, ARG_PRIO },
                        { 0, 0, 0, 0 }
                };
-       
+
                c = getopt_long(argc, argv, "hvd:p:i:k:", long_opts, &optidx);
                if (c == -1)
                        break;
@@ -118,11 +118,11 @@ int main(int argc, char *argv[])
                        rtnl_cls_set_prio(cls, nl_cli_parse_u32(optarg));
                        break;
                }
-       }
+       }
 
        if ((ifindex = rtnl_tc_get_ifindex(tc)))
                __dump_link(ifindex, cls);
-        else
+       else
                nl_cache_foreach(link_cache, dump_link, cls);
 
        return 0;
index 4cddabe4097303d0b8f5dc9a4693156e3e9891be..09cef9aa1e064e56a6c1049c29a8f3c8b904c890 100644 (file)
@@ -51,12 +51,12 @@ int main(int argc, char *argv[])
                .dp_fd = stdout,
        };
        int err, ok = 0, nlflags = NLM_F_REPLACE | NLM_F_CREATE;
+
        sock = nl_cli_alloc_socket();
        nl_cli_connect(sock, NETLINK_ROUTE);
        link_cache = nl_cli_link_alloc_cache(sock);
-       neigh = nl_cli_neigh_alloc();
+       neigh = nl_cli_neigh_alloc();
+
        for (;;) {
                int c, optidx = 0;
                enum {
@@ -76,7 +76,7 @@ int main(int argc, char *argv[])
                        { "state", 1, 0, ARG_STATE },
                        { 0, 0, 0, 0 }
                };
-       
+
                c = getopt_long(argc, argv, "qhva:l:d:", long_opts, &optidx);
                if (c == -1)
                        break;
@@ -92,7 +92,7 @@ int main(int argc, char *argv[])
                case 'd': nl_cli_neigh_parse_dev(neigh, link_cache, optarg); break;
                case ARG_STATE: nl_cli_neigh_parse_state(neigh, optarg); break;
                }
-       }
+       }
 
        if (!ok)
                print_usage();
@@ -104,7 +104,7 @@ int main(int argc, char *argv[])
        if (!quiet) {
                printf("Added ");
                nl_object_dump(OBJ_CAST(neigh), &dp);
-       }
+       }
 
        return 0;
 }
index c41860880d1d11d37f9d1e20acc89a00e701129e..b6be44c92a7538e759594c6c50724ab79cc12849 100644 (file)
@@ -67,13 +67,13 @@ int main(int argc, char *argv[])
 {
        struct rtnl_neigh *neigh;
        struct nl_cache *link_cache, *neigh_cache;
+
        sock = nl_cli_alloc_socket();
        nl_cli_connect(sock, NETLINK_ROUTE);
        link_cache = nl_cli_link_alloc_cache(sock);
        neigh_cache = nl_cli_neigh_alloc_cache(sock);
-       neigh = nl_cli_neigh_alloc();
+       neigh = nl_cli_neigh_alloc();
+
        for (;;) {
                int c, optidx = 0;
                enum {
@@ -94,7 +94,7 @@ int main(int argc, char *argv[])
                        { "state", 1, 0, ARG_STATE },
                        { 0, 0, 0, 0 }
                };
-       
+
                c = getopt_long(argc, argv, "qhva:l:d:", long_opts, &optidx);
                if (c == -1)
                        break;
@@ -111,7 +111,7 @@ int main(int argc, char *argv[])
                case ARG_FAMILY: nl_cli_neigh_parse_family(neigh, optarg); break;
                case ARG_STATE: nl_cli_neigh_parse_state(neigh, optarg); break;
                }
-       }
+       }
 
        nl_cache_foreach_filter(neigh_cache, OBJ_CAST(neigh), delete_cb, NULL);
 
index 8390d4b2db28ef7b94f12cc5f1ab5dcd47f1547d..c99d237f87545912644329e068c6d44a34826bce 100644 (file)
@@ -42,13 +42,13 @@ int main(int argc, char *argv[])
                .dp_type = NL_DUMP_LINE,
                .dp_fd = stdout,
        };
+
        sock = nl_cli_alloc_socket();
        nl_cli_connect(sock, NETLINK_ROUTE);
        link_cache = nl_cli_link_alloc_cache_flags(sock, NL_CACHE_AF_ITER);
        neigh_cache = nl_cli_neigh_alloc_cache(sock);
-       neigh = nl_cli_neigh_alloc();
+       neigh = nl_cli_neigh_alloc();
+
        for (;;) {
                int c, optidx = 0;
                enum {
@@ -66,7 +66,7 @@ int main(int argc, char *argv[])
                        { "state", 1, 0, ARG_STATE },
                        { 0, 0, 0, 0 }
                };
-       
+
                c = getopt_long(argc, argv, "f:hva:l:d:", long_opts, &optidx);
                if (c == -1)
                        break;
@@ -81,7 +81,7 @@ int main(int argc, char *argv[])
                case ARG_FAMILY: nl_cli_neigh_parse_family(neigh, optarg); break;
                case ARG_STATE: nl_cli_neigh_parse_state(neigh, optarg); break;
                }
-       }
+       }
 
        nl_cache_dump_filter(neigh_cache, &params, OBJ_CAST(neigh));
 
index 4c4230f18a0254043e7088ef238cf8cca0af557a..2380e015378e359930c271c5b78460b95f74b8bc 100644 (file)
@@ -33,13 +33,13 @@ int main(int argc, char *argv[])
                .dp_type = NL_DUMP_LINE,
                .dp_fd = stdout,
        };
+
        sock = nl_cli_alloc_socket();
        nl_cli_connect(sock, NETLINK_ROUTE);
        nl_cli_link_alloc_cache(sock);
        neightbl_cache = nl_cli_alloc_cache(sock, "neighbour table",
                                            rtnl_neightbl_alloc_cache);
+
        for (;;) {
                int c, optidx = 0;
                static struct option long_opts[] = {
@@ -48,7 +48,7 @@ int main(int argc, char *argv[])
                        { "version", 0, 0, 'v' },
                        { 0, 0, 0, 0 }
                };
-       
+
                c = getopt_long(argc, argv, "f:hv", long_opts, &optidx);
                if (c == -1)
                        break;
@@ -58,7 +58,7 @@ int main(int argc, char *argv[])
                case 'h': print_usage(); break;
                case 'v': nl_cli_print_version(); break;
                }
-       }
+       }
 
        nl_cache_dump(neightbl_cache, &params);
 
index 17c867b545c75684061fa657dcc3d9a90a864b6e..7d2440216f80cbd3b0112c5b99d6483b146b312e 100644 (file)
@@ -122,7 +122,7 @@ int main(int argc, char *argv[])
                        { "u32", 1, 0, ARG_U32 },
                        { 0, 0, 0, 0 }
                };
-       
+
                c = getopt_long(argc, argv, "hvl", long_opts, &optidx);
                if (c == -1)
                        break;
@@ -136,7 +136,7 @@ int main(int argc, char *argv[])
                        uvalue = nl_cli_parse_u32(optarg);
                        break;
                }
-       }
+       }
 
        if (optind >= argc)
                print_usage();
index c2a7c9f75ef46cb5fe9ffe934d997afe31f2f43c..d8a1f73ea0997b0251323e4c87ec6fd10668cdfb 100644 (file)
@@ -59,15 +59,15 @@ int main(int argc, char *argv[])
        struct rtnl_tc_ops *ops;
        int err, flags = NLM_F_CREATE | NLM_F_EXCL;
        char *kind, *id = NULL;
+
        sock = nl_cli_alloc_socket();
        nl_cli_connect(sock, NETLINK_ROUTE);
 
        link_cache = nl_cli_link_alloc_cache(sock);
 
-       qdisc = nl_cli_qdisc_alloc();
+       qdisc = nl_cli_qdisc_alloc();
        tc = (struct rtnl_tc *) qdisc;
+
        for (;;) {
                int c, optidx = 0;
                enum {
@@ -89,7 +89,7 @@ int main(int argc, char *argv[])
                        { "update-only", 0, 0, ARG_UPDATE_ONLY },
                        { 0, 0, 0, 0 }
                };
-       
+
                c = getopt_long(argc, argv, "+qhvd:p:i:",
                                long_opts, &optidx);
                if (c == -1)
@@ -107,7 +107,7 @@ int main(int argc, char *argv[])
                case ARG_UPDATE_ONLY: flags = 0; break;
                case ARG_REPLACE_ONLY: flags = NLM_F_REPLACE; break;
                }
-       }
+       }
 
        if (optind >= argc)
                print_usage();
@@ -137,7 +137,7 @@ int main(int argc, char *argv[])
        if (!quiet) {
                printf("Adding ");
                nl_object_dump(OBJ_CAST(qdisc), &dp);
-       }
+       }
 
        if ((err = rtnl_qdisc_add(sock, qdisc, flags)) < 0)
                nl_cli_fatal(EINVAL, "Unable to add qdisc: %s", nl_geterror(err));
index 2f945bb248f6b85c7a6ece80d0761270507616be..c4acbfe5d7d2925835c25f0da0098b715ecfaa31 100644 (file)
@@ -71,14 +71,14 @@ int main(int argc, char *argv[])
        struct rtnl_tc *tc;
        struct nl_cache *link_cache, *qdisc_cache;
        int nfilter = 0;
+
        sock = nl_cli_alloc_socket();
        nl_cli_connect(sock, NETLINK_ROUTE);
        link_cache = nl_cli_link_alloc_cache(sock);
        qdisc_cache = nl_cli_qdisc_alloc_cache(sock);
-       qdisc = nl_cli_qdisc_alloc();
+       qdisc = nl_cli_qdisc_alloc();
        tc = (struct rtnl_tc *) qdisc;
+
        for (;;) {
                int c, optidx = 0;
                enum {
@@ -97,7 +97,7 @@ int main(int argc, char *argv[])
                        { "kind", 1, 0, 'k' },
                        { 0, 0, 0, 0 }
                };
-       
+
                c = getopt_long(argc, argv, "qhvd:p:i:k:", long_opts, &optidx);
                if (c == -1)
                        break;
@@ -126,7 +126,7 @@ int main(int argc, char *argv[])
                        nl_cli_tc_parse_kind(tc, optarg);
                        break;
                }
-       }
+       }
 
        if (nfilter == 0 && !interactive && !default_yes) {
                nl_cli_fatal(EINVAL,
index 5b0a3f00593b5a24cb521466d641576c65a0f636..b8110f1b80d930015e019f5b30410758f4ccc692 100644 (file)
@@ -129,15 +129,15 @@ int main(int argc, char *argv[])
        struct rtnl_qdisc *qdisc;
        struct rtnl_tc *tc;
        struct nl_cache *link_cache, *qdisc_cache;
+
        params.dp_fd = stdout;
        sock = nl_cli_alloc_socket();
        nl_cli_connect(sock, NETLINK_ROUTE);
        link_cache = nl_cli_link_alloc_cache(sock);
        qdisc_cache = nl_cli_qdisc_alloc_cache(sock);
-       qdisc = nl_cli_qdisc_alloc();
+       qdisc = nl_cli_qdisc_alloc();
        tc = (struct rtnl_tc *) qdisc;
+
        for (;;) {
                int c, optidx = 0;
                enum {
@@ -156,7 +156,7 @@ int main(int argc, char *argv[])
                        { "kind", 1, 0, 'k' },
                        { 0, 0, 0, 0 }
                };
-       
+
                c = getopt_long(argc, argv, "rhvd:p:i:k:", long_opts, &optidx);
                if (c == -1)
                        break;
@@ -172,7 +172,7 @@ int main(int argc, char *argv[])
                case 'i': nl_cli_tc_parse_handle(tc, optarg, 0); break;
                case 'k': nl_cli_tc_parse_kind(tc, optarg); break;
                }
-       }
+       }
 
        if (recursive)
                nl_cache_foreach_filter(qdisc_cache, OBJ_CAST(qdisc), list_qdisc, NULL);