]> git.proxmox.com Git - mirror_frr.git/commitdiff
Revert "*: reindent pt. 2"
authorDavid Lamparter <equinox@opensourcerouting.org>
Sat, 22 Jul 2017 12:52:33 +0000 (14:52 +0200)
committerDavid Lamparter <equinox@opensourcerouting.org>
Sat, 22 Jul 2017 12:52:33 +0000 (14:52 +0200)
This reverts commit c14777c6bfd0a446c85243d3a9835054a259c276.

clang 5 is not widely available enough for people to indent with.  This
is particularly problematic when rebasing/adjusting branches.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
140 files changed:
bgpd/bgp_aspath.c
bgpd/bgp_attr.c
bgpd/bgp_attr.h
bgpd/bgp_bfd.c
bgpd/bgp_btoa.c
bgpd/bgp_damp.c
bgpd/bgp_dump.c
bgpd/bgp_evpn.c
bgpd/bgp_evpn_vty.c
bgpd/bgp_fsm.c
bgpd/bgp_label.c
bgpd/bgp_main.c
bgpd/bgp_mpath.c
bgpd/bgp_mplsvpn.c
bgpd/bgp_network.c
bgpd/bgp_open.c
bgpd/bgp_packet.c
bgpd/bgp_route.c
bgpd/bgp_route.h
bgpd/bgp_routemap.c
bgpd/bgp_snmp.c
bgpd/bgp_updgrp.c
bgpd/bgp_updgrp.h
bgpd/bgp_updgrp_adv.c
bgpd/bgp_updgrp_packet.c
bgpd/bgp_vpn.c
bgpd/bgp_vty.c
bgpd/bgp_zebra.c
bgpd/bgpd.c
bgpd/bgpd.h
bgpd/rfapi/bgp_rfapi_cfg.c
bgpd/rfapi/rfapi.c
bgpd/rfapi/rfapi_import.c
bgpd/rfapi/rfapi_monitor.c
bgpd/rfapi/rfapi_rib.c
bgpd/rfapi/vnc_import_bgp.c
bgpd/rfapi/vnc_zebra.c
eigrpd/eigrp_interface.c
eigrpd/eigrp_main.c
eigrpd/eigrp_packet.c
eigrpd/eigrp_routemap.c
eigrpd/eigrp_structs.h
eigrpd/eigrp_update.c
isisd/dict.c
isisd/isis_adjacency.c
isisd/isis_circuit.c
isisd/isis_lsp.c
isisd/isis_pdu.c
isisd/isis_pfpacket.c
isisd/isis_redist.c
isisd/isis_spf.c
isisd/isis_tlv.h
isisd/isisd.h
lib/checksum.c
lib/command.c
lib/command_py.c
lib/getopt.c
lib/hook.h
lib/if.h
lib/log.c
lib/log.h
lib/md5.c
lib/mpls.h
lib/openbsd-tree.h
lib/plist.c
lib/prefix.c
lib/prefix.h
lib/privs.c
lib/routemap.c
lib/sigevent.c
lib/smux.c
lib/sockopt.c
lib/vty.c
lib/zassert.h
lib/zclient.c
ospf6d/ospf6_asbr.c
ospf6d/ospf6_interface.c
ospf6d/ospf6_intra.c
ospf6d/ospf6_message.c
ospf6d/ospf6_zebra.c
ospfd/ospf_abr.c
ospfd/ospf_api.c
ospfd/ospf_apiserver.c
ospfd/ospf_flood.c
ospfd/ospf_ia.c
ospfd/ospf_interface.c
ospfd/ospf_lsa.c
ospfd/ospf_main.c
ospfd/ospf_neighbor.c
ospfd/ospf_opaque.c
ospfd/ospf_packet.c
ospfd/ospf_route.c
ospfd/ospf_routemap.c
ospfd/ospf_snmp.c
ospfd/ospf_vty.c
pimd/pim_assert.c
pimd/pim_cmd.c
pimd/pim_iface.h
pimd/pim_ifchannel.c
pimd/pim_main.c
pimd/pim_msdp.c
pimd/pim_msdp.h
pimd/pim_register.c
pimd/pim_rp.c
pimd/pim_zlookup.c
qpb/qpb_allocator.h
ripd/rip_interface.c
ripd/rip_routemap.c
ripd/rip_zebra.c
ripd/ripd.c
ripngd/ripng_routemap.c
ripngd/ripng_zebra.c
ripngd/ripngd.c
tests/bgpd/test_aspath.c
tests/bgpd/test_capability.c
tests/bgpd/test_mp_attr.c
tests/bgpd/test_mpath.c
tests/lib/cli/test_commands.c
tests/lib/test_checksum.c
tests/lib/test_privs.c
tests/lib/test_timer_correctness.c
tools/start-stop-daemon.c
vtysh/vtysh.c
zebra/if_ioctl_solaris.c
zebra/interface.c
zebra/interface.h
zebra/kernel_netlink.c
zebra/kernel_socket.c
zebra/main.c
zebra/rtadv.c
zebra/zebra_l2.h
zebra/zebra_mpls.c
zebra/zebra_ptm.c
zebra/zebra_rib.c
zebra/zebra_rnh.h
zebra/zebra_routemap.c
zebra/zebra_static.c
zebra/zebra_vty.c
zebra/zebra_vxlan.c
zebra/zserv.c

index 1e68c7d53b00873bf2f257b350abc7c8299d9dfa..4e55c5f264ae7bddcda2e9c139f56cc78e74a053 100644 (file)
@@ -878,9 +878,8 @@ size_t aspath_put(struct stream *s, struct aspath *as, int use32bit)
                 * The general assumption here is that many things tested will
                 * never happen.  And, in real live, up to now, they have not.
                 */
-               while (seg
-                      && (ASSEGMENT_LEN(seg, use32bit)
-                          <= STREAM_WRITEABLE(s))) {
+               while (seg && (ASSEGMENT_LEN(seg, use32bit)
+                              <= STREAM_WRITEABLE(s))) {
                        struct assegment *next = seg->next;
                        int written = 0;
                        int asns_packed = 0;
@@ -1585,14 +1584,12 @@ int aspath_cmp_left(const struct aspath *aspath1, const struct aspath *aspath2)
                return 1;
 
        /* find first non-confed segments for each */
-       while (seg1
-              && ((seg1->type == AS_CONFED_SEQUENCE)
-                  || (seg1->type == AS_CONFED_SET)))
+       while (seg1 && ((seg1->type == AS_CONFED_SEQUENCE)
+                       || (seg1->type == AS_CONFED_SET)))
                seg1 = seg1->next;
 
-       while (seg2
-              && ((seg2->type == AS_CONFED_SEQUENCE)
-                  || (seg2->type == AS_CONFED_SET)))
+       while (seg2 && ((seg2->type == AS_CONFED_SEQUENCE)
+                       || (seg2->type == AS_CONFED_SET)))
                seg2 = seg2->next;
 
        /* Check as1's */
@@ -2069,8 +2066,7 @@ static void aspath_show_all_iterator(struct hash_backet *backet,
    `show [ip] bgp paths' command. */
 void aspath_print_all_vty(struct vty *vty)
 {
-       hash_iterate(ashash,
-                    (void (*)(struct hash_backet *,
-                              void *))aspath_show_all_iterator,
+       hash_iterate(ashash, (void (*)(struct hash_backet *,
+                                      void *))aspath_show_all_iterator,
                     vty);
 }
index 508deb1d3427f9ca334ee618929f9ef11681f07c..79d215f1bd2b2540ba192fa18722641b084d0346 100644 (file)
@@ -82,14 +82,15 @@ static const struct message attr_str[] = {
        {BGP_ATTR_PREFIX_SID, "PREFIX_SID"},
        {0}};
 
-static const struct message attr_flag_str[] = {
-       {BGP_ATTR_FLAG_OPTIONAL, "Optional"},
-       {BGP_ATTR_FLAG_TRANS, "Transitive"},
-       {BGP_ATTR_FLAG_PARTIAL, "Partial"},
-       /* bgp_attr_flags_diagnose() relies on this bit being last in
-          this list */
-       {BGP_ATTR_FLAG_EXTLEN, "Extended Length"},
-       {0}};
+static const struct message attr_flag_str[] =
+       {
+               {BGP_ATTR_FLAG_OPTIONAL, "Optional"},
+               {BGP_ATTR_FLAG_TRANS, "Transitive"},
+               {BGP_ATTR_FLAG_PARTIAL, "Partial"},
+               /* bgp_attr_flags_diagnose() relies on this bit being last in
+                  this list */
+               {BGP_ATTR_FLAG_EXTLEN, "Extended Length"},
+               {0}};
 
 static struct hash *cluster_hash;
 
@@ -679,10 +680,9 @@ static void attr_show_all_iterator(struct hash_backet *backet, struct vty *vty)
 
 void attr_show_all(struct vty *vty)
 {
-       hash_iterate(
-               attrhash,
-               (void (*)(struct hash_backet *, void *))attr_show_all_iterator,
-               vty);
+       hash_iterate(attrhash, (void (*)(struct hash_backet *,
+                                        void *))attr_show_all_iterator,
+                    vty);
 }
 
 static void *bgp_attr_hash_alloc(void *p)
@@ -1055,7 +1055,7 @@ bgp_attr_malformed(struct bgp_attr_parser_args *args, u_char subcode,
 static void
 bgp_attr_flags_diagnose(struct bgp_attr_parser_args *args,
                        u_int8_t desired_flags /* how RFC says it must be */
-)
+                       )
 {
        u_char seen = 0, i;
        u_char real_flags = args->flags;
@@ -1087,26 +1087,30 @@ bgp_attr_flags_diagnose(struct bgp_attr_parser_args *args,
  * as will PARTIAL for optional+transitive attributes.
  */
 const u_int8_t attr_flags_values[] = {
-       [BGP_ATTR_ORIGIN] = BGP_ATTR_FLAG_TRANS,
-       [BGP_ATTR_AS_PATH] = BGP_ATTR_FLAG_TRANS,
-       [BGP_ATTR_NEXT_HOP] = BGP_ATTR_FLAG_TRANS,
-       [BGP_ATTR_MULTI_EXIT_DISC] = BGP_ATTR_FLAG_OPTIONAL,
-       [BGP_ATTR_LOCAL_PREF] = BGP_ATTR_FLAG_TRANS,
-       [BGP_ATTR_ATOMIC_AGGREGATE] = BGP_ATTR_FLAG_TRANS,
-       [BGP_ATTR_AGGREGATOR] = BGP_ATTR_FLAG_TRANS | BGP_ATTR_FLAG_OPTIONAL,
-       [BGP_ATTR_COMMUNITIES] = BGP_ATTR_FLAG_TRANS | BGP_ATTR_FLAG_OPTIONAL,
-       [BGP_ATTR_ORIGINATOR_ID] = BGP_ATTR_FLAG_OPTIONAL,
-       [BGP_ATTR_CLUSTER_LIST] = BGP_ATTR_FLAG_OPTIONAL,
-       [BGP_ATTR_MP_REACH_NLRI] = BGP_ATTR_FLAG_OPTIONAL,
-       [BGP_ATTR_MP_UNREACH_NLRI] = BGP_ATTR_FLAG_OPTIONAL,
-       [BGP_ATTR_EXT_COMMUNITIES] =
-               BGP_ATTR_FLAG_OPTIONAL | BGP_ATTR_FLAG_TRANS,
-       [BGP_ATTR_AS4_PATH] = BGP_ATTR_FLAG_OPTIONAL | BGP_ATTR_FLAG_TRANS,
-       [BGP_ATTR_AS4_AGGREGATOR] =
-               BGP_ATTR_FLAG_OPTIONAL | BGP_ATTR_FLAG_TRANS,
-       [BGP_ATTR_LARGE_COMMUNITIES] =
-               BGP_ATTR_FLAG_OPTIONAL | BGP_ATTR_FLAG_TRANS,
-       [BGP_ATTR_PREFIX_SID] = BGP_ATTR_FLAG_OPTIONAL | BGP_ATTR_FLAG_TRANS,
+               [BGP_ATTR_ORIGIN] = BGP_ATTR_FLAG_TRANS,
+               [BGP_ATTR_AS_PATH] = BGP_ATTR_FLAG_TRANS,
+               [BGP_ATTR_NEXT_HOP] = BGP_ATTR_FLAG_TRANS,
+               [BGP_ATTR_MULTI_EXIT_DISC] = BGP_ATTR_FLAG_OPTIONAL,
+               [BGP_ATTR_LOCAL_PREF] = BGP_ATTR_FLAG_TRANS,
+               [BGP_ATTR_ATOMIC_AGGREGATE] = BGP_ATTR_FLAG_TRANS,
+               [BGP_ATTR_AGGREGATOR] =
+                       BGP_ATTR_FLAG_TRANS | BGP_ATTR_FLAG_OPTIONAL,
+               [BGP_ATTR_COMMUNITIES] =
+                       BGP_ATTR_FLAG_TRANS | BGP_ATTR_FLAG_OPTIONAL,
+               [BGP_ATTR_ORIGINATOR_ID] = BGP_ATTR_FLAG_OPTIONAL,
+               [BGP_ATTR_CLUSTER_LIST] = BGP_ATTR_FLAG_OPTIONAL,
+               [BGP_ATTR_MP_REACH_NLRI] = BGP_ATTR_FLAG_OPTIONAL,
+               [BGP_ATTR_MP_UNREACH_NLRI] = BGP_ATTR_FLAG_OPTIONAL,
+               [BGP_ATTR_EXT_COMMUNITIES] =
+                       BGP_ATTR_FLAG_OPTIONAL | BGP_ATTR_FLAG_TRANS,
+               [BGP_ATTR_AS4_PATH] =
+                       BGP_ATTR_FLAG_OPTIONAL | BGP_ATTR_FLAG_TRANS,
+               [BGP_ATTR_AS4_AGGREGATOR] =
+                       BGP_ATTR_FLAG_OPTIONAL | BGP_ATTR_FLAG_TRANS,
+               [BGP_ATTR_LARGE_COMMUNITIES] =
+                       BGP_ATTR_FLAG_OPTIONAL | BGP_ATTR_FLAG_TRANS,
+               [BGP_ATTR_PREFIX_SID] =
+                       BGP_ATTR_FLAG_OPTIONAL | BGP_ATTR_FLAG_TRANS,
 };
 static const size_t attr_flags_values_max = array_size(attr_flags_values) - 1;
 
@@ -2751,10 +2755,9 @@ static void bgp_packet_mpattr_tea(struct bgp *bgp, struct peer *peer,
        struct bgp_attr_encap_subtlv *st;
        const char *attrname;
 
-       if (!attr
-           || (attrtype == BGP_ATTR_ENCAP
-               && (!attr->encap_tunneltype
-                   || attr->encap_tunneltype == BGP_ENCAP_TYPE_MPLS)))
+       if (!attr || (attrtype == BGP_ATTR_ENCAP
+                     && (!attr->encap_tunneltype
+                         || attr->encap_tunneltype == BGP_ENCAP_TYPE_MPLS)))
                return;
 
        switch (attrtype) {
@@ -2801,8 +2804,9 @@ static void bgp_packet_mpattr_tea(struct bgp *bgp, struct peer *peer,
 
        if (attrlenfield > 0xff) {
                /* 2-octet length field */
-               stream_putc(s, BGP_ATTR_FLAG_TRANS | BGP_ATTR_FLAG_OPTIONAL
-                                      | BGP_ATTR_FLAG_EXTLEN);
+               stream_putc(s,
+                           BGP_ATTR_FLAG_TRANS | BGP_ATTR_FLAG_OPTIONAL
+                                   | BGP_ATTR_FLAG_EXTLEN);
                stream_putc(s, attrtype);
                stream_putw(s, attrlenfield & 0xffff);
        } else {
@@ -3040,14 +3044,15 @@ bgp_size_t bgp_packet_attribute(struct bgp *bgp, struct peer *peer,
        if (CHECK_FLAG(peer->af_flags[afi][safi], PEER_FLAG_SEND_COMMUNITY)
            && (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_COMMUNITIES))) {
                if (attr->community->size * 4 > 255) {
-                       stream_putc(s, BGP_ATTR_FLAG_OPTIONAL
-                                              | BGP_ATTR_FLAG_TRANS
-                                              | BGP_ATTR_FLAG_EXTLEN);
+                       stream_putc(s,
+                                   BGP_ATTR_FLAG_OPTIONAL | BGP_ATTR_FLAG_TRANS
+                                           | BGP_ATTR_FLAG_EXTLEN);
                        stream_putc(s, BGP_ATTR_COMMUNITIES);
                        stream_putw(s, attr->community->size * 4);
                } else {
-                       stream_putc(s, BGP_ATTR_FLAG_OPTIONAL
-                                              | BGP_ATTR_FLAG_TRANS);
+                       stream_putc(s,
+                                   BGP_ATTR_FLAG_OPTIONAL
+                                           | BGP_ATTR_FLAG_TRANS);
                        stream_putc(s, BGP_ATTR_COMMUNITIES);
                        stream_putc(s, attr->community->size * 4);
                }
@@ -3061,14 +3066,15 @@ bgp_size_t bgp_packet_attribute(struct bgp *bgp, struct peer *peer,
                       PEER_FLAG_SEND_LARGE_COMMUNITY)
            && (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_LARGE_COMMUNITIES))) {
                if (attr->lcommunity->size * 12 > 255) {
-                       stream_putc(s, BGP_ATTR_FLAG_OPTIONAL
-                                              | BGP_ATTR_FLAG_TRANS
-                                              | BGP_ATTR_FLAG_EXTLEN);
+                       stream_putc(s,
+                                   BGP_ATTR_FLAG_OPTIONAL | BGP_ATTR_FLAG_TRANS
+                                           | BGP_ATTR_FLAG_EXTLEN);
                        stream_putc(s, BGP_ATTR_LARGE_COMMUNITIES);
                        stream_putw(s, attr->lcommunity->size * 12);
                } else {
-                       stream_putc(s, BGP_ATTR_FLAG_OPTIONAL
-                                              | BGP_ATTR_FLAG_TRANS);
+                       stream_putc(s,
+                                   BGP_ATTR_FLAG_OPTIONAL
+                                           | BGP_ATTR_FLAG_TRANS);
                        stream_putc(s, BGP_ATTR_LARGE_COMMUNITIES);
                        stream_putc(s, attr->lcommunity->size * 12);
                }
@@ -3120,14 +3126,16 @@ bgp_size_t bgp_packet_attribute(struct bgp *bgp, struct peer *peer,
                if (peer->sort == BGP_PEER_IBGP
                    || peer->sort == BGP_PEER_CONFED) {
                        if (attr->ecommunity->size * 8 > 255) {
-                               stream_putc(s, BGP_ATTR_FLAG_OPTIONAL
-                                                      | BGP_ATTR_FLAG_TRANS
-                                                      | BGP_ATTR_FLAG_EXTLEN);
+                               stream_putc(s,
+                                           BGP_ATTR_FLAG_OPTIONAL
+                                                   | BGP_ATTR_FLAG_TRANS
+                                                   | BGP_ATTR_FLAG_EXTLEN);
                                stream_putc(s, BGP_ATTR_EXT_COMMUNITIES);
                                stream_putw(s, attr->ecommunity->size * 8);
                        } else {
-                               stream_putc(s, BGP_ATTR_FLAG_OPTIONAL
-                                                      | BGP_ATTR_FLAG_TRANS);
+                               stream_putc(s,
+                                           BGP_ATTR_FLAG_OPTIONAL
+                                                   | BGP_ATTR_FLAG_TRANS);
                                stream_putc(s, BGP_ATTR_EXT_COMMUNITIES);
                                stream_putc(s, attr->ecommunity->size * 8);
                        }
@@ -3193,8 +3201,9 @@ bgp_size_t bgp_packet_attribute(struct bgp *bgp, struct peer *peer,
                        label_index = attr->label_index;
 
                        if (label_index != BGP_INVALID_LABEL_INDEX) {
-                               stream_putc(s, BGP_ATTR_FLAG_OPTIONAL
-                                                      | BGP_ATTR_FLAG_TRANS);
+                               stream_putc(s,
+                                           BGP_ATTR_FLAG_OPTIONAL
+                                                   | BGP_ATTR_FLAG_TRANS);
                                stream_putc(s, BGP_ATTR_PREFIX_SID);
                                stream_putc(s, 10);
                                stream_putc(s, BGP_PREFIX_SID_LABEL_INDEX);
@@ -3222,8 +3231,9 @@ bgp_size_t bgp_packet_attribute(struct bgp *bgp, struct peer *peer,
                 */
                aspath = aspath_delete_confed_seq(aspath);
 
-               stream_putc(s, BGP_ATTR_FLAG_TRANS | BGP_ATTR_FLAG_OPTIONAL
-                                      | BGP_ATTR_FLAG_EXTLEN);
+               stream_putc(s,
+                           BGP_ATTR_FLAG_TRANS | BGP_ATTR_FLAG_OPTIONAL
+                                   | BGP_ATTR_FLAG_EXTLEN);
                stream_putc(s, BGP_ATTR_AS4_PATH);
                aspath_sizep = stream_get_endp(s);
                stream_putw(s, 0);
@@ -3408,14 +3418,15 @@ void bgp_dump_routes_attr(struct stream *s, struct attr *attr,
        /* Community attribute. */
        if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_COMMUNITIES)) {
                if (attr->community->size * 4 > 255) {
-                       stream_putc(s, BGP_ATTR_FLAG_OPTIONAL
-                                              | BGP_ATTR_FLAG_TRANS
-                                              | BGP_ATTR_FLAG_EXTLEN);
+                       stream_putc(s,
+                                   BGP_ATTR_FLAG_OPTIONAL | BGP_ATTR_FLAG_TRANS
+                                           | BGP_ATTR_FLAG_EXTLEN);
                        stream_putc(s, BGP_ATTR_COMMUNITIES);
                        stream_putw(s, attr->community->size * 4);
                } else {
-                       stream_putc(s, BGP_ATTR_FLAG_OPTIONAL
-                                              | BGP_ATTR_FLAG_TRANS);
+                       stream_putc(s,
+                                   BGP_ATTR_FLAG_OPTIONAL
+                                           | BGP_ATTR_FLAG_TRANS);
                        stream_putc(s, BGP_ATTR_COMMUNITIES);
                        stream_putc(s, attr->community->size * 4);
                }
@@ -3425,14 +3436,15 @@ void bgp_dump_routes_attr(struct stream *s, struct attr *attr,
        /* Large Community attribute. */
        if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_LARGE_COMMUNITIES)) {
                if (attr->lcommunity->size * 12 > 255) {
-                       stream_putc(s, BGP_ATTR_FLAG_OPTIONAL
-                                              | BGP_ATTR_FLAG_TRANS
-                                              | BGP_ATTR_FLAG_EXTLEN);
+                       stream_putc(s,
+                                   BGP_ATTR_FLAG_OPTIONAL | BGP_ATTR_FLAG_TRANS
+                                           | BGP_ATTR_FLAG_EXTLEN);
                        stream_putc(s, BGP_ATTR_LARGE_COMMUNITIES);
                        stream_putw(s, attr->lcommunity->size * 12);
                } else {
-                       stream_putc(s, BGP_ATTR_FLAG_OPTIONAL
-                                              | BGP_ATTR_FLAG_TRANS);
+                       stream_putc(s,
+                                   BGP_ATTR_FLAG_OPTIONAL
+                                           | BGP_ATTR_FLAG_TRANS);
                        stream_putc(s, BGP_ATTR_LARGE_COMMUNITIES);
                        stream_putc(s, attr->lcommunity->size * 12);
                }
@@ -3477,8 +3489,9 @@ void bgp_dump_routes_attr(struct stream *s, struct attr *attr,
        /* Prefix SID */
        if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_PREFIX_SID)) {
                if (attr->label_index != BGP_INVALID_LABEL_INDEX) {
-                       stream_putc(s, BGP_ATTR_FLAG_OPTIONAL
-                                              | BGP_ATTR_FLAG_TRANS);
+                       stream_putc(s,
+                                   BGP_ATTR_FLAG_OPTIONAL
+                                           | BGP_ATTR_FLAG_TRANS);
                        stream_putc(s, BGP_ATTR_PREFIX_SID);
                        stream_putc(s, 10);
                        stream_putc(s, BGP_PREFIX_SID_LABEL_INDEX);
index c9f0d6f4eb9a6b941173d4644a76d96705f88184..324813c085dcea24220b38d0224957772ec0f6f1 100644 (file)
@@ -220,7 +220,7 @@ typedef enum {
        BGP_ATTR_PARSE_WITHDRAW = -2,
 
        /* only used internally, send notify + convert to BGP_ATTR_PARSE_ERROR
-        */
+          */
        BGP_ATTR_PARSE_ERROR_NOTIFYPLS = -3,
 } bgp_attr_parse_ret_t;
 
index 9b5202ff9109e4ef0cd86520e993dd44cee92e2d..2e277bfa5ff6909960e020fa2215064cea8984dd 100644 (file)
@@ -212,9 +212,8 @@ static void bgp_bfd_update_type(struct peer *peer)
                if ((multihop
                     && !CHECK_FLAG(bfd_info->flags,
                                    BFD_FLAG_BFD_TYPE_MULTIHOP))
-                   || (!multihop
-                       && CHECK_FLAG(bfd_info->flags,
-                                     BFD_FLAG_BFD_TYPE_MULTIHOP))) {
+                   || (!multihop && CHECK_FLAG(bfd_info->flags,
+                                               BFD_FLAG_BFD_TYPE_MULTIHOP))) {
                        bgp_bfd_peer_sendmsg(peer, ZEBRA_BFD_DEST_DEREGISTER);
                        bgp_bfd_peer_sendmsg(peer, ZEBRA_BFD_DEST_REGISTER);
                }
index e29f72b747fa8a5abf694e1cb8ceae77024232e4..4faebb538e8807711d24ab78476d5061f055322d 100644 (file)
@@ -36,9 +36,7 @@
 
 /* privileges */
 static zebra_capabilities_t _caps_p[] = {
-       ZCAP_BIND,
-       ZCAP_NET_RAW,
-       ZCAP_NET_ADMIN,
+       ZCAP_BIND, ZCAP_NET_RAW, ZCAP_NET_ADMIN,
 };
 
 struct zebra_privs_t bgpd_privs = {
index e3ab9437921a1c3ee8331a054dbf9b8fad5f96ca..bd3ae27c054b3335fc581fa7c762a51b8d1ceec6 100644 (file)
@@ -369,9 +369,10 @@ static void bgp_damp_parameter_set(int hlife, int reuse, int sup, int maxsup)
        /* Initialize params per bgp_damp_config. */
        damp->reuse_index_size = REUSE_ARRAY_SIZE;
 
-       damp->ceiling = (int)(damp->reuse_limit
-                             * (pow(2, (double)damp->max_suppress_time
-                                               / damp->half_life)));
+       damp->ceiling =
+               (int)(damp->reuse_limit * (pow(2,
+                                              (double)damp->max_suppress_time
+                                                      / damp->half_life)));
 
        /* Decay-array computations */
        damp->decay_array_size =
@@ -413,11 +414,9 @@ static void bgp_damp_parameter_set(int hlife, int reuse, int sup, int maxsup)
        for (i = 0; i < damp->reuse_index_size; i++) {
                damp->reuse_index[i] =
                        (int)(((double)damp->half_life / DELTA_REUSE)
-                             * log10(1.0
-                                     / (damp->reuse_limit
-                                        * (1.0
-                                           + ((double)i
-                                              / damp->scale_factor))))
+                             * log10(1.0 / (damp->reuse_limit
+                                            * (1.0 + ((double)i
+                                                      / damp->scale_factor))))
                              / log10(0.5));
        }
 }
index d1d06f36ba33d3e68490a1fd078849cd0e08ffea..08313690624631ce9b47923e79663829a3414fe6 100644 (file)
@@ -244,8 +244,9 @@ static void bgp_dump_routes_index_table(struct bgp *bgp)
 
        /* Populate fake peer at index 0, for locally originated routes */
        /* Peer type (IPv4) */
-       stream_putc(obuf, TABLE_DUMP_V2_PEER_INDEX_TABLE_AS4
-                                 + TABLE_DUMP_V2_PEER_INDEX_TABLE_IP);
+       stream_putc(obuf,
+                   TABLE_DUMP_V2_PEER_INDEX_TABLE_AS4
+                           + TABLE_DUMP_V2_PEER_INDEX_TABLE_IP);
        /* Peer BGP ID (0.0.0.0) */
        stream_putl(obuf, 0);
        /* Peer IP address (0.0.0.0) */
index 4d1e690f9cd7da4769376e1011c3accc83ee36e1..f0081e6d020c38a042cae81fc5f5c25cb3cca042 100644 (file)
@@ -2718,10 +2718,9 @@ int bgp_evpn_local_vni_add(struct bgp *bgp, vni_t vni,
  */
 void bgp_evpn_cleanup_on_disable(struct bgp *bgp)
 {
-       hash_iterate(
-               bgp->vnihash,
-               (void (*)(struct hash_backet *, void *))cleanup_vni_on_disable,
-               bgp);
+       hash_iterate(bgp->vnihash, (void (*)(struct hash_backet *,
+                                            void *))cleanup_vni_on_disable,
+                    bgp);
 }
 
 /*
@@ -2731,10 +2730,9 @@ void bgp_evpn_cleanup_on_disable(struct bgp *bgp)
 void bgp_evpn_cleanup(struct bgp *bgp)
 {
        if (bgp->vnihash)
-               hash_iterate(
-                       bgp->vnihash,
-                       (void (*)(struct hash_backet *, void *))free_vni_entry,
-                       bgp);
+               hash_iterate(bgp->vnihash, (void (*)(struct hash_backet *,
+                                                    void *))free_vni_entry,
+                            bgp);
        if (bgp->import_rt_hash)
                hash_free(bgp->import_rt_hash);
        bgp->import_rt_hash = NULL;
index 0e16fa2eae3ec7e2802c4c775882c7926cd25ec1..4b39ee86270da388dad2c191b4af2bcf01d9a3ca 100644 (file)
@@ -1301,10 +1301,9 @@ static void evpn_show_routes_vni_all(struct vty *vty, struct bgp *bgp,
        wctx.bgp = bgp;
        wctx.vty = vty;
        wctx.vtep_ip = vtep_ip;
-       hash_iterate(
-               bgp->vnihash,
-               (void (*)(struct hash_backet *, void *))show_vni_routes_hash,
-               &wctx);
+       hash_iterate(bgp->vnihash, (void (*)(struct hash_backet *,
+                                            void *))show_vni_routes_hash,
+                    &wctx);
 }
 
 /*
index 8275f3e89c5bed94e27d6be6154b555e784b4351..cf1cb1868966cecdb779c667a33040c2d0884d69 100644 (file)
@@ -1394,8 +1394,9 @@ static int bgp_establish(struct peer *peer)
        }
 
        if (other == peer)
-               ret = 1; /* bgp_establish specific code when xfer_conn
-                           happens. */
+               ret =
+                       1; /* bgp_establish specific code when xfer_conn
+                             happens. */
 
        /* Reset capability open status flag. */
        if (!CHECK_FLAG(peer->sflags, PEER_STATUS_CAPABILITY_OPEN))
index 88c77d978ca8a41057ccc3df02b2f370718a9a3e..ad7411990e1f7156083d6fa6ab6ec1707b0adc83 100644 (file)
@@ -283,7 +283,7 @@ int bgp_nlri_parse_label(struct peer *peer, struct attr *attr,
                                 * an error SHOULD
                                 * be logged locally, and the prefix SHOULD be
                                 * ignored.
-                                */
+                                 */
                                zlog_err(
                                        "%s: IPv4 labeled-unicast NLRI is multicast address %s, ignoring",
                                        peer->host, inet_ntoa(p.u.prefix4));
index 319d28f3fb5ea83acdb2a89b132a8cacf03aafd3..25a562ed68f9c944a4d25e3db77dd770e83210e8 100644 (file)
@@ -101,9 +101,7 @@ static int retain_mode = 0;
 
 /* privileges */
 static zebra_capabilities_t _caps_p[] = {
-       ZCAP_BIND,
-       ZCAP_NET_RAW,
-       ZCAP_NET_ADMIN,
+       ZCAP_BIND, ZCAP_NET_RAW, ZCAP_NET_ADMIN,
 };
 
 struct zebra_privs_t bgpd_privs = {
index a9346582ba76eb7ab1457113322b91df5fbb0f02..6dc6dc6769dbfd47af13982bd1467cc786aa1bb3 100644 (file)
@@ -675,9 +675,8 @@ void bgp_info_mpath_aggregate_update(struct bgp_info *new_best,
 
        bgp_attr_dup(&attr, new_best->attr);
 
-       if (new_best->peer
-           && bgp_flag_check(new_best->peer->bgp,
-                             BGP_FLAG_MULTIPATH_RELAX_AS_SET)) {
+       if (new_best->peer && bgp_flag_check(new_best->peer->bgp,
+                                            BGP_FLAG_MULTIPATH_RELAX_AS_SET)) {
 
                /* aggregate attribute from multipath constituents */
                aspath = aspath_dup(attr.aspath);
index d56d62e6b90273fb557723812dc2beddf4890a86..5d2966d1ad5d525978e6628506d9e4f5de6616f4 100644 (file)
@@ -612,9 +612,8 @@ int bgp_show_mpls_vpn(struct vty *vty, afi_t afi, struct prefix_rd *prd,
 
        if (use_json) {
                json_object_object_add(json, "routes", json_nroute);
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        } else {
                if (output_count == 0)
index 9c13869206efeaa4d0638164358197bae1295b62..70299ea456f4017d426b3bee400fa901d6422924 100644 (file)
@@ -158,9 +158,8 @@ int bgp_set_socket_ttl(struct peer *peer, int bgp_sock)
                if (ret) {
                        zlog_err(
                                "%s: Can't set TxTTL on peer (rtrid %s) socket, err = %d",
-                               __func__,
-                               inet_ntop(AF_INET, &peer->remote_id, buf,
-                                         sizeof(buf)),
+                               __func__, inet_ntop(AF_INET, &peer->remote_id,
+                                                   buf, sizeof(buf)),
                                errno);
                        return ret;
                }
@@ -173,9 +172,8 @@ int bgp_set_socket_ttl(struct peer *peer, int bgp_sock)
                if (ret) {
                        zlog_err(
                                "%s: Can't set TxTTL on peer (rtrid %s) socket, err = %d",
-                               __func__,
-                               inet_ntop(AF_INET, &peer->remote_id, buf,
-                                         sizeof(buf)),
+                               __func__, inet_ntop(AF_INET, &peer->remote_id,
+                                                   buf, sizeof(buf)),
                                errno);
                        return ret;
                }
@@ -184,9 +182,8 @@ int bgp_set_socket_ttl(struct peer *peer, int bgp_sock)
                if (ret) {
                        zlog_err(
                                "%s: Can't set MinTTL on peer (rtrid %s) socket, err = %d",
-                               __func__,
-                               inet_ntop(AF_INET, &peer->remote_id, buf,
-                                         sizeof(buf)),
+                               __func__, inet_ntop(AF_INET, &peer->remote_id,
+                                                   buf, sizeof(buf)),
                                errno);
                        return ret;
                }
index d31e54c6729bb2782d695d7abc25f0df27a0f8e1..b18a4b7c46e6237bc63c2349dc5c0191066861ee 100644 (file)
@@ -744,18 +744,18 @@ static const struct message capcode_str[] = {
 
 /* Minimum sizes for length field of each cap (so not inc. the header) */
 static const size_t cap_minsizes[] = {
-       [CAPABILITY_CODE_MP] = CAPABILITY_CODE_MP_LEN,
-       [CAPABILITY_CODE_REFRESH] = CAPABILITY_CODE_REFRESH_LEN,
-       [CAPABILITY_CODE_ORF] = CAPABILITY_CODE_ORF_LEN,
-       [CAPABILITY_CODE_RESTART] = CAPABILITY_CODE_RESTART_LEN,
-       [CAPABILITY_CODE_AS4] = CAPABILITY_CODE_AS4_LEN,
-       [CAPABILITY_CODE_ADDPATH] = CAPABILITY_CODE_ADDPATH_LEN,
-       [CAPABILITY_CODE_DYNAMIC] = CAPABILITY_CODE_DYNAMIC_LEN,
-       [CAPABILITY_CODE_DYNAMIC_OLD] = CAPABILITY_CODE_DYNAMIC_LEN,
-       [CAPABILITY_CODE_ENHE] = CAPABILITY_CODE_ENHE_LEN,
-       [CAPABILITY_CODE_REFRESH_OLD] = CAPABILITY_CODE_REFRESH_LEN,
-       [CAPABILITY_CODE_ORF_OLD] = CAPABILITY_CODE_ORF_LEN,
-       [CAPABILITY_CODE_FQDN] = CAPABILITY_CODE_MIN_FQDN_LEN,
+               [CAPABILITY_CODE_MP] = CAPABILITY_CODE_MP_LEN,
+               [CAPABILITY_CODE_REFRESH] = CAPABILITY_CODE_REFRESH_LEN,
+               [CAPABILITY_CODE_ORF] = CAPABILITY_CODE_ORF_LEN,
+               [CAPABILITY_CODE_RESTART] = CAPABILITY_CODE_RESTART_LEN,
+               [CAPABILITY_CODE_AS4] = CAPABILITY_CODE_AS4_LEN,
+               [CAPABILITY_CODE_ADDPATH] = CAPABILITY_CODE_ADDPATH_LEN,
+               [CAPABILITY_CODE_DYNAMIC] = CAPABILITY_CODE_DYNAMIC_LEN,
+               [CAPABILITY_CODE_DYNAMIC_OLD] = CAPABILITY_CODE_DYNAMIC_LEN,
+               [CAPABILITY_CODE_ENHE] = CAPABILITY_CODE_ENHE_LEN,
+               [CAPABILITY_CODE_REFRESH_OLD] = CAPABILITY_CODE_REFRESH_LEN,
+               [CAPABILITY_CODE_ORF_OLD] = CAPABILITY_CODE_ORF_LEN,
+               [CAPABILITY_CODE_FQDN] = CAPABILITY_CODE_MIN_FQDN_LEN,
 };
 
 /* value the capability must be a multiple of.
@@ -764,12 +764,18 @@ static const size_t cap_minsizes[] = {
  * table should be set to 1.
  */
 static const size_t cap_modsizes[] = {
-       [CAPABILITY_CODE_MP] = 4,      [CAPABILITY_CODE_REFRESH] = 1,
-       [CAPABILITY_CODE_ORF] = 1,     [CAPABILITY_CODE_RESTART] = 1,
-       [CAPABILITY_CODE_AS4] = 4,     [CAPABILITY_CODE_ADDPATH] = 4,
-       [CAPABILITY_CODE_DYNAMIC] = 1, [CAPABILITY_CODE_DYNAMIC_OLD] = 1,
-       [CAPABILITY_CODE_ENHE] = 6,    [CAPABILITY_CODE_REFRESH_OLD] = 1,
-       [CAPABILITY_CODE_ORF_OLD] = 1, [CAPABILITY_CODE_FQDN] = 1,
+               [CAPABILITY_CODE_MP] = 4,
+               [CAPABILITY_CODE_REFRESH] = 1,
+               [CAPABILITY_CODE_ORF] = 1,
+               [CAPABILITY_CODE_RESTART] = 1,
+               [CAPABILITY_CODE_AS4] = 4,
+               [CAPABILITY_CODE_ADDPATH] = 4,
+               [CAPABILITY_CODE_DYNAMIC] = 1,
+               [CAPABILITY_CODE_DYNAMIC_OLD] = 1,
+               [CAPABILITY_CODE_ENHE] = 6,
+               [CAPABILITY_CODE_REFRESH_OLD] = 1,
+               [CAPABILITY_CODE_ORF_OLD] = 1,
+               [CAPABILITY_CODE_FQDN] = 1,
 };
 
 /**
@@ -1309,8 +1315,9 @@ void bgp_open_capability(struct stream *s, struct peer *peer)
                                         */
                                        SET_FLAG(peer->cap, PEER_CAP_ENHE_ADV);
                                        stream_putc(s, BGP_OPEN_OPT_CAP);
-                                       stream_putc(s, CAPABILITY_CODE_ENHE_LEN
-                                                              + 2);
+                                       stream_putc(s,
+                                                   CAPABILITY_CODE_ENHE_LEN
+                                                           + 2);
                                        stream_putc(s, CAPABILITY_CODE_ENHE);
                                        stream_putc(s,
                                                    CAPABILITY_CODE_ENHE_LEN);
index b0d6a9388a10cec61a5062d7b283954be6110e80..e92f2d69773efa41741e83112e34b9cac3b00e1f 100644 (file)
@@ -547,8 +547,9 @@ void bgp_open_send(struct peer *peer)
 
        /* Set open packet values. */
        stream_putc(s, BGP_VERSION_4); /* BGP version */
-       stream_putw(s, (local_as <= BGP_AS_MAX) ? (u_int16_t)local_as
-                                               : BGP_AS_TRANS);
+       stream_putw(s,
+                   (local_as <= BGP_AS_MAX) ? (u_int16_t)local_as
+                                            : BGP_AS_TRANS);
        stream_putw(s, send_holdtime);          /* Hold Time */
        stream_put_in_addr(s, &peer->local_id); /* BGP Identifier */
 
index 1c1c95525c4df1cc5be758334c2376c830db37ed..38ad7a6e0a239edff68e2853275764f5f6a2c211 100644 (file)
@@ -1916,9 +1916,8 @@ int subgroup_process_announce_selected(struct update_subgroup *subgrp,
                                                 : NULL);
 
        /* First update is deferred until ORF or ROUTE-REFRESH is received */
-       if (onlypeer
-           && CHECK_FLAG(onlypeer->af_sflags[afi][safi],
-                         PEER_STATUS_ORF_WAIT_REFRESH))
+       if (onlypeer && CHECK_FLAG(onlypeer->af_sflags[afi][safi],
+                                  PEER_STATUS_ORF_WAIT_REFRESH))
                return 0;
 
        memset(&attr, 0, sizeof(struct attr));
@@ -3869,7 +3868,7 @@ int bgp_nlri_parse_ip(struct peer *peer, struct attr *attr,
                                 * an error SHOULD
                                 * be logged locally, and the prefix SHOULD be
                                 * ignored.
-                                */
+                                 */
                                zlog_err(
                                        "%s: IPv4 unicast NLRI is multicast address %s, ignoring",
                                        peer->host, inet_ntoa(p.u.prefix4));
@@ -5210,16 +5209,14 @@ DEFUN (no_bgp_network_mask_natural,
 }
 
 ALIAS(no_bgp_network, no_bgp_network_label_index_cmd,
-      "no network A.B.C.D/M label-index (0-1048560)",
-      NO_STR
+      "no network A.B.C.D/M label-index (0-1048560)", NO_STR
       "Specify a network to announce via BGP\n"
       "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
       "Label index to associate with the prefix\n"
       "Label index value\n")
 
 ALIAS(no_bgp_network, no_bgp_network_label_index_route_map_cmd,
-      "no network A.B.C.D/M label-index (0-1048560) route-map WORD",
-      NO_STR
+      "no network A.B.C.D/M label-index (0-1048560) route-map WORD", NO_STR
       "Specify a network to announce via BGP\n"
       "IP prefix\n"
       "Label index to associate with the prefix\n"
@@ -5301,16 +5298,14 @@ DEFUN (no_ipv6_bgp_network,
 }
 
 ALIAS(no_ipv6_bgp_network, no_ipv6_bgp_network_label_index_cmd,
-      "no network X:X::X:X/M label-index (0-1048560)",
-      NO_STR
+      "no network X:X::X:X/M label-index (0-1048560)", NO_STR
       "Specify a network to announce via BGP\n"
       "IPv6 prefix <network>/<length>\n"
       "Label index to associate with the prefix\n"
       "Label index value\n")
 
 ALIAS(no_ipv6_bgp_network, no_ipv6_bgp_network_label_index_route_map_cmd,
-      "no network X:X::X:X/M label-index (0-1048560) route-map WORD",
-      NO_STR
+      "no network X:X::X:X/M label-index (0-1048560) route-map WORD", NO_STR
       "Specify a network to announce via BGP\n"
       "IPv6 prefix\n"
       "Label index to associate with the prefix\n"
@@ -6510,10 +6505,11 @@ void route_vty_out(struct vty *vty, struct prefix *p, struct bgp_info *binfo,
                                                len = vty_out(
                                                        vty, "%s",
                                                        binfo->peer->conf_if);
-                                               len = 7 - len; /* len of IPv6
-                                                                 addr + max
-                                                                 len of def
-                                                                 ifname */
+                                               len =
+                                                       7 - len; /* len of IPv6
+                                                                   addr + max
+                                                                   len of def
+                                                                   ifname */
 
                                                if (len < 1)
                                                        vty_out(vty, "\n%*s",
@@ -7000,10 +6996,9 @@ static void damp_route_vty_out(struct vty *vty, struct prefix *p,
                bgp_damp_reuse_time_vty(vty, binfo, timebuf, BGP_UPTIME_LEN,
                                        use_json, json);
        else
-               vty_out(vty, "%s ",
-                       bgp_damp_reuse_time_vty(vty, binfo, timebuf,
-                                               BGP_UPTIME_LEN, use_json,
-                                               json));
+               vty_out(vty, "%s ", bgp_damp_reuse_time_vty(vty, binfo, timebuf,
+                                                           BGP_UPTIME_LEN,
+                                                           use_json, json));
 
        /* Print attribute */
        attr = binfo->attr;
@@ -7082,9 +7077,8 @@ static void flap_route_vty_out(struct vty *vty, struct prefix *p,
                peer_uptime(bdi->start_time, timebuf, BGP_UPTIME_LEN, use_json,
                            json);
        else
-               vty_out(vty, "%s ",
-                       peer_uptime(bdi->start_time, timebuf, BGP_UPTIME_LEN, 0,
-                                   NULL));
+               vty_out(vty, "%s ", peer_uptime(bdi->start_time, timebuf,
+                                               BGP_UPTIME_LEN, 0, NULL));
 
        if (CHECK_FLAG(binfo->flags, BGP_INFO_DAMPED)
            && !CHECK_FLAG(binfo->flags, BGP_INFO_HISTORY)) {
@@ -8604,9 +8598,8 @@ static int bgp_show_route_in_table(struct vty *vty, struct bgp *bgp,
                if (display)
                        json_object_object_add(json, "paths", json_paths);
 
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        } else {
                if (!display) {
@@ -9276,20 +9269,21 @@ enum bgp_stats {
 };
 
 static const char *table_stats_strs[] = {
-       [BGP_STATS_PREFIXES] = "Total Prefixes",
-       [BGP_STATS_TOTPLEN] = "Average prefix length",
-       [BGP_STATS_RIB] = "Total Advertisements",
-       [BGP_STATS_UNAGGREGATEABLE] = "Unaggregateable prefixes",
-       [BGP_STATS_MAX_AGGREGATEABLE] = "Maximum aggregateable prefixes",
-       [BGP_STATS_AGGREGATES] = "BGP Aggregate advertisements",
-       [BGP_STATS_SPACE] = "Address space advertised",
-       [BGP_STATS_ASPATH_COUNT] = "Advertisements with paths",
-       [BGP_STATS_ASPATH_MAXHOPS] = "Longest AS-Path (hops)",
-       [BGP_STATS_ASPATH_MAXSIZE] = "Largest AS-Path (bytes)",
-       [BGP_STATS_ASPATH_TOTHOPS] = "Average AS-Path length (hops)",
-       [BGP_STATS_ASPATH_TOTSIZE] = "Average AS-Path size (bytes)",
-       [BGP_STATS_ASN_HIGHEST] = "Highest public ASN",
-       [BGP_STATS_MAX] = NULL,
+               [BGP_STATS_PREFIXES] = "Total Prefixes",
+               [BGP_STATS_TOTPLEN] = "Average prefix length",
+               [BGP_STATS_RIB] = "Total Advertisements",
+               [BGP_STATS_UNAGGREGATEABLE] = "Unaggregateable prefixes",
+               [BGP_STATS_MAX_AGGREGATEABLE] =
+                       "Maximum aggregateable prefixes",
+               [BGP_STATS_AGGREGATES] = "BGP Aggregate advertisements",
+               [BGP_STATS_SPACE] = "Address space advertised",
+               [BGP_STATS_ASPATH_COUNT] = "Advertisements with paths",
+               [BGP_STATS_ASPATH_MAXHOPS] = "Longest AS-Path (hops)",
+               [BGP_STATS_ASPATH_MAXSIZE] = "Largest AS-Path (bytes)",
+               [BGP_STATS_ASPATH_TOTHOPS] = "Average AS-Path length (hops)",
+               [BGP_STATS_ASPATH_TOTSIZE] = "Average AS-Path size (bytes)",
+               [BGP_STATS_ASN_HIGHEST] = "Highest public ASN",
+               [BGP_STATS_MAX] = NULL,
 };
 
 struct bgp_table_stats {
@@ -9524,11 +9518,16 @@ enum bgp_pcounts {
 };
 
 static const char *pcount_strs[] = {
-       [PCOUNT_ADJ_IN] = "Adj-in",   [PCOUNT_DAMPED] = "Damped",
-       [PCOUNT_REMOVED] = "Removed", [PCOUNT_HISTORY] = "History",
-       [PCOUNT_STALE] = "Stale",     [PCOUNT_VALID] = "Valid",
-       [PCOUNT_ALL] = "All RIB",     [PCOUNT_COUNTED] = "PfxCt counted",
-       [PCOUNT_PFCNT] = "Useable",   [PCOUNT_MAX] = NULL,
+               [PCOUNT_ADJ_IN] = "Adj-in",
+               [PCOUNT_DAMPED] = "Damped",
+               [PCOUNT_REMOVED] = "Removed",
+               [PCOUNT_HISTORY] = "History",
+               [PCOUNT_STALE] = "Stale",
+               [PCOUNT_VALID] = "Valid",
+               [PCOUNT_ALL] = "All RIB",
+               [PCOUNT_COUNTED] = "PfxCt counted",
+               [PCOUNT_PFCNT] = "Useable",
+               [PCOUNT_MAX] = NULL,
 };
 
 struct peer_pcounts {
@@ -9629,9 +9628,9 @@ static int bgp_peer_counts(struct vty *vty, struct peer *peer, afi_t afi,
        pcounts.table = peer->bgp->rib[afi][safi];
 
        /* in-place call via thread subsystem so as to record execution time
-        *    * stats for the thread-walk (i.e. ensure this can't be blamed on
-        *       * on just vty_read()).
-        *          */
+       *    * stats for the thread-walk (i.e. ensure this can't be blamed on
+       *       * on just vty_read()).
+       *          */
        thread_execute(bm->master, bgp_peer_count_walker, &pcounts, 0);
 
        if (use_json) {
@@ -9888,9 +9887,8 @@ static void show_adj_route(struct vty *vty, struct peer *peer, afi_t afi,
                                               "bgpOriginatingDefaultNetwork",
                                               "0.0.0.0");
                } else {
-                       vty_out(vty,
-                               "BGP table version is %" PRIu64
-                               ", local router ID is %s\n",
+                       vty_out(vty, "BGP table version is %" PRIu64
+                                    ", local router ID is %s\n",
                                table->version, inet_ntoa(bgp->router_id));
                        vty_out(vty, BGP_SHOW_SCODE_HEADER);
                        vty_out(vty, BGP_SHOW_OCODE_HEADER);
index cb4c9a21ee86b22733fdc41de1c75f892ef876c8..1a1817bad35642410d83b8b13e4049be4a57b175 100644 (file)
@@ -97,8 +97,10 @@ struct bgp_info_extra {
                                struct in6_addr addr6;
                        } un; /* cached un address */
                        time_t create_time;
-                       struct prefix aux_prefix; /* AFI_L2VPN: the IP addr,
-                                                    if family set */
+                       struct
+                               prefix
+                                       aux_prefix; /* AFI_L2VPN: the IP addr,
+                                                      if family set */
                } import;
 
        } vnc;
index 8a9bd764eec7daa5866bd352f9b53c95662c8a6d..285bb9a80cea2bf5f251a636d6d704d71f21da1d 100644 (file)
@@ -652,10 +652,7 @@ static route_map_result_t route_match_metric(void *rule, struct prefix *prefix,
 
 /* Route map commands for metric matching. */
 struct route_map_rule_cmd route_match_metric_cmd = {
-       "metric",
-       route_match_metric,
-       route_value_compile,
-       route_value_free,
+       "metric", route_match_metric, route_value_compile, route_value_free,
 };
 
 /* `match as-path ASPATH' */
@@ -1050,9 +1047,7 @@ static route_map_result_t route_match_tag(void *rule, struct prefix *prefix,
 
 /* Route map commands for tag matching. */
 static struct route_map_rule_cmd route_match_tag_cmd = {
-       "tag",
-       route_match_tag,
-       route_map_rule_tag_compile,
+       "tag", route_match_tag, route_map_rule_tag_compile,
        route_map_rule_tag_free,
 };
 
@@ -1197,9 +1192,7 @@ static route_map_result_t route_set_local_pref(void *rule,
 
 /* Set local preference rule structure. */
 struct route_map_rule_cmd route_set_local_pref_cmd = {
-       "local-preference",
-       route_set_local_pref,
-       route_value_compile,
+       "local-preference", route_set_local_pref, route_value_compile,
        route_value_free,
 };
 
@@ -1228,10 +1221,7 @@ static route_map_result_t route_set_weight(void *rule, struct prefix *prefix,
 
 /* Set local preference rule structure. */
 struct route_map_rule_cmd route_set_weight_cmd = {
-       "weight",
-       route_set_weight,
-       route_value_compile,
-       route_value_free,
+       "weight", route_set_weight, route_value_compile, route_value_free,
 };
 
 /* `set metric METRIC' */
@@ -1263,10 +1253,7 @@ static route_map_result_t route_set_metric(void *rule, struct prefix *prefix,
 
 /* Set metric rule structure. */
 struct route_map_rule_cmd route_set_metric_cmd = {
-       "metric",
-       route_set_metric,
-       route_value_compile,
-       route_value_free,
+       "metric", route_set_metric, route_value_compile, route_value_free,
 };
 
 /* `set as-path prepend ASPATH' */
@@ -1324,10 +1311,8 @@ static void route_set_aspath_prepend_free(void *rule)
 
 /* Set as-path prepend rule structure. */
 struct route_map_rule_cmd route_set_aspath_prepend_cmd = {
-       "as-path prepend",
-       route_set_aspath_prepend,
-       route_set_aspath_prepend_compile,
-       route_set_aspath_prepend_free,
+       "as-path prepend", route_set_aspath_prepend,
+       route_set_aspath_prepend_compile, route_set_aspath_prepend_free,
 };
 
 /* `set as-path exclude ASn' */
@@ -1360,9 +1345,7 @@ static route_map_result_t route_set_aspath_exclude(void *rule,
 
 /* Set ASn exlude rule structure. */
 struct route_map_rule_cmd route_set_aspath_exclude_cmd = {
-       "as-path exclude",
-       route_set_aspath_exclude,
-       route_aspath_compile,
+       "as-path exclude", route_set_aspath_exclude, route_aspath_compile,
        route_aspath_free,
 };
 
@@ -1475,9 +1458,7 @@ static void route_set_community_free(void *rule)
 
 /* Set community rule structure. */
 struct route_map_rule_cmd route_set_community_cmd = {
-       "community",
-       route_set_community,
-       route_set_community_compile,
+       "community", route_set_community, route_set_community_compile,
        route_set_community_free,
 };
 
@@ -1595,9 +1576,7 @@ static void route_set_lcommunity_free(void *rule)
 
 /* Set community rule structure. */
 struct route_map_rule_cmd route_set_lcommunity_cmd = {
-       "large-community",
-       route_set_lcommunity,
-       route_set_lcommunity_compile,
+       "large-community", route_set_lcommunity, route_set_lcommunity_compile,
        route_set_lcommunity_free,
 };
 
@@ -1680,10 +1659,8 @@ static void route_set_lcommunity_delete_free(void *rule)
 
 /* Set lcommunity rule structure. */
 struct route_map_rule_cmd route_set_lcommunity_delete_cmd = {
-       "large-comm-list",
-       route_set_lcommunity_delete,
-       route_set_lcommunity_delete_compile,
-       route_set_lcommunity_delete_free,
+       "large-comm-list", route_set_lcommunity_delete,
+       route_set_lcommunity_delete_compile, route_set_lcommunity_delete_free,
 };
 
 
@@ -1766,10 +1743,8 @@ static void route_set_community_delete_free(void *rule)
 
 /* Set community rule structure. */
 struct route_map_rule_cmd route_set_community_delete_cmd = {
-       "comm-list",
-       route_set_community_delete,
-       route_set_community_delete_compile,
-       route_set_community_delete_free,
+       "comm-list", route_set_community_delete,
+       route_set_community_delete_compile, route_set_community_delete_free,
 };
 
 /* `set extcommunity rt COMMUNITY' */
@@ -1836,10 +1811,8 @@ static void route_set_ecommunity_free(void *rule)
 
 /* Set community rule structure. */
 struct route_map_rule_cmd route_set_ecommunity_rt_cmd = {
-       "extcommunity rt",
-       route_set_ecommunity,
-       route_set_ecommunity_rt_compile,
-       route_set_ecommunity_free,
+       "extcommunity rt", route_set_ecommunity,
+       route_set_ecommunity_rt_compile, route_set_ecommunity_free,
 };
 
 /* `set extcommunity soo COMMUNITY' */
@@ -1858,10 +1831,8 @@ static void *route_set_ecommunity_soo_compile(const char *arg)
 
 /* Set community rule structure. */
 struct route_map_rule_cmd route_set_ecommunity_soo_cmd = {
-       "extcommunity soo",
-       route_set_ecommunity,
-       route_set_ecommunity_soo_compile,
-       route_set_ecommunity_free,
+       "extcommunity soo", route_set_ecommunity,
+       route_set_ecommunity_soo_compile, route_set_ecommunity_free,
 };
 
 /* `set origin ORIGIN' */
@@ -1909,9 +1880,7 @@ static void route_set_origin_free(void *rule)
 
 /* Set origin rule structure. */
 struct route_map_rule_cmd route_set_origin_cmd = {
-       "origin",
-       route_set_origin,
-       route_set_origin_compile,
+       "origin", route_set_origin, route_set_origin_compile,
        route_set_origin_free,
 };
 
@@ -1948,10 +1917,8 @@ static void route_set_atomic_aggregate_free(void *rule)
 
 /* Set atomic aggregate rule structure. */
 struct route_map_rule_cmd route_set_atomic_aggregate_cmd = {
-       "atomic-aggregate",
-       route_set_atomic_aggregate,
-       route_set_atomic_aggregate_compile,
-       route_set_atomic_aggregate_free,
+       "atomic-aggregate", route_set_atomic_aggregate,
+       route_set_atomic_aggregate_compile, route_set_atomic_aggregate_free,
 };
 
 /* `set aggregator as AS A.B.C.D' */
@@ -2006,10 +1973,8 @@ static void route_set_aggregator_as_free(void *rule)
 }
 
 struct route_map_rule_cmd route_set_aggregator_as_cmd = {
-       "aggregator as",
-       route_set_aggregator_as,
-       route_set_aggregator_as_compile,
-       route_set_aggregator_as_free,
+       "aggregator as", route_set_aggregator_as,
+       route_set_aggregator_as_compile, route_set_aggregator_as_free,
 };
 
 /* Set tag to object. object must be pointer to struct bgp_info */
@@ -2032,9 +1997,7 @@ static route_map_result_t route_set_tag(void *rule, struct prefix *prefix,
 
 /* Route map commands for tag set. */
 static struct route_map_rule_cmd route_set_tag_cmd = {
-       "tag",
-       route_set_tag,
-       route_map_rule_tag_compile,
+       "tag", route_set_tag, route_map_rule_tag_compile,
        route_map_rule_tag_free,
 };
 
@@ -2067,9 +2030,7 @@ static route_map_result_t route_set_label_index(void *rule,
 
 /* Route map commands for label-index set. */
 static struct route_map_rule_cmd route_set_label_index_cmd = {
-       "label-index",
-       route_set_label_index,
-       route_value_compile,
+       "label-index", route_set_label_index, route_value_compile,
        route_value_free,
 };
 
@@ -2596,10 +2557,8 @@ static void route_set_originator_id_free(void *rule)
 
 /* Set originator-id rule structure. */
 struct route_map_rule_cmd route_set_originator_id_cmd = {
-       "originator-id",
-       route_set_originator_id,
-       route_set_originator_id_compile,
-       route_set_originator_id_free,
+       "originator-id", route_set_originator_id,
+       route_set_originator_id_compile, route_set_originator_id_free,
 };
 
 /* Add bgp route map rule. */
index 50ced81644f0b25ebfbdad1e889e912cf13b3d5d..8a9d61f3058ab89370c992df2cb00c441cff399d 100644 (file)
@@ -864,6 +864,8 @@ static u_char *bgp4PathAttrTable(struct variable *v, oid name[], size_t *length,
                return SNMP_INTEGER(-1);
                break;
        case BGP4PATHATTRBEST: /* 13 */
+                              /* $FRR indent$ */
+                              /* clang-format off */
 #define BGP4_PathAttrBest_false 1
 #define BGP4_PathAttrBest_true  2
                if (CHECK_FLAG(binfo->flags, BGP_INFO_SELECTED))
index b791bc1a1c86f489ffbf10cc6971db9dcf33667d..77e6157150dbf11ae8c0700ee6333e461f16a979 100644 (file)
@@ -1121,8 +1121,8 @@ int update_subgroup_check_merge(struct update_subgroup *subgrp,
 }
 
 /*
- * update_subgroup_merge_check_thread_cb
- */
+* update_subgroup_merge_check_thread_cb
+*/
 static int update_subgroup_merge_check_thread_cb(struct thread *thread)
 {
        struct update_subgroup *subgrp;
index d6c8055b6475ae711574b567e33ef0d8b6a626b0..52a21679b895c40a9b398629a490fcaddb4b9e6a 100644 (file)
@@ -267,6 +267,7 @@ struct update_subgroup {
  */
 #define SUBGRP_DECR_STAT(subgrp, stat) SUBGRP_INCR_STAT_BY(subgrp, stat, -1)
 
+
 typedef int (*updgrp_walkcb)(struct update_group *updgrp, void *ctx);
 
 /* really a private structure */
index a0961d8cee672b1a9c469785df026821e7e968d4..0a33fa5ed4237379c7851d44da1c8a5ca1289815 100644 (file)
@@ -646,10 +646,9 @@ void subgroup_announce_route(struct update_subgroup *subgrp)
         */
        onlypeer = ((SUBGRP_PCOUNT(subgrp) == 1) ? (SUBGRP_PFIRST(subgrp))->peer
                                                 : NULL);
-       if (onlypeer
-           && CHECK_FLAG(onlypeer->af_sflags[SUBGRP_AFI(subgrp)]
-                                            [SUBGRP_SAFI(subgrp)],
-                         PEER_STATUS_ORF_WAIT_REFRESH))
+       if (onlypeer && CHECK_FLAG(onlypeer->af_sflags[SUBGRP_AFI(subgrp)]
+                                                     [SUBGRP_SAFI(subgrp)],
+                                  PEER_STATUS_ORF_WAIT_REFRESH))
                return;
 
        if (SUBGRP_SAFI(subgrp) != SAFI_MPLS_VPN
index 53d695167f738b0bf6bfe99c42d2af271c3353ad..d7a4a36986b17bd88f72c0216645a3aa21daab03 100644 (file)
@@ -732,9 +732,8 @@ struct bpacket *subgroup_update_packet(struct update_subgroup *subgrp)
 
                space_remaining = STREAM_CONCAT_REMAIN(s, snlri, STREAM_SIZE(s))
                                  - BGP_MAX_PACKET_SIZE_OVERFLOW;
-               space_needed =
-                       BGP_NLRI_LENGTH
-                       + bgp_packet_mpattr_prefix_size(afi, safi, &rn->p);
+               space_needed = BGP_NLRI_LENGTH + bgp_packet_mpattr_prefix_size(
+                                                        afi, safi, &rn->p);
 
                /* When remaining space can't include NLRI and it's length.  */
                if (space_remaining < space_needed)
@@ -778,9 +777,9 @@ struct bpacket *subgroup_update_packet(struct update_subgroup *subgrp)
                        space_remaining =
                                STREAM_CONCAT_REMAIN(s, snlri, STREAM_SIZE(s))
                                - BGP_MAX_PACKET_SIZE_OVERFLOW;
-                       space_needed = BGP_NLRI_LENGTH
-                                      + bgp_packet_mpattr_prefix_size(
-                                                afi, safi, &rn->p);
+                       space_needed =
+                               BGP_NLRI_LENGTH + bgp_packet_mpattr_prefix_size(
+                                                         afi, safi, &rn->p);
 
                        /* If the attributes alone do not leave any room for
                         * NLRI then
index c9baf5af34df38d4f176cb1c0727bbff60fee791..ca98ff0668a58c869c2a12256632da956496f4f7 100644 (file)
@@ -242,9 +242,8 @@ int show_adj_route_vpn(struct vty *vty, struct peer *peer,
        }
        if (use_json) {
                json_object_object_add(json, "routes", json_routes);
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        }
        return CMD_SUCCESS;
index 353a3425a24da223fcbfd0929622e95d4407cc84..8ae015173f5e80f2ef2b1aee901625c0877bddd9 100644 (file)
@@ -1470,8 +1470,7 @@ DEFUN (no_bgp_maxpaths,
 }
 
 ALIAS_HIDDEN(no_bgp_maxpaths, no_bgp_maxpaths_hidden_cmd,
-            "no maximum-paths [" CMD_RANGE_STR(1, MULTIPATH_NUM) "]",
-            NO_STR
+            "no maximum-paths [" CMD_RANGE_STR(1, MULTIPATH_NUM) "]", NO_STR
             "Forward packets over multiple paths\n"
             "Number of paths\n")
 
@@ -6377,9 +6376,8 @@ DEFUN (show_bgp_vrfs,
 
                json_object_int_add(json, "totalVrfs", count);
 
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        } else {
                if (count)
@@ -6473,20 +6471,17 @@ DEFUN (show_bgp_memory,
        /* Other attributes */
        if ((count = community_count()))
                vty_out(vty, "%ld BGP community entries, using %s of memory\n",
-                       count,
-                       mtype_memstr(memstrbuf, sizeof(memstrbuf),
-                                    count * sizeof(struct community)));
+                       count, mtype_memstr(memstrbuf, sizeof(memstrbuf),
+                                           count * sizeof(struct community)));
        if ((count = mtype_stats_alloc(MTYPE_ECOMMUNITY)))
                vty_out(vty, "%ld BGP community entries, using %s of memory\n",
-                       count,
-                       mtype_memstr(memstrbuf, sizeof(memstrbuf),
-                                    count * sizeof(struct ecommunity)));
+                       count, mtype_memstr(memstrbuf, sizeof(memstrbuf),
+                                           count * sizeof(struct ecommunity)));
        if ((count = mtype_stats_alloc(MTYPE_LCOMMUNITY)))
                vty_out(vty,
                        "%ld BGP large-community entries, using %s of memory\n",
-                       count,
-                       mtype_memstr(memstrbuf, sizeof(memstrbuf),
-                                    count * sizeof(struct lcommunity)));
+                       count, mtype_memstr(memstrbuf, sizeof(memstrbuf),
+                                           count * sizeof(struct lcommunity)));
 
        if ((count = mtype_stats_alloc(MTYPE_CLUSTER)))
                vty_out(vty, "%ld Cluster lists, using %s of memory\n", count,
@@ -6515,9 +6510,8 @@ DEFUN (show_bgp_memory,
                                     count * sizeof(struct hash_backet)));
        if ((count = mtype_stats_alloc(MTYPE_BGP_REGEXP)))
                vty_out(vty, "%ld compiled regexes, using %s of memory\n",
-                       count,
-                       mtype_memstr(memstrbuf, sizeof(memstrbuf),
-                                    count * sizeof(regex_t)));
+                       count, mtype_memstr(memstrbuf, sizeof(memstrbuf),
+                                           count * sizeof(regex_t)));
        return CMD_SUCCESS;
 }
 
@@ -6742,9 +6736,8 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi,
                                                        ents);
                                                json_object_int_add(
                                                        json, "peerGroupMemory",
-                                                       ents
-                                                               * sizeof(struct
-                                                                        peer_group));
+                                                       ents * sizeof(struct
+                                                                     peer_group));
                                        }
 
                                        if (CHECK_FLAG(bgp->af_flags[afi][safi],
@@ -6775,9 +6768,8 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi,
                                                mtype_memstr(
                                                        memstrbuf,
                                                        sizeof(memstrbuf),
-                                                       ents
-                                                               * sizeof(struct
-                                                                        bgp_node)));
+                                                       ents * sizeof(struct
+                                                                     bgp_node)));
 
                                        /* Peer related usage */
                                        ents = listcount(bgp->peer);
@@ -6787,9 +6779,8 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi,
                                                mtype_memstr(
                                                        memstrbuf,
                                                        sizeof(memstrbuf),
-                                                       ents
-                                                               * sizeof(struct
-                                                                        peer)));
+                                                       ents * sizeof(struct
+                                                                     peer)));
 
                                        if ((ents = listcount(bgp->group)))
                                                vty_out(vty,
@@ -6798,9 +6789,8 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi,
                                                        mtype_memstr(
                                                                memstrbuf,
                                                                sizeof(memstrbuf),
-                                                               ents
-                                                                       * sizeof(struct
-                                                                                peer_group)));
+                                                               ents * sizeof(struct
+                                                                             peer_group)));
 
                                        if (CHECK_FLAG(bgp->af_flags[afi][safi],
                                                       BGP_CONFIG_DAMPENING))
@@ -6918,9 +6908,8 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi,
                                        vty_out(vty, "%*s",
                                                max_neighbor_width - len, " ");
 
-                               vty_out(vty,
-                                       "4 %10u %7d %7d %8" PRIu64
-                                       " %4d %4zd %8s",
+                               vty_out(vty, "4 %10u %7d %7d %8" PRIu64
+                                            " %4d %4zd %8s",
                                        peer->as,
                                        peer->open_in + peer->update_in
                                                + peer->keepalive_in
@@ -6968,9 +6957,8 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi,
                json_object_int_add(json, "totalPeers", count);
                json_object_int_add(json, "dynamicPeers", dn_count);
 
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        } else {
                if (count)
@@ -7065,9 +7053,10 @@ static void bgp_show_summary_afi_safi(struct vty *vty, struct bgp *bgp, int afi,
                        }
                        safi++;
                        if (safi == SAFI_RESERVED_4
-                           || safi == SAFI_RESERVED_5) /* handle special
-                                                          cases to match
-                                                          zebra.h */
+                           || safi
+                                      == SAFI_RESERVED_5) /* handle special
+                                                             cases to match
+                                                             zebra.h */
                                safi++;
                        if (!safi_wildcard)
                                safi = SAFI_MAX;
@@ -7626,9 +7615,8 @@ static void bgp_show_peer_afi(struct vty *vty, struct peer *p, afi_t afi,
 
                paf = peer_af_find(p, afi, safi);
                if (paf && PAF_SUBGRP(paf)) {
-                       vty_out(vty,
-                               "  Update group %" PRIu64 ", subgroup %" PRIu64
-                               "\n",
+                       vty_out(vty, "  Update group %" PRIu64
+                                    ", subgroup %" PRIu64 "\n",
                                PAF_UPDGRP(paf)->id, PAF_SUBGRP(paf)->id);
                        vty_out(vty, "  Packet Queue length %d\n",
                                bpacket_queue_virtual_length(paf));
@@ -9394,9 +9382,8 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, u_char use_json,
                        } else
                                vty_out(vty,
                                        "  Reduce the no. of prefix from %s, will restart in %ld seconds\n",
-                                       p->host,
-                                       thread_timer_remain_second(
-                                               p->t_pmax_restart));
+                                       p->host, thread_timer_remain_second(
+                                                        p->t_pmax_restart));
                } else {
                        if (use_json)
                                json_object_boolean_true_add(
@@ -9636,9 +9623,8 @@ static int bgp_show_neighbor(struct vty *vty, struct bgp *bgp,
        }
 
        if (use_json) {
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        } else {
                vty_out(vty, "\n");
@@ -11093,45 +11079,31 @@ int bgp_config_write_redistribute(struct vty *vty, struct bgp *bgp, afi_t afi,
 
 /* BGP node structure. */
 static struct cmd_node bgp_node = {
-       BGP_NODE,
-       "%s(config-router)# ",
-       1,
+       BGP_NODE, "%s(config-router)# ", 1,
 };
 
 static struct cmd_node bgp_ipv4_unicast_node = {
-       BGP_IPV4_NODE,
-       "%s(config-router-af)# ",
-       1,
+       BGP_IPV4_NODE, "%s(config-router-af)# ", 1,
 };
 
 static struct cmd_node bgp_ipv4_multicast_node = {
-       BGP_IPV4M_NODE,
-       "%s(config-router-af)# ",
-       1,
+       BGP_IPV4M_NODE, "%s(config-router-af)# ", 1,
 };
 
 static struct cmd_node bgp_ipv4_labeled_unicast_node = {
-       BGP_IPV4L_NODE,
-       "%s(config-router-af)# ",
-       1,
+       BGP_IPV4L_NODE, "%s(config-router-af)# ", 1,
 };
 
 static struct cmd_node bgp_ipv6_unicast_node = {
-       BGP_IPV6_NODE,
-       "%s(config-router-af)# ",
-       1,
+       BGP_IPV6_NODE, "%s(config-router-af)# ", 1,
 };
 
 static struct cmd_node bgp_ipv6_multicast_node = {
-       BGP_IPV6M_NODE,
-       "%s(config-router-af)# ",
-       1,
+       BGP_IPV6M_NODE, "%s(config-router-af)# ", 1,
 };
 
 static struct cmd_node bgp_ipv6_labeled_unicast_node = {
-       BGP_IPV6L_NODE,
-       "%s(config-router-af)# ",
-       1,
+       BGP_IPV6L_NODE, "%s(config-router-af)# ", 1,
 };
 
 static struct cmd_node bgp_vpnv4_node = {BGP_VPNV4_NODE,
index be3c6eea3a2418a305de3a0807866b8dbc7c97e7..8bf5477a61673d5bccfbadde69ec64a89415c45f 100644 (file)
@@ -621,12 +621,10 @@ static int zebra_read_ipv4(int command, struct zclient *zclient,
                        zlog_debug(
                                "Rx IPv4 route add VRF %u %s[%d] %s/%d nexthop %s metric %u tag %" ROUTE_TAG_PRI,
                                vrf_id, zebra_route_string(api.type),
-                               api.instance,
-                               inet_ntop(AF_INET, &p.prefix, buf[0],
-                                         sizeof(buf[0])),
-                               p.prefixlen,
-                               inet_ntop(AF_INET, &nexthop, buf[1],
-                                         sizeof(buf[1])),
+                               api.instance, inet_ntop(AF_INET, &p.prefix,
+                                                       buf[0], sizeof(buf[0])),
+                               p.prefixlen, inet_ntop(AF_INET, &nexthop,
+                                                      buf[1], sizeof(buf[1])),
                                api.metric, api.tag);
                }
 
@@ -657,12 +655,10 @@ static int zebra_read_ipv4(int command, struct zclient *zclient,
                                "Rx IPv4 route delete VRF %u %s[%d] %s/%d "
                                "nexthop %s metric %u tag %" ROUTE_TAG_PRI,
                                vrf_id, zebra_route_string(api.type),
-                               api.instance,
-                               inet_ntop(AF_INET, &p.prefix, buf[0],
-                                         sizeof(buf[0])),
-                               p.prefixlen,
-                               inet_ntop(AF_INET, &nexthop, buf[1],
-                                         sizeof(buf[1])),
+                               api.instance, inet_ntop(AF_INET, &p.prefix,
+                                                       buf[0], sizeof(buf[0])),
+                               p.prefixlen, inet_ntop(AF_INET, &nexthop,
+                                                      buf[1], sizeof(buf[1])),
                                api.metric, api.tag);
                }
                bgp_redistribute_delete(bgp, (struct prefix *)&p, api.type,
@@ -752,12 +748,10 @@ static int zebra_read_ipv6(int command, struct zclient *zclient,
                        zlog_debug(
                                "Rx IPv6 route add VRF %u %s[%d] %s/%d nexthop %s metric %u tag %" ROUTE_TAG_PRI,
                                vrf_id, zebra_route_string(api.type),
-                               api.instance,
-                               inet_ntop(AF_INET6, &p.prefix, buf[0],
-                                         sizeof(buf[0])),
-                               p.prefixlen,
-                               inet_ntop(AF_INET, &nexthop, buf[1],
-                                         sizeof(buf[1])),
+                               api.instance, inet_ntop(AF_INET6, &p.prefix,
+                                                       buf[0], sizeof(buf[0])),
+                               p.prefixlen, inet_ntop(AF_INET, &nexthop,
+                                                      buf[1], sizeof(buf[1])),
                                api.metric, api.tag);
                }
 
@@ -787,12 +781,10 @@ static int zebra_read_ipv6(int command, struct zclient *zclient,
                                "Rx IPv6 route delete VRF %u %s[%d] %s/%d "
                                "nexthop %s metric %u tag %" ROUTE_TAG_PRI,
                                vrf_id, zebra_route_string(api.type),
-                               api.instance,
-                               inet_ntop(AF_INET6, &p.prefix, buf[0],
-                                         sizeof(buf[0])),
-                               p.prefixlen,
-                               inet_ntop(AF_INET6, &nexthop, buf[1],
-                                         sizeof(buf[1])),
+                               api.instance, inet_ntop(AF_INET6, &p.prefix,
+                                                       buf[0], sizeof(buf[0])),
+                               p.prefixlen, inet_ntop(AF_INET6, &nexthop,
+                                                      buf[1], sizeof(buf[1])),
                                api.metric, api.tag);
                }
                bgp_redistribute_delete(bgp, (struct prefix *)&p, api.type,
@@ -1324,9 +1316,8 @@ void bgp_zebra_announce(struct bgp_node *rn, struct prefix *p,
                                "Tx IPv4 route %s VRF %u %s/%d metric %u tag %" ROUTE_TAG_PRI
                                " count %d",
                                (valid_nh_count ? "add" : "delete"),
-                               bgp->vrf_id,
-                               inet_ntop(AF_INET, &p->u.prefix4, buf[0],
-                                         sizeof(buf[0])),
+                               bgp->vrf_id, inet_ntop(AF_INET, &p->u.prefix4,
+                                                      buf[0], sizeof(buf[0])),
                                p->prefixlen, api.metric, api.tag,
                                api.nexthop_num);
                        for (i = 0; i < api.nexthop_num; i++) {
index 0c5b88d74d537c7ba4953d7e1da80468abdffd80..3453da665a0f7922ab37b6d1b9f11456100d5497 100644 (file)
@@ -3886,9 +3886,8 @@ static int peer_af_flag_modify(struct peer *peer, afi_t afi, safi_t safi,
        }
 
        /* Track if addpath TX is in use */
-       if (flag
-           & (PEER_FLAG_ADDPATH_TX_ALL_PATHS
-              | PEER_FLAG_ADDPATH_TX_BESTPATH_PER_AS)) {
+       if (flag & (PEER_FLAG_ADDPATH_TX_ALL_PATHS
+                   | PEER_FLAG_ADDPATH_TX_BESTPATH_PER_AS)) {
                bgp = peer->bgp;
                addpath_tx_used = 0;
 
@@ -6758,9 +6757,8 @@ static void bgp_config_write_peer_af(struct vty *vty, struct bgp *bgp,
        } else {
                if (!peer_af_flag_check(peer, afi, safi,
                                        PEER_FLAG_SEND_COMMUNITY)
-                   && (!g_peer
-                       || peer_af_flag_check(g_peer, afi, safi,
-                                             PEER_FLAG_SEND_COMMUNITY))
+                   && (!g_peer || peer_af_flag_check(g_peer, afi, safi,
+                                                     PEER_FLAG_SEND_COMMUNITY))
                    && !peer_af_flag_check(peer, afi, safi,
                                           PEER_FLAG_SEND_EXT_COMMUNITY)
                    && (!g_peer
@@ -6768,10 +6766,9 @@ static void bgp_config_write_peer_af(struct vty *vty, struct bgp *bgp,
                                              PEER_FLAG_SEND_EXT_COMMUNITY))
                    && !peer_af_flag_check(peer, afi, safi,
                                           PEER_FLAG_SEND_LARGE_COMMUNITY)
-                   && (!g_peer
-                       || peer_af_flag_check(
-                                  g_peer, afi, safi,
-                                  PEER_FLAG_SEND_LARGE_COMMUNITY))) {
+                   && (!g_peer || peer_af_flag_check(
+                                          g_peer, afi, safi,
+                                          PEER_FLAG_SEND_LARGE_COMMUNITY))) {
                        afi_header_vty_out(
                                vty, afi, safi, write,
                                "  no neighbor %s send-community all\n", addr);
@@ -6802,10 +6799,9 @@ static void bgp_config_write_peer_af(struct vty *vty, struct bgp *bgp,
 
                        if (!peer_af_flag_check(peer, afi, safi,
                                                PEER_FLAG_SEND_COMMUNITY)
-                           && (!g_peer
-                               || peer_af_flag_check(
-                                          g_peer, afi, safi,
-                                          PEER_FLAG_SEND_COMMUNITY))) {
+                           && (!g_peer || peer_af_flag_check(
+                                                  g_peer, afi, safi,
+                                                  PEER_FLAG_SEND_COMMUNITY))) {
                                afi_header_vty_out(
                                        vty, afi, safi, write,
                                        "  no neighbor %s send-community\n",
index c6c14420e69fa006289ba85ae77aa66f5ae6fb4e..67b8289c70bccbeddb890c88ff21b9cab2de3fc0 100644 (file)
@@ -251,14 +251,13 @@ struct bgp {
                               /* $FRR indent$ */
                               /* clang-format off */
 #define BGP_MAXMED_ADMIN_UNCONFIGURED  0 /* Off by default */
-       u_int32_t maxmed_admin_value; /* Max-med value when administrative in on
+       u_int32_t
+               maxmed_admin_value; /* Max-med value when administrative in on
                                       */
-                                     /* $FRR indent$ */
-                                     /* clang-format off */
 #define BGP_MAXMED_VALUE_DEFAULT  4294967294 /* Maximum by default */
 
-       u_char maxmed_active;    /* 1/0 if max-med is active or not */
-       u_int32_t maxmed_value;       /* Max-med value when its active */
+       u_char maxmed_active;   /* 1/0 if max-med is active or not */
+       u_int32_t maxmed_value; /* Max-med value when its active */
 
        /* BGP update delay on startup */
        struct thread *t_update_delay;
index ba4c703e96290bec61416eb57700390ea802cdb2..8a93d3984efb42d2c91fd7008aba5360498b5125 100644 (file)
@@ -503,8 +503,9 @@ DEFUN (vnc_defaults_responselifetime,
        } else {
                rspint = strtoul(argv[1]->arg, NULL, 10);
                if (rspint > INT32_MAX)
-                       rspint = INT32_MAX; /* is really an int, not an unsigned
-                                              int */
+                       rspint =
+                               INT32_MAX; /* is really an int, not an unsigned
+                                             int */
        }
 
        bgp->rfapi_cfg->default_response_lifetime = rspint;
@@ -1673,9 +1674,8 @@ DEFUN (vnc_nve_group_export_no_prefixlist,
        }
 
        if (argv[2]->arg[0] == 'b') {
-               if (((argc > 5)
-                    && strmatch(argv[5]->text,
-                                rfg->plist_export_bgp_name[afi]))
+               if (((argc > 5) && strmatch(argv[5]->text,
+                                           rfg->plist_export_bgp_name[afi]))
                    || (argc <= 5)) {
 
                        if (rfg->plist_export_bgp_name[afi])
@@ -1686,9 +1686,8 @@ DEFUN (vnc_nve_group_export_no_prefixlist,
                        vnc_direct_bgp_reexport_group_afi(bgp, rfg, afi);
                }
        } else {
-               if (((argc > 5)
-                    && strmatch(argv[5]->text,
-                                rfg->plist_export_zebra_name[afi]))
+               if (((argc > 5) && strmatch(argv[5]->text,
+                                           rfg->plist_export_zebra_name[afi]))
                    || (argc <= 5)) {
                        if (rfg->plist_export_zebra_name[afi])
                                free(rfg->plist_export_zebra_name[afi]);
@@ -1792,9 +1791,8 @@ DEFUN (vnc_nve_group_export_no_routemap,
                        vnc_direct_bgp_reexport_group_afi(bgp, rfg, AFI_IP6);
                }
        } else {
-               if (((argc > 4)
-                    && strmatch(argv[4]->text,
-                                rfg->routemap_export_zebra_name))
+               if (((argc > 4) && strmatch(argv[4]->text,
+                                           rfg->routemap_export_zebra_name))
                    || (argc <= 4)) {
                        if (rfg->routemap_export_zebra_name)
                                free(rfg->routemap_export_zebra_name);
@@ -2447,9 +2445,8 @@ bgp_rfapi_delete_named_nve_group(struct vty *vty, /* NULL = no output */
         */
        for (ALL_LIST_ELEMENTS_RO(bgp->rfapi_cfg->rfg_export_direct_bgp_l, node,
                                  rfgn)) {
-               if (rfg_name == NULL
-                   || (type == RFAPI_GROUP_CFG_NVE
-                       && !strcmp(rfgn->name, rfg_name))) {
+               if (rfg_name == NULL || (type == RFAPI_GROUP_CFG_NVE
+                                        && !strcmp(rfgn->name, rfg_name))) {
                        rfgn->rfg = NULL;
                        /* remove exported routes from this group */
                        vnc_direct_bgp_del_group(bgp, rfg);
@@ -2463,9 +2460,8 @@ bgp_rfapi_delete_named_nve_group(struct vty *vty, /* NULL = no output */
        for (ALL_LIST_ELEMENTS_RO(bgp->rfapi_cfg->rfg_export_zebra_l, node,
                                  rfgn)) {
 
-               if (rfg_name == NULL
-                   || (type == RFAPI_GROUP_CFG_NVE
-                       && !strcmp(rfgn->name, rfg_name))) {
+               if (rfg_name == NULL || (type == RFAPI_GROUP_CFG_NVE
+                                        && !strcmp(rfgn->name, rfg_name))) {
                        rfgn->rfg = NULL;
                        /* remove exported routes from this group */
                        vnc_zebra_del_group(bgp, rfg);
index f8096211236f91ddd707edc0c6a943412be49514..3a2a608a7c6422b12b66e1d2098e0e20a152b071 100644 (file)
@@ -2603,9 +2603,8 @@ int rfapi_register(void *handle, struct rfapi_ip_prefix *prefix,
                        ZEBRA_ROUTE_BGP, BGP_ROUTE_RFP, NULL,
                        action == RFAPI_REGISTER_KILL);
 
-               if (0
-                   == rfapiApDelete(bgp, rfd, &p, pfx_mac, &prd,
-                                    &adv_tunnel)) {
+               if (0 == rfapiApDelete(bgp, rfd, &p, pfx_mac, &prd,
+                                      &adv_tunnel)) {
                        if (adv_tunnel)
                                rfapiTunnelRouteAnnounce(
                                        bgp, rfd, &rfd->max_prefix_lifetime);
index d16d578ac8ed090b472315e4c202629d1417de59..d0379e1ef8d1311dc5848149eebf38755ed5e42a 100644 (file)
@@ -1,22 +1,22 @@
 /*
- *
- * Copyright 2009-2016, LabN Consulting, L.L.C.
- *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
+*
+* Copyright 2009-2016, LabN Consulting, L.L.C.
+*
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License along
+* with this program; see the file COPYING; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
 
 /*
  * File:       rfapi_import.c
@@ -1086,8 +1086,9 @@ int rfapiEcommunityGetEthernetTag(struct ecommunity *ecom, uint16_t *tag_id)
                                } else if (encode == ECOMMUNITY_ENCODE_AS) {
                                        as = (*p++ << 8);
                                        as |= (*p++);
-                                       p += 2; /* skip next two, tag/vid
-                                                  always in lowest bytes */
+                                       p +=
+                                               2; /* skip next two, tag/vid
+                                                     always in lowest bytes */
                                }
                                if (as == bgp->as) {
                                        *tag_id = *p++ << 8;
@@ -2010,9 +2011,8 @@ static void rfapiBgpInfoAttachSorted(struct route_node *rn,
 
        for (prev = NULL, next = rn->info; next;
             prev = next, next = next->next) {
-               if (!bgp
-                   || (!CHECK_FLAG(info_new->flags, BGP_INFO_REMOVED)
-                       && CHECK_FLAG(next->flags, BGP_INFO_REMOVED))
+               if (!bgp || (!CHECK_FLAG(info_new->flags, BGP_INFO_REMOVED)
+                            && CHECK_FLAG(next->flags, BGP_INFO_REMOVED))
                    || bgp_info_cmp_compatible(bgp, info_new, next, pfx_buf,
                                               afi, safi)
                               == -1) { /* -1 if 1st is better */
@@ -3554,10 +3554,9 @@ void rfapiBgpInfoFilteredImportVPN(
 
                                vnc_zlog_debug_verbose(
                                        "%s: withdrawing at prefix %s/%d%s",
-                                       __func__,
-                                       rfapi_ntop(rn->p.family,
-                                                  &rn->p.u.prefix, buf,
-                                                  BUFSIZ),
+                                       __func__, rfapi_ntop(rn->p.family,
+                                                            &rn->p.u.prefix,
+                                                            buf, BUFSIZ),
                                        rn->p.prefixlen,
                                        (washolddown
                                                 ? " (already being withdrawn)"
@@ -4024,7 +4023,7 @@ void rfapiProcessWithdraw(struct peer *peer, void *rfd, struct prefix *p,
                                p,                       /* aux_prefix: IP */
                                AFI_L2VPN, prd, attr, type, 0,
                                NULL); /* sub_type & label unused for withdraw
-                                       */
+                                         */
                }
        }
 
@@ -4311,8 +4310,9 @@ void bgp_rfapi_destroy(struct bgp *bgp, struct rfapi *h)
                void *cursor;
                int rc;
 
-               for (cursor = NULL, rc = skiplist_next(h->import_mac, NULL,
-                                                      (void **)&it, &cursor);
+               for (cursor = NULL,
+                   rc = skiplist_next(h->import_mac, NULL, (void **)&it,
+                                      &cursor);
                     !rc; rc = skiplist_next(h->import_mac, NULL, (void **)&it,
                                             &cursor)) {
 
@@ -4711,8 +4711,9 @@ void rfapiDeleteRemotePrefixes(struct prefix *un, struct prefix *vn,
                void *cursor = NULL;
                int rc;
 
-               for (cursor = NULL, rc = skiplist_next(h->import_mac, NULL,
-                                                      (void **)&it, &cursor);
+               for (cursor = NULL,
+                   rc = skiplist_next(h->import_mac, NULL, (void **)&it,
+                                      &cursor);
                     !rc; rc = skiplist_next(h->import_mac, NULL, (void **)&it,
                                             &cursor)) {
 
@@ -4805,8 +4806,9 @@ void rfapiCountAllItRoutes(int *pALRcount, /* active local routes */
        int rc;
 
        if (h->import_mac) {
-               for (cursor = NULL, rc = skiplist_next(h->import_mac, NULL,
-                                                      (void **)&it, &cursor);
+               for (cursor = NULL,
+                   rc = skiplist_next(h->import_mac, NULL, (void **)&it,
+                                      &cursor);
                     !rc; rc = skiplist_next(h->import_mac, NULL, (void **)&it,
                                             &cursor)) {
 
index 5a1b29e5985d5504ca46cf9514e73dbe04446aab..9c0d9da6ff916332e7a2208a58ab7b78ba7c5389 100644 (file)
@@ -1339,11 +1339,10 @@ struct route_node *rfapiMonitorEthAdd(struct bgp *bgp,
        {
                char buf[BUFSIZ];
 
-               vnc_zlog_debug_verbose("%s: LNI=%d: rfd=%p, pfx=%s", __func__,
-                                      logical_net_id, rfd,
-                                      rfapi_ntop(pfx_mac_buf.family,
-                                                 pfx_mac_buf.u.val, buf,
-                                                 BUFSIZ));
+               vnc_zlog_debug_verbose(
+                       "%s: LNI=%d: rfd=%p, pfx=%s", __func__, logical_net_id,
+                       rfd, rfapi_ntop(pfx_mac_buf.family, pfx_mac_buf.u.val,
+                                       buf, BUFSIZ));
        }
 
 
index 58da84ea32d7b501a535ce7657ae2bcdf7ae4812..a414df1ab4c89c3b17e8fedadfe81a398b976703 100644 (file)
@@ -527,11 +527,11 @@ void rfapiRibClear(struct rfapi_descriptor *rfd)
 
                                        struct rfapi_info *ri;
 
-                                       while (0
-                                              == skiplist_first(
-                                                         (struct skiplist *)
-                                                                 rn->info,
-                                                         NULL, (void **)&ri)) {
+                                       while (0 == skiplist_first(
+                                                           (struct skiplist *)
+                                                                   rn->info,
+                                                           NULL,
+                                                           (void **)&ri)) {
 
                                                rfapi_info_free(ri);
                                                skiplist_delete_first(
@@ -2449,7 +2449,7 @@ void rfapiRibShowResponses(void *stream, struct prefix *pfx_match,
 #else
                                           "Remaining"
 #endif
-                                       );
+                                          );
                                }
                                if (!printednve) {
                                        char str_vn[BUFSIZ];
index 0fab2e70050b4a646db7b12a03f2d4c838e193b2..117d4fbfd4de27e766e69040a7f0d06092e3dccb 100644 (file)
@@ -2009,7 +2009,7 @@ void vnc_import_bgp_exterior_del_route(
                                                        bgp_info_unlock(info);
                                                        route_unlock_node(
                                                                rn); /* sl entry
-                                                                     */
+                                                                       */
                                                }
                                                if (skiplist_empty(
                                                            RFAPI_MONITOR_EXTERIOR(
index 69529c722e1ed7f4b8ad5fe00802313afb19a2a5..3075d4109fb0ece805e73fa14aed883676e73278 100644 (file)
@@ -375,9 +375,8 @@ static int vnc_zebra_read_ipv4(int command, struct zclient *zclient,
                                __func__, zebra_route_string(api.type),
                                inet_ntop(AF_INET, &p.prefix, buf[0],
                                          sizeof(buf[0])),
-                               p.prefixlen,
-                               inet_ntop(AF_INET, &nexthop, buf[1],
-                                         sizeof(buf[1])),
+                               p.prefixlen, inet_ntop(AF_INET, &nexthop,
+                                                      buf[1], sizeof(buf[1])),
                                api.metric);
                }
                vnc_redistribute_add((struct prefix *)&p, &nexthop, api.metric,
@@ -391,9 +390,8 @@ static int vnc_zebra_read_ipv4(int command, struct zclient *zclient,
                                __func__, zebra_route_string(api.type),
                                inet_ntop(AF_INET, &p.prefix, buf[0],
                                          sizeof(buf[0])),
-                               p.prefixlen,
-                               inet_ntop(AF_INET, &nexthop, buf[1],
-                                         sizeof(buf[1])),
+                               p.prefixlen, inet_ntop(AF_INET, &nexthop,
+                                                      buf[1], sizeof(buf[1])),
                                api.metric);
                }
                vnc_redistribute_delete((struct prefix *)&p, api.type);
index 7f312d9808b9fcbdc8532fb666111af5d05f027a..2312cc6eddbc0064938171630b18b4e02551c743 100644 (file)
@@ -552,9 +552,8 @@ struct eigrp_interface *eigrp_if_lookup_recv_if(struct eigrp *eigrp,
 
                if (prefix_match(CONNECTED_PREFIX(ei->connected),
                                 (struct prefix *)&addr)) {
-                       if ((match == NULL)
-                           || (match->address->prefixlen
-                               < ei->address->prefixlen))
+                       if ((match == NULL) || (match->address->prefixlen
+                                               < ei->address->prefixlen))
                                match = ei;
                }
        }
index d593f5ceea2769ba27ba704773171613014a0f5e..bc8bbb445042ffa67ff60cda241a100d43a2447d 100644 (file)
@@ -68,9 +68,7 @@
 
 /* eigprd privileges */
 zebra_capabilities_t _caps_p[] = {
-       ZCAP_NET_RAW,
-       ZCAP_BIND,
-       ZCAP_NET_ADMIN,
+       ZCAP_NET_RAW, ZCAP_BIND, ZCAP_NET_ADMIN,
 };
 
 struct zebra_privs_t eigrpd_privs = {
index 1cbd06df6c15386237759f3088be06336ba5e8f2..f20ec0ad12e581ed726900cdcd060b176d203653 100644 (file)
@@ -134,9 +134,8 @@ int eigrp_make_md5_digest(struct eigrp_interface *ei, struct stream *s,
                        MD5Update(&ctx, zeropad, 16 - strlen(key->string));
                if (backup_end > (EIGRP_HEADER_LEN + EIGRP_AUTH_MD5_TLV_SIZE)) {
                        MD5Update(&ctx,
-                                 ibuf
-                                         + (EIGRP_HEADER_LEN
-                                            + EIGRP_AUTH_MD5_TLV_SIZE),
+                                 ibuf + (EIGRP_HEADER_LEN
+                                         + EIGRP_AUTH_MD5_TLV_SIZE),
                                  backup_end - 20
                                          - (EIGRP_HEADER_LEN
                                             + EIGRP_AUTH_MD5_TLV_SIZE));
@@ -209,9 +208,8 @@ int eigrp_check_md5_digest(struct stream *s,
                        MD5Update(&ctx, zeropad, 16 - strlen(key->string));
                if (backup_end > (EIGRP_HEADER_LEN + EIGRP_AUTH_MD5_TLV_SIZE)) {
                        MD5Update(&ctx,
-                                 ibuf
-                                         + (EIGRP_HEADER_LEN
-                                            + EIGRP_AUTH_MD5_TLV_SIZE),
+                                 ibuf + (EIGRP_HEADER_LEN
+                                         + EIGRP_AUTH_MD5_TLV_SIZE),
                                  backup_end - 20
                                          - (EIGRP_HEADER_LEN
                                             + EIGRP_AUTH_MD5_TLV_SIZE));
@@ -328,9 +326,9 @@ int eigrp_write(struct thread *thread)
        struct listnode *node;
 #ifdef WANT_EIGRP_WRITE_FRAGMENT
        static u_int16_t ipid = 0;
-#endif  /* WANT_EIGRP_WRITE_FRAGMENT */
-       /* $FRR indent$ */
-       /* clang-format off */
+#endif /* WANT_EIGRP_WRITE_FRAGMENT */
+       /* $FRR indent$ */
+/* clang-format off */
 #define EIGRP_WRITE_IPHL_SHIFT 2
 
        eigrp->t_write = NULL;
index 0823201fec4e0e63c8196b03c0acae9a1091258d..b645ed198784babf9964edf5040c2e741d2a0c20 100644 (file)
@@ -644,9 +644,7 @@ static void route_set_metric_free(void *rule)
 
 /* Set metric rule structure. */
 static struct route_map_rule_cmd route_set_metric_cmd = {
-       "metric",
-       route_set_metric,
-       route_set_metric_compile,
+       "metric", route_set_metric, route_set_metric_compile,
        route_set_metric_free,
 };
 
@@ -778,8 +776,7 @@ DEFUN (no_match_metric,
 }
 
 ALIAS(no_match_metric, no_match_metric_val_cmd,
-      "no match metric <0-4294967295>",
-      NO_STR MATCH_STR
+      "no match metric <0-4294967295>", NO_STR MATCH_STR
       "Match metric of route\n"
       "Metric value\n")
 
@@ -842,8 +839,7 @@ DEFUN (no_match_ip_next_hop,
 }
 
 ALIAS(no_match_ip_next_hop, no_match_ip_next_hop_val_cmd,
-      "no match ip next-hop (<1-199>|<1300-2699>|WORD)",
-      NO_STR MATCH_STR IP_STR
+      "no match ip next-hop (<1-199>|<1300-2699>|WORD)", NO_STR MATCH_STR IP_STR
       "Match next-hop address of route\n"
       "IP access-list number\n"
       "IP access-list number (expanded range)\n"
@@ -881,8 +877,7 @@ DEFUN (no_match_ip_next_hop_prefix_list,
 
 ALIAS(no_match_ip_next_hop_prefix_list,
       no_match_ip_next_hop_prefix_list_val_cmd,
-      "no match ip next-hop prefix-list WORD",
-      NO_STR MATCH_STR IP_STR
+      "no match ip next-hop prefix-list WORD", NO_STR MATCH_STR IP_STR
       "Match next-hop address of route\n"
       "Match entries of prefix-lists\n"
       "IP prefix-list name\n")
@@ -916,8 +911,7 @@ DEFUN (no_match_ip_address,
 }
 
 ALIAS(no_match_ip_address, no_match_ip_address_val_cmd,
-      "no match ip address (<1-199>|<1300-2699>|WORD)",
-      NO_STR MATCH_STR IP_STR
+      "no match ip address (<1-199>|<1300-2699>|WORD)", NO_STR MATCH_STR IP_STR
       "Match address of route\n"
       "IP access-list number\n"
       "IP access-list number (expanded range)\n"
@@ -954,8 +948,7 @@ DEFUN (no_match_ip_address_prefix_list,
 }
 
 ALIAS(no_match_ip_address_prefix_list, no_match_ip_address_prefix_list_val_cmd,
-      "no match ip address prefix-list WORD",
-      NO_STR MATCH_STR IP_STR
+      "no match ip address prefix-list WORD", NO_STR MATCH_STR IP_STR
       "Match address of route\n"
       "Match entries of prefix-lists\n"
       "IP prefix-list name\n")
@@ -1000,8 +993,7 @@ DEFUN (set_metric,
        return eigrp_route_set_add(vty, vty->index, "metric", argv[0]);
 }
 
-ALIAS(set_metric, set_metric_addsub_cmd, "set metric <+/-metric>",
-      SET_STR
+ALIAS(set_metric, set_metric_addsub_cmd, "set metric <+/-metric>", SET_STR
       "Metric value for destination routing protocol\n"
       "Add or subtract metric\n")
 
@@ -1019,8 +1011,7 @@ DEFUN (no_set_metric,
 }
 
 ALIAS(no_set_metric, no_set_metric_val_cmd,
-      "no set metric (<0-4294967295>|<+/-metric>)",
-      NO_STR SET_STR
+      "no set metric (<0-4294967295>|<+/-metric>)", NO_STR SET_STR
       "Metric value for destination routing protocol\n"
       "Metric value\n"
       "Add or subtract metric\n")
@@ -1061,8 +1052,7 @@ DEFUN (no_set_ip_nexthop,
 }
 
 ALIAS(no_set_ip_nexthop, no_set_ip_nexthop_val_cmd,
-      "no set ip next-hop A.B.C.D",
-      NO_STR SET_STR IP_STR
+      "no set ip next-hop A.B.C.D", NO_STR SET_STR IP_STR
       "Next hop address\n"
       "IP address of next hop\n")
 
@@ -1089,8 +1079,7 @@ DEFUN (no_set_tag,
        return eigrp_route_set_delete(vty, vty->index, "tag", argv[0]);
 }
 
-ALIAS(no_set_tag, no_set_tag_val_cmd, "no set tag <0-65535>",
-      NO_STR SET_STR
+ALIAS(no_set_tag, no_set_tag_val_cmd, "no set tag <0-65535>", NO_STR SET_STR
       "Tag value for routing protocol\n"
       "Tag value\n")
 
index bc87b076bbc89b9cb69135f4dfbfa405381959b6..6b3a14abc5664671d8a42f3da83d347f1d9d966f 100644 (file)
@@ -104,8 +104,9 @@ struct eigrp {
 
        uint64_t serno; /* Global serial number counter for topology entry
                           changes*/
-       uint64_t serno_last_update; /* Highest serial number of information send
-                                      by last update*/
+       uint64_t
+               serno_last_update; /* Highest serial number of information send
+                                     by last update*/
        struct list *topology_changes_internalIPV4;
        struct list *topology_changes_externalIPV4;
 
index 88a6ccf2a8e069e8a9cb151cd734dd42a8d23f87..3c2ce6ce428e37a4a7ff7ab6c19a509569aba6b0 100644 (file)
@@ -771,8 +771,8 @@ void eigrp_update_send_all(struct eigrp *eigrp,
 /**
  * @fn eigrp_update_send_GR_part
  *
- * @param[in]          nbr             contains neighbor who would receive
- * Graceful restart
+ * @param[in]          nbr             contains neighbor who would receive Graceful
+ * restart
  *
  * @return void
  *
@@ -1034,8 +1034,8 @@ int eigrp_update_send_GR_thread(struct thread *thread)
 /**
  * @fn eigrp_update_send_GR
  *
- * @param[in]          nbr                     Neighbor who would receive
- * Graceful restart
+ * @param[in]          nbr                     Neighbor who would receive Graceful
+ * restart
  * @param[in]          gr_type         Who executed Graceful restart
  * @param[in]          vty             Virtual terminal for log output
  *
@@ -1094,8 +1094,8 @@ void eigrp_update_send_GR(struct eigrp_neighbor *nbr, enum GR_type gr_type,
 /**
  * @fn eigrp_update_send_interface_GR
  *
- * @param[in]          ei                      Interface to neighbors of which the
- * GR is sent
+ * @param[in]          ei                      Interface to neighbors of which the GR
+ * is sent
  * @param[in]          gr_type         Who executed Graceful restart
  * @param[in]          vty             Virtual terminal for log output
  *
index 5da2a741a74a2d84ac3ecee0287b21190a4a81d8..f09a8152a836a6109fd0d10d74d47c4c272eae60 100644 (file)
@@ -441,7 +441,7 @@ dnode_t *dict_lookup(dict_t *dict, const void *key)
                        root = root->right;
                else {
                        if (!dict->dupes) { /* no duplicates, return match
-                                            */
+                                              */
                                return root;
                        } else { /* could be dupes, find leftmost one   */
                                do {
index 7214f3109323f991bd3253a80211bf6ce9c900d2..d8cb32375bec3506581ba8901b27b7d37c2a33c9 100644 (file)
@@ -446,10 +446,9 @@ void isis_adj_print_vty(struct isis_adjacency *adj, struct vty *vty,
                                        adj->dis_record[ISIS_LEVELS + level - 1]
                                                .dis),
                                adj->dischanges[level - 1],
-                               time2string(now
-                                           - (adj->dis_record[ISIS_LEVELS
-                                                              + level - 1]
-                                                      .last_dis_change)));
+                               time2string(now - (adj->dis_record[ISIS_LEVELS
+                                                                  + level - 1]
+                                                          .last_dis_change)));
                }
                vty_out(vty, "\n");
 
index de2c453aeebdfd1916db965876c28fbe2d2f47ca..72810532b01a83026a658b13a9869a16164362c6 100644 (file)
@@ -1270,9 +1270,7 @@ int isis_circuit_passwd_hmac_md5_set(struct isis_circuit *circuit,
                                       passwd);
 }
 struct cmd_node interface_node = {
-       INTERFACE_NODE,
-       "%s(config-if)# ",
-       1,
+       INTERFACE_NODE, "%s(config-if)# ", 1,
 };
 
 int isis_circuit_circ_type_set(struct isis_circuit *circuit, int circ_type)
index e86b9d93e44ded5a793ba1f9860fdf5e848e50a8..40c6141ab8128a5bdbea2085388a9c4fdab0fb3f 100644 (file)
@@ -838,30 +838,26 @@ static void lsp_print_mt_ipv6_reach(struct list *list, struct vty *vty,
                if (mtid == ISIS_MT_IPV4_UNICAST) {
                        if ((ipv6_reach->control_info & CTRL_INFO_DISTRIBUTION)
                            == DISTRIBUTION_INTERNAL)
-                               vty_out(vty,
-                                       "  Metric      : %-8" PRIu32
-                                       " IPv6-Internal : %s/%d\n",
+                               vty_out(vty, "  Metric      : %-8" PRIu32
+                                            " IPv6-Internal : %s/%d\n",
                                        ntohl(ipv6_reach->metric), buff,
                                        ipv6_reach->prefix_len);
                        else
-                               vty_out(vty,
-                                       "  Metric      : %-8" PRIu32
-                                       " IPv6-External : %s/%d\n",
+                               vty_out(vty, "  Metric      : %-8" PRIu32
+                                            " IPv6-External : %s/%d\n",
                                        ntohl(ipv6_reach->metric), buff,
                                        ipv6_reach->prefix_len);
                } else {
                        if ((ipv6_reach->control_info & CTRL_INFO_DISTRIBUTION)
                            == DISTRIBUTION_INTERNAL)
-                               vty_out(vty,
-                                       "  Metric      : %-8" PRIu32
-                                       " IPv6-MT-Int   : %s/%d %s\n",
+                               vty_out(vty, "  Metric      : %-8" PRIu32
+                                            " IPv6-MT-Int   : %s/%d %s\n",
                                        ntohl(ipv6_reach->metric), buff,
                                        ipv6_reach->prefix_len,
                                        isis_mtid2str(mtid));
                        else
-                               vty_out(vty,
-                                       "  Metric      : %-8" PRIu32
-                                       " IPv6-MT-Ext   : %s/%d %s\n",
+                               vty_out(vty, "  Metric      : %-8" PRIu32
+                                            " IPv6-MT-Ext   : %s/%d %s\n",
                                        ntohl(ipv6_reach->metric), buff,
                                        ipv6_reach->prefix_len,
                                        isis_mtid2str(mtid));
@@ -879,9 +875,8 @@ static void lsp_print_mt_ipv4_reach(struct list *list, struct vty *vty,
                if (mtid == ISIS_MT_IPV4_UNICAST) {
                        /* FIXME: There should be better way to output this
                         * stuff. */
-                       vty_out(vty,
-                               "  Metric      : %-8" PRIu32
-                               " IPv4-Extended : %s/%d\n",
+                       vty_out(vty, "  Metric      : %-8" PRIu32
+                                    " IPv4-Extended : %s/%d\n",
                                ntohl(te_ipv4_reach->te_metric),
                                inet_ntoa(newprefix2inaddr(
                                        &te_ipv4_reach->prefix_start,
@@ -890,9 +885,8 @@ static void lsp_print_mt_ipv4_reach(struct list *list, struct vty *vty,
                } else {
                        /* FIXME: There should be better way to output this
                         * stuff. */
-                       vty_out(vty,
-                               "  Metric      : %-8" PRIu32
-                               " IPv4-MT       : %s/%d %s\n",
+                       vty_out(vty, "  Metric      : %-8" PRIu32
+                                    " IPv4-MT       : %s/%d %s\n",
                                ntohl(te_ipv4_reach->te_metric),
                                inet_ntoa(newprefix2inaddr(
                                        &te_ipv4_reach->prefix_start,
@@ -993,9 +987,8 @@ void lsp_print_detail(struct isis_lsp *lsp, struct vty *vty, char dynhost)
                for (ALL_LIST_ELEMENTS_RO(lsp->tlv_data.is_neighs, lnode,
                                          is_neigh)) {
                        lspid_print(is_neigh->neigh_id, LSPid, dynhost, 0);
-                       vty_out(vty,
-                               "  Metric      : %-8" PRIu8
-                               " IS            : %s\n",
+                       vty_out(vty, "  Metric      : %-8" PRIu8
+                                    " IS            : %s\n",
                                is_neigh->metrics.metric_default, LSPid);
                }
 
@@ -1007,9 +1000,8 @@ void lsp_print_detail(struct isis_lsp *lsp, struct vty *vty, char dynhost)
                               sizeof(ipv4_reach_prefix));
                        memcpy(ipv4_reach_mask, inet_ntoa(ipv4_reach->mask),
                               sizeof(ipv4_reach_mask));
-                       vty_out(vty,
-                               "  Metric      : %-8" PRIu8
-                               " IPv4-Internal : %s %s\n",
+                       vty_out(vty, "  Metric      : %-8" PRIu8
+                                    " IPv4-Internal : %s %s\n",
                                ipv4_reach->metrics.metric_default,
                                ipv4_reach_prefix, ipv4_reach_mask);
                }
@@ -1022,9 +1014,8 @@ void lsp_print_detail(struct isis_lsp *lsp, struct vty *vty, char dynhost)
                               sizeof(ipv4_reach_prefix));
                        memcpy(ipv4_reach_mask, inet_ntoa(ipv4_reach->mask),
                               sizeof(ipv4_reach_mask));
-                       vty_out(vty,
-                               "  Metric      : %-8" PRIu8
-                               " IPv4-External : %s %s\n",
+                       vty_out(vty, "  Metric      : %-8" PRIu8
+                                    " IPv4-External : %s %s\n",
                                ipv4_reach->metrics.metric_default,
                                ipv4_reach_prefix, ipv4_reach_mask);
                }
@@ -2763,9 +2754,9 @@ int lsp_regenerate_schedule_pseudo(struct isis_circuit *circuit, int level)
                THREAD_TIMER_OFF(circuit->u.bc.t_refresh_pseudo_lsp[lvl - 1]);
                diff = now - lsp->last_generated;
                if (diff < circuit->area->lsp_gen_interval[lvl - 1]) {
-                       timeout = 1000
-                                 * (circuit->area->lsp_gen_interval[lvl - 1]
-                                    - diff);
+                       timeout =
+                               1000 * (circuit->area->lsp_gen_interval[lvl - 1]
+                                       - diff);
                        sched_debug(
                                "ISIS (%s): Sechduling in %ld ms to match configured lsp_gen_interval",
                                area->area_tag, timeout);
@@ -2990,9 +2981,9 @@ void lsp_purge_non_exist(int level, struct isis_link_state_hdr *lsp_hdr,
        lsp->level = level;
        lsp->pdu = stream_new(LLC_LEN + area->lsp_mtu);
        lsp->isis_header = (struct isis_fixed_hdr *)STREAM_DATA(lsp->pdu);
-       fill_fixed_hdr(lsp->isis_header, (lsp->level == IS_LEVEL_1)
-                                                ? L1_LINK_STATE
-                                                : L2_LINK_STATE);
+       fill_fixed_hdr(lsp->isis_header,
+                      (lsp->level == IS_LEVEL_1) ? L1_LINK_STATE
+                                                 : L2_LINK_STATE);
        lsp->lsp_header = (struct isis_link_state_hdr *)(STREAM_DATA(lsp->pdu)
                                                         + ISIS_FIXED_HDR_LEN);
        memcpy(lsp->lsp_header, lsp_hdr, ISIS_LSP_HDR_LEN);
index c107c2e3471bc9da30b32b1924cc792af7ea0ae8..a3706179a6b305a06f66d16c5025ac90e4f02835 100644 (file)
@@ -1391,10 +1391,11 @@ dontcheckadj:
                                        lsp_set_all_srmflags(lsp);
                                        /* v */
                                        ISIS_FLAGS_CLEAR_ALL(
-                                               lsp->SSNflags); /* FIXME:
-                                                                  OTHER
-                                                                  than c
-                                                                  */
+                                               lsp
+                                                       ->SSNflags); /* FIXME:
+                                                                       OTHER
+                                                                       than c
+                                                                       */
 
                                        /* For the case of lsp confusion, flood
                                         * the purge back to its
index e5752e31f6444cb5d4b6692802e3d1c947ae5ad0..e24901b0defeb03ef97d002b3acf864cab99c01a 100644 (file)
 extern struct zebra_privs_t isisd_privs;
 
 /* tcpdump -i eth0 'isis' -dd */
-static struct sock_filter isisfilter[] = {
-       /* NB: we're in SOCK_DGRAM, so src/dst mac + length are stripped
-        * off!
-        * (OTOH it's a bit more lower-layer agnostic and might work
-        * over GRE?) */
-       /*      { 0x28, 0, 0, 0x0000000c - 14 }, */
-       /*      { 0x25, 5, 0, 0x000005dc }, */
-       {0x28, 0, 0, 0x0000000e - 14}, {0x15, 0, 3, 0x0000fefe},
-       {0x30, 0, 0, 0x00000011 - 14}, {0x15, 0, 1, 0x00000083},
-       {0x6, 0, 0, 0x00040000},       {0x6, 0, 0, 0x00000000},
+static struct sock_filter isisfilter[] =
+       {
+               /* NB: we're in SOCK_DGRAM, so src/dst mac + length are stripped
+                * off!
+                * (OTOH it's a bit more lower-layer agnostic and might work
+                * over GRE?) */
+               /*      { 0x28, 0, 0, 0x0000000c - 14 }, */
+               /*      { 0x25, 5, 0, 0x000005dc }, */
+               {0x28, 0, 0, 0x0000000e - 14}, {0x15, 0, 3, 0x0000fefe},
+               {0x30, 0, 0, 0x00000011 - 14}, {0x15, 0, 1, 0x00000083},
+               {0x6, 0, 0, 0x00040000},       {0x6, 0, 0, 0x00000000},
 };
 
 static struct sock_fprog bpf = {
index 9f27d780a410fb83fbbca58b6f6fb2946f20227c..8e329494dd5b9e903cf6c91c41d2456e1514bbb0 100644 (file)
@@ -389,9 +389,9 @@ static void isis_redist_update_zebra_subscriptions(struct isis *isis)
                for (protocol = 0; protocol < REDIST_PROTOCOL_COUNT; protocol++)
                        for (type = 0; type < ZEBRA_ROUTE_MAX + 1; type++)
                                for (level = 0; level < ISIS_LEVELS; level++)
-                                       if (area->redist_settings
-                                                   [protocol][type][level]
-                                                           .redist)
+                                       if (area->redist_settings[protocol]
+                                                                [type]
+                                                                [level].redist)
                                                do_subscribe[protocol][type] =
                                                        1;
 
index 620b19391d32776ee9fb48de5492196333903f4c..615c2eeaa2c89ccfb00344e264ef52026e36fd8f 100644 (file)
@@ -366,9 +366,10 @@ static struct isis_vertex *isis_spf_add_root(struct isis_spftree *spftree,
                zlog_warn("ISIS-Spf: could not find own l%d LSP!",
                          spftree->level);
 
-       vertex = isis_vertex_new(id, spftree->area->oldmetric
-                                            ? VTYPE_NONPSEUDO_IS
-                                            : VTYPE_NONPSEUDO_TE_IS);
+       vertex = isis_vertex_new(id,
+                                spftree->area->oldmetric
+                                        ? VTYPE_NONPSEUDO_IS
+                                        : VTYPE_NONPSEUDO_TE_IS);
        listnode_add(spftree->paths, vertex);
 
 #ifdef EXTREME_DEBUG
@@ -507,13 +508,11 @@ static void isis_spf_add_local(struct isis_spftree *spftree,
                        /*       d) */
                        if (listcount(vertex->Adj_N) > ISIS_MAX_PATH_SPLITS)
                                remove_excess_adjs(vertex->Adj_N);
-                       if (parent
-                           && (listnode_lookup(vertex->parents, parent)
-                               == NULL))
+                       if (parent && (listnode_lookup(vertex->parents, parent)
+                                      == NULL))
                                listnode_add(vertex->parents, parent);
-                       if (parent
-                           && (listnode_lookup(parent->children, vertex)
-                               == NULL))
+                       if (parent && (listnode_lookup(parent->children, vertex)
+                                      == NULL))
                                listnode_add(parent->children, vertex);
                        return;
                } else if (vertex->d_N < cost) {
@@ -650,9 +649,8 @@ static int isis_spf_process_lsp(struct isis_spftree *spftree,
                mt_router_info = tlvs_lookup_mt_router_info(&lsp->tlv_data,
                                                            spftree->mtid);
 
-       if (!pseudo_lsp
-           && (spftree->mtid == ISIS_MT_IPV4_UNICAST
-               && !speaks(lsp->tlv_data.nlpids, spftree->family))
+       if (!pseudo_lsp && (spftree->mtid == ISIS_MT_IPV4_UNICAST
+                           && !speaks(lsp->tlv_data.nlpids, spftree->family))
            && !mt_router_info)
                return ISIS_OK;
 
@@ -669,9 +667,8 @@ lspfragloop:
 #endif /* EXTREME_DEBUG */
 
        /* RFC3787 section 4 SHOULD ignore overload bit in pseudo LSPs */
-       if (pseudo_lsp
-           || (spftree->mtid == ISIS_MT_IPV4_UNICAST
-               && !ISIS_MASK_LSP_OL_BIT(lsp->lsp_header->lsp_bits))
+       if (pseudo_lsp || (spftree->mtid == ISIS_MT_IPV4_UNICAST
+                          && !ISIS_MASK_LSP_OL_BIT(lsp->lsp_header->lsp_bits))
            || (mt_router_info && !mt_router_info->overload))
 
        {
index dea44f5f23813eb554f396f4feaf6b052445a2da..d06548519f8e80909f8102419d21f80f4926c2b3 100644 (file)
@@ -217,7 +217,7 @@ struct te_ipv4_reachability {
        u_int32_t te_metric;
        u_char control;
        u_char prefix_start; /* since this is variable length by nature it only
-                             */
+                               */
 };                          /* points to an approximate location */
 
 #define TE_IPV4_HAS_SUBTLV (0x40)
index 007d48f33d18171224f46bcef37415e79dbf76d7..1aacea881f6efc9dd4010ff04a2961e5798119eb 100644 (file)
@@ -70,7 +70,7 @@ struct isis_area {
        struct isis_spftree *spftree6[ISIS_LEVELS];    /* The v6 SPTs */
        struct route_table *route_table6[ISIS_LEVELS]; /* IPv6 routes */
                                                       /* $FRR indent$ */
-                                                      /* clang-format off */
+/* clang-format off */
 #define DEFAULT_LSP_MTU 1497
        unsigned int lsp_mtu;      /* Size of LSPs to generate */
        struct list *circuit_list; /* IS-IS circuits */
index 7666c58a31221ab446013292ce7bf019a38dd0f4..8eef73e2435feed953c067dab46016f82dcc9633 100644 (file)
@@ -10,7 +10,7 @@
 #include "checksum.h"
 
 int /* return checksum in low-order 16 bits */
-in_cksum(void *parg, int nbytes)
+       in_cksum(void *parg, int nbytes)
 {
        u_short *ptr = parg;
        register long sum; /* assumes long == 32 bits */
index d4b628ab029ee0328169d6c1ad22bacf8d0322df..d97ad9db3c27420d77f471e1847f7b6070cc0f69 100644 (file)
@@ -56,23 +56,19 @@ struct host host;
 
 /* Standard command node structures. */
 static struct cmd_node auth_node = {
-       AUTH_NODE,
-       "Password: ",
+       AUTH_NODE, "Password: ",
 };
 
 static struct cmd_node view_node = {
-       VIEW_NODE,
-       "%s> ",
+       VIEW_NODE, "%s> ",
 };
 
 static struct cmd_node auth_enable_node = {
-       AUTH_ENABLE_NODE,
-       "Password: ",
+       AUTH_ENABLE_NODE, "Password: ",
 };
 
 static struct cmd_node enable_node = {
-       ENABLE_NODE,
-       "%s# ",
+       ENABLE_NODE, "%s# ",
 };
 
 static struct cmd_node config_node = {CONFIG_NODE, "%s(config)# ", 1};
@@ -653,9 +649,8 @@ void cmd_variable_complete(struct cmd_token *token, const char *arg,
        for (ALL_LIST_ELEMENTS_RO(varhandlers, ln, cvh)) {
                if (cvh->tokenname && strcmp(cvh->tokenname, token->text))
                        continue;
-               if (cvh->varname
-                   && (!token->varname
-                       || strcmp(cvh->varname, token->varname)))
+               if (cvh->varname && (!token->varname
+                                    || strcmp(cvh->varname, token->varname)))
                        continue;
                cvh->completions(tmpcomps, token);
                break;
@@ -1500,9 +1495,8 @@ DEFUN (config_write,
        struct stat conf_stat;
 
        // if command was 'write terminal' or 'show running-config'
-       if (argc == 2
-           && (strmatch(argv[idx_type]->text, "terminal")
-               || strmatch(argv[0]->text, "show"))) {
+       if (argc == 2 && (strmatch(argv[idx_type]->text, "terminal")
+                         || strmatch(argv[0]->text, "show"))) {
                vty_write_config(vty);
                return CMD_SUCCESS;
        }
index be4c39a36139c48466d981cd266466df1105a110..785d2ffa70ae86db85c5e32e5bf1665fc0e93b1f 100644 (file)
@@ -203,7 +203,7 @@ static PyObject *graph_to_pyobj(struct wrap_graph *wgraph,
                                /* plumbing types */
                                item(FORK_TKN) item(JOIN_TKN) item(START_TKN)
                                        item(END_TKN) default
-                           : wrap->type = "???";
+                               : wrap->type = "???";
                }
 
                wrap->deprecated = (tok->attr == CMD_ATTR_DEPRECATED);
index 3f52c6f06bc9797546cbabd16a210d0436361764..71799c9b6d5a8a201c3cc20a357f9453881bc194 100644 (file)
@@ -619,9 +619,8 @@ int long_only;
 
        if (longopts != NULL
            && (argv[optind][1] == '-'
-               || (long_only
-                   && (argv[optind][2]
-                       || !my_index(optstring, argv[optind][1]))))) {
+               || (long_only && (argv[optind][2]
+                                 || !my_index(optstring, argv[optind][1]))))) {
                char *nameend;
                const struct option *p;
                const struct option *pfound = NULL;
index da3419bd27dafae3220149dd453091cde4106fa0..4a5cee2fd394ea1783cfc0c5f33c6869101ba2e9 100644 (file)
@@ -161,8 +161,7 @@ extern void _hook_unregister(struct hook *hook, void *funcptr, void *arg,
  */
 #define DEFINE_HOOK(hookname, arglist, passlist)                               \
        struct hook _hook_##hookname = {                                       \
-               .name = #hookname,                                             \
-               .entries = NULL,                                               \
+               .name = #hookname, .entries = NULL,                            \
        };                                                                     \
        static int hook_call_##hookname arglist                                \
        {                                                                      \
index 0204d325b7c3eba6b4068f1194896065a61666ea..f80ac19179527e2bf57da2d165cd6c1d90f2a06d 100644 (file)
--- a/lib/if.h
+++ b/lib/if.h
@@ -236,7 +236,7 @@ struct interface {
        unsigned int mtu; /* IPv4 MTU */
        unsigned int
                mtu6; /* IPv6 MTU - probably, but not neccessarily same as mtu
-                      */
+                        */
 
        /* Link-layer information and hardware address */
        enum zebra_link_type ll_type;
index 68f172cdf9165e32429f7a9926f6994fc64574a9..28e086535412218f70dbde14dc2fed64f9cf65c5 100644 (file)
--- a/lib/log.c
+++ b/lib/log.c
@@ -411,7 +411,7 @@ void zlog_signal(int signo, const char *action
                 ,
                 siginfo_t *siginfo, void *program_counter
 #endif
-)
+                )
 {
        time_t now;
        char buf[sizeof("DEFAULT: Received signal S at T (si_addr 0xP, PC 0xP); aborting...")
@@ -474,7 +474,7 @@ void zlog_signal(int signo, const char *action
 #else
                               NULL
 #endif
-       );
+                              );
 
        s = buf;
        struct thread *tc;
@@ -1063,9 +1063,10 @@ void zlog_hexdump(const void *mem, unsigned int len)
                                                 printing */
                                        s += sprintf(s, " ");
 
-                               else if (isprint((int)((const char *)mem)
-                                                        [j])) /* printable char
-                                                               */
+                               else if (
+                                       isprint((int)((const char *)mem)
+                                                       [j])) /* printable char
+                                                                */
                                        s += sprintf(
                                                s, "%c",
                                                0xFF & ((const char *)mem)[j]);
index 711308a47676e9026ead3a441d3a992d38f446e8..d872ce56d695b77422c42ce007bc0bd7a5028de6 100644 (file)
--- a/lib/log.h
+++ b/lib/log.h
@@ -109,7 +109,7 @@ extern void zlog_signal(int signo, const char *action
                        ,
                        siginfo_t *siginfo, void *program_counter
 #endif
-);
+                       );
 
 /* Log a backtrace. */
 extern void zlog_backtrace(int priority);
@@ -143,7 +143,7 @@ struct timestamp_control {
        int precision;                  /* configuration parameter */
        int already_rendered;           /* should be initialized to 0 */
        char buf[QUAGGA_TIMESTAMP_LEN]; /* will contain the rendered timestamp
-                                        */
+                                          */
 };
 
 /* Defines for use in command construction: */
index 633256b77bd6fb89f8917e5e0d2947e45af51f36..cce67d7ec1d299e5d0a7cc9b9d904d90e36bb308 100644 (file)
--- a/lib/md5.c
+++ b/lib/md5.c
@@ -389,11 +389,11 @@ uint8_t *digest;                     /* caller digest to be filled in */
 {
        MD5_CTX context;
        unsigned char k_ipad[65]; /* inner padding -
-                                  * key XORd with ipad
-                                  */
+                                 * key XORd with ipad
+                                 */
        unsigned char k_opad[65]; /* outer padding -
-                                  * key XORd with opad
-                                  */
+                                 * key XORd with opad
+                                 */
        unsigned char tk[16];
        int i;
        /* if key is longer than 64 bytes reset it to key=MD5(key) */
index 38482e2f926c27b65cd949c47ffc0b889363e357..025770d479645bebc23d826cd96ba15d63dbbecd 100644 (file)
@@ -173,7 +173,7 @@ static inline char *label2str(mpls_label_t label, char *buf, size_t len)
 #define MPLS_LABEL_RTALERT     1               /* Router Alert Label       */
 #define MPLS_LABEL_IPV6NULL    2               /* IPv6 Explicit NULL Label */
 #define MPLS_LABEL_IMPLNULL    3               /* Implicit NULL Label      */
-/*      MPLS_LABEL_RESERVED    4-15 */ /* Values 4-15 are reserved */
+       /*      MPLS_LABEL_RESERVED     4-15 */ /* Values 4-15 are reserved */
 #define MPLS_LABEL_RESERVED_MAX 15
 #define MPLS_LABEL_MAX         ((1 << 20) - 1)
 
index bfa695fcdc8a84bcc0f53ffac02bd0ebfd96ca6b..859f751678f7ac45c82366a19ffc0a67773e0dc0 100644 (file)
@@ -509,9 +509,7 @@ int _rb_check(const struct rb_type *, void *, unsigned long);
                return _cmp(l, r);                                             \
        }                                                                      \
        static const struct rb_type _name##_RB_INFO = {                        \
-               _name##_RB_COMPARE,                                            \
-               _aug,                                                          \
-               offsetof(struct _type, _field),                                \
+               _name##_RB_COMPARE, _aug, offsetof(struct _type, _field),      \
        };                                                                     \
        const struct rb_type *const _name##_RB_TYPE = &_name##_RB_INFO;
 
index a598548c68c8c7c88843c0d769968c9689a877c9..d7a0db6807664a692c4362d18003c4720c69678b 100644 (file)
@@ -1918,9 +1918,8 @@ int prefix_bgp_show_prefix_list(struct vty *vty, afi_t afi, char *name,
                        json_object_object_add(json, "ipv6PrefixList",
                                               json_prefix);
 
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        } else {
                vty_out(vty, "ip%s prefix-list %s: %d entries\n",
index 6a37d7de36ca19527207155d2ec1a4bd12ea0702..88b13cd99f209c506ee969cd67c02610b214f09f 100644 (file)
@@ -1151,9 +1151,8 @@ const char *prefix2str(union prefixconstptr pu, char *str, int size)
        switch (p->family) {
        case AF_INET:
        case AF_INET6:
-               snprintf(str, size, "%s/%d",
-                        inet_ntop(p->family, &p->u.prefix, buf,
-                                  PREFIX2STR_BUFFER),
+               snprintf(str, size, "%s/%d", inet_ntop(p->family, &p->u.prefix,
+                                                      buf, PREFIX2STR_BUFFER),
                         p->prefixlen);
                break;
 
index ab9e49f7afa2c478bc6f16d4338d7d4a8a3d2590..ce13dcfa0a71a1f9c4f055502d47780eb526ac78 100644 (file)
@@ -53,9 +53,9 @@ struct ethaddr {
 
 
 /* length is the number of valuable bits of prefix structure
- * 18 bytes is current length in structure, if address is ipv4
- * 30 bytes is in case of ipv6
- */
+* 18 bytes is current length in structure, if address is ipv4
+* 30 bytes is in case of ipv6
+*/
 #define PREFIX_LEN_ROUTE_TYPE_5_IPV4 (18*8)
 #define PREFIX_LEN_ROUTE_TYPE_5_IPV6 (30*8)
 
index 81673f84a10b5ca3a0cf875a244fae41b0b69e88..c971596117f1b810600af31667115270f7a89b9c 100644 (file)
@@ -99,131 +99,113 @@ static struct {
        pvalue_t *system_caps;
 } cap_map[ZCAP_MAX] = {
 #ifdef HAVE_LCAPS /* Quagga -> Linux capabilities mappings */
-       [ZCAP_SETID] =
-               {
-                       2,
-                       (pvalue_t[]){CAP_SETGID, CAP_SETUID},
-               },
-       [ZCAP_BIND] =
-               {
-                       1,
-                       (pvalue_t[]){CAP_NET_BIND_SERVICE},
-               },
-       [ZCAP_NET_ADMIN] =
-               {
-                       1,
-                       (pvalue_t[]){CAP_NET_ADMIN},
-               },
-       [ZCAP_NET_RAW] =
-               {
-                       1,
-                       (pvalue_t[]){CAP_NET_RAW},
-               },
-       [ZCAP_CHROOT] =
-               {
-                       1,
-                       (pvalue_t[]){
-                               CAP_SYS_CHROOT,
+               [ZCAP_SETID] =
+                       {
+                               2, (pvalue_t[]){CAP_SETGID, CAP_SETUID},
+                       },
+               [ZCAP_BIND] =
+                       {
+                               1, (pvalue_t[]){CAP_NET_BIND_SERVICE},
+                       },
+               [ZCAP_NET_ADMIN] =
+                       {
+                               1, (pvalue_t[]){CAP_NET_ADMIN},
+                       },
+               [ZCAP_NET_RAW] =
+                       {
+                               1, (pvalue_t[]){CAP_NET_RAW},
+                       },
+               [ZCAP_CHROOT] =
+                       {
+                               1,
+                               (pvalue_t[]){
+                                       CAP_SYS_CHROOT,
+                               },
+                       },
+               [ZCAP_NICE] =
+                       {
+                               1, (pvalue_t[]){CAP_SYS_NICE},
+                       },
+               [ZCAP_PTRACE] =
+                       {
+                               1, (pvalue_t[]){CAP_SYS_PTRACE},
+                       },
+               [ZCAP_DAC_OVERRIDE] =
+                       {
+                               1, (pvalue_t[]){CAP_DAC_OVERRIDE},
+                       },
+               [ZCAP_READ_SEARCH] =
+                       {
+                               1, (pvalue_t[]){CAP_DAC_READ_SEARCH},
+                       },
+               [ZCAP_SYS_ADMIN] =
+                       {
+                               1, (pvalue_t[]){CAP_SYS_ADMIN},
+                       },
+               [ZCAP_FOWNER] =
+                       {
+                               1, (pvalue_t[]){CAP_FOWNER},
                        },
-               },
-       [ZCAP_NICE] =
-               {
-                       1,
-                       (pvalue_t[]){CAP_SYS_NICE},
-               },
-       [ZCAP_PTRACE] =
-               {
-                       1,
-                       (pvalue_t[]){CAP_SYS_PTRACE},
-               },
-       [ZCAP_DAC_OVERRIDE] =
-               {
-                       1,
-                       (pvalue_t[]){CAP_DAC_OVERRIDE},
-               },
-       [ZCAP_READ_SEARCH] =
-               {
-                       1,
-                       (pvalue_t[]){CAP_DAC_READ_SEARCH},
-               },
-       [ZCAP_SYS_ADMIN] =
-               {
-                       1,
-                       (pvalue_t[]){CAP_SYS_ADMIN},
-               },
-       [ZCAP_FOWNER] =
-               {
-                       1,
-                       (pvalue_t[]){CAP_FOWNER},
-               },
 #elif defined(HAVE_SOLARIS_CAPABILITIES) /* HAVE_LCAPS */
-       /* Quagga -> Solaris privilege mappings */
-       [ZCAP_SETID] =
-               {
-                       1,
-                       (pvalue_t[]){PRIV_PROC_SETID},
-               },
-       [ZCAP_BIND] =
-               {
-                       1,
-                       (pvalue_t[]){PRIV_NET_PRIVADDR},
-               },
+               /* Quagga -> Solaris privilege mappings */
+               [ZCAP_SETID] =
+                       {
+                               1, (pvalue_t[]){PRIV_PROC_SETID},
+                       },
+               [ZCAP_BIND] =
+                       {
+                               1, (pvalue_t[]){PRIV_NET_PRIVADDR},
+                       },
 /* IP_CONFIG is a subset of NET_CONFIG and is allowed in zones */
 #ifdef PRIV_SYS_IP_CONFIG
-       [ZCAP_NET_ADMIN] =
-               {
-                       1,
-                       (pvalue_t[]){PRIV_SYS_IP_CONFIG},
-               },
+               [ZCAP_NET_ADMIN] =
+                       {
+                               1, (pvalue_t[]){PRIV_SYS_IP_CONFIG},
+                       },
 #else
-       [ZCAP_NET_ADMIN] =
-               {
-                       1,
-                       (pvalue_t[]){PRIV_SYS_NET_CONFIG},
-               },
+               [ZCAP_NET_ADMIN] =
+                       {
+                               1, (pvalue_t[]){PRIV_SYS_NET_CONFIG},
+                       },
 #endif
-       [ZCAP_NET_RAW] =
-               {
-                       2,
-                       (pvalue_t[]){PRIV_NET_RAWACCESS, PRIV_NET_ICMPACCESS},
-               },
-       [ZCAP_CHROOT] =
-               {
-                       1,
-                       (pvalue_t[]){PRIV_PROC_CHROOT},
-               },
-       [ZCAP_NICE] =
-               {
-                       1,
-                       (pvalue_t[]){PRIV_PROC_PRIOCNTL},
-               },
-       [ZCAP_PTRACE] =
-               {
-                       1,
-                       (pvalue_t[]){PRIV_PROC_SESSION},
-               },
-       [ZCAP_DAC_OVERRIDE] =
-               {
-                       5,
-                       (pvalue_t[]){PRIV_FILE_DAC_EXECUTE, PRIV_FILE_DAC_READ,
-                                    PRIV_FILE_DAC_SEARCH, PRIV_FILE_DAC_WRITE,
-                                    PRIV_FILE_DAC_SEARCH},
-               },
-       [ZCAP_READ_SEARCH] =
-               {
-                       2,
-                       (pvalue_t[]){PRIV_FILE_DAC_SEARCH, PRIV_FILE_DAC_READ},
-               },
-       [ZCAP_SYS_ADMIN] =
-               {
-                       1,
-                       (pvalue_t[]){PRIV_SYS_ADMIN},
-               },
-       [ZCAP_FOWNER] =
-               {
-                       1,
-                       (pvalue_t[]){PRIV_FILE_OWNER},
-               },
+               [ZCAP_NET_RAW] =
+                       {
+                               2, (pvalue_t[]){PRIV_NET_RAWACCESS,
+                                               PRIV_NET_ICMPACCESS},
+                       },
+               [ZCAP_CHROOT] =
+                       {
+                               1, (pvalue_t[]){PRIV_PROC_CHROOT},
+                       },
+               [ZCAP_NICE] =
+                       {
+                               1, (pvalue_t[]){PRIV_PROC_PRIOCNTL},
+                       },
+               [ZCAP_PTRACE] =
+                       {
+                               1, (pvalue_t[]){PRIV_PROC_SESSION},
+                       },
+               [ZCAP_DAC_OVERRIDE] =
+                       {
+                               5, (pvalue_t[]){PRIV_FILE_DAC_EXECUTE,
+                                               PRIV_FILE_DAC_READ,
+                                               PRIV_FILE_DAC_SEARCH,
+                                               PRIV_FILE_DAC_WRITE,
+                                               PRIV_FILE_DAC_SEARCH},
+                       },
+               [ZCAP_READ_SEARCH] =
+                       {
+                               2, (pvalue_t[]){PRIV_FILE_DAC_SEARCH,
+                                               PRIV_FILE_DAC_READ},
+                       },
+               [ZCAP_SYS_ADMIN] =
+                       {
+                               1, (pvalue_t[]){PRIV_SYS_ADMIN},
+                       },
+               [ZCAP_FOWNER] =
+                       {
+                               1, (pvalue_t[]){PRIV_FILE_OWNER},
+                       },
 #endif /* HAVE_SOLARIS_CAPABILITIES */
 };
 
@@ -785,7 +767,7 @@ void zprivs_init(struct zebra_privs_t *zprivs)
 
        if (zprivs->vty_group)
        /* Add the vty_group to the supplementary groups so it can be chowned to
-        */
+          */
        {
                if (zprivs_state.vtygrp == (gid_t)-1) {
                        fprintf(stderr,
index 40daeae41c869b23b64ccee65077595e694a08d4..3d1add25dc5dc02a1ccc25ed0a19b960ae2c3995 100644 (file)
@@ -1232,9 +1232,8 @@ int route_map_delete_match(struct route_map_index *index,
                return 1;
 
        for (rule = index->match_list.head; rule; rule = rule->next)
-               if (rule->cmd == cmd
-                   && (rulecmp(rule->rule_str, match_arg) == 0
-                       || match_arg == NULL)) {
+               if (rule->cmd == cmd && (rulecmp(rule->rule_str, match_arg) == 0
+                                        || match_arg == NULL)) {
                        route_map_rule_delete(&index->match_list, rule);
                        /* Execute event hook. */
                        if (route_map_master.event_hook) {
@@ -1320,9 +1319,8 @@ int route_map_delete_set(struct route_map_index *index, const char *set_name,
                return 1;
 
        for (rule = index->set_list.head; rule; rule = rule->next)
-               if ((rule->cmd == cmd)
-                   && (rulecmp(rule->rule_str, set_arg) == 0
-                       || set_arg == NULL)) {
+               if ((rule->cmd == cmd) && (rulecmp(rule->rule_str, set_arg) == 0
+                                          || set_arg == NULL)) {
                        route_map_rule_delete(&index->set_list, rule);
                        /* Execute event hook. */
                        if (route_map_master.event_hook) {
index 2eebb47d6cdd439c4f5e688175d2316be3a19336..2a04fa23cb793f00fab46b7f05a5a97a221f47a8 100644 (file)
@@ -207,14 +207,14 @@ exit_handler(int signo
             ,
             siginfo_t *siginfo, void *context
 #endif
-)
+            )
 {
        zlog_signal(signo, "exiting..."
 #ifdef SA_SIGINFO
                    ,
                    siginfo, program_counter(context)
 #endif
-       );
+                           );
        _exit(128 + signo);
 }
 
@@ -224,7 +224,7 @@ core_handler(int signo
             ,
             siginfo_t *siginfo, void *context
 #endif
-)
+            )
 {
        /* make sure we don't hang in here.  default for SIGALRM is terminate.
         * - if we're in backtrace for more than a second, abort. */
@@ -243,7 +243,7 @@ core_handler(int signo
                    ,
                    siginfo, program_counter(context)
 #endif
-       );
+                           );
        /* dump memory stats on core */
        log_memstats_stderr("core_handler");
        abort();
@@ -290,7 +290,7 @@ static void trap_default_signals(void)
                                ,
                                siginfo_t *info, void *context
 #endif
-               );
+                               );
        } sigmap[] = {
                {core_signals, array_size(core_signals), core_handler},
                {exit_signals, array_size(exit_signals), exit_handler},
index 56c2e874a2576a0c6a5f6759167639bc5c6ab248..9a0063df213e413ff0a4fc7b63da45710ce484e5 100644 (file)
@@ -210,25 +210,22 @@ static void smux_getresp_send(oid objid[], size_t objid_len, long reqid,
        ptr = asn_build_sequence(ptr, &len, (u_char)SMUX_GETRSP, 0);
        h1e = ptr;
 
-       ptr = asn_build_int(
-               ptr, &len,
-               (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_INTEGER), &reqid,
-               sizeof(reqid));
+       ptr = asn_build_int(ptr, &len, (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE
+                                               | ASN_INTEGER),
+                           &reqid, sizeof(reqid));
 
        if (debug_smux)
                zlog_debug("SMUX GETRSP errstat: %ld", errstat);
 
-       ptr = asn_build_int(
-               ptr, &len,
-               (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_INTEGER), &errstat,
-               sizeof(errstat));
+       ptr = asn_build_int(ptr, &len, (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE
+                                               | ASN_INTEGER),
+                           &errstat, sizeof(errstat));
        if (debug_smux)
                zlog_debug("SMUX GETRSP errindex: %ld", errindex);
 
-       ptr = asn_build_int(
-               ptr, &len,
-               (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_INTEGER),
-               &errindex, sizeof(errindex));
+       ptr = asn_build_int(ptr, &len, (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE
+                                               | ASN_INTEGER),
+                           &errindex, sizeof(errindex));
 
        h2 = ptr;
        /* Place holder h2 for one variable */
@@ -887,28 +884,24 @@ static int smux_open(int sock)
 
        /* SMUX Open. */
        version = 0;
-       ptr = asn_build_int(
-               ptr, &len,
-               (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_INTEGER), &version,
-               sizeof(version));
+       ptr = asn_build_int(ptr, &len, (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE
+                                               | ASN_INTEGER),
+                           &version, sizeof(version));
 
        /* SMUX connection oid. */
-       ptr = asn_build_objid(
-               ptr, &len,
-               (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_OBJECT_ID),
-               smux_oid, smux_oid_len);
+       ptr = asn_build_objid(ptr, &len, (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE
+                                                 | ASN_OBJECT_ID),
+                             smux_oid, smux_oid_len);
 
        /* SMUX connection description. */
-       ptr = asn_build_string(
-               ptr, &len,
-               (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_OCTET_STR),
-               (const u_char *)progname, strlen(progname));
+       ptr = asn_build_string(ptr, &len, (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE
+                                                  | ASN_OCTET_STR),
+                              (const u_char *)progname, strlen(progname));
 
        /* SMUX connection password. */
-       ptr = asn_build_string(
-               ptr, &len,
-               (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_OCTET_STR),
-               (u_char *)smux_passwd, strlen(smux_passwd));
+       ptr = asn_build_string(ptr, &len, (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE
+                                                  | ASN_OCTET_STR),
+                              (u_char *)smux_passwd, strlen(smux_passwd));
 
        /* Fill in real SMUX header.  We exclude ASN header size (2). */
        len = BUFSIZ;
@@ -948,31 +941,27 @@ int smux_trap(struct variable *vp, size_t vp_len, const oid *ename,
        ptr = asn_build_header(ptr, &len, (u_char)SMUX_TRAP, 0);
 
        /* Sub agent enterprise oid. */
-       ptr = asn_build_objid(
-               ptr, &len,
-               (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_OBJECT_ID),
-               smux_oid, smux_oid_len);
+       ptr = asn_build_objid(ptr, &len, (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE
+                                                 | ASN_OBJECT_ID),
+                             smux_oid, smux_oid_len);
 
        /* IP address. */
        addr.s_addr = 0;
-       ptr = asn_build_string(
-               ptr, &len,
-               (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_IPADDRESS),
-               (u_char *)&addr, sizeof(addr));
+       ptr = asn_build_string(ptr, &len, (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE
+                                                  | ASN_IPADDRESS),
+                              (u_char *)&addr, sizeof(addr));
 
        /* Generic trap integer. */
        val = SNMP_TRAP_ENTERPRISESPECIFIC;
-       ptr = asn_build_int(
-               ptr, &len,
-               (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_INTEGER),
-               (long *)&val, sizeof(val));
+       ptr = asn_build_int(ptr, &len, (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE
+                                               | ASN_INTEGER),
+                           (long *)&val, sizeof(val));
 
        /* Specific trap integer. */
        val = sptrap;
-       ptr = asn_build_int(
-               ptr, &len,
-               (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_INTEGER),
-               (long *)&val, sizeof(val));
+       ptr = asn_build_int(ptr, &len, (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE
+                                               | ASN_INTEGER),
+                           (long *)&val, sizeof(val));
 
        /* Timeticks timestamp. */
        val = 0;
index a1bde13a9c63e6543724beece6fa0eebb4548272..d100991a3319fc6919c0fdcc65aeca821da5d852 100644 (file)
@@ -261,9 +261,8 @@ int setsockopt_ipv4_multicast(int sock, int optname, struct in_addr if_addr,
                zlog_info(
                        "setsockopt_ipv4_multicast attempting to drop and "
                        "re-add (fd %d, mcast %s, ifindex %u)",
-                       sock,
-                       inet_ntop(AF_INET, &mreqn.imr_multiaddr, buf[0],
-                                 sizeof(buf[0])),
+                       sock, inet_ntop(AF_INET, &mreqn.imr_multiaddr, buf[0],
+                                       sizeof(buf[0])),
                        ifindex);
                setsockopt(sock, IPPROTO_IP, IP_DROP_MEMBERSHIP, (void *)&mreqn,
                           sizeof(mreqn));
@@ -304,9 +303,8 @@ int setsockopt_ipv4_multicast(int sock, int optname, struct in_addr if_addr,
                zlog_info(
                        "setsockopt_ipv4_multicast attempting to drop and "
                        "re-add (fd %d, mcast %s, ifindex %u)",
-                       sock,
-                       inet_ntop(AF_INET, &mreq.imr_multiaddr, buf[0],
-                                 sizeof(buf[0])),
+                       sock, inet_ntop(AF_INET, &mreq.imr_multiaddr, buf[0],
+                                       sizeof(buf[0])),
                        ifindex);
                setsockopt(sock, IPPROTO_IP, IP_DROP_MEMBERSHIP, (void *)&mreq,
                           sizeof(mreq));
index 494fad7c3844d19ce9bb800b5710634e32367cc2..00579550e4723a2891d584b721c5cfad3524247e 100644 (file)
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -2822,9 +2822,7 @@ static int vty_config_write(struct vty *vty)
 }
 
 struct cmd_node vty_node = {
-       VTY_NODE,
-       "%s(config-line)# ",
-       1,
+       VTY_NODE, "%s(config-line)# ", 1,
 };
 
 /* Reset all VTY status. */
index 3adaf4f98c44648c85bb439f12a45cb6a4db3898..5c06d933e6fb277d38d9d537f793c5354e728d94 100644 (file)
@@ -34,10 +34,9 @@ extern void _zlog_assert_failed(const char *assertion, const char *file,
 #endif
 
 #define zassert(EX)                                                            \
-       ((void)((EX) ? 0                                                       \
-                    : (_zlog_assert_failed(#EX, __FILE__, __LINE__,           \
-                                           __ASSERT_FUNCTION),                \
-                       0)))
+       ((void)((EX) ? 0 : (_zlog_assert_failed(#EX, __FILE__, __LINE__,       \
+                                               __ASSERT_FUNCTION),            \
+                           0)))
 
 #undef assert
 #define assert(EX) zassert(EX)
index b4511ed2cb17ccb839935041e779684a2d64b9a0..a54d8749a399d2b99ef6c8d0ad2ff97dfd4c6b8a 100644 (file)
@@ -1480,9 +1480,8 @@ struct connected *zebra_interface_address_read(int type, struct stream *s,
                                zlog_warn(
                                        "warning: interface %s address %s "
                                        "with peer flag set, but no peer address!",
-                                       ifp->name,
-                                       prefix2str(ifc->address, buf,
-                                                  sizeof buf));
+                                       ifp->name, prefix2str(ifc->address, buf,
+                                                             sizeof buf));
                                UNSET_FLAG(ifc->flags, ZEBRA_IFA_PEER);
                        }
                }
index 5d344aca71da0da2a2322910bd8a624cc5edb806..7f8341d0e42c67ab91a8fad2eca5c28760fc4853 100644 (file)
@@ -848,9 +848,7 @@ static route_map_result_t ospf6_routemap_rule_match_tag(void *rule,
 }
 
 static struct route_map_rule_cmd ospf6_routemap_rule_match_tag_cmd = {
-       "tag",
-       ospf6_routemap_rule_match_tag,
-       route_map_rule_tag_compile,
+       "tag", ospf6_routemap_rule_match_tag, route_map_rule_tag_compile,
        route_map_rule_tag_free,
 };
 
@@ -885,8 +883,7 @@ static void ospf6_routemap_rule_set_metric_type_free(void *rule)
 }
 
 struct route_map_rule_cmd ospf6_routemap_rule_set_metric_type_cmd = {
-       "metric-type",
-       ospf6_routemap_rule_set_metric_type,
+       "metric-type", ospf6_routemap_rule_set_metric_type,
        ospf6_routemap_rule_set_metric_type_compile,
        ospf6_routemap_rule_set_metric_type_free,
 };
@@ -921,8 +918,7 @@ static void ospf6_routemap_rule_set_metric_free(void *rule)
 }
 
 struct route_map_rule_cmd ospf6_routemap_rule_set_metric_cmd = {
-       "metric",
-       ospf6_routemap_rule_set_metric,
+       "metric", ospf6_routemap_rule_set_metric,
        ospf6_routemap_rule_set_metric_compile,
        ospf6_routemap_rule_set_metric_free,
 };
@@ -960,8 +956,7 @@ static void ospf6_routemap_rule_set_forwarding_free(void *rule)
 }
 
 struct route_map_rule_cmd ospf6_routemap_rule_set_forwarding_cmd = {
-       "forwarding-address",
-       ospf6_routemap_rule_set_forwarding,
+       "forwarding-address", ospf6_routemap_rule_set_forwarding,
        ospf6_routemap_rule_set_forwarding_compile,
        ospf6_routemap_rule_set_forwarding_free,
 };
@@ -983,9 +978,7 @@ static route_map_result_t ospf6_routemap_rule_set_tag(void *rule,
 }
 
 static struct route_map_rule_cmd ospf6_routemap_rule_set_tag_cmd = {
-       "tag",
-       ospf6_routemap_rule_set_tag,
-       route_map_rule_tag_compile,
+       "tag", ospf6_routemap_rule_set_tag, route_map_rule_tag_compile,
        route_map_rule_tag_free,
 };
 
index 7921df884e593bb237c3a7748ae490f08074776a..1d17a1c233ffd59f3ef856efe4bbe7d530f7aa25 100644 (file)
@@ -1402,10 +1402,9 @@ DEFUN (ipv6_ospf6_priority,
 
        oi->priority = strtol(argv[idx_number]->arg, NULL, 10);
 
-       if (oi->area
-           && (oi->state == OSPF6_INTERFACE_DROTHER
-               || oi->state == OSPF6_INTERFACE_BDR
-               || oi->state == OSPF6_INTERFACE_DR))
+       if (oi->area && (oi->state == OSPF6_INTERFACE_DROTHER
+                        || oi->state == OSPF6_INTERFACE_BDR
+                        || oi->state == OSPF6_INTERFACE_DR))
                ospf6_interface_state_change(dr_election(oi), oi);
 
        return CMD_SUCCESS;
index 66e5714d07b602e31f0b792e969859e75db5c606..7c5c44fca71df3dee195aa73321fa27de2e5987d 100644 (file)
@@ -73,9 +73,8 @@ static char *ospf6_router_lsa_get_nbr_id(struct ospf6_lsa *lsa, char *buf,
 
                lsdesc = (struct ospf6_router_lsdesc
                                  *)(start
-                                    + pos
-                                              * (sizeof(struct
-                                                        ospf6_router_lsdesc)));
+                                    + pos * (sizeof(struct
+                                                    ospf6_router_lsdesc)));
                if ((char *)lsdesc < end) {
                        if (buf && (buflen > INET_ADDRSTRLEN * 2)) {
                                inet_ntop(AF_INET,
index 78f1148243eace68e0171b15e38321ae7363f072..aa5f05ce172b92a08baa1eac21005493be6fc6a0 100644 (file)
@@ -869,7 +869,7 @@ static unsigned ospf6_prefixes_examin(
        unsigned length,
        const u_int32_t req_num_pfxs /* always compared with the actual number
                                        of prefixes */
-)
+       )
 {
        u_char requested_pfx_bytes;
        u_int32_t real_num_pfxs = 0;
@@ -1066,7 +1066,7 @@ static unsigned ospf6_lsa_examin(struct ospf6_lsa_header *lsah,
                        lsalen - OSPF6_LSA_HEADER_SIZE
                                - OSPF6_LINK_LSA_MIN_SIZE,
                        ntohl(link_lsa->prefix_num) /* 32 bits */
-               );
+                       );
        case OSPF6_LSTYPE_INTRA_PREFIX:
                /* RFC5340 A.4.10, LSA header + OSPF6_INTRA_PREFIX_LSA_MIN_SIZE
                   bytes
@@ -1084,7 +1084,7 @@ static unsigned ospf6_lsa_examin(struct ospf6_lsa_header *lsah,
                        lsalen - OSPF6_LSA_HEADER_SIZE
                                - OSPF6_INTRA_PREFIX_LSA_MIN_SIZE,
                        ntohs(intra_prefix_lsa->prefix_num) /* 16 bits */
-               );
+                       );
        }
        /* No additional validation is possible for unknown LSA types, which are
           themselves valid in OPSFv3, hence the default decision is to accept.
@@ -1270,7 +1270,7 @@ static unsigned ospf6_packet_examin(struct ospf6_header *oh,
                                                    + OSPF6_LS_UPD_MIN_SIZE),
                        bytesonwire - OSPF6_HEADER_SIZE - OSPF6_LS_UPD_MIN_SIZE,
                        0, ntohl(lsupd->lsa_number) /* 32 bits */
-               );
+                       );
                break;
        case OSPF6_MESSAGE_TYPE_LSACK:
                /* RFC5340 A.3.6, packet header + N>=0 header-only LSAs. */
index 84993f0b4c89b617a7e596f7845a8c96ab33d519..d33f41730e2130b9c1f0403f9f5e4b2c3476bde5 100644 (file)
@@ -347,8 +347,7 @@ static int config_write_ospf6_zebra(struct vty *vty)
 
 /* Zebra node structure. */
 static struct cmd_node zebra_node = {
-       ZEBRA_NODE,
-       "%s(config-zebra)# ",
+       ZEBRA_NODE, "%s(config-zebra)# ",
 };
 
 #define ADD    0
index 41c21ee9b690bc7c9e43d283985e1ba8380690ba..c6d4364fa3c1adefe9e9f8309dbe22ba03e6cd0a 100644 (file)
@@ -1034,20 +1034,22 @@ static void ospf_abr_process_network_rt(struct ospf *ospf,
                        continue;
                }
 
-               if (or->path_type == OSPF_PATH_INTRA_AREA
-                             && !ospf_abr_should_announce(
-                                        ospf, (struct prefix_ipv4 *)&rn->p,
-                                        or)) {
+               if (
+                       or->path_type == OSPF_PATH_INTRA_AREA
+                                 && !ospf_abr_should_announce(
+                                            ospf, (struct prefix_ipv4 *)&rn->p,
+                                            or)) {
                        if (IS_DEBUG_OSPF_EVENT)
                                zlog_debug(
                                        "ospf_abr_process_network_rt(): denied by export-list");
                        continue;
                }
 
-               if (or->path_type == OSPF_PATH_INTRA_AREA
-                             && !ospf_abr_plist_out_check(
-                                        area, or,
-                                        (struct prefix_ipv4 *)&rn->p)) {
+               if (
+                       or->path_type == OSPF_PATH_INTRA_AREA
+                                 && !ospf_abr_plist_out_check(
+                                            area, or,
+                                            (struct prefix_ipv4 *)&rn->p)) {
                        if (IS_DEBUG_OSPF_EVENT)
                                zlog_debug(
                                        "ospf_abr_process_network_rt(): denied by prefix-list");
@@ -1269,9 +1271,10 @@ static void ospf_abr_process_router_rt(struct ospf *ospf,
                                continue;
                        }
 
-                       if (or->path_type == OSPF_PATH_INTER_AREA
-                                     && !OSPF_IS_AREA_ID_BACKBONE(
-                                                or->u.std.area_id)) {
+                       if (
+                               or->path_type == OSPF_PATH_INTER_AREA
+                                         && !OSPF_IS_AREA_ID_BACKBONE(
+                                                    or->u.std.area_id)) {
                                if (IS_DEBUG_OSPF_EVENT)
                                        zlog_debug(
                                                "ospf_abr_process_router_rt(): "
index 10570f4e62f85cc7240fa29946176723a362ffad..f1a7433760daf5d7e34456c12b8e364a79aa1b6c 100644 (file)
@@ -131,60 +131,46 @@ const char *ospf_api_typename(int msgtype)
 {
        struct nametab NameTab[] = {
                {
-                       MSG_REGISTER_OPAQUETYPE,
-                       "Register opaque-type",
+                       MSG_REGISTER_OPAQUETYPE, "Register opaque-type",
                },
                {
-                       MSG_UNREGISTER_OPAQUETYPE,
-                       "Unregister opaque-type",
+                       MSG_UNREGISTER_OPAQUETYPE, "Unregister opaque-type",
                },
                {
-                       MSG_REGISTER_EVENT,
-                       "Register event",
+                       MSG_REGISTER_EVENT, "Register event",
                },
                {
-                       MSG_SYNC_LSDB,
-                       "Sync LSDB",
+                       MSG_SYNC_LSDB, "Sync LSDB",
                },
                {
-                       MSG_ORIGINATE_REQUEST,
-                       "Originate request",
+                       MSG_ORIGINATE_REQUEST, "Originate request",
                },
                {
-                       MSG_DELETE_REQUEST,
-                       "Delete request",
+                       MSG_DELETE_REQUEST, "Delete request",
                },
                {
-                       MSG_REPLY,
-                       "Reply",
+                       MSG_REPLY, "Reply",
                },
                {
-                       MSG_READY_NOTIFY,
-                       "Ready notify",
+                       MSG_READY_NOTIFY, "Ready notify",
                },
                {
-                       MSG_LSA_UPDATE_NOTIFY,
-                       "LSA update notify",
+                       MSG_LSA_UPDATE_NOTIFY, "LSA update notify",
                },
                {
-                       MSG_LSA_DELETE_NOTIFY,
-                       "LSA delete notify",
+                       MSG_LSA_DELETE_NOTIFY, "LSA delete notify",
                },
                {
-                       MSG_NEW_IF,
-                       "New interface",
+                       MSG_NEW_IF, "New interface",
                },
                {
-                       MSG_DEL_IF,
-                       "Del interface",
+                       MSG_DEL_IF, "Del interface",
                },
                {
-                       MSG_ISM_CHANGE,
-                       "ISM change",
+                       MSG_ISM_CHANGE, "ISM change",
                },
                {
-                       MSG_NSM_CHANGE,
-                       "NSM change",
+                       MSG_NSM_CHANGE, "NSM change",
                },
        };
 
@@ -205,48 +191,38 @@ const char *ospf_api_errname(int errcode)
 {
        struct nametab NameTab[] = {
                {
-                       OSPF_API_OK,
-                       "OK",
+                       OSPF_API_OK, "OK",
                },
                {
-                       OSPF_API_NOSUCHINTERFACE,
-                       "No such interface",
+                       OSPF_API_NOSUCHINTERFACE, "No such interface",
                },
                {
-                       OSPF_API_NOSUCHAREA,
-                       "No such area",
+                       OSPF_API_NOSUCHAREA, "No such area",
                },
                {
-                       OSPF_API_NOSUCHLSA,
-                       "No such LSA",
+                       OSPF_API_NOSUCHLSA, "No such LSA",
                },
                {
-                       OSPF_API_ILLEGALLSATYPE,
-                       "Illegal LSA type",
+                       OSPF_API_ILLEGALLSATYPE, "Illegal LSA type",
                },
                {
-                       OSPF_API_OPAQUETYPEINUSE,
-                       "Opaque type in use",
+                       OSPF_API_OPAQUETYPEINUSE, "Opaque type in use",
                },
                {
                        OSPF_API_OPAQUETYPENOTREGISTERED,
                        "Opaque type not registered",
                },
                {
-                       OSPF_API_NOTREADY,
-                       "Not ready",
+                       OSPF_API_NOTREADY, "Not ready",
                },
                {
-                       OSPF_API_NOMEMORY,
-                       "No memory",
+                       OSPF_API_NOMEMORY, "No memory",
                },
                {
-                       OSPF_API_ERROR,
-                       "Other error",
+                       OSPF_API_ERROR, "Other error",
                },
                {
-                       OSPF_API_UNDEF,
-                       "Undefined",
+                       OSPF_API_UNDEF, "Undefined",
                },
        };
 
index 2a178a684e9da0be956887083e8b11779cef980a..a5f5971ac01ea0e2aa1e045a808ad495f197f1f5 100644 (file)
@@ -1236,10 +1236,10 @@ static int apiserver_sync_callback(struct ospf_lsa *lsa, void *p_arg,
                        zlog_warn(
                                "apiserver_sync_callback: new_msg_update failed");
 #ifdef NOTYET
-/* Cannot allocate new message. What should we do? */
-/*        ospf_apiserver_free (apiserv);*/ /* Do nothing
-                                             here XXX
-                                             */
+                       /* Cannot allocate new message. What should we do? */
+                       /*        ospf_apiserver_free (apiserv);*/ /* Do nothing
+                                                                     here XXX
+                                                                     */
 #endif
                        goto out;
                }
index f00973d64a8d5aaac0f2f2ac0a7f30329137aff1..c775f2ea2e0daf82723f95afe7469e5b22e1ecae 100644 (file)
@@ -217,7 +217,7 @@ static void ospf_process_self_originated_lsa(struct ospf *ospf,
                break;
        case OSPF_OPAQUE_AS_LSA:
                ospf_opaque_lsa_refresh(new);
-               /* Reconsideration may needed. */ /* XXX */
+                       /* Reconsideration may needed. */ /* XXX */
                break;
        default:
                break;
@@ -281,7 +281,7 @@ int ospf_flood(struct ospf *ospf, struct ospf_neighbor *nbr,
                                        "LSA[Flooding]: Got a self-originated LSA, "
                                        "while local one is initial instance.");
                        ; /* Accept this LSA for quick LSDB resynchronization.
-                          */
+                            */
                } else if (monotime_since(&current->tv_recv, NULL)
                           < ospf->min_ls_arrival * 1000LL) {
                        if (IS_DEBUG_OSPF_EVENT)
index 38ce71293be15daeed1402133bf904170d04f204..c65d8b874361a2dd2b755070390e1adf7da20bad 100644 (file)
@@ -361,8 +361,10 @@ static void ospf_update_network_route(struct ospf *ospf, struct route_table *rt,
        }
 
        if (ospf->abr_type == OSPF_ABR_SHORTCUT) {
-               if (or->path_type == OSPF_PATH_INTRA_AREA
-                             && !OSPF_IS_AREA_ID_BACKBONE(or->u.std.area_id)) {
+               if (
+                       or->path_type == OSPF_PATH_INTRA_AREA
+                                 && !OSPF_IS_AREA_ID_BACKBONE(
+                                            or->u.std.area_id)) {
                        if (IS_DEBUG_OSPF_EVENT)
                                zlog_debug(
                                        "ospf_update_network_route(): Shortcut: "
@@ -648,7 +650,7 @@ void ospf_ia_routing(struct ospf *ospf, struct route_table *rt,
                                                        OSPF_EXAMINE_TRANSIT_SUMMARIES_ALL(
                                                                area, rt, rtrs);
                        } else { /* No active BB connection--consider all areas
-                                 */
+                                   */
                                if (IS_DEBUG_OSPF_EVENT)
                                        zlog_debug(
                                                "ospf_ia_routing(): "
index b4624f400fc4856afe0e41f1aac65a79518fdf8e..4ea8ec26f2acf892d923a212e60f361484b6007a 100644 (file)
@@ -428,9 +428,8 @@ struct ospf_interface *ospf_if_lookup_recv_if(struct ospf *ospf,
                        match = oi;
                else if (prefix_match(CONNECTED_PREFIX(oi->connected),
                                      (struct prefix *)&addr)) {
-                       if ((match == NULL)
-                           || (match->address->prefixlen
-                               < oi->address->prefixlen))
+                       if ((match == NULL) || (match->address->prefixlen
+                                               < oi->address->prefixlen))
                                match = oi;
                }
        }
index 38a17710cdc6b25580077b536b3ada3bdb5204b3..68adf2e10be7198e49c047927d2abe6d298798dc 100644 (file)
@@ -429,8 +429,8 @@ static char link_info_set(struct stream *s, struct in_addr id,
                         *
                         * Simpler just to subtract OSPF_MAX_LSA_SIZE though.
                         */
-                       ret = stream_resize(s, OSPF_MAX_PACKET_SIZE
-                                                      - OSPF_MAX_LSA_SIZE);
+                       ret = stream_resize(
+                               s, OSPF_MAX_PACKET_SIZE - OSPF_MAX_LSA_SIZE);
                }
 
                if (ret == OSPF_MAX_LSA_SIZE) {
@@ -519,9 +519,8 @@ static int lsa_link_broadcast_set(struct stream *s, struct ospf_interface *oi)
 
        dr = ospf_nbr_lookup_by_addr(oi->nbrs, &DR(oi));
        /* Describe Type 2 link. */
-       if (dr
-           && (dr->state == NSM_Full
-               || IPV4_ADDR_SAME(&oi->address->u.prefix4, &DR(oi)))
+       if (dr && (dr->state == NSM_Full
+                  || IPV4_ADDR_SAME(&oi->address->u.prefix4, &DR(oi)))
            && ospf_nbr_count(oi, NSM_Full) > 0) {
                if (IS_DEBUG_OSPF(lsa, LSA_GENERATE))
                        zlog_debug(
@@ -3418,7 +3417,7 @@ struct in_addr ospf_lsa_unique_id(struct ospf *ospf, struct ospf_lsdb *lsdb,
                        return id;
                }
                /* Masklen differs, then apply wildcard mask to Link State ID.
-                */
+                  */
                else {
                        masklen2ip(p->prefixlen, &mask);
 
index d1cc00b9136e2bc6d144f24aaafa1e5c39ad3acf..f284a04cbe5498a6ebf204066217252435bfb2ae 100644 (file)
@@ -55,9 +55,7 @@
 
 /* ospfd privileges */
 zebra_capabilities_t _caps_p[] = {
-       ZCAP_NET_RAW,
-       ZCAP_BIND,
-       ZCAP_NET_ADMIN,
+       ZCAP_NET_RAW, ZCAP_BIND, ZCAP_NET_ADMIN,
 };
 
 struct zebra_privs_t ospfd_privs = {
index a1e9533dbab8939c576c092127c72b0ff95fc6aa..33492cf7c9b91585acf4f9148c9138f75f51b25e 100644 (file)
@@ -460,8 +460,9 @@ struct ospf_neighbor *ospf_nbr_get(struct ospf_interface *oi,
 
        if (oi->type == OSPF_IFTYPE_VIRTUALLINK
            || oi->type == OSPF_IFTYPE_POINTOPOINT)
-               key.u.prefix4 = ospfh->router_id; /* index vlink and ptp nbrs by
-                                                    router-id */
+               key.u.prefix4 =
+                       ospfh->router_id; /* index vlink and ptp nbrs by
+                                            router-id */
        else
                key.u.prefix4 = iph->ip_src;
 
index 97f06afd6691e3780eb40cd0213f309d7a16e768..a2c40923b1d776d442b3f838890d9f0f195c2956 100644 (file)
@@ -1358,11 +1358,12 @@ void ospf_opaque_lsa_originate_schedule(struct ospf_interface *oi, int *delay0)
                         * list_isempty (oipt->id_list)
                         * not being empty.
                         */
-                       if (oipt->t_opaque_lsa_self
-                                   != NULL /* Waiting for a thread call. */
-                           || oipt->status == PROC_SUSPEND) /* Cannot
-                                                               originate
-                                                               now. */
+                       if (
+                               oipt->t_opaque_lsa_self
+                                       != NULL /* Waiting for a thread call. */
+                               || oipt->status == PROC_SUSPEND) /* Cannot
+                                                                   originate
+                                                                   now. */
                                continue;
 
                        ospf_opaque_lsa_reoriginate_schedule(
@@ -1383,11 +1384,12 @@ void ospf_opaque_lsa_originate_schedule(struct ospf_interface *oi, int *delay0)
                         * list_isempty (oipt->id_list)
                         * not being empty.
                         */
-                       if (oipt->t_opaque_lsa_self
-                                   != NULL /* Waiting for a thread call. */
-                           || oipt->status == PROC_SUSPEND) /* Cannot
-                                                               originate
-                                                               now. */
+                       if (
+                               oipt->t_opaque_lsa_self
+                                       != NULL /* Waiting for a thread call. */
+                               || oipt->status == PROC_SUSPEND) /* Cannot
+                                                                   originate
+                                                                   now. */
                                continue;
 
                        ospf_opaque_lsa_reoriginate_schedule(
@@ -1408,11 +1410,12 @@ void ospf_opaque_lsa_originate_schedule(struct ospf_interface *oi, int *delay0)
                         * list_isempty (oipt->id_list)
                         * not being empty.
                         */
-                       if (oipt->t_opaque_lsa_self
-                                   != NULL /* Waiting for a thread call. */
-                           || oipt->status == PROC_SUSPEND) /* Cannot
-                                                               originate
-                                                               now. */
+                       if (
+                               oipt->t_opaque_lsa_self
+                                       != NULL /* Waiting for a thread call. */
+                               || oipt->status == PROC_SUSPEND) /* Cannot
+                                                                   originate
+                                                                   now. */
                                continue;
 
                        ospf_opaque_lsa_reoriginate_schedule((void *)top,
index ee6623a05746ecfd286693d980f8530cd44a7121..ac2406ec2d363f5733d495e2b73359606ac6f10c 100644 (file)
@@ -643,9 +643,9 @@ static int ospf_write(struct thread *thread)
 #ifdef WANT_OSPF_WRITE_FRAGMENT
        static u_int16_t ipid = 0;
        u_int16_t maxdatasize;
-#endif  /* WANT_OSPF_WRITE_FRAGMENT */
-       /* $FRR indent$ */
-       /* clang-format off */
+#endif /* WANT_OSPF_WRITE_FRAGMENT */
+       /* $FRR indent$ */
+       /* clang-format off */
 #define OSPF_WRITE_IPHL_SHIFT 2
        int pkt_count = 0;
 
@@ -2436,15 +2436,15 @@ static int ospf_check_auth(struct ospf_interface *oi, struct ospf_header *ospfh)
                        return 0;
                }
                /* only MD5 crypto method can pass ospf_packet_examin() */
-               if (NULL
-                           == (ck = listgetdata(listtail(
-                                       OSPF_IF_PARAM(oi, auth_crypt))))
-                   || ospfh->u.crypt.key_id != ck->key_id ||
-                   /* Condition above uses the last key ID on the list,
-                      which is
-                      different from what ospf_crypt_key_lookup() does. A
-                      bug? */
-                   !ospf_check_md5_digest(oi, ospfh)) {
+               if (
+                       NULL == (ck = listgetdata(listtail(
+                                        OSPF_IF_PARAM(oi, auth_crypt))))
+                       || ospfh->u.crypt.key_id != ck->key_id ||
+                       /* Condition above uses the last key ID on the list,
+                          which is
+                          different from what ospf_crypt_key_lookup() does. A
+                          bug? */
+                       !ospf_check_md5_digest(oi, ospfh)) {
                        if (IS_DEBUG_OSPF_PACKET(ospfh->type - 1, RECV))
                                zlog_warn("interface %s: MD5 auth failed",
                                          IF_NAME(oi));
@@ -2548,7 +2548,7 @@ static unsigned ospf_lsa_examin(struct lsa_header *lsah, const u_int16_t lsalen,
                                                              header, "flags",
                                                              0, "# links" */
                        ntohs(rlsa->links)                 /* 16 bits */
-               );
+                       );
                break;
        case OSPF_AS_EXTERNAL_LSA:
        /* RFC2328 A.4.5, LSA header + 4 bytes followed by N>=1 12-bytes long
@@ -2772,7 +2772,7 @@ static unsigned ospf_packet_examin(struct ospf_header *oh,
                        bytesdeclared - OSPF_HEADER_SIZE - OSPF_LS_UPD_MIN_SIZE,
                        0,                     /* full LSAs */
                        ntohl(lsupd->num_lsas) /* 32 bits */
-               );
+                       );
                break;
        case OSPF_MSG_LS_ACK:
                /* RFC2328 A.3.6, packet header followed by N>=0 header-only
@@ -2888,8 +2888,8 @@ int ospf_read(struct thread *thread)
 
        ospfh = (struct ospf_header *)STREAM_PNT(ibuf);
        if (MSG_OK
-           != ospf_packet_examin(ospfh, stream_get_endp(ibuf)
-                                                - stream_get_getp(ibuf)))
+           != ospf_packet_examin(
+                      ospfh, stream_get_endp(ibuf) - stream_get_getp(ibuf)))
                return -1;
        /* Now it is safe to access all fields of OSPF packet header. */
 
@@ -2935,9 +2935,8 @@ int ospf_read(struct thread *thread)
         * or header area is backbone but ospf_interface is not
         * check for VLINK interface
         */
-       if ((oi == NULL)
-           || (OSPF_IS_AREA_ID_BACKBONE(ospfh->area_id)
-               && !OSPF_IS_AREA_ID_BACKBONE(oi->area->area_id))) {
+       if ((oi == NULL) || (OSPF_IS_AREA_ID_BACKBONE(ospfh->area_id)
+                            && !OSPF_IS_AREA_ID_BACKBONE(oi->area->area_id))) {
                if ((oi = ospf_associate_packet_vl(ospf, ifp, iph, ospfh))
                    == NULL) {
                        if (!ospf->instance && IS_DEBUG_OSPF_EVENT)
index 020dfe9d4d9b464e8441e090eb67152c3e59e624..9c4dca2e2fbea2ed79e2c4dbc2000c9d920b6546 100644 (file)
@@ -229,16 +229,18 @@ static void ospf_route_delete_uniq(struct route_table *rt,
                            or->path_type == OSPF_PATH_INTER_AREA) {
                                if (or->type == OSPF_DESTINATION_NETWORK) {
                                        if (!ospf_route_exist_new_table(
-                                                   cmprt, (struct prefix_ipv4
-                                                                   *)&rn->p))
+                                                   cmprt,
+                                                   (struct prefix_ipv4 *)&rn
+                                                           ->p))
                                                ospf_zebra_delete(
                                                        (struct prefix_ipv4
                                                                 *)&rn->p,
                                                        or);
                                } else if (or->type == OSPF_DESTINATION_DISCARD)
                                        if (!ospf_route_exist_new_table(
-                                                   cmprt, (struct prefix_ipv4
-                                                                   *)&rn->p))
+                                                   cmprt,
+                                                   (struct prefix_ipv4 *)&rn
+                                                           ->p))
                                                ospf_zebra_delete_discard(
                                                        (struct prefix_ipv4
                                                                 *)&rn->p);
index 80fdbf2158778fbfe6535d8bfb43d738a4fa90fa..547e1e8f53ee5250ea027125b872b3375663954f 100644 (file)
@@ -332,9 +332,7 @@ static route_map_result_t route_match_tag(void *rule, struct prefix *prefix,
 
 /* Route map commands for tag matching. */
 static struct route_map_rule_cmd route_match_tag_cmd = {
-       "tag",
-       route_match_tag,
-       route_map_rule_tag_compile,
+       "tag", route_match_tag, route_map_rule_tag_compile,
        route_map_rule_tag_free,
 };
 
@@ -392,9 +390,7 @@ static void route_set_metric_free(void *rule)
 
 /* Set metric rule structure. */
 struct route_map_rule_cmd route_set_metric_cmd = {
-       "metric",
-       route_set_metric,
-       route_set_metric_compile,
+       "metric", route_set_metric, route_set_metric_compile,
        route_set_metric_free,
 };
 
@@ -446,9 +442,7 @@ static void route_set_metric_type_free(void *rule)
 
 /* Set metric rule structure. */
 struct route_map_rule_cmd route_set_metric_type_cmd = {
-       "metric-type",
-       route_set_metric_type,
-       route_set_metric_type_compile,
+       "metric-type", route_set_metric_type, route_set_metric_type_compile,
        route_set_metric_type_free,
 };
 
@@ -471,9 +465,7 @@ static route_map_result_t route_set_tag(void *rule, struct prefix *prefix,
 
 /* Route map commands for tag set. */
 static struct route_map_rule_cmd route_set_tag_cmd = {
-       "tag",
-       route_set_tag,
-       route_map_rule_tag_compile,
+       "tag", route_set_tag, route_map_rule_tag_compile,
        route_map_rule_tag_free,
 };
 
index a8b7027194639b4ed137bc617a4b296f6544a7e6..6a352380b8c8c6b1e430dbc4724d24d2a6b67ffa 100644 (file)
@@ -872,9 +872,7 @@ static u_char *ospfStubAreaEntry(struct variable *v, oid *name, size_t *length,
                return SNMP_INTEGER(SNMP_VALID);
                break;
        case OSPFSTUBMETRICTYPE: /* 5 */
-                                /* OSPF Metric type. */
-                                /* $FRR indent$ */
-                                /* clang-format off */
+/* OSPF Metric type. */
 #define OSPF_ospfMetric     1
 #define OSPF_comparableCost 2
 #define OSPF_nonComparable  3
@@ -2102,8 +2100,7 @@ static struct ospf_neighbor *ospf_snmp_nbr_lookup(struct ospf *ospf,
 
        for (ALL_LIST_ELEMENTS(ospf->oiflist, node, nnode, oi)) {
                for (rn = route_top(oi->nbrs); rn; rn = route_next(rn))
-                       if ((nbr = rn->info) != NULL
-                           && nbr != oi->nbr_self
+                       if ((nbr = rn->info) != NULL && nbr != oi->nbr_self
                            /* If EXACT match is needed, provide ALL entry found
                                        && nbr->state != NSM_Down
                             */
index b644c94ca4d0069a6caa7cb113e997a90c66b85f..55d6c27e8c2d52c429d37dc299eaa92e109c8e66 100644 (file)
@@ -290,9 +290,8 @@ static void ospf_passive_interface_default(struct ospf *ospf, u_char newval)
        ospf->passive_interface_default = newval;
 
        for (ALL_LIST_ELEMENTS_RO(om->iflist, ln, ifp)) {
-               if (ifp
-                   && OSPF_IF_PARAM_CONFIGURED(IF_DEF_PARAMS(ifp),
-                                               passive_interface))
+               if (ifp && OSPF_IF_PARAM_CONFIGURED(IF_DEF_PARAMS(ifp),
+                                                   passive_interface))
                        UNSET_IF_PARAM(IF_DEF_PARAMS(ifp), passive_interface);
        }
        for (ALL_LIST_ELEMENTS_RO(ospf->oiflist, ln, oi)) {
@@ -395,9 +394,8 @@ DEFUN (ospf_passive_interface,
        for (rn = route_top(IF_OIFS(ifp)); rn; rn = route_next(rn)) {
                struct ospf_interface *oi = rn->info;
 
-               if (oi
-                   && (OSPF_IF_PARAM(oi, passive_interface)
-                       == OSPF_IF_PASSIVE))
+               if (oi && (OSPF_IF_PARAM(oi, passive_interface)
+                          == OSPF_IF_PASSIVE))
                        ospf_if_set_multicast(oi);
        }
        /*
@@ -2127,8 +2125,7 @@ ALIAS(ospf_compatible_rfc1583, ospf_rfc1583_flag_cmd,
       "Enable the RFC1583Compatibility flag\n")
 
 ALIAS(no_ospf_compatible_rfc1583, no_ospf_rfc1583_flag_cmd,
-      "no ospf rfc1583compatibility",
-      NO_STR
+      "no ospf rfc1583compatibility", NO_STR
       "OSPF specific commands\n"
       "Disable the RFC1583Compatibility flag\n")
 
@@ -2582,8 +2579,7 @@ DEFUN (no_ospf_write_multiplier,
 }
 
 ALIAS(no_ospf_write_multiplier, no_write_multiplier_cmd,
-      "no write-multiplier (1-100)",
-      NO_STR
+      "no write-multiplier (1-100)", NO_STR
       "Write multiplier\n"
       "Maximum number of interface serviced per write\n")
 
@@ -3181,9 +3177,8 @@ static int show_ip_ospf_common(struct vty *vty, struct ospf *ospf,
 
        if (use_json) {
                json_object_object_add(json, "areas", json_areas);
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        } else
                vty_out(vty, "\n");
@@ -3327,10 +3322,10 @@ static void show_ip_ospf_interface_sub(struct vty *vty, struct ospf *ospf,
                                        dstr = "Broadcast";
 
                                /* For Vlinks, showing the peer address is
-                                * probably more
-                                *  *  *  *                * informative than
-                                * the local interface that is being used
-                                *   *   *   *                               */
+                  * probably more
+                  *  *  *  *                * informative than the local
+                  * interface that is being used
+                  *   *   *   *                               */
                                if (oi->type == OSPF_IFTYPE_VIRTUALLINK)
                                        dest = &oi->vl_data->peer_addr;
                                else
@@ -3611,9 +3606,8 @@ static int show_ip_ospf_interface_common(struct vty *vty, struct ospf *ospf,
        }
 
        if (use_json) {
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        } else
                vty_out(vty, "\n");
@@ -3823,9 +3817,8 @@ static int show_ip_ospf_neighbor_common(struct vty *vty, struct ospf *ospf,
                show_ip_ospf_neighbor_sub(vty, oi, json, use_json);
 
        if (use_json) {
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        } else
                vty_out(vty, "\n");
@@ -3944,9 +3937,8 @@ static int show_ip_ospf_neighbor_all_common(struct vty *vty, struct ospf *ospf,
        }
 
        if (use_json) {
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        } else
                vty_out(vty, "\n");
@@ -4038,9 +4030,8 @@ static int show_ip_ospf_neighbor_int_common(struct vty *vty, struct ospf *ospf,
        }
 
        if (use_json) {
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        } else
                vty_out(vty, "\n");
@@ -4422,9 +4413,8 @@ static int show_ip_ospf_neighbor_id_common(struct vty *vty, struct ospf *ospf,
        }
 
        if (use_json) {
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        } else
                vty_out(vty, "\n");
@@ -4512,9 +4502,8 @@ static int show_ip_ospf_neighbor_detail_common(struct vty *vty,
        }
 
        if (use_json) {
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        } else
                vty_out(vty, "\n");
@@ -4611,9 +4600,8 @@ static int show_ip_ospf_neighbor_detail_all_common(struct vty *vty,
        }
 
        if (use_json) {
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        } else {
                vty_out(vty, "\n");
@@ -4714,9 +4702,8 @@ static int show_ip_ospf_neighbor_int_detail_common(struct vty *vty,
        }
 
        if (use_json) {
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        } else
                vty_out(vty, "\n");
index e1c961491f48772905f8d8dc5892d49ae1ef8ea9..f68c252a3563120ab00461f20ee847b4fcb46f9f 100644 (file)
@@ -404,9 +404,9 @@ int pim_assert_build_msg(uint8_t *pim_msg, int buf_size, struct interface *ifp,
        }
 
        /* Metric preference */
-       pim_write_uint32(pim_msg_curr, rpt_bit_flag
-                                              ? metric_preference | 0x80000000
-                                              : metric_preference);
+       pim_write_uint32(pim_msg_curr,
+                        rpt_bit_flag ? metric_preference | 0x80000000
+                                     : metric_preference);
        pim_msg_curr += 4;
 
        /* Route metric */
index 07678159d0f72b9bb8058be4df5e663ba614dc98..1c9fe40c299f7d76612342362cf7049c685bbc54 100644 (file)
@@ -423,9 +423,8 @@ static void pim_show_membership(struct vty *vty, u_char uj)
        } /* scan interface channels */
 
        if (uj) {
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
        } else {
                vty_out(vty,
                        "Interface  Address          Source           Group            Membership\n");
@@ -589,9 +588,8 @@ static void igmp_show_interfaces(struct vty *vty, u_char uj)
        }
 
        if (uj) {
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        }
 }
@@ -786,9 +784,8 @@ static void igmp_show_interfaces_single(struct vty *vty, const char *ifname,
        }
 
        if (uj) {
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        } else {
                if (!found_ifname)
@@ -1168,8 +1165,9 @@ static void pim_show_interfaces_single(struct vty *vty, const char *ifname,
                        print_header = 1;
                        for (ALL_LIST_ELEMENTS_RO(pim_upstream_list, upnode,
                                                  up)) {
-                               if (strcmp(ifp->name, up->rpf.source_nexthop
-                                                             .interface->name)
+                               if (strcmp(ifp->name,
+                                          up->rpf.source_nexthop
+                                                  .interface->name)
                                    == 0) {
                                        if (up->flags
                                            & PIM_UPSTREAM_FLAG_MASK_FHR) {
@@ -1256,9 +1254,8 @@ static void pim_show_interfaces_single(struct vty *vty, const char *ifname,
        }
 
        if (uj) {
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        } else {
                if (!found_ifname)
@@ -1317,9 +1314,8 @@ static void pim_show_interfaces(struct vty *vty, u_char uj)
        }
 
        if (uj) {
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
        } else {
                vty_out(vty,
                        "Interface  State          Address  PIM Nbrs           PIM DR  FHR IfChannels\n");
@@ -1436,9 +1432,8 @@ static void pim_show_interface_traffic(struct vty *vty, u_char uj)
                }
        }
        if (uj) {
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        }
 }
@@ -1523,9 +1518,8 @@ static void pim_show_interface_traffic_single(struct vty *vty,
                }
        }
        if (uj) {
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        } else {
                if (!found_ifname)
@@ -1628,9 +1622,8 @@ static void pim_show_join(struct vty *vty, u_char uj)
        } /* scan interface channels */
 
        if (uj) {
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        }
 }
@@ -1833,9 +1826,8 @@ static void pim_show_neighbors_single(struct vty *vty, const char *neighbor,
        }
 
        if (uj) {
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        } else {
                {
@@ -2039,9 +2031,8 @@ static void pim_show_state(struct vty *vty, const char *src_or_group,
 
 
        if (uj) {
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        } else {
                vty_out(vty, "\n");
@@ -2124,9 +2115,8 @@ static void pim_show_neighbors(struct vty *vty, u_char uj)
        }
 
        if (uj) {
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        }
 }
@@ -2356,9 +2346,8 @@ static void pim_show_upstream(struct vty *vty, u_char uj)
        }
 
        if (uj) {
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        }
 }
@@ -2442,9 +2431,8 @@ static void pim_show_join_desired(struct vty *vty, u_char uj)
        }
 
        if (uj) {
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        }
 }
@@ -2481,10 +2469,7 @@ static void pim_show_upstream_rpf(struct vty *vty, u_char uj)
                pim_addr_dump("<rpf?>", &rpf->rpf_addr, rpf_addr_str,
                              sizeof(rpf_addr_str));
 
-               rpf_ifname =
-                       rpf->source_nexthop.interface ? rpf->source_nexthop
-                                                               .interface->name
-                                                     : "<ifname?>";
+               rpf_ifname = rpf->source_nexthop.interface ? rpf->source_nexthop.interface->name : "<ifname?>";
 
                if (uj) {
                        json_object_object_get_ex(json, grp_str, &json_group);
@@ -2514,9 +2499,8 @@ static void pim_show_upstream_rpf(struct vty *vty, u_char uj)
        }
 
        if (uj) {
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        }
 }
@@ -2620,10 +2604,7 @@ static void pim_show_rpf(struct vty *vty, u_char uj)
                              &rpf->source_nexthop.mrib_nexthop_addr,
                              rib_nexthop_str, sizeof(rib_nexthop_str));
 
-               rpf_ifname =
-                       rpf->source_nexthop.interface ? rpf->source_nexthop
-                                                               .interface->name
-                                                     : "<ifname?>";
+               rpf_ifname = rpf->source_nexthop.interface ? rpf->source_nexthop.interface->name : "<ifname?>";
 
                if (uj) {
                        json_object_object_get_ex(json, grp_str, &json_group);
@@ -2661,9 +2642,8 @@ static void pim_show_rpf(struct vty *vty, u_char uj)
        }
 
        if (uj) {
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        }
 }
@@ -2822,9 +2802,8 @@ static void igmp_show_groups(struct vty *vty, u_char uj)
        }                 /* scan interfaces */
 
        if (uj) {
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        }
 }
@@ -4060,9 +4039,8 @@ static void show_mroute(struct vty *vty, u_char uj)
        }
 
        if (uj) {
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        }
 }
@@ -4655,9 +4633,8 @@ static void ip_pim_ssm_show_group_range(struct vty *vty, u_char uj)
                json_object *json;
                json = json_object_new_object();
                json_object_string_add(json, "ssmGroups", range_str);
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        } else
                vty_out(vty, "SSM group range : %s\n", range_str);
@@ -4699,9 +4676,8 @@ static void ip_pim_ssm_show_group_type(struct vty *vty, u_char uj,
                json_object *json;
                json = json_object_new_object();
                json_object_string_add(json, "groupType", type_str);
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        } else
                vty_out(vty, "Group type : %s\n", type_str);
@@ -6453,8 +6429,7 @@ DEFUN (ip_pim_bfd_param,
 }
 
 ALIAS(no_ip_pim_bfd, no_ip_pim_bfd_param_cmd,
-      "no ip pim bfd (2-255) (50-60000) (50-60000)",
-      NO_STR IP_STR PIM_STR
+      "no ip pim bfd (2-255) (50-60000) (50-60000)", NO_STR IP_STR PIM_STR
       "Enables BFD support\n"
       "Detect Multiplier\n"
       "Required min receive interval\n"
@@ -6815,9 +6790,8 @@ static void ip_msdp_show_mesh_group(struct vty *vty, u_char uj)
 
        if (uj) {
                json_object_object_add(json, mg->mesh_group_name, json_mg_row);
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        }
 }
@@ -6884,9 +6858,8 @@ static void ip_msdp_show_peers(struct vty *vty, u_char uj)
        }
 
        if (uj) {
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        }
 }
@@ -6990,9 +6963,8 @@ static void ip_msdp_show_peers_detail(struct vty *vty, const char *peer,
        }
 
        if (uj) {
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        }
 }
@@ -7089,9 +7061,8 @@ static void ip_msdp_show_sa(struct vty *vty, u_char uj)
 
 
        if (uj) {
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        }
 }
@@ -7182,9 +7153,8 @@ static void ip_msdp_show_sa_detail(struct vty *vty, u_char uj)
        }
 
        if (uj) {
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        }
 }
@@ -7227,9 +7197,8 @@ static void ip_msdp_show_sa_addr(struct vty *vty, const char *addr, u_char uj)
        }
 
        if (uj) {
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        }
 }
@@ -7257,9 +7226,8 @@ static void ip_msdp_show_sa_sg(struct vty *vty, const char *src,
        }
 
        if (uj) {
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        }
 }
index 5165f7890642f6852ef4a7bb06668a0d106d1e96..e742e68f6783011f0db2d833b6a38915ea524be9 100644 (file)
@@ -78,9 +78,10 @@ struct pim_interface {
        struct in_addr update_source;   /* user can statically set the primary
                                         * address of the interface */
 
-       int igmp_version;                      /* IGMP version */
-       int igmp_default_robustness_variable;  /* IGMPv3 QRV */
-       int igmp_default_query_interval;       /* IGMPv3 secs between general
+       int igmp_version;                     /* IGMP version */
+       int igmp_default_robustness_variable; /* IGMPv3 QRV */
+       int
+               igmp_default_query_interval;   /* IGMPv3 secs between general
                                                  queries */
        int igmp_query_max_response_time_dsec; /* IGMPv3 Max Response Time in
                                                  dsecs for general queries */
index cd9da1f53650afa5c1437198bd87ed4e430d1ffb..d4916518e74029afede254faa673ce2ece698ed9 100644 (file)
@@ -814,9 +814,8 @@ void pim_ifchannel_join_add(struct interface *ifp, struct in_addr neigh_addr,
                /*
                 * If we are going to be a LHR, we need to note it
                 */
-               if (ch->upstream->parent
-                   && (ch->upstream->parent->flags
-                       & PIM_UPSTREAM_FLAG_MASK_SRC_IGMP)
+               if (ch->upstream->parent && (ch->upstream->parent->flags
+                                            & PIM_UPSTREAM_FLAG_MASK_SRC_IGMP)
                    && !(ch->upstream->flags
                         & PIM_UPSTREAM_FLAG_MASK_SRC_LHR)) {
                        pim_upstream_ref(ch->upstream,
index ecaafaa587f8afd59e4ae4db04fc83ce9fff6a4f..b8e6d8ad3db41d6da1d21e03992fa972b6021d2c 100644 (file)
@@ -53,10 +53,7 @@ struct option longopts[] = {{0}};
 
 /* pimd privileges */
 zebra_capabilities_t _caps_p[] = {
-       ZCAP_NET_ADMIN,
-       ZCAP_SYS_ADMIN,
-       ZCAP_NET_RAW,
-       ZCAP_BIND,
+       ZCAP_NET_ADMIN, ZCAP_SYS_ADMIN, ZCAP_NET_RAW, ZCAP_BIND,
 };
 
 /* pimd privileges to run with */
index 648bc1d5b526e38619352d2686dcc76c5c65f81e..0f653e70a4310d2887bc2bef686fb99097e5ff30 100644 (file)
@@ -793,10 +793,10 @@ static void pim_msdp_peer_listen(struct pim_msdp_peer *mp)
        }
 
        /* this is interntionally asymmetric i.e. we set up listen-socket when
-        * the
-        * first listening peer is configured; but don't bother tearing it down
-        * when
-        * all the peers go down */
+       * the
+       * first listening peer is configured; but don't bother tearing it down
+       * when
+       * all the peers go down */
        pim_msdp_sock_listen();
 }
 
index 971994136213726d5d1fd3a4371598bea54ea65f..66e5457df443710243210e1cb6723ab07e660498 100644 (file)
@@ -69,7 +69,7 @@ enum pim_msdp_sa_flags {
        PIM_MSDP_SAF_PEER = (1 << 1),
        PIM_MSDP_SAF_REF = (PIM_MSDP_SAF_LOCAL | PIM_MSDP_SAF_PEER),
        PIM_MSDP_SAF_STALE = (1 << 2), /* local entries can get kicked out on
-                                       * misc pim events such as RP change */
+                                      * misc pim events such as RP change */
        PIM_MSDP_SAF_UP_DEL_IN_PROG = (1 << 3)
 };
 
@@ -116,13 +116,13 @@ struct pim_msdp_peer {
 #define PIM_MSDP_PEER_HOLD_TIME 75
        struct thread *hold_timer; // 5.4
                                   /* $FRR indent$ */
-                                  /* clang-format off */
+/* clang-format off */
 #define PIM_MSDP_PEER_KA_TIME 60
-       struct thread *ka_timer;   // 5.5
-                                  /* $FRR indent$ */
-                                  /* clang-format off */
+       struct thread *ka_timer; // 5.5
+                                /* $FRR indent$ */
+                                /* clang-format off */
 #define PIM_MSDP_PEER_CONNECT_RETRY_TIME 30
-       struct thread *cr_timer;   // 5.6
+       struct thread *cr_timer; // 5.6
 
        /* packet thread and buffers */
        uint32_t packet_size;
index 2210a91f98063591479c8a18c0b687f738b5422f..1cbe1dcf7ff00e78ccf866ccc639f838a36f6ed3 100644 (file)
@@ -330,9 +330,8 @@ int pim_register_recv(struct interface *ifp, struct in_addr dest_addr,
                        pim_str_sg_dump(&sg), src_str, ifp->name, i_am_rp);
        }
 
-       if (i_am_rp
-           && (dest_addr.s_addr
-               == ((RP(sg.grp))->rpf_addr.u.prefix4.s_addr))) {
+       if (i_am_rp && (dest_addr.s_addr
+                       == ((RP(sg.grp))->rpf_addr.u.prefix4.s_addr))) {
                sentRegisterStop = 0;
 
                if (*bits & PIM_REGISTER_BORDER_BIT) {
index 4c5722e3539621a64a33563d689ae4c99ecdbf40..2fe0143a87ef23443e0af6da7202babd9fa9bd8e 100644 (file)
@@ -948,9 +948,8 @@ void pim_rp_show_information(struct vty *vty, u_char uj)
                                inet_ntoa(prev_rp_info->rp.rpf_addr.u.prefix4),
                                json_rp_rows);
 
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        }
 }
index 5258377cca5082f9aa5e558d227e326427fd4dac..027b18e123bac6f5f0dd9bfed31f74c4ba140e00 100644 (file)
@@ -435,8 +435,9 @@ int zclient_lookup_nexthop(struct pim_zlookup_nexthop nexthop_tab[],
                                nexthop_tab[0].route_metric);
                }
 
-               addr = nexthop_addr.u.prefix4; /* use nexthop addr for
-                                                 recursive lookup */
+               addr =
+                       nexthop_addr.u.prefix4; /* use nexthop addr for
+                                                  recursive lookup */
 
        } /* for (max_lookup) */
 
index fd55592f88976396568325a8849fc1590094b2d4..c9022af713977f2477bc424b0115696f6c408d78 100644 (file)
@@ -74,6 +74,7 @@ static inline void qpb_free(qpb_allocator_t *allocator, void *ptr)
  */
 #define QPB_ALLOC(allocator, type) (type *)qpb_alloc(allocator, sizeof(type))
 
+
 /*
  * Externs.
  */
index 3dc54a6617b8beec67993d94f31659521434e030..a1704711230dc01b31b5b7ed1e9fa7f7cece36a7 100644 (file)
@@ -1855,9 +1855,7 @@ int config_write_rip_network(struct vty *vty, int config_mode)
 }
 
 static struct cmd_node interface_node = {
-       INTERFACE_NODE,
-       "%s(config-if)# ",
-       1,
+       INTERFACE_NODE, "%s(config-if)# ", 1,
 };
 
 /* Called when interface structure allocated. */
index 546efb2dadae6861eb0266f476f7add18852b6ff..7255df5e67848f1fb94f5ead512591df5ab8f2ee 100644 (file)
@@ -347,9 +347,7 @@ static route_map_result_t route_match_tag(void *rule, struct prefix *prefix,
 
 /* Route map commands for tag matching. */
 static struct route_map_rule_cmd route_match_tag_cmd = {
-       "tag",
-       route_match_tag,
-       route_map_rule_tag_compile,
+       "tag", route_match_tag, route_map_rule_tag_compile,
        route_map_rule_tag_free,
 };
 
@@ -438,9 +436,7 @@ static void route_set_metric_free(void *rule)
 
 /* Set metric rule structure. */
 static struct route_map_rule_cmd route_set_metric_cmd = {
-       "metric",
-       route_set_metric,
-       route_set_metric_compile,
+       "metric", route_set_metric, route_set_metric_compile,
        route_set_metric_free,
 };
 
index 79d4324ea184764056d6b284de78dc7c376ebc92..961a846db23f82d38db79872357694aabfc9a6e1 100644 (file)
@@ -661,8 +661,7 @@ int config_write_rip_redistribute(struct vty *vty, int config_mode)
 
 /* Zebra node structure. */
 static struct cmd_node zebra_node = {
-       ZEBRA_NODE,
-       "%s(config-router)# ",
+       ZEBRA_NODE, "%s(config-router)# ",
 };
 
 static void rip_zebra_connected(struct zclient *zclient)
index eb6c8f743a2711eb64de2ad72b8b082d0ff3a769..d9b38bba89384a043482ff4acf86752426bd8e0b 100644 (file)
@@ -454,8 +454,9 @@ static void rip_rte_process(struct rte *rte, struct sockaddr_in *from,
                /* Get back the object */
                rte->nexthop = newinfo.nexthop_out;
                rte->tag = htons(newinfo.tag_out); /* XXX */
-               rte->metric = newinfo.metric_out;  /* XXX: the routemap uses the
-                                                     metric_out field */
+               rte->metric =
+                       newinfo.metric_out; /* XXX: the routemap uses the
+                                              metric_out field */
        }
 
        /* Once the entry has been validated, update the metric by
index 0696d61ac03cf97dee1d39fe8b9344d2e8ceb268..3080801fb3537db541946a05f757e08fed8c5908 100644 (file)
@@ -150,9 +150,7 @@ static route_map_result_t route_match_tag(void *rule, struct prefix *prefix,
 }
 
 static struct route_map_rule_cmd route_match_tag_cmd = {
-       "tag",
-       route_match_tag,
-       route_map_rule_tag_compile,
+       "tag", route_match_tag, route_map_rule_tag_compile,
        route_map_rule_tag_free,
 };
 
@@ -242,9 +240,7 @@ static void route_set_metric_free(void *rule)
 }
 
 static struct route_map_rule_cmd route_set_metric_cmd = {
-       "metric",
-       route_set_metric,
-       route_set_metric_compile,
+       "metric", route_set_metric, route_set_metric_compile,
        route_set_metric_free,
 };
 
index 709a285ab5ab52a8af605e34b0d0a184705dfc66..386bee43b8cb6caf6b6acb7f27ad7b22690729bb 100644 (file)
@@ -507,8 +507,7 @@ static int zebra_config_write(struct vty *vty)
 
 /* Zebra node structure. */
 static struct cmd_node zebra_node = {
-       ZEBRA_NODE,
-       "%s(config-router)# ",
+       ZEBRA_NODE, "%s(config-router)# ",
 };
 
 static void ripng_zebra_connected(struct zclient *zclient)
index 874c42e7e8f1a9b9c4ded651f3b90f69cce4e4af..2883698f47b8bf59915dc11d7ebbcf9a5bfa5ee0 100644 (file)
@@ -742,8 +742,9 @@ static void ripng_route_process(struct rte *rte, struct sockaddr_in6 *from,
                        }
                }
                rte->tag = htons(newinfo.tag_out); /* XXX */
-               rte->metric = newinfo.metric_out;  /* XXX: the routemap uses the
-                                                     metric_out field */
+               rte->metric =
+                       newinfo.metric_out; /* XXX: the routemap uses the
+                                              metric_out field */
        }
 
        /* Once the entry has been validated, update the metric by
@@ -2717,9 +2718,7 @@ static int ripng_config_write(struct vty *vty)
 
 /* RIPng node structure. */
 static struct cmd_node cmd_ripng_node = {
-       RIPNG_NODE,
-       "%s(config-router)# ",
-       1,
+       RIPNG_NODE, "%s(config-router)# ", 1,
 };
 
 static void ripng_distribute_update(struct distribute *dist)
index 706825681b1e5bd6c2312ca27df0c97df2b7d012..46462d79c40caf90f272a7907658a5d73ed5f50d 100644 (file)
@@ -50,10 +50,8 @@ struct test_spec {
                                               deleted */
        const unsigned int hops;            /* aspath_count_hops result */
        const unsigned int confeds;      /* aspath_count_confeds */
-       const int private_as;   /* whether the private_as check should pass or
-                                  fail */
-                               /* $FRR indent$ */
-                               /* clang-format off */
+       const int private_as; /* whether the private_as check should pass or
+                                fail */
 #define NOT_ALL_PRIVATE 0
 #define ALL_PRIVATE 1
        const as_t does_loop;   /* an ASN which should trigger loop-check */
@@ -87,14 +85,7 @@ static struct test_segment {
                {0x2, 0x1, 0x22, 0x12, 0x2, 0x1, 0x00, 0x04},
                8,
                {
-                       "8722 4",
-                       "8722 4",
-                       2,
-                       0,
-                       NOT_ALL_PRIVATE,
-                       4,
-                       5,
-                       8722,
+                       "8722 4", "8722 4", 2, 0, NOT_ALL_PRIVATE, 4, 5, 8722,
                },
        },
        {
@@ -407,22 +398,8 @@ static struct test_segment {
                "reconcile_start_trans",
                "seq(23456,23456,23456) seq(6435,59408,21665)",
                {
-                       0x2,
-                       0x3,
-                       0x5b,
-                       0xa0,
-                       0x5b,
-                       0xa0,
-                       0x5b,
-                       0xa0,
-                       0x2,
-                       0x3,
-                       0x19,
-                       0x23,
-                       0xe8,
-                       0x10,
-                       0x54,
-                       0xa1,
+                       0x2, 0x3, 0x5b, 0xa0, 0x5b, 0xa0, 0x5b, 0xa0, 0x2, 0x3,
+                       0x19, 0x23, 0xe8, 0x10, 0x54, 0xa1,
                },
                16,
                {"23456 23456 23456 6435 59408 21665",
@@ -434,22 +411,8 @@ static struct test_segment {
                "reconcile_start_trans4",
                "seq(1842,41591,51793) seq(6435,59408,21665)",
                {
-                       0x2,
-                       0x3,
-                       0x07,
-                       0x32,
-                       0xa2,
-                       0x77,
-                       0xca,
-                       0x51,
-                       0x2,
-                       0x3,
-                       0x19,
-                       0x23,
-                       0xe8,
-                       0x10,
-                       0x54,
-                       0xa1,
+                       0x2, 0x3, 0x07, 0x32, 0xa2, 0x77, 0xca, 0x51, 0x2, 0x3,
+                       0x19, 0x23, 0xe8, 0x10, 0x54, 0xa1,
                },
                16,
                {"1842 41591 51793 6435 59408 21665",
@@ -461,20 +424,8 @@ static struct test_segment {
                "reconcile_start_trans_error",
                "seq(23456,23456,23456) seq(6435,59408)",
                {
-                       0x2,
-                       0x3,
-                       0x5b,
-                       0xa0,
-                       0x5b,
-                       0xa0,
-                       0x5b,
-                       0xa0,
-                       0x2,
-                       0x2,
-                       0x19,
-                       0x23,
-                       0xe8,
-                       0x10,
+                       0x2, 0x3, 0x5b, 0xa0, 0x5b, 0xa0, 0x5b, 0xa0, 0x2, 0x2,
+                       0x19, 0x23, 0xe8, 0x10,
                },
                14,
                {"23456 23456 23456 6435 59408", "23456 23456 23456 6435 59408",
@@ -552,10 +503,7 @@ static struct aspath_tests {
                0,
                0,
                {
-                       COMMON_ATTRS,
-                       BGP_ATTR_FLAG_TRANS,
-                       BGP_ATTR_AS_PATH,
-                       10,
+                       COMMON_ATTRS, BGP_ATTR_FLAG_TRANS, BGP_ATTR_AS_PATH, 10,
                },
                COMMON_ATTR_SIZE + 3,
        },
@@ -568,10 +516,7 @@ static struct aspath_tests {
                -1,
                0,
                {
-                       COMMON_ATTRS,
-                       BGP_ATTR_FLAG_TRANS,
-                       BGP_ATTR_AS_PATH,
-                       8,
+                       COMMON_ATTRS, BGP_ATTR_FLAG_TRANS, BGP_ATTR_AS_PATH, 8,
                },
                COMMON_ATTR_SIZE + 3,
        },
@@ -584,10 +529,7 @@ static struct aspath_tests {
                -1,
                0,
                {
-                       COMMON_ATTRS,
-                       BGP_ATTR_FLAG_TRANS,
-                       BGP_ATTR_AS_PATH,
-                       12,
+                       COMMON_ATTRS, BGP_ATTR_FLAG_TRANS, BGP_ATTR_AS_PATH, 12,
                },
                COMMON_ATTR_SIZE + 3,
        },
@@ -602,8 +544,7 @@ static struct aspath_tests {
                {
                        COMMON_ATTRS,
                        BGP_ATTR_FLAG_TRANS | BGP_ATTR_FLAG_OPTIONAL,
-                       BGP_ATTR_AS_PATH,
-                       10,
+                       BGP_ATTR_AS_PATH, 10,
                },
                COMMON_ATTR_SIZE + 3,
        },
@@ -618,8 +559,7 @@ static struct aspath_tests {
                {
                        COMMON_ATTRS,
                        BGP_ATTR_FLAG_TRANS | BGP_ATTR_FLAG_OPTIONAL,
-                       BGP_ATTR_AS4_PATH,
-                       10,
+                       BGP_ATTR_AS4_PATH, 10,
                },
                COMMON_ATTR_SIZE + 3,
        },
@@ -634,8 +574,7 @@ static struct aspath_tests {
                {
                        COMMON_ATTRS,
                        BGP_ATTR_FLAG_TRANS | BGP_ATTR_FLAG_OPTIONAL,
-                       BGP_ATTR_AS4_PATH,
-                       10,
+                       BGP_ATTR_AS4_PATH, 10,
                },
                COMMON_ATTR_SIZE + 3,
        },
@@ -648,10 +587,7 @@ static struct aspath_tests {
                0,
                PEER_CAP_AS4_RCV | PEER_CAP_AS4_ADV,
                {
-                       COMMON_ATTRS,
-                       BGP_ATTR_FLAG_TRANS,
-                       BGP_ATTR_AS_PATH,
-                       18,
+                       COMMON_ATTRS, BGP_ATTR_FLAG_TRANS, BGP_ATTR_AS_PATH, 18,
                },
                COMMON_ATTR_SIZE + 3,
        },
@@ -664,10 +600,7 @@ static struct aspath_tests {
                -1,
                PEER_CAP_AS4_RCV | PEER_CAP_AS4_ADV,
                {
-                       COMMON_ATTRS,
-                       BGP_ATTR_FLAG_TRANS,
-                       BGP_ATTR_AS_PATH,
-                       16,
+                       COMMON_ATTRS, BGP_ATTR_FLAG_TRANS, BGP_ATTR_AS_PATH, 16,
                },
                COMMON_ATTR_SIZE + 3,
        },
@@ -680,10 +613,7 @@ static struct aspath_tests {
                -1,
                PEER_CAP_AS4_RCV | PEER_CAP_AS4_ADV,
                {
-                       COMMON_ATTRS,
-                       BGP_ATTR_FLAG_TRANS,
-                       BGP_ATTR_AS_PATH,
-                       20,
+                       COMMON_ATTRS, BGP_ATTR_FLAG_TRANS, BGP_ATTR_AS_PATH, 20,
                },
                COMMON_ATTR_SIZE + 3,
        },
@@ -696,10 +626,7 @@ static struct aspath_tests {
                -1,
                PEER_CAP_AS4_RCV | PEER_CAP_AS4_ADV,
                {
-                       COMMON_ATTRS,
-                       BGP_ATTR_FLAG_TRANS,
-                       BGP_ATTR_AS_PATH,
-                       22,
+                       COMMON_ATTRS, BGP_ATTR_FLAG_TRANS, BGP_ATTR_AS_PATH, 22,
                },
                COMMON_ATTR_SIZE + 3,
        },
@@ -714,8 +641,7 @@ static struct aspath_tests {
                {
                        COMMON_ATTRS,
                        BGP_ATTR_FLAG_TRANS | BGP_ATTR_FLAG_OPTIONAL,
-                       BGP_ATTR_AS_PATH,
-                       18,
+                       BGP_ATTR_AS_PATH, 18,
                },
                COMMON_ATTR_SIZE + 3,
        },
@@ -730,8 +656,7 @@ static struct aspath_tests {
                {
                        COMMON_ATTRS,
                        BGP_ATTR_FLAG_TRANS | BGP_ATTR_FLAG_OPTIONAL,
-                       BGP_ATTR_AS4_PATH,
-                       14,
+                       BGP_ATTR_AS4_PATH, 14,
                },
                COMMON_ATTR_SIZE + 3,
        },
@@ -746,8 +671,7 @@ static struct aspath_tests {
                {
                        COMMON_ATTRS,
                        BGP_ATTR_FLAG_TRANS | BGP_ATTR_FLAG_OPTIONAL,
-                       BGP_ATTR_AS4_PATH,
-                       14,
+                       BGP_ATTR_AS4_PATH, 14,
                },
                COMMON_ATTR_SIZE + 3,
                &test_segments[0],
@@ -880,13 +804,7 @@ static struct tests {
        {NULL,
         NULL,
         {
-                NULL,
-                0,
-                0,
-                0,
-                0,
-                0,
-                0,
+                NULL, 0, 0, 0, 0, 0, 0,
         }},
 };
 
@@ -934,13 +852,7 @@ struct tests reconcile_tests[] = {
        {NULL,
         NULL,
         {
-                NULL,
-                0,
-                0,
-                0,
-                0,
-                0,
-                0,
+                NULL, 0, 0, 0, 0, 0, 0,
         }},
 };
 
index 2b515b0f78863c189039da0eac5d8876e177e812..9ec2b5df19698aa07beb2c2236776723bea8062f 100644 (file)
@@ -216,387 +216,439 @@ static struct test_segment mp_segments[] = {
        },
        {NULL, NULL, {0}, 0, 0}};
 
-static struct test_segment misc_segments[] = {
-       /* 13 */
+static struct test_segment misc_segments[] =
        {
-               "ORF",
-               "ORF, simple, single entry, single tuple",
-               {/* hdr */ CAPABILITY_CODE_ORF, 0x7,
-                /* mpc */ 0x0, 0x1, 0x0, 0x1,
-                /* num */ 0x1,
-                /* tuples */ 0x40, 0x3},
-               9,
-               SHOULD_PARSE,
-       },
-       /* 14 */
-       {
-               "ORF-many",
-               "ORF, multi entry/tuple",
+               /* 13 */
                {
-                       /* hdr */ CAPABILITY_CODE_ORF,
-                       0x21,
-                       /* mpc */ 0x0,
-                       0x1,
-                       0x0,
-                       0x1,
-                       /* num */ 0x3,
-                       /* tuples */ 0x40,
-                       ORF_MODE_BOTH,
-                       0x80,
-                       ORF_MODE_RECEIVE,
-                       0x80,
-                       ORF_MODE_SEND,
-                       /* mpc */ 0x0,
-                       0x2,
-                       0x0,
-                       0x1,
-                       /* num */ 0x3,
-                       /* tuples */ 0x40,
-                       ORF_MODE_BOTH,
-                       0x80,
-                       ORF_MODE_RECEIVE,
-                       0x80,
-                       ORF_MODE_SEND,
-                       /* mpc */ 0x0,
-                       0x2,
-                       0x0,
-                       0x2,
-                       /* num */ 0x3,
-                       /* tuples */ 0x40,
-                       ORF_MODE_RECEIVE,
-                       0x80,
-                       ORF_MODE_SEND,
-                       0x80,
-                       ORF_MODE_BOTH,
+                       "ORF",
+                       "ORF, simple, single entry, single tuple",
+                       {/* hdr */ CAPABILITY_CODE_ORF, 0x7,
+                        /* mpc */ 0x0, 0x1, 0x0, 0x1,
+                        /* num */ 0x1,
+                        /* tuples */ 0x40, 0x3},
+                       9,
+                       SHOULD_PARSE,
                },
-               35,
-               SHOULD_PARSE,
-       },
-       /* 15 */
-       {
-               "ORFlo",
-               "ORF, multi entry/tuple, hdr length too short",
+               /* 14 */
                {
-                       /* hdr */ CAPABILITY_CODE_ORF,
-                       0x15,
-                       /* mpc */ 0x0,
-                       0x1,
-                       0x0,
-                       0x1,
-                       /* num */ 0x3,
-                       /* tuples */ 0x40,
-                       0x3,
-                       0x80,
-                       0x1,
-                       0x80,
-                       0x2,
-                       /* mpc */ 0x0,
-                       0x1,
-                       0x0,
-                       0x1,
-                       /* num */ 0x3,
-                       /* tuples */ 0x40,
-                       0x3,
-                       0x80,
-                       0x1,
-                       0x80,
-                       0x2,
-                       /* mpc */ 0x0,
-                       0x2,
-                       0x0,
-                       0x2,
-                       /* num */ 0x3,
-                       /* tuples */ 0x40,
-                       0x3,
-                       0x80,
-                       0x1,
-                       0x80,
-                       0x2,
+                       "ORF-many",
+                       "ORF, multi entry/tuple",
+                       {
+                               /* hdr */ CAPABILITY_CODE_ORF,
+                               0x21,
+                               /* mpc */ 0x0,
+                               0x1,
+                               0x0,
+                               0x1,
+                               /* num */ 0x3,
+                               /* tuples */ 0x40,
+                               ORF_MODE_BOTH,
+                               0x80,
+                               ORF_MODE_RECEIVE,
+                               0x80,
+                               ORF_MODE_SEND,
+                               /* mpc */ 0x0,
+                               0x2,
+                               0x0,
+                               0x1,
+                               /* num */ 0x3,
+                               /* tuples */ 0x40,
+                               ORF_MODE_BOTH,
+                               0x80,
+                               ORF_MODE_RECEIVE,
+                               0x80,
+                               ORF_MODE_SEND,
+                               /* mpc */ 0x0,
+                               0x2,
+                               0x0,
+                               0x2,
+                               /* num */ 0x3,
+                               /* tuples */ 0x40,
+                               ORF_MODE_RECEIVE,
+                               0x80,
+                               ORF_MODE_SEND,
+                               0x80,
+                               ORF_MODE_BOTH,
+                       },
+                       35,
+                       SHOULD_PARSE,
                },
-               35,
-               SHOULD_ERR, /* It should error on invalid
-                              Route-Refresh.. */
-       },
-       /* 16 */
-       {"ORFlu",
-        "ORF, multi entry/tuple, length too long",
-        {
-                /* hdr */ 0x3,     0x22,
-                /* mpc */ 0x0,     0x1,  0x0,  0x1,
-                /* num */ 0x3,
-                /* tuples */ 0x40, 0x3,  0x80, 0x1, 0x80, 0x2,
-                /* mpc */ 0x0,     0x2,  0x0,  0x1,
-                /* num */ 0x3,
-                /* tuples */ 0x40, 0x3,  0x80, 0x1, 0x80, 0x2,
-                /* mpc */ 0x0,     0x2,  0x0,  0x2,
-                /* num */ 0x3,
-                /* tuples */ 0x40, 0x3,  0x80, 0x1, 0x80, 0x2,
-        },
-        35,
-        SHOULD_ERR},
-       /* 17 */
-       {
-               "ORFnu",
-               "ORF, multi entry/tuple, entry number too long",
+               /* 15 */
                {
-                       /* hdr */ 0x3,     0x21,
-                       /* mpc */ 0x0,     0x1,  0x0,  0x1,
-                       /* num */ 0x3,
-                       /* tuples */ 0x40, 0x3,  0x80, 0x1, 0x80, 0x2,
-                       /* mpc */ 0x0,     0x2,  0x0,  0x1,
-                       /* num */ 0x4,
-                       /* tuples */ 0x40, 0x3,  0x80, 0x1, 0x80, 0x2,
-                       /* mpc */ 0x0,     0x2,  0x0,  0x2,
-                       /* num */ 0x3,
-                       /* tuples */ 0x40, 0x3,  0x80, 0x1, 0x80, 0x2,
+                       "ORFlo",
+                       "ORF, multi entry/tuple, hdr length too short",
+                       {
+                               /* hdr */ CAPABILITY_CODE_ORF,
+                               0x15,
+                               /* mpc */ 0x0,
+                               0x1,
+                               0x0,
+                               0x1,
+                               /* num */ 0x3,
+                               /* tuples */ 0x40,
+                               0x3,
+                               0x80,
+                               0x1,
+                               0x80,
+                               0x2,
+                               /* mpc */ 0x0,
+                               0x1,
+                               0x0,
+                               0x1,
+                               /* num */ 0x3,
+                               /* tuples */ 0x40,
+                               0x3,
+                               0x80,
+                               0x1,
+                               0x80,
+                               0x2,
+                               /* mpc */ 0x0,
+                               0x2,
+                               0x0,
+                               0x2,
+                               /* num */ 0x3,
+                               /* tuples */ 0x40,
+                               0x3,
+                               0x80,
+                               0x1,
+                               0x80,
+                               0x2,
+                       },
+                       35,
+                       SHOULD_ERR, /* It should error on invalid
+                                      Route-Refresh.. */
                },
-               35,
-               SHOULD_PARSE, /* parses, but last few tuples should be
-                                gibberish */
-       },
-       /* 18 */
-       {
-               "ORFno",
-               "ORF, multi entry/tuple, entry number too short",
+               /* 16 */
+               {"ORFlu",
+                "ORF, multi entry/tuple, length too long",
+                {
+                        /* hdr */ 0x3,
+                        0x22,
+                        /* mpc */ 0x0,
+                        0x1,
+                        0x0,
+                        0x1,
+                        /* num */ 0x3,
+                        /* tuples */ 0x40,
+                        0x3,
+                        0x80,
+                        0x1,
+                        0x80,
+                        0x2,
+                        /* mpc */ 0x0,
+                        0x2,
+                        0x0,
+                        0x1,
+                        /* num */ 0x3,
+                        /* tuples */ 0x40,
+                        0x3,
+                        0x80,
+                        0x1,
+                        0x80,
+                        0x2,
+                        /* mpc */ 0x0,
+                        0x2,
+                        0x0,
+                        0x2,
+                        /* num */ 0x3,
+                        /* tuples */ 0x40,
+                        0x3,
+                        0x80,
+                        0x1,
+                        0x80,
+                        0x2,
+                },
+                35,
+                SHOULD_ERR},
+               /* 17 */
                {
-                       /* hdr */ 0x3,     0x21,
-                       /* mpc */ 0x0,     0x1,  0x0,  0x1,
-                       /* num */ 0x3,
-                       /* tuples */ 0x40, 0x3,  0x80, 0x1, 0x80, 0x2,
-                       /* mpc */ 0x0,     0x2,  0x0,  0x1,
-                       /* num */ 0x1,
-                       /* tuples */ 0x40, 0x3,  0x80, 0x1, 0x80, 0x2,
-                       /* mpc */ 0x0,     0x2,  0x0,  0x2,
-                       /* num */ 0x3,
-                       /* tuples */ 0x40, 0x3,  0x80, 0x1, 0x80, 0x2,
+                       "ORFnu",
+                       "ORF, multi entry/tuple, entry number too long",
+                       {
+                               /* hdr */ 0x3,
+                               0x21,
+                               /* mpc */ 0x0,
+                               0x1,
+                               0x0,
+                               0x1,
+                               /* num */ 0x3,
+                               /* tuples */ 0x40,
+                               0x3,
+                               0x80,
+                               0x1,
+                               0x80,
+                               0x2,
+                               /* mpc */ 0x0,
+                               0x2,
+                               0x0,
+                               0x1,
+                               /* num */ 0x4,
+                               /* tuples */ 0x40,
+                               0x3,
+                               0x80,
+                               0x1,
+                               0x80,
+                               0x2,
+                               /* mpc */ 0x0,
+                               0x2,
+                               0x0,
+                               0x2,
+                               /* num */ 0x3,
+                               /* tuples */ 0x40,
+                               0x3,
+                               0x80,
+                               0x1,
+                               0x80,
+                               0x2,
+                       },
+                       35,
+                       SHOULD_PARSE, /* parses, but last few tuples should be
+                                        gibberish */
                },
-               35,
-               SHOULD_PARSE, /* Parses, but should get gibberish
-                                afi/safis */
-       },
-       /* 17 */
-       {
-               "ORFpad",
-               "ORF, multi entry/tuple, padded to align",
+               /* 18 */
                {
-                       /* hdr */ 0x3,
-                       0x22,
-                       /* mpc */ 0x0,
-                       0x1,
-                       0x0,
-                       0x1,
-                       /* num */ 0x3,
-                       /* tuples */ 0x40,
-                       0x3,
-                       0x80,
-                       0x1,
-                       0x80,
-                       0x2,
-                       /* mpc */ 0x0,
-                       0x2,
-                       0x0,
-                       0x1,
-                       /* num */ 0x3,
-                       /* tuples */ 0x40,
-                       0x3,
-                       0x80,
-                       0x1,
-                       0x80,
-                       0x2,
-                       /* mpc */ 0x0,
-                       0x2,
-                       0x0,
-                       0x2,
-                       /* num */ 0x3,
-                       /* tuples */ 0x40,
-                       0x3,
-                       0x80,
-                       0x1,
-                       0x80,
-                       0x2,
-                       0x00,
+                       "ORFno",
+                       "ORF, multi entry/tuple, entry number too short",
+                       {
+                               /* hdr */ 0x3,
+                               0x21,
+                               /* mpc */ 0x0,
+                               0x1,
+                               0x0,
+                               0x1,
+                               /* num */ 0x3,
+                               /* tuples */ 0x40,
+                               0x3,
+                               0x80,
+                               0x1,
+                               0x80,
+                               0x2,
+                               /* mpc */ 0x0,
+                               0x2,
+                               0x0,
+                               0x1,
+                               /* num */ 0x1,
+                               /* tuples */ 0x40,
+                               0x3,
+                               0x80,
+                               0x1,
+                               0x80,
+                               0x2,
+                               /* mpc */ 0x0,
+                               0x2,
+                               0x0,
+                               0x2,
+                               /* num */ 0x3,
+                               /* tuples */ 0x40,
+                               0x3,
+                               0x80,
+                               0x1,
+                               0x80,
+                               0x2,
+                       },
+                       35,
+                       SHOULD_PARSE, /* Parses, but should get gibberish
+                                        afi/safis */
                },
-               36,
-               SHOULD_PARSE,
-       },
-       /* 19 */
-       {
-               "AS4",
-               "AS4 capability",
-               {0x41, 0x4, 0xab, 0xcd, 0xef, 0x12}, /* AS: 2882400018 */
-               6,
-               SHOULD_PARSE,
-               2882400018,
-       },
-       {
-               "AS4",
-               "AS4 capability: short",
-               {0x41, 0x4, 0xab, 0xcd, 0xef}, /* AS: 2882400018 */
-               5,
-               SHOULD_ERR,
-       },
-       {
-               "AS4",
-               "AS4 capability: long",
-               {0x41, 0x4, 0xab, 0xcd, 0xef, 0x12, 0x12},
-               7,
-               SHOULD_ERR,
-               2882400018,
-       },
-       {
-               "GR",
-               "GR capability",
+               /* 17 */
                {
-                       /* hdr */ CAPABILITY_CODE_RESTART,
-                       0xe,
-                       /* R-bit, time */ 0xf1,
-                       0x12,
-                       /* afi */ 0x0,
-                       0x1,
-                       /* safi */ 0x1,
-                       /* flags */ 0xf,
-                       /* afi */ 0x0,
-                       0x2,
-                       /* safi */ 0x1,
-                       /* flags */ 0x0,
-                       /* afi */ 0x0,
-                       0x2,
-                       /* safi */ 0x2,
-                       /* flags */ 0x1,
+                       "ORFpad",
+                       "ORF, multi entry/tuple, padded to align",
+                       {
+                               /* hdr */ 0x3,
+                               0x22,
+                               /* mpc */ 0x0,
+                               0x1,
+                               0x0,
+                               0x1,
+                               /* num */ 0x3,
+                               /* tuples */ 0x40,
+                               0x3,
+                               0x80,
+                               0x1,
+                               0x80,
+                               0x2,
+                               /* mpc */ 0x0,
+                               0x2,
+                               0x0,
+                               0x1,
+                               /* num */ 0x3,
+                               /* tuples */ 0x40,
+                               0x3,
+                               0x80,
+                               0x1,
+                               0x80,
+                               0x2,
+                               /* mpc */ 0x0,
+                               0x2,
+                               0x0,
+                               0x2,
+                               /* num */ 0x3,
+                               /* tuples */ 0x40,
+                               0x3,
+                               0x80,
+                               0x1,
+                               0x80,
+                               0x2,
+                               0x00,
+                       },
+                       36,
+                       SHOULD_PARSE,
                },
-               16,
-               SHOULD_PARSE,
-       },
-       {
-               "GR-short",
-               "GR capability, but header length too short",
+               /* 19 */
                {
-                       /* hdr */ 0x40,
-                       0xa,
-                       /* R-bit, time */ 0xf1,
-                       0x12,
-                       /* afi */ 0x0,
-                       0x1,
-                       /* safi */ 0x1,
-                       /* flags */ 0xf,
-                       /* afi */ 0x0,
-                       0x2,
-                       /* safi */ 0x1,
-                       /* flags */ 0x0,
-                       /* afi */ 0x0,
-                       0x2,
-                       /* safi */ 0x2,
-                       /* flags */ 0x1,
+                       "AS4",
+                       "AS4 capability",
+                       {0x41, 0x4, 0xab, 0xcd, 0xef,
+                        0x12}, /* AS: 2882400018 */
+                       6,
+                       SHOULD_PARSE,
+                       2882400018,
                },
-               15 /* array is 16 though */,
-               SHOULD_ERR,
-       },
-       {
-               "GR-long",
-               "GR capability, but header length too long",
                {
-                       /* hdr */ 0x40,
-                       0xf,
-                       /* R-bit, time */ 0xf1,
-                       0x12,
-                       /* afi */ 0x0,
-                       0x1,
-                       /* safi */ 0x1,
-                       /* flags */ 0xf,
-                       /* afi */ 0x0,
-                       0x2,
-                       /* safi */ 0x1,
-                       /* flags */ 0x0,
-                       /* afi */ 0x0,
-                       0x2,
-                       /* safi */ 0x2,
-                       /* flags */ 0x01,
+                       "AS4",
+                       "AS4 capability: short",
+                       {0x41, 0x4, 0xab, 0xcd, 0xef}, /* AS: 2882400018 */
+                       5,
+                       SHOULD_ERR,
                },
-               16,
-               SHOULD_ERR,
-       },
-       {
-               "GR-trunc",
-               "GR capability, but truncated",
                {
-                       /* hdr */ 0x40,
-                       0xf,
-                       /* R-bit, time */ 0xf1,
-                       0x12,
-                       /* afi */ 0x0,
-                       0x1,
-                       /* safi */ 0x1,
-                       /* flags */ 0xf,
-                       /* afi */ 0x0,
-                       0x2,
-                       /* safi */ 0x1,
-                       /* flags */ 0x0,
-                       /* afi */ 0x0,
-                       0x2,
-                       /* safi */ 0x2,
-                       /* flags */ 0x1,
+                       "AS4",
+                       "AS4 capability: long",
+                       {0x41, 0x4, 0xab, 0xcd, 0xef, 0x12, 0x12},
+                       7,
+                       SHOULD_ERR,
+                       2882400018,
                },
-               15,
-               SHOULD_ERR,
-       },
-       {
-               "GR-empty",
-               "GR capability, but empty.",
                {
-                       /* hdr */ 0x40,
-                       0x0,
+                       "GR",
+                       "GR capability",
+                       {
+                               /* hdr */ CAPABILITY_CODE_RESTART, 0xe,
+                               /* R-bit, time */ 0xf1, 0x12,
+                               /* afi */ 0x0, 0x1,
+                               /* safi */ 0x1,
+                               /* flags */ 0xf,
+                               /* afi */ 0x0, 0x2,
+                               /* safi */ 0x1,
+                               /* flags */ 0x0,
+                               /* afi */ 0x0, 0x2,
+                               /* safi */ 0x2,
+                               /* flags */ 0x1,
+                       },
+                       16,
+                       SHOULD_PARSE,
                },
-               2,
-               SHOULD_ERR,
-       },
-       {
-               "MP-empty",
-               "MP capability, but empty.",
                {
-                       /* hdr */ 0x1,
-                       0x0,
+                       "GR-short",
+                       "GR capability, but header length too short",
+                       {
+                               /* hdr */ 0x40, 0xa,
+                               /* R-bit, time */ 0xf1, 0x12,
+                               /* afi */ 0x0, 0x1,
+                               /* safi */ 0x1,
+                               /* flags */ 0xf,
+                               /* afi */ 0x0, 0x2,
+                               /* safi */ 0x1,
+                               /* flags */ 0x0,
+                               /* afi */ 0x0, 0x2,
+                               /* safi */ 0x2,
+                               /* flags */ 0x1,
+                       },
+                       15 /* array is 16 though */,
+                       SHOULD_ERR,
                },
-               2,
-               SHOULD_ERR,
-       },
-       {
-               "ORF-empty",
-               "ORF capability, but empty.",
                {
-                       /* hdr */ 0x3,
-                       0x0,
+                       "GR-long",
+                       "GR capability, but header length too long",
+                       {
+                               /* hdr */ 0x40, 0xf,
+                               /* R-bit, time */ 0xf1, 0x12,
+                               /* afi */ 0x0, 0x1,
+                               /* safi */ 0x1,
+                               /* flags */ 0xf,
+                               /* afi */ 0x0, 0x2,
+                               /* safi */ 0x1,
+                               /* flags */ 0x0,
+                               /* afi */ 0x0, 0x2,
+                               /* safi */ 0x2,
+                               /* flags */ 0x01,
+                       },
+                       16,
+                       SHOULD_ERR,
                },
-               2,
-               SHOULD_ERR,
-       },
-       {
-               "AS4-empty",
-               "AS4 capability, but empty.",
                {
-                       /* hdr */ 0x41,
-                       0x0,
+                       "GR-trunc",
+                       "GR capability, but truncated",
+                       {
+                               /* hdr */ 0x40, 0xf,
+                               /* R-bit, time */ 0xf1, 0x12,
+                               /* afi */ 0x0, 0x1,
+                               /* safi */ 0x1,
+                               /* flags */ 0xf,
+                               /* afi */ 0x0, 0x2,
+                               /* safi */ 0x1,
+                               /* flags */ 0x0,
+                               /* afi */ 0x0, 0x2,
+                               /* safi */ 0x2,
+                               /* flags */ 0x1,
+                       },
+                       15,
+                       SHOULD_ERR,
                },
-               2,
-               SHOULD_ERR,
-       },
-       {
-               "dyn-empty",
-               "Dynamic capability, but empty.",
                {
-                       /* hdr */ 0x42,
-                       0x0,
+                       "GR-empty",
+                       "GR capability, but empty.",
+                       {
+                               /* hdr */ 0x40, 0x0,
+                       },
+                       2,
+                       SHOULD_ERR,
                },
-               2,
-               SHOULD_PARSE,
-       },
-       {
-               "dyn-old",
-               "Dynamic capability (deprecated version)",
-               {CAPABILITY_CODE_DYNAMIC, 0x0},
-               2,
-               SHOULD_PARSE,
-       },
-       {NULL, NULL, {0}, 0, 0}};
+               {
+                       "MP-empty",
+                       "MP capability, but empty.",
+                       {
+                               /* hdr */ 0x1, 0x0,
+                       },
+                       2,
+                       SHOULD_ERR,
+               },
+               {
+                       "ORF-empty",
+                       "ORF capability, but empty.",
+                       {
+                               /* hdr */ 0x3, 0x0,
+                       },
+                       2,
+                       SHOULD_ERR,
+               },
+               {
+                       "AS4-empty",
+                       "AS4 capability, but empty.",
+                       {
+                               /* hdr */ 0x41, 0x0,
+                       },
+                       2,
+                       SHOULD_ERR,
+               },
+               {
+                       "dyn-empty",
+                       "Dynamic capability, but empty.",
+                       {
+                               /* hdr */ 0x42, 0x0,
+                       },
+                       2,
+                       SHOULD_PARSE,
+               },
+               {
+                       "dyn-old",
+                       "Dynamic capability (deprecated version)",
+                       {CAPABILITY_CODE_DYNAMIC, 0x0},
+                       2,
+                       SHOULD_PARSE,
+               },
+               {NULL, NULL, {0}, 0, 0}};
 
 /* DYNAMIC message */
 struct test_segment dynamic_cap_msgs[] = {
@@ -819,9 +871,9 @@ static void parse_test(struct peer *peer, struct test_segment *t, int type)
                failed++;
 
        if (tty)
-               printf("%s", (failed > oldfailed)
-                                    ? VT100_RED "failed!" VT100_RESET
-                                    : VT100_GREEN "OK" VT100_RESET);
+               printf("%s",
+                      (failed > oldfailed) ? VT100_RED "failed!" VT100_RESET
+                                           : VT100_GREEN "OK" VT100_RESET);
        else
                printf("%s", (failed > oldfailed) ? "failed!" : "OK");
 
index 2dbde0dbdde530fde5daa374124bec094d1d594c..7c0afa1b92a5849b25c8a81a9347a281359eff4e 100644 (file)
@@ -610,15 +610,15 @@ static struct test_segment {
                        /* Nexthop */ 192, 168, 0, 1,
                        /* SNPA (defunct, MBZ) */ 0x0,
                        /* NLRI tuples */ 88 + 16, 0, 1, 2, /* tag */
-                       /* rd, 8 octets */
-                       0, 0,                /* RD_TYPE_AS */
-                       0, 2, 0, 0xff, 3, 4, /* AS(2):val(4) */
-                       10, 1,               /* 10.1/16 */
-                       88 + 17, 0xff, 0, 0, /* tag */
-                       /* rd, 8 octets */
-                       0, 0,           /* RD_TYPE_IP */
-                       192, 168, 0, 1, /* IPv4 */
-                       10, 2, 3,       /* 10.2.3/17 */
+                                                           /* rd, 8 octets */
+                       0, 0,                               /* RD_TYPE_AS */
+                       0, 2, 0, 0xff, 3, 4,                /* AS(2):val(4) */
+                       10, 1,                              /* 10.1/16 */
+                       88 + 17, 0xff, 0, 0,                /* tag */
+                                                           /* rd, 8 octets */
+                       0, 0,                               /* RD_TYPE_IP */
+                       192, 168, 0, 1,                     /* IPv4 */
+                       10, 2, 3,                           /* 10.2.3/17 */
                },
                (4 + 12 + 1 + (1 + 3 + 8 + 2) + (1 + 3 + 8 + 3)),
                SHOULD_PARSE,
@@ -700,15 +700,15 @@ static struct test_segment {
                        /* Nexthop */ 192, 168, 0, 1,
                        /* SNPA (defunct, MBZ) */ 0x0,
                        /* NLRI tuples */ 88 + 32, 0, 1, 2, /* tag */
-                       /* rd, 8 octets */
-                       0, 0,                /* RD_TYPE_AS */
-                       0, 2, 0, 0xff, 3, 4, /* AS(2):val(4) */
-                       10, 1,               /* 10.1/16 */
-                       88 + 17, 0xff, 0, 0, /* tag */
-                       /* rd, 8 octets */
-                       0, 0,           /* RD_TYPE_IP */
-                       192, 168, 0, 1, /* IPv4 */
-                       10, 2, 3,       /* 10.2.3/17 */
+                                                           /* rd, 8 octets */
+                       0, 0,                               /* RD_TYPE_AS */
+                       0, 2, 0, 0xff, 3, 4,                /* AS(2):val(4) */
+                       10, 1,                              /* 10.1/16 */
+                       88 + 17, 0xff, 0, 0,                /* tag */
+                                                           /* rd, 8 octets */
+                       0, 0,                               /* RD_TYPE_IP */
+                       192, 168, 0, 1,                     /* IPv4 */
+                       10, 2, 3,                           /* 10.2.3/17 */
                },
                (4 + 12 + 1 + (1 + 3 + 8 + 2) + (1 + 3 + 8 + 3)),
                SHOULD_ERR,
@@ -727,16 +727,16 @@ static struct test_segment {
                        /* Nexthop */ 192, 168, 0, 1,
                        /* SNPA (defunct, MBZ) */ 0x0,
                        /* NLRI tuples */ 88 + 16, 0, 1, 2, /* tag */
-                       /* rd, 8 octets */
-                       0, 0,                /* RD_TYPE_AS */
-                       0, 2, 0, 0xff, 3, 4, /* AS(2):val(4) */
-                       10, 1,               /* 10.1/16 */
-                       88 + 17, 0xff, 0, 0, /* tag */
-                       /* rd, 8 octets */
-                       0, 0,           /* RD_TYPE_IP */
-                       192, 168, 0, 1, /* IPv4 */
-                       10, 2, 3,       /* 10.2.3/17 */
-                       88 + 1,         /* bogus */
+                                                           /* rd, 8 octets */
+                       0, 0,                               /* RD_TYPE_AS */
+                       0, 2, 0, 0xff, 3, 4,                /* AS(2):val(4) */
+                       10, 1,                              /* 10.1/16 */
+                       88 + 17, 0xff, 0, 0,                /* tag */
+                                                           /* rd, 8 octets */
+                       0, 0,                               /* RD_TYPE_IP */
+                       192, 168, 0, 1,                     /* IPv4 */
+                       10, 2, 3,                           /* 10.2.3/17 */
+                       88 + 1,                             /* bogus */
                },
                (4 + 12 + 1 + (1 + 3 + 8 + 2) + (1 + 3 + 8 + 3) + 1),
                SHOULD_ERR,
@@ -755,15 +755,15 @@ static struct test_segment {
                        /* Nexthop */ 192, 168, 0, 1,
                        /* SNPA (defunct, MBZ) */ 0x0,
                        /* NLRI tuples */ 88 + 16, 0, 1, 2, /* tag */
-                       /* rd, 8 octets */
-                       0, 0,                /* RD_TYPE_AS */
-                       0, 2, 0, 0xff, 3, 4, /* AS(2):val(4) */
-                       10, 1,               /* 10.1/16 */
-                       88 + 2, 0xff, 0, 0,  /* tag */
-                       /* rd, 8 octets */
-                       0, 0,           /* RD_TYPE_IP */
-                       192, 168, 0, 1, /* IPv4 */
-                       10, 2, 3,       /* 10.2.3/17 */
+                                                           /* rd, 8 octets */
+                       0, 0,                               /* RD_TYPE_AS */
+                       0, 2, 0, 0xff, 3, 4,                /* AS(2):val(4) */
+                       10, 1,                              /* 10.1/16 */
+                       88 + 2, 0xff, 0, 0,                 /* tag */
+                                                           /* rd, 8 octets */
+                       0, 0,                               /* RD_TYPE_IP */
+                       192, 168, 0, 1,                     /* IPv4 */
+                       10, 2, 3,                           /* 10.2.3/17 */
                },
                (4 + 12 + 1 + (1 + 3 + 8 + 2) + (1 + 3 + 8 + 3)),
                SHOULD_ERR,
@@ -782,15 +782,15 @@ static struct test_segment {
                        /* Nexthop */ 192, 168, 0, 1,
                        /* SNPA (defunct, MBZ) */ 0x0,
                        /* NLRI tuples */ 88 + 16, 0, 1, 2, /* tag */
-                       /* rd, 8 octets */
-                       0xff, 0,             /* Bogus RD */
-                       0, 2, 0, 0xff, 3, 4, /* AS(2):val(4) */
-                       10, 1,               /* 10.1/16 */
-                       88 + 17, 0xff, 0, 0, /* tag */
-                       /* rd, 8 octets */
-                       0, 0,           /* RD_TYPE_IP */
-                       192, 168, 0, 1, /* IPv4 */
-                       10, 2, 3,       /* 10.2.3/17 */
+                                                           /* rd, 8 octets */
+                       0xff, 0,                            /* Bogus RD */
+                       0, 2, 0, 0xff, 3, 4,                /* AS(2):val(4) */
+                       10, 1,                              /* 10.1/16 */
+                       88 + 17, 0xff, 0, 0,                /* tag */
+                                                           /* rd, 8 octets */
+                       0, 0,                               /* RD_TYPE_IP */
+                       192, 168, 0, 1,                     /* IPv4 */
+                       10, 2, 3,                           /* 10.2.3/17 */
                },
                (4 + 12 + 1 + (1 + 3 + 8 + 2) + (1 + 3 + 8 + 3)),
                SHOULD_PARSE,
@@ -809,16 +809,16 @@ static struct test_segment {
                        /* Nexthop */ 192, 168, 0, 1,
                        /* SNPA (defunct, MBZ) */ 0x0,
                        /* NLRI tuples */ 88 + 16, 0, 1, 2, /* tag */
-                       /* rd, 8 octets */
-                       0, 0,                /* RD_TYPE_AS */
-                       0, 2, 0, 0xff, 3, 4, /* AS(2):val(4) */
-                       10, 1,               /* 10.1/16 */
-                       88 + 17, 0xff, 0, 0, /* tag */
-                       /* rd, 8 octets */
-                       0, 0,           /* RD_TYPE_IP */
-                       192, 168, 0, 1, /* IPv4 */
-                       10, 2, 3,       /* 10.2.3/17 */
-                       0               /* 0/0, bogus for vpnv4 ?? */
+                                                           /* rd, 8 octets */
+                       0, 0,                               /* RD_TYPE_AS */
+                       0, 2, 0, 0xff, 3, 4,                /* AS(2):val(4) */
+                       10, 1,                              /* 10.1/16 */
+                       88 + 17, 0xff, 0, 0,                /* tag */
+                                                           /* rd, 8 octets */
+                       0, 0,                               /* RD_TYPE_IP */
+                       192, 168, 0, 1,                     /* IPv4 */
+                       10, 2, 3,                           /* 10.2.3/17 */
+                       0 /* 0/0, bogus for vpnv4 ?? */
                },
                (4 + 12 + 1 + (1 + 3 + 8 + 2) + (1 + 3 + 8 + 3) + 1),
                SHOULD_ERR,
@@ -901,23 +901,11 @@ static struct test_segment mp_unreach_segments[] = {
                "IPv6-unreach2",
                "IPV6 MP Unreach, 2 NLRIs",
                {
-                       /* AFI / SAFI */ 0x0,
-                       AFI_IP6,
-                       SAFI_UNICAST,
-                       /* NLRI tuples */ 32,
-                       0xff,
-                       0xfe,
-                       0x1,
-                       0x2, /* fffe:102::/32 */
-                       64,
-                       0xff,
-                       0xfe,
-                       0x0,
-                       0x1, /* fffe:1:2:3::/64 */
-                       0x0,
-                       0x2,
-                       0x0,
-                       0x3,
+                       /* AFI / SAFI */ 0x0, AFI_IP6, SAFI_UNICAST,
+                       /* NLRI tuples */ 32, 0xff, 0xfe, 0x1,
+                       0x2,                      /* fffe:102::/32 */
+                       64, 0xff, 0xfe, 0x0, 0x1, /* fffe:1:2:3::/64 */
+                       0x0, 0x2, 0x0, 0x3,
                },
                (3 + 5 + 9),
                SHOULD_PARSE,
@@ -992,15 +980,15 @@ static struct test_segment mp_unreach_segments[] = {
                {
                        /* AFI / SAFI */ 0x0, AFI_IP, IANA_SAFI_MPLS_VPN,
                        /* NLRI tuples */ 88 + 16, 0, 1, 2, /* tag */
-                       /* rd, 8 octets */
-                       0, 0,                /* RD_TYPE_AS */
-                       0, 2, 0, 0xff, 3, 4, /* AS(2):val(4) */
-                       10, 1,               /* 10.1/16 */
-                       88 + 17, 0xff, 0, 0, /* tag */
-                       /* rd, 8 octets */
-                       0, 0,           /* RD_TYPE_IP */
-                       192, 168, 0, 1, /* IPv4 */
-                       10, 2, 3,       /* 10.2.3/17 */
+                                                           /* rd, 8 octets */
+                       0, 0,                               /* RD_TYPE_AS */
+                       0, 2, 0, 0xff, 3, 4,                /* AS(2):val(4) */
+                       10, 1,                              /* 10.1/16 */
+                       88 + 17, 0xff, 0, 0,                /* tag */
+                                                           /* rd, 8 octets */
+                       0, 0,                               /* RD_TYPE_IP */
+                       192, 168, 0, 1,                     /* IPv4 */
+                       10, 2, 3,                           /* 10.2.3/17 */
                },
                (3 + (1 + 3 + 8 + 2) + (1 + 3 + 8 + 3)),
                SHOULD_PARSE,
@@ -1029,9 +1017,9 @@ static void handle_result(struct peer *peer, struct test_segment *t,
 
 
        if (tty)
-               printf("%s", (failed > oldfailed)
-                                    ? VT100_RED "failed!" VT100_RESET
-                                    : VT100_GREEN "OK" VT100_RESET);
+               printf("%s",
+                      (failed > oldfailed) ? VT100_RED "failed!" VT100_RESET
+                                           : VT100_GREEN "OK" VT100_RESET);
        else
                printf("%s", (failed > oldfailed) ? "failed!" : "OK");
 
index 72fe2d821c074d88ce9a3ec7d1588740bd7ab5d0..ccd3b6f4c2c99ee826dfe0100bf650d08e55bed7 100644 (file)
@@ -361,8 +361,7 @@ testcase_t test_bgp_info_mpath_update = {
  * Set up testcase vector
  */
 testcase_t *all_tests[] = {
-       &test_bgp_cfg_maximum_paths,
-       &test_bgp_mp_list,
+       &test_bgp_cfg_maximum_paths, &test_bgp_mp_list,
        &test_bgp_info_mpath_update,
 };
 
index e149487c5da04af8659d396b3e5b86ffcadef692..48dd99d28a9bfa455ea2dbccf1778c069f10b947 100644 (file)
@@ -49,23 +49,19 @@ static vector test_cmds;
 static char test_buf[32768];
 
 static struct cmd_node bgp_node = {
-       BGP_NODE,
-       "%s(config-router)# ",
+       BGP_NODE, "%s(config-router)# ",
 };
 
 static struct cmd_node rip_node = {
-       RIP_NODE,
-       "%s(config-router)# ",
+       RIP_NODE, "%s(config-router)# ",
 };
 
 static struct cmd_node isis_node = {
-       ISIS_NODE,
-       "%s(config-router)# ",
+       ISIS_NODE, "%s(config-router)# ",
 };
 
 static struct cmd_node interface_node = {
-       INTERFACE_NODE,
-       "%s(config-if)# ",
+       INTERFACE_NODE, "%s(config-if)# ",
 };
 
 static struct cmd_node rmap_node = {RMAP_NODE, "%s(config-route-map)# "};
index 87ea3039ecf490c3df3841df977a13167d41e497..c265e164ebbd97519a8fdf28d0b0fae68c60f31f 100644 (file)
@@ -401,7 +401,7 @@ static int verify(u_char *buffer, testsz_t len)
 }
 
 static int /* return checksum in low-order 16 bits */
-in_cksum_optimized(void *parg, int nbytes)
+       in_cksum_optimized(void *parg, int nbytes)
 {
        u_short *ptr = parg;
        register long sum;       /* assumes long == 32 bits */
@@ -433,7 +433,7 @@ in_cksum_optimized(void *parg, int nbytes)
 
 
 static int /* return checksum in low-order 16 bits */
-in_cksum_rfc(void *parg, int count)
+       in_cksum_rfc(void *parg, int count)
 /* from RFC 1071 */
 {
        u_short *addr = parg;
index 8438334377066d24da6ae10d6978a356b63e4f5a..c2cb5c2ea5afdcbea07cf6a53f2fccbcee8364d2 100644 (file)
 #include "memory_vty.h"
 
 zebra_capabilities_t _caps_p[] = {
-       ZCAP_NET_RAW,
-       ZCAP_BIND,
-       ZCAP_NET_ADMIN,
-       ZCAP_DAC_OVERRIDE,
+       ZCAP_NET_RAW, ZCAP_BIND, ZCAP_NET_ADMIN, ZCAP_DAC_OVERRIDE,
 };
 
 struct zebra_privs_t test_privs = {
index eb9bca71d73c209eb76f41bfdbb3365b04cfa948..43e79ba9d06b57ef5882e583354224d55aabbf3b 100644 (file)
@@ -97,8 +97,8 @@ static int timer_func(struct thread *thread)
 
 static int cmp_timeval(const void *a, const void *b)
 {
-       const struct timeval *ta = *(struct timeval *const *)a;
-       const struct timeval *tb = *(struct timeval *const *)b;
+       const struct timeval *ta = *(struct timeval * const *)a;
+       const struct timeval *tb = *(struct timeval * const *)b;
 
        if (timercmp(ta, tb, <))
                return -1;
index 7372cc8449c1c93a7f8ae3378faa85cf0e2d4e21..39527eca777b8490beeca981ca8b21c832d4f881 100644 (file)
@@ -869,13 +869,12 @@ static int run_stop_schedule(void)
                                if (ratio < 10)
                                        ratio++;
 
-                               TVCALC(interval, ratio
-                                                        * (TVELEM(&after)
-                                                           - TVELEM(&before)
-                                                           + TVADJUST));
-                               TVCALC(maxinterval, TVELEM(&stopat)
-                                                           - TVELEM(&after)
-                                                           + TVADJUST);
+                               TVCALC(interval,
+                                      ratio * (TVELEM(&after) - TVELEM(&before)
+                                               + TVADJUST));
+                               TVCALC(maxinterval,
+                                      TVELEM(&stopat) - TVELEM(&after)
+                                              + TVADJUST);
 
                                if (timercmp(&interval, &maxinterval, >))
                                        interval = maxinterval;
index bca582d6289c05195668f021ad4dade634bc3598..666f3049d7c87cf5f96b3cc429f24bf50cc60048 100644 (file)
@@ -667,8 +667,9 @@ int vtysh_config_from_file(struct vty *vty, FILE *fp)
                case CMD_ERR_NO_MATCH:
                        fprintf(stderr, "line %d: %% Unknown command[%d]: %s",
                                lineno, vty->node, vty->buf);
-                       retcode = CMD_ERR_NO_MATCH; /* once we have an error, we
-                                                      remember & return that */
+                       retcode =
+                               CMD_ERR_NO_MATCH; /* once we have an error, we
+                                                    remember & return that */
                        break;
                case CMD_ERR_INCOMPLETE:
                        fprintf(stderr,
@@ -870,33 +871,27 @@ static char **new_completion(char *text, int start, int end)
 
 /* Vty node structures. */
 static struct cmd_node bgp_node = {
-       BGP_NODE,
-       "%s(config-router)# ",
+       BGP_NODE, "%s(config-router)# ",
 };
 
 static struct cmd_node rip_node = {
-       RIP_NODE,
-       "%s(config-router)# ",
+       RIP_NODE, "%s(config-router)# ",
 };
 
 static struct cmd_node isis_node = {
-       ISIS_NODE,
-       "%s(config-router)# ",
+       ISIS_NODE, "%s(config-router)# ",
 };
 
 static struct cmd_node interface_node = {
-       INTERFACE_NODE,
-       "%s(config-if)# ",
+       INTERFACE_NODE, "%s(config-if)# ",
 };
 
 static struct cmd_node ns_node = {
-       NS_NODE,
-       "%s(config-logical-router)# ",
+       NS_NODE, "%s(config-logical-router)# ",
 };
 
 static struct cmd_node vrf_node = {
-       VRF_NODE,
-       "%s(config-vrf)# ",
+       VRF_NODE, "%s(config-vrf)# ",
 };
 
 static struct cmd_node rmap_node = {RMAP_NODE, "%s(config-route-map)# "};
@@ -978,8 +973,7 @@ static struct cmd_node keychain_key_node = {KEYCHAIN_KEY_NODE,
                                            "%s(config-keychain-key)# "};
 
 struct cmd_node link_params_node = {
-       LINK_PARAMS_NODE,
-       "%s(config-link-params)# ",
+       LINK_PARAMS_NODE, "%s(config-link-params)# ",
 };
 
 /* Defined in lib/vty.c */
@@ -1635,8 +1629,7 @@ DEFUNSH(VTYSH_INTERFACE, vtysh_interface, vtysh_interface_cmd,
 /* TODO Implement "no interface command in isisd. */
 DEFSH(VTYSH_ZEBRA | VTYSH_RIPD | VTYSH_RIPNGD | VTYSH_OSPFD | VTYSH_OSPF6D
              | VTYSH_EIGRPD,
-      vtysh_no_interface_cmd, "no interface IFNAME",
-      NO_STR
+      vtysh_no_interface_cmd, "no interface IFNAME", NO_STR
       "Delete a pseudo interface's configuration\n"
       "Interface's name\n")
 
@@ -1663,8 +1656,7 @@ DEFUNSH(VTYSH_VRF, vtysh_vrf, vtysh_vrf_cmd, "vrf NAME",
        return CMD_SUCCESS;
 }
 
-DEFSH(VTYSH_ZEBRA, vtysh_no_vrf_cmd, "no vrf NAME",
-      NO_STR
+DEFSH(VTYSH_ZEBRA, vtysh_no_vrf_cmd, "no vrf NAME", NO_STR
       "Delete a pseudo vrf's configuration\n"
       "VRF's name\n")
 
@@ -1915,8 +1907,7 @@ DEFUNSH(VTYSH_ALL, vtysh_log_stdout_level, vtysh_log_stdout_level_cmd,
 }
 
 DEFUNSH(VTYSH_ALL, no_vtysh_log_stdout, no_vtysh_log_stdout_cmd,
-       "no log stdout [LEVEL]",
-       NO_STR
+       "no log stdout [LEVEL]", NO_STR
        "Logging control\n"
        "Cancel logging to stdout\n"
        "Logging level\n")
@@ -1942,8 +1933,7 @@ DEFUNSH(VTYSH_ALL, vtysh_log_file_level, vtysh_log_file_level_cmd,
 }
 
 DEFUNSH(VTYSH_ALL, no_vtysh_log_file, no_vtysh_log_file_cmd,
-       "no log file [FILENAME [LEVEL]]",
-       NO_STR
+       "no log file [FILENAME [LEVEL]]", NO_STR
        "Logging control\n"
        "Cancel logging to file\n"
        "Logging file name\n"
@@ -1961,8 +1951,7 @@ DEFUNSH(VTYSH_ALL, vtysh_log_monitor, vtysh_log_monitor_cmd,
 }
 
 DEFUNSH(VTYSH_ALL, no_vtysh_log_monitor, no_vtysh_log_monitor_cmd,
-       "no log monitor [LEVEL]",
-       NO_STR
+       "no log monitor [LEVEL]", NO_STR
        "Logging control\n"
        "Disable terminal line (monitor) logging\n"
        "Logging level\n")
@@ -1979,8 +1968,7 @@ DEFUNSH(VTYSH_ALL, vtysh_log_syslog, vtysh_log_syslog_cmd,
 }
 
 DEFUNSH(VTYSH_ALL, no_vtysh_log_syslog, no_vtysh_log_syslog_cmd,
-       "no log syslog [LEVEL]",
-       NO_STR
+       "no log syslog [LEVEL]", NO_STR
        "Logging control\n"
        "Cancel logging to syslog\n"
        "Logging level\n")
@@ -1998,8 +1986,7 @@ DEFUNSH(VTYSH_ALL, vtysh_log_facility, vtysh_log_facility_cmd,
 }
 
 DEFUNSH(VTYSH_ALL, no_vtysh_log_facility, no_vtysh_log_facility_cmd,
-       "no log facility [FACILITY]",
-       NO_STR
+       "no log facility [FACILITY]", NO_STR
        "Logging control\n"
        "Reset syslog facility to default (daemon)\n"
        "Syslog facility\n")
@@ -2019,8 +2006,7 @@ DEFUNSH_DEPRECATED(
 }
 
 DEFUNSH_DEPRECATED(VTYSH_ALL, no_vtysh_log_trap, no_vtysh_log_trap_cmd,
-                  "no log trap [LEVEL]",
-                  NO_STR
+                  "no log trap [LEVEL]", NO_STR
                   "Logging control\n"
                   "Permit all logging information\n"
                   "Logging level\n")
@@ -2037,8 +2023,7 @@ DEFUNSH(VTYSH_ALL, vtysh_log_record_priority, vtysh_log_record_priority_cmd,
 }
 
 DEFUNSH(VTYSH_ALL, no_vtysh_log_record_priority,
-       no_vtysh_log_record_priority_cmd, "no log record-priority",
-       NO_STR
+       no_vtysh_log_record_priority_cmd, "no log record-priority", NO_STR
        "Logging control\n"
        "Do not log the priority of the message within the message\n")
 {
@@ -2102,8 +2087,7 @@ DEFUNSH(VTYSH_ALL, vtysh_config_enable_password, vtysh_enable_password_cmd,
 }
 
 DEFUNSH(VTYSH_ALL, no_vtysh_config_enable_password,
-       no_vtysh_enable_password_cmd, "no enable password",
-       NO_STR
+       no_vtysh_enable_password_cmd, "no enable password", NO_STR
        "Modify enable password parameters\n"
        "Assign the privileged level password\n")
 {
index d38fe7c30657db685cb015dac7ad865bb10f4cd8..fce36ebc1d4af60df3a8b61f45e6ecd4bc38f763 100644 (file)
@@ -119,7 +119,7 @@ calculate_lifc_len: /* must hold privileges to enter here */
        if (ret < 0) {
                if (errno == EINVAL)
                        goto calculate_lifc_len; /* deliberately hold privileges
-                                                 */
+                                                   */
 
                zlog_warn("SIOCGLIFCONF: %s", safe_strerror(errno));
 
index 4bce42f22b3886e4ba1ecb4dacd949571667db79..03ddf8d3864a73f106b136c90e31b78d7dfac73b 100644 (file)
@@ -429,7 +429,7 @@ static void if_addr_wakeup(struct interface *ifp)
                                         * XXX: RUNNING is not a settable flag
                                         * on any system
                                         * I (paulj) am aware of.
-                                        */
+                                       */
                                        if_set_flags(ifp, IFF_UP | IFF_RUNNING);
                                        if_refresh(ifp);
                                }
@@ -1757,9 +1757,7 @@ DEFUN (no_bandwidth_if,
 
 
 struct cmd_node link_params_node = {
-       LINK_PARAMS_NODE,
-       "%s(config-link-params)# ",
-       1,
+       LINK_PARAMS_NODE, "%s(config-link-params)# ", 1,
 };
 
 static void link_param_cmd_set_uint32(struct interface *ifp, uint32_t *field,
index 58c61c2c1131e9af45496187f7fe2926f82369c2..ea722646968734db70acbdab0004b84c3781c0ed 100644 (file)
@@ -172,10 +172,11 @@ struct rtadvconf {
        int DefaultPreference;
 #define RTADV_PREF_MEDIUM 0x0 /* Per RFC4191. */
 
-       u_char inFastRexmit;      /* True if we're rexmits faster than usual */
-       u_char configured;      /* Has operator configured RA? */
-       int NumFastReXmitsRemain; /* Loaded first with number of fast
-                                    rexmits to do */
+       u_char inFastRexmit; /* True if we're rexmits faster than usual */
+       u_char configured;   /* Has operator configured RA? */
+       int
+               NumFastReXmitsRemain; /* Loaded first with number of fast
+                                        rexmits to do */
 
 #define RTADV_FAST_REXMIT_PERIOD 1 /* 1 sec */
 #define RTADV_NUM_FAST_REXMITS   4 /* Fast Rexmit RA 4 times on certain events */
index 8a5bc6952160e1f58cc7d87142dc87900bc16708..7fc2d613328c2f20cf9b507de197f5b2f25ea355 100644 (file)
@@ -307,8 +307,7 @@ static void netlink_install_filter(int sock, __u32 pid)
        };
 
        struct sock_fprog prog = {
-               .len = array_size(filter),
-               .filter = filter,
+               .len = array_size(filter), .filter = filter,
        };
 
        if (setsockopt(sock, SOL_SOCKET, SO_ATTACH_FILTER, &prog, sizeof(prog))
index 2484d81832598bccca07c3d7fe2cbab7be0bdc3d..4b63a3eb04b445273c1ddace96b0427e58ad653a 100644 (file)
@@ -315,9 +315,8 @@ static int ifan_read(struct if_announcemsghdr *ifan)
                assert((ifp->ifindex == ifan->ifan_index)
                       || (ifp->ifindex == IFINDEX_INTERNAL));
 
-       if ((ifp == NULL)
-           || ((ifp->ifindex == IFINDEX_INTERNAL)
-               && (ifan->ifan_what == IFAN_ARRIVAL))) {
+       if ((ifp == NULL) || ((ifp->ifindex == IFINDEX_INTERNAL)
+                             && (ifan->ifan_what == IFAN_ARRIVAL))) {
                if (IS_ZEBRA_DEBUG_KERNEL)
                        zlog_debug(
                                "%s: creating interface for ifindex %d, name %s",
@@ -945,7 +944,7 @@ void rtm_read(struct rt_msghdr *rtm)
                                                buf, gate_buf);
                                        break;
                                case ZEBRA_RIB_FOUND_EXACT: /* RIB RR == FIB RR
-                                                            */
+                                                              */
                                        zlog_debug(
                                                "%s: %s %s: done Ok", __func__,
                                                lookup_msg(rtm_type_str,
index b9a3bf881a0689b08f64862f8be6b172107d3c5f..27a6f3e02762974deb37867aa9fb11ef6e400cd7 100644 (file)
@@ -89,9 +89,7 @@ struct option longopts[] = {{"batch", no_argument, NULL, 'b'},
                            {0}};
 
 zebra_capabilities_t _caps_p[] = {
-       ZCAP_NET_ADMIN,
-       ZCAP_SYS_ADMIN,
-       ZCAP_NET_RAW,
+       ZCAP_NET_ADMIN, ZCAP_SYS_ADMIN, ZCAP_NET_RAW,
 };
 
 /* zebra privileges to run with */
@@ -226,7 +224,7 @@ int main(int argc, char **argv)
 #ifdef HAVE_NETLINK
                "  -s, --nl-bufsize   Set netlink receive buffer size\n"
 #endif /* HAVE_NETLINK */
-       );
+               );
 
        while (1) {
                int opt = frr_getopt(argc, argv, NULL);
@@ -310,25 +308,25 @@ int main(int argc, char **argv)
        zebra_ns_init();
 
        /* Process the configuration file. Among other configuration
-        *  directives we can meet those installing static routes. Such
-        *  requests will not be executed immediately, but queued in
-        *  zebra->ribq structure until we enter the main execution loop.
-        *  The notifications from kernel will show originating PID equal
-        *  to that after daemon() completes (if ever called).
-        */
+       *  directives we can meet those installing static routes. Such
+       *  requests will not be executed immediately, but queued in
+       *  zebra->ribq structure until we enter the main execution loop.
+       *  The notifications from kernel will show originating PID equal
+       *  to that after daemon() completes (if ever called).
+       */
        frr_config_fork();
 
        /* Clean up rib -- before fork (?) */
        /* rib_weed_tables (); */
 
        /* After we have successfully acquired the pidfile, we can be sure
-        *  about being the only copy of zebra process, which is submitting
-        *  changes to the FIB.
-        *  Clean up zebra-originated routes. The requests will be sent to OS
-        *  immediately, so originating PID in notifications from kernel
-        *  will be equal to the current getpid(). To know about such routes,
-        * we have to have route_read() called before.
-        */
+       *  about being the only copy of zebra process, which is submitting
+       *  changes to the FIB.
+       *  Clean up zebra-originated routes. The requests will be sent to OS
+       *  immediately, so originating PID in notifications from kernel
+       *  will be equal to the current getpid(). To know about such routes,
+       * we have to have route_read() called before.
+       */
        if (!keep_kernel_mode)
                rib_sweep_route();
 
index a7679cb830867f1baa87628f69b74f841b467174..b8cf2d490afbe2a269c1e9969fb629c765a5bfe8 100644 (file)
@@ -263,7 +263,7 @@ static void rtadv_send_packet(int sock, struct interface *ifp)
                                                                      for RL,
                                                                      but not
                                                                      for HAL*/
-                       );
+                             );
                len += sizeof(struct nd_opt_homeagent_info);
        }
 
@@ -1274,9 +1274,8 @@ DEFUN (ipv6_nd_prefix,
 {
        /* prelude */
        char *prefix = argv[3]->arg;
-       int lifetimes = (argc > 4)
-                       && (argv[4]->type == RANGE_TKN
-                           || strmatch(argv[4]->text, "infinite"));
+       int lifetimes = (argc > 4) && (argv[4]->type == RANGE_TKN
+                                      || strmatch(argv[4]->text, "infinite"));
        int routeropts = lifetimes ? argc > 6 : argc > 4;
 
        int idx_routeropts = routeropts ? (lifetimes ? 6 : 4) : 0;
index 0d0c5aaf2295a3eeaa58ac2c1825239543eac924..d9bbcfed6fc48c344161e45540f421521980aa08 100644 (file)
@@ -67,6 +67,7 @@ union zebra_l2if_info {
 
 #define IS_ZEBRA_IF_BRIDGE_VLAN_AWARE(zif) ((zif)->l2info.br.vlan_aware == 1)
 
+
 extern void zebra_l2_map_slave_to_bridge(struct zebra_l2info_brslave *br_slave);
 extern void
 zebra_l2_unmap_slave_from_bridge(struct zebra_l2info_brslave *br_slave);
index cb1c80923d666eb10032e16fc49059549d25fca6..e44e5d2e6b52895c439fabba95f7954d49ef14c1 100644 (file)
@@ -1965,7 +1965,7 @@ int zebra_mpls_label_already_bound(struct zebra_vrf *zvrf, mpls_label_t label)
  * Add static FEC to label binding. If there are clients registered for this
  * FEC, notify them. If there are labeled routes for this FEC, install the
  * label forwarding entry.
- */
+*/
 int zebra_mpls_static_fec_add(struct zebra_vrf *zvrf, struct prefix *p,
                              mpls_label_t in_label)
 {
@@ -2639,9 +2639,8 @@ void zebra_mpls_print_lsp(struct vty *vty, struct zebra_vrf *zvrf,
 
        if (use_json) {
                json = lsp_json(lsp);
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        } else
                lsp_print(lsp, (void *)vty);
@@ -2669,9 +2668,8 @@ void zebra_mpls_print_lsp_table(struct vty *vty, struct zebra_vrf *zvrf,
                                json, label2str(lsp->ile.in_label, buf, BUFSIZ),
                                lsp_json(lsp));
 
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        } else {
                vty_out(vty, " Inbound                            Outbound\n");
index 0c79d773a8284b8d7b3c4d603f86476537fb5402..1bf672d4a1cb3bc3d25c66273c41b80edf0af4d8 100644 (file)
@@ -267,9 +267,8 @@ DEFUN (zebra_ptm_enable,
        for (ALL_LIST_ELEMENTS_RO(vrf->iflist, i, ifp))
                if (!ifp->ptm_enable) {
                        if_data = (struct zebra_if *)ifp->info;
-                       if (if_data
-                           && (if_data->ptm_enable
-                               == ZEBRA_IF_PTM_ENABLE_UNSPEC)) {
+                       if (if_data && (if_data->ptm_enable
+                                       == ZEBRA_IF_PTM_ENABLE_UNSPEC)) {
                                ifp->ptm_enable = ZEBRA_IF_PTM_ENABLE_ON;
                        }
                        /* Assign a default unknown status */
index c72e2900326a52169da3a9d9b2293b9eec9fc406..98508aaa89efbf6413cadf39df1efc0671a7f9b0 100644 (file)
@@ -68,17 +68,17 @@ static const struct {
        int key;
        int distance;
 } route_info[ZEBRA_ROUTE_MAX] = {
-       [ZEBRA_ROUTE_SYSTEM] = {ZEBRA_ROUTE_SYSTEM, 0},
-       [ZEBRA_ROUTE_KERNEL] = {ZEBRA_ROUTE_KERNEL, 0},
-       [ZEBRA_ROUTE_CONNECT] = {ZEBRA_ROUTE_CONNECT, 0},
-       [ZEBRA_ROUTE_STATIC] = {ZEBRA_ROUTE_STATIC, 1},
-       [ZEBRA_ROUTE_RIP] = {ZEBRA_ROUTE_RIP, 120},
-       [ZEBRA_ROUTE_RIPNG] = {ZEBRA_ROUTE_RIPNG, 120},
-       [ZEBRA_ROUTE_OSPF] = {ZEBRA_ROUTE_OSPF, 110},
-       [ZEBRA_ROUTE_OSPF6] = {ZEBRA_ROUTE_OSPF6, 110},
-       [ZEBRA_ROUTE_ISIS] = {ZEBRA_ROUTE_ISIS, 115},
-       [ZEBRA_ROUTE_BGP] = {ZEBRA_ROUTE_BGP, 20 /* IBGP is 200. */},
-       [ZEBRA_ROUTE_NHRP] = {ZEBRA_ROUTE_NHRP, 10},
+               [ZEBRA_ROUTE_SYSTEM] = {ZEBRA_ROUTE_SYSTEM, 0},
+               [ZEBRA_ROUTE_KERNEL] = {ZEBRA_ROUTE_KERNEL, 0},
+               [ZEBRA_ROUTE_CONNECT] = {ZEBRA_ROUTE_CONNECT, 0},
+               [ZEBRA_ROUTE_STATIC] = {ZEBRA_ROUTE_STATIC, 1},
+               [ZEBRA_ROUTE_RIP] = {ZEBRA_ROUTE_RIP, 120},
+               [ZEBRA_ROUTE_RIPNG] = {ZEBRA_ROUTE_RIPNG, 120},
+               [ZEBRA_ROUTE_OSPF] = {ZEBRA_ROUTE_OSPF, 110},
+               [ZEBRA_ROUTE_OSPF6] = {ZEBRA_ROUTE_OSPF6, 110},
+               [ZEBRA_ROUTE_ISIS] = {ZEBRA_ROUTE_ISIS, 115},
+               [ZEBRA_ROUTE_BGP] = {ZEBRA_ROUTE_BGP, 20 /* IBGP is 200. */},
+               [ZEBRA_ROUTE_NHRP] = {ZEBRA_ROUTE_NHRP, 10},
        /* no entry/default: 150 */
 };
 
@@ -1551,9 +1551,8 @@ static void rib_process(struct route_node *rn)
 
        /* Buffer ROUTE_ENTRY_CHANGED here, because it will get cleared if
         * fib == selected */
-       bool selected_changed =
-               new_selected
-               && CHECK_FLAG(new_selected->status, ROUTE_ENTRY_CHANGED);
+       bool selected_changed = new_selected && CHECK_FLAG(new_selected->status,
+                                                          ROUTE_ENTRY_CHANGED);
 
        /* Update fib according to selection results */
        if (new_fib && old_fib)
@@ -1726,30 +1725,30 @@ static wq_item_status meta_queue_process(struct work_queue *dummy, void *data)
  * Map from rib types to queue type (priority) in meta queue
  */
 static const u_char meta_queue_map[ZEBRA_ROUTE_MAX] = {
-       [ZEBRA_ROUTE_SYSTEM] = 4,
-       [ZEBRA_ROUTE_KERNEL] = 0,
-       [ZEBRA_ROUTE_CONNECT] = 0,
-       [ZEBRA_ROUTE_STATIC] = 1,
-       [ZEBRA_ROUTE_RIP] = 2,
-       [ZEBRA_ROUTE_RIPNG] = 2,
-       [ZEBRA_ROUTE_OSPF] = 2,
-       [ZEBRA_ROUTE_OSPF6] = 2,
-       [ZEBRA_ROUTE_ISIS] = 2,
-       [ZEBRA_ROUTE_BGP] = 3,
-       [ZEBRA_ROUTE_PIM] = 4, // Shouldn't happen but for safety
-       [ZEBRA_ROUTE_EIGRP] = 2,
-       [ZEBRA_ROUTE_NHRP] = 2,
-       [ZEBRA_ROUTE_HSLS] = 4,
-       [ZEBRA_ROUTE_OLSR] = 4,
-       [ZEBRA_ROUTE_TABLE] = 1,
-       [ZEBRA_ROUTE_LDP] = 4,
-       [ZEBRA_ROUTE_VNC] = 3,
-       [ZEBRA_ROUTE_VNC_DIRECT] = 3,
-       [ZEBRA_ROUTE_VNC_DIRECT_RH] = 3,
-       [ZEBRA_ROUTE_BGP_DIRECT] = 3,
-       [ZEBRA_ROUTE_BGP_DIRECT_EXT] = 3,
-       [ZEBRA_ROUTE_BABEL] = 2,
-       [ZEBRA_ROUTE_ALL] = 4, // Shouldn't happen but for safety
+               [ZEBRA_ROUTE_SYSTEM] = 4,
+               [ZEBRA_ROUTE_KERNEL] = 0,
+               [ZEBRA_ROUTE_CONNECT] = 0,
+               [ZEBRA_ROUTE_STATIC] = 1,
+               [ZEBRA_ROUTE_RIP] = 2,
+               [ZEBRA_ROUTE_RIPNG] = 2,
+               [ZEBRA_ROUTE_OSPF] = 2,
+               [ZEBRA_ROUTE_OSPF6] = 2,
+               [ZEBRA_ROUTE_ISIS] = 2,
+               [ZEBRA_ROUTE_BGP] = 3,
+               [ZEBRA_ROUTE_PIM] = 4, // Shouldn't happen but for safety
+               [ZEBRA_ROUTE_EIGRP] = 2,
+               [ZEBRA_ROUTE_NHRP] = 2,
+               [ZEBRA_ROUTE_HSLS] = 4,
+               [ZEBRA_ROUTE_OLSR] = 4,
+               [ZEBRA_ROUTE_TABLE] = 1,
+               [ZEBRA_ROUTE_LDP] = 4,
+               [ZEBRA_ROUTE_VNC] = 3,
+               [ZEBRA_ROUTE_VNC_DIRECT] = 3,
+               [ZEBRA_ROUTE_VNC_DIRECT_RH] = 3,
+               [ZEBRA_ROUTE_BGP_DIRECT] = 3,
+               [ZEBRA_ROUTE_BGP_DIRECT_EXT] = 3,
+               [ZEBRA_ROUTE_BABEL] = 2,
+               [ZEBRA_ROUTE_ALL] = 4, // Shouldn't happen but for safety
 };
 
 /* Look into the RN and queue it into one or more priority queues,
@@ -2396,7 +2395,7 @@ void rib_delete(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type,
                                                        family2afi(afi), gate,
                                                        buf2,
                                                        INET_ADDRSTRLEN), /* FIXME
-                                                                          */
+                                                                            */
                                                ifindex, type);
                                else
                                        rnode_debug(
index f769a273eb1294d09da0048d602f5b86ebaa0e0d..f8d89ec8ca89fe2780e44734033a09264b012dc0 100644 (file)
@@ -39,12 +39,12 @@ struct rnh {
        struct route_entry *state;
        struct prefix resolved_route;
        struct list *client_list;
-       struct list
-               *zebra_static_route_list; /* static routes dependent on this NH
-                                          */
+       struct list *
+               zebra_static_route_list; /* static routes dependent on this NH
+                                           */
        struct route_node *node;
        int filtered[ZEBRA_ROUTE_MAX]; /* if this has been filtered for client
-                                       */
+                                         */
 };
 
 typedef enum { RNH_NEXTHOP_TYPE, RNH_IMPORT_CHECK_TYPE } rnh_type_t;
index 2b209613d4a9eb0df53d87fb055ba6d2461520c7..0176b36840a8c351d5b0d707ee895231f8cb0ed1 100644 (file)
@@ -148,9 +148,7 @@ static route_map_result_t route_match_tag(void *rule, struct prefix *prefix,
 
 /* Route map commands for tag matching */
 static struct route_map_rule_cmd route_match_tag_cmd = {
-       "tag",
-       route_match_tag,
-       route_map_rule_tag_compile,
+       "tag", route_match_tag, route_map_rule_tag_compile,
        route_map_rule_tag_free,
 };
 
@@ -1169,10 +1167,7 @@ static void route_set_src_free(void *rule)
 
 /* Set src rule structure. */
 static struct route_map_rule_cmd route_set_src_cmd = {
-       "src",
-       route_set_src,
-       route_set_src_compile,
-       route_set_src_free,
+       "src", route_set_src, route_set_src_compile, route_set_src_free,
 };
 
 static int zebra_route_map_update_timer(struct thread *thread)
index 84b2c14dbe189e465c673c1fbd1bc8efc8b0c9a0..ae32395161733d9f611f360aaefcdbd81f4fba56 100644 (file)
@@ -361,9 +361,8 @@ int static_add_route(afi_t afi, safi_t safi, u_char type, struct prefix *p,
        if (!stable)
                return -1;
 
-       if (!gate
-           && (type == STATIC_IPV4_GATEWAY || type == STATIC_IPV6_GATEWAY
-               || type == STATIC_IPV6_GATEWAY_IFINDEX))
+       if (!gate && (type == STATIC_IPV4_GATEWAY || type == STATIC_IPV6_GATEWAY
+                     || type == STATIC_IPV6_GATEWAY_IFINDEX))
                return -1;
 
        if (!ifindex
@@ -376,11 +375,10 @@ int static_add_route(afi_t afi, safi_t safi, u_char type, struct prefix *p,
        /* Do nothing if there is a same static route.  */
        for (si = rn->info; si; si = si->next) {
                if (type == si->type
-                   && (!gate
-                       || ((afi == AFI_IP
-                            && IPV4_ADDR_SAME(gate, &si->addr.ipv4))
-                           || (afi == AFI_IP6
-                               && IPV6_ADDR_SAME(gate, &si->addr.ipv6))))
+                   && (!gate || ((afi == AFI_IP
+                                  && IPV4_ADDR_SAME(gate, &si->addr.ipv4))
+                                 || (afi == AFI_IP6
+                                     && IPV6_ADDR_SAME(gate, &si->addr.ipv6))))
                    && (!ifindex || ifindex == si->ifindex)) {
                        if ((distance == si->distance) && (tag == si->tag)
                            && !memcmp(&si->snh_label, snh_label,
@@ -485,11 +483,10 @@ int static_delete_route(afi_t afi, safi_t safi, u_char type, struct prefix *p,
        /* Find same static route is the tree */
        for (si = rn->info; si; si = si->next)
                if (type == si->type
-                   && (!gate
-                       || ((afi == AFI_IP
-                            && IPV4_ADDR_SAME(gate, &si->addr.ipv4))
-                           || (afi == AFI_IP6
-                               && IPV6_ADDR_SAME(gate, &si->addr.ipv6))))
+                   && (!gate || ((afi == AFI_IP
+                                  && IPV4_ADDR_SAME(gate, &si->addr.ipv4))
+                                 || (afi == AFI_IP6
+                                     && IPV6_ADDR_SAME(gate, &si->addr.ipv6))))
                    && (!ifindex || ifindex == si->ifindex)
                    && (!tag || (tag == si->tag))
                    && (!snh_label->num_labels
index a97672599da531b7cb0f30a30bbde101bb902b90..3978664dbeb053c7cf00a9cad626aa0fd05f2c77 100644 (file)
@@ -1231,9 +1231,8 @@ static int do_show_ip_route(struct vty *vty, const char *vrf_name, afi_t afi,
        }
 
        if (use_json) {
-               vty_out(vty, "%s\n",
-                       json_object_to_json_string_ext(
-                               json, JSON_C_TO_STRING_PRETTY));
+               vty_out(vty, "%s\n", json_object_to_json_string_ext(
+                                            json, JSON_C_TO_STRING_PRETTY));
                json_object_free(json);
        }
 
@@ -1621,9 +1620,8 @@ static void vty_show_ip_route_summary(struct vty *vty,
                "FIB", zvrf_name(((rib_table_info_t *)table->info)->zvrf));
 
        for (i = 0; i < ZEBRA_ROUTE_MAX; i++) {
-               if ((rib_cnt[i] > 0)
-                   || (i == ZEBRA_ROUTE_BGP
-                       && rib_cnt[ZEBRA_ROUTE_IBGP] > 0)) {
+               if ((rib_cnt[i] > 0) || (i == ZEBRA_ROUTE_BGP
+                                        && rib_cnt[ZEBRA_ROUTE_IBGP] > 0)) {
                        if (i == ZEBRA_ROUTE_BGP) {
                                vty_out(vty, "%-20s %-20d %-20d \n", "ebgp",
                                        rib_cnt[ZEBRA_ROUTE_BGP],
index d03caabfa696591ae2a570d9ea45beebe3410220..c96f073064d80d1d347049e4e5345e9543990dc0 100644 (file)
@@ -903,10 +903,9 @@ static void zvni_mac_del_from_vtep(zebra_vni_t *zvni, int uninstall,
        wctx.flags = DEL_REMOTE_MAC_FROM_VTEP;
        wctx.r_vtep_ip = *r_vtep_ip;
 
-       hash_iterate(
-               zvni->mac_table,
-               (void (*)(struct hash_backet *, void *))zvni_mac_del_hash_entry,
-               &wctx);
+       hash_iterate(zvni->mac_table, (void (*)(struct hash_backet *,
+                                               void *))zvni_mac_del_hash_entry,
+                    &wctx);
 }
 
 /*
@@ -927,10 +926,9 @@ static void zvni_mac_del_all(struct zebra_vrf *zvrf, zebra_vni_t *zvni,
        wctx.upd_client = upd_client;
        wctx.flags = flags;
 
-       hash_iterate(
-               zvni->mac_table,
-               (void (*)(struct hash_backet *, void *))zvni_mac_del_hash_entry,
-               &wctx);
+       hash_iterate(zvni->mac_table, (void (*)(struct hash_backet *,
+                                               void *))zvni_mac_del_hash_entry,
+                    &wctx);
 }
 
 /*
@@ -1995,7 +1993,7 @@ int zebra_vxlan_local_neigh_add_update(struct interface *ifp,
                                send_del = 1;
                } else if (ext_learned)
                /* The neighbor is remote and that is the notification we got.
-                */
+                  */
                {
                        /* TODO: Evaluate if we need to do anything here. */
                        return 0;
index fb1ff74c28881483b07410ddcb3aa207ba906092..3bc5f83f6451d68fea444fea5165d275d75f86e9 100644 (file)
@@ -854,9 +854,8 @@ static int zserv_rnh_register(struct zserv *client, int sock, u_short length,
                        if (flags
                            && !CHECK_FLAG(rnh->flags, ZEBRA_NHT_EXACT_MATCH))
                                SET_FLAG(rnh->flags, ZEBRA_NHT_EXACT_MATCH);
-                       else if (!flags
-                                && CHECK_FLAG(rnh->flags,
-                                              ZEBRA_NHT_EXACT_MATCH))
+                       else if (!flags && CHECK_FLAG(rnh->flags,
+                                                     ZEBRA_NHT_EXACT_MATCH))
                                UNSET_FLAG(rnh->flags, ZEBRA_NHT_EXACT_MATCH);
                }
 
@@ -2820,9 +2819,8 @@ DEFUN (show_zebra,
        RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
        {
                struct zebra_vrf *zvrf = vrf->info;
-               vty_out(vty,
-                       "%-25s %10" PRIu64 " %10" PRIu64 " %10" PRIu64
-                       " %10" PRIu64 " %10" PRIu64 "\n",
+               vty_out(vty, "%-25s %10" PRIu64 " %10" PRIu64 " %10" PRIu64
+                            " %10" PRIu64 " %10" PRIu64 "\n",
                        vrf->name, zvrf->installs, zvrf->removals,
                        zvrf->neigh_updates, zvrf->lsp_installs,
                        zvrf->lsp_removals);