diff options
| author | Lou Berger <lberger@labn.net> | 2018-03-06 14:02:52 -0500 |
|---|---|---|
| committer | Lou Berger <lberger@labn.net> | 2018-03-06 14:04:32 -0500 |
| commit | 996c93142d3abfab0f6d6c800474e22a8cfbdbc5 (patch) | |
| tree | 2b28846d256c84cf7b7f1a8988fb3267c8611722 /ospf6d/ospf6_intra.c | |
| parent | 3380418fa10556ef2c9139d09b9a435db64dc392 (diff) | |
*: conform with COMMUNITY.md formatting rules, via 'make indent'
Signed-off-by: Lou Berger <lberger@labn.net>
Diffstat (limited to 'ospf6d/ospf6_intra.c')
| -rw-r--r-- | ospf6d/ospf6_intra.c | 117 |
1 files changed, 57 insertions, 60 deletions
diff --git a/ospf6d/ospf6_intra.c b/ospf6d/ospf6_intra.c index 77653ea33f..14f12d6b6a 100644 --- a/ospf6d/ospf6_intra.c +++ b/ospf6d/ospf6_intra.c @@ -215,7 +215,8 @@ int ospf6_router_lsa_originate(struct thread *thread) ospf6_router_lsa_options_set(oa, router_lsa); /* describe links for each interfaces */ - lsdesc = (struct ospf6_router_lsdesc *)((caddr_t)router_lsa + lsdesc = (struct ospf6_router_lsdesc + *)((caddr_t)router_lsa + sizeof(struct ospf6_router_lsa)); for (ALL_LIST_ELEMENTS(oa->if_list, node, nnode, oi)) { @@ -253,10 +254,9 @@ int ospf6_router_lsa_originate(struct thread *thread) lsa_header->type = htons(OSPF6_LSTYPE_ROUTER); lsa_header->id = htonl(link_state_id); lsa_header->adv_router = oa->ospf6->router_id; - lsa_header->seqnum = - ospf6_new_ls_seqnum(lsa_header->type, - lsa_header->id, - lsa_header->adv_router, oa->lsdb); + lsa_header->seqnum = ospf6_new_ls_seqnum( + lsa_header->type, lsa_header->id, + lsa_header->adv_router, oa->lsdb); lsa_header->length = htons((caddr_t)lsdesc - (caddr_t)buffer); @@ -273,15 +273,16 @@ int ospf6_router_lsa_originate(struct thread *thread) memset(buffer, 0, sizeof(buffer)); lsa_header = (struct ospf6_lsa_header *)buffer; router_lsa = - (struct ospf6_router_lsa *)((caddr_t)lsa_header + (struct ospf6_router_lsa + *)((caddr_t)lsa_header + sizeof(struct ospf6_lsa_header)); ospf6_router_lsa_options_set(oa, router_lsa); /* describe links for each interfaces */ - lsdesc = (struct ospf6_router_lsdesc *) - ((caddr_t)router_lsa + - sizeof(struct ospf6_router_lsa)); + lsdesc = (struct ospf6_router_lsdesc + *)((caddr_t)router_lsa + + sizeof(struct ospf6_router_lsa)); link_state_id++; } @@ -922,16 +923,15 @@ int ospf6_intra_prefix_lsa_originate_stub(struct thread *thread) ospf6_lsa_purge(old); /* find previous LSA */ old_next = ospf6_lsdb_lookup( - htons(OSPF6_LSTYPE_INTRA_PREFIX), - htonl(++ls_id), - oa->ospf6->router_id, oa->lsdb); + htons(OSPF6_LSTYPE_INTRA_PREFIX), + htonl(++ls_id), oa->ospf6->router_id, oa->lsdb); while (old_next) { ospf6_lsa_purge(old_next); old_next = ospf6_lsdb_lookup( htons(OSPF6_LSTYPE_INTRA_PREFIX), - htonl(++ls_id), - oa->ospf6->router_id, oa->lsdb); + htonl(++ls_id), oa->ospf6->router_id, + oa->lsdb); } } return 0; @@ -945,7 +945,8 @@ int ospf6_intra_prefix_lsa_originate_stub(struct thread *thread) /* prepare buffer */ memset(buffer, 0, sizeof(buffer)); lsa_header = (struct ospf6_lsa_header *)buffer; - intra_prefix_lsa = (struct ospf6_intra_prefix_lsa *)((caddr_t)lsa_header + intra_prefix_lsa = (struct ospf6_intra_prefix_lsa + *)((caddr_t)lsa_header + sizeof(struct ospf6_lsa_header)); /* Fill Intra-Area-Prefix-LSA */ @@ -999,16 +1000,15 @@ int ospf6_intra_prefix_lsa_originate_stub(struct thread *thread) ospf6_lsa_purge(old); /* find previous LSA */ old_next = ospf6_lsdb_lookup( - htons(OSPF6_LSTYPE_INTRA_PREFIX), - htonl(++ls_id), - oa->ospf6->router_id, oa->lsdb); + htons(OSPF6_LSTYPE_INTRA_PREFIX), + htonl(++ls_id), oa->ospf6->router_id, oa->lsdb); while (old_next) { ospf6_lsa_purge(old_next); old_next = ospf6_lsdb_lookup( htons(OSPF6_LSTYPE_INTRA_PREFIX), - htonl(++ls_id), - oa->ospf6->router_id, oa->lsdb); + htonl(++ls_id), oa->ospf6->router_id, + oa->lsdb); } } ospf6_route_table_delete(route_advertise); @@ -1030,13 +1030,11 @@ int ospf6_intra_prefix_lsa_originate_stub(struct thread *thread) lsa_header->type = htons(OSPF6_LSTYPE_INTRA_PREFIX); lsa_header->id = htonl(ls_id++); lsa_header->adv_router = oa->ospf6->router_id; - lsa_header->seqnum = - ospf6_new_ls_seqnum(lsa_header->type, - lsa_header->id, - lsa_header->adv_router, - oa->lsdb); - lsa_header->length = htons((caddr_t)op - - (caddr_t)lsa_header); + lsa_header->seqnum = ospf6_new_ls_seqnum( + lsa_header->type, lsa_header->id, + lsa_header->adv_router, oa->lsdb); + lsa_header->length = + htons((caddr_t)op - (caddr_t)lsa_header); /* LSA checksum */ ospf6_lsa_checksum(lsa_header); @@ -1050,9 +1048,10 @@ int ospf6_intra_prefix_lsa_originate_stub(struct thread *thread) /* Prepare next buffer */ memset(buffer, 0, sizeof(buffer)); lsa_header = (struct ospf6_lsa_header *)buffer; - intra_prefix_lsa = (struct ospf6_intra_prefix_lsa *) - ((caddr_t)lsa_header - + sizeof(struct ospf6_lsa_header)); + intra_prefix_lsa = + (struct ospf6_intra_prefix_lsa + *)((caddr_t)lsa_header + + sizeof(struct ospf6_lsa_header)); /* Fill Intra-Area-Prefix-LSA */ intra_prefix_lsa->ref_type = htons(OSPF6_LSTYPE_ROUTER); @@ -1061,8 +1060,10 @@ int ospf6_intra_prefix_lsa_originate_stub(struct thread *thread) /* Put next set of prefixes to advertise */ prefix_num = 0; - op = (struct ospf6_prefix *)((caddr_t)intra_prefix_lsa - + sizeof(struct ospf6_intra_prefix_lsa)); + op = (struct ospf6_prefix + *)((caddr_t)intra_prefix_lsa + + sizeof(struct + ospf6_intra_prefix_lsa)); } op->prefix_length = route->prefix.prefixlen; @@ -1740,32 +1741,29 @@ void ospf6_intra_brouter_calculation(struct ospf6_area *oa) oa->name); } -struct ospf6_lsa_handler router_handler = { - .lh_type = OSPF6_LSTYPE_ROUTER, - .lh_name = "Router", - .lh_short_name = "Rtr", - .lh_show = ospf6_router_lsa_show, - .lh_get_prefix_str = ospf6_router_lsa_get_nbr_id, - .lh_debug = 0 -}; - -struct ospf6_lsa_handler network_handler = { - .lh_type = OSPF6_LSTYPE_NETWORK, - .lh_name = "Network", - .lh_short_name = "Net", - .lh_show = ospf6_network_lsa_show, - .lh_get_prefix_str = ospf6_network_lsa_get_ar_id, - .lh_debug = 0 -}; - -struct ospf6_lsa_handler link_handler = { - .lh_type = OSPF6_LSTYPE_LINK, - .lh_name = "Link", - .lh_short_name = "Lnk", - .lh_show = ospf6_link_lsa_show, - .lh_get_prefix_str = ospf6_link_lsa_get_prefix_str, - .lh_debug = 0 -}; +struct ospf6_lsa_handler router_handler = {.lh_type = OSPF6_LSTYPE_ROUTER, + .lh_name = "Router", + .lh_short_name = "Rtr", + .lh_show = ospf6_router_lsa_show, + .lh_get_prefix_str = + ospf6_router_lsa_get_nbr_id, + .lh_debug = 0}; + +struct ospf6_lsa_handler network_handler = {.lh_type = OSPF6_LSTYPE_NETWORK, + .lh_name = "Network", + .lh_short_name = "Net", + .lh_show = ospf6_network_lsa_show, + .lh_get_prefix_str = + ospf6_network_lsa_get_ar_id, + .lh_debug = 0}; + +struct ospf6_lsa_handler link_handler = {.lh_type = OSPF6_LSTYPE_LINK, + .lh_name = "Link", + .lh_short_name = "Lnk", + .lh_show = ospf6_link_lsa_show, + .lh_get_prefix_str = + ospf6_link_lsa_get_prefix_str, + .lh_debug = 0}; struct ospf6_lsa_handler intra_prefix_handler = { .lh_type = OSPF6_LSTYPE_INTRA_PREFIX, @@ -1773,8 +1771,7 @@ struct ospf6_lsa_handler intra_prefix_handler = { .lh_short_name = "INP", .lh_show = ospf6_intra_prefix_lsa_show, .lh_get_prefix_str = ospf6_intra_prefix_lsa_get_prefix_str, - .lh_debug = 0 -}; + .lh_debug = 0}; void ospf6_intra_init(void) { |
