Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 213828
b: refs/heads/master
c: c2de581
h: refs/heads/master
v: v3
  • Loading branch information
Allan Stephens authored and David S. Miller committed Aug 18, 2010
1 parent 73481ce commit 154d37d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 29 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 76ae0d71d839b365faa7fdca0eec85a6d1a20d95
refs/heads/master: c2de58140a380172610b6a0f07f975abb2fbb311
44 changes: 16 additions & 28 deletions trunk/net/tipc/name_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,7 @@ static void subseq_list(struct sub_seq *sseq, struct print_buf *buf, u32 depth,
u32 index)
{
char portIdStr[27];
char *scopeStr;
const char *scope_str[] = {"", " zone", " cluster", " node"};
struct publication *publ = sseq->zone_list;

tipc_printf(buf, "%-10u %-10u ", sseq->lower, sseq->upper);
Expand All @@ -893,15 +893,8 @@ static void subseq_list(struct sub_seq *sseq, struct print_buf *buf, u32 depth,
tipc_node(publ->node), publ->ref);
tipc_printf(buf, "%-26s ", portIdStr);
if (depth > 3) {
if (publ->node != tipc_own_addr)
scopeStr = "";
else if (publ->scope == TIPC_NODE_SCOPE)
scopeStr = "node";
else if (publ->scope == TIPC_CLUSTER_SCOPE)
scopeStr = "cluster";
else
scopeStr = "zone";
tipc_printf(buf, "%-10u %s", publ->key, scopeStr);
tipc_printf(buf, "%-10u %s", publ->key,
scope_str[publ->scope]);
}

publ = publ->zone_list_next;
Expand Down Expand Up @@ -951,24 +944,19 @@ static void nameseq_list(struct name_seq *seq, struct print_buf *buf, u32 depth,

static void nametbl_header(struct print_buf *buf, u32 depth)
{
tipc_printf(buf, "Type ");

if (depth > 1)
tipc_printf(buf, "Lower Upper ");
if (depth > 2)
tipc_printf(buf, "Port Identity ");
if (depth > 3)
tipc_printf(buf, "Publication");

tipc_printf(buf, "\n-----------");

if (depth > 1)
tipc_printf(buf, "--------------------- ");
if (depth > 2)
tipc_printf(buf, "-------------------------- ");
if (depth > 3)
tipc_printf(buf, "------------------");

const char *header[] = {
"Type ",
"Lower Upper ",
"Port Identity ",
"Publication Scope"
};

int i;

if (depth > 4)
depth = 4;
for (i = 0; i < depth; i++)
tipc_printf(buf, header[i]);
tipc_printf(buf, "\n");
}

Expand Down

0 comments on commit 154d37d

Please sign in to comment.