#define VLAN_ID_LEN 9
-#define __stringify_1(x...) #x
-#define __stringify(x...) __stringify_1(x)
-
static void usage(void)
{
fprintf(stderr,
{
open_json_object(NULL);
print_color_string(PRINT_ANY, COLOR_IFNAME, "ifname",
- "%-" __stringify(IFNAMSIZ) "s ",
+ "%-" textify(IFNAMSIZ) "s ",
ll_index_to_name(ifi_index));
open_json_array(PRINT_JSON,
subject == VLAN_SHOW_VLAN ? "vlans": "tunnels");
opened = true;
} else {
print_string(PRINT_FP, NULL,
- "%-" __stringify(IFNAMSIZ) "s ", "");
+ "%-" textify(IFNAMSIZ) "s ", "");
}
open_json_object(NULL);
static void __print_one_vlan_stats(const struct bridge_vlan_xstats *vstats)
{
- print_string(PRINT_FP, NULL, "%-" __stringify(IFNAMSIZ) "s ", "");
+ print_string(PRINT_FP, NULL, "%-" textify(IFNAMSIZ) "s ", "");
print_lluint(PRINT_ANY, "rx_bytes", "RX: %llu bytes",
vstats->rx_bytes);
print_lluint(PRINT_ANY, "rx_packets", " %llu packets\n",
vstats->rx_packets);
- print_string(PRINT_FP, NULL, "%-" __stringify(IFNAMSIZ) "s ", "");
+ print_string(PRINT_FP, NULL, "%-" textify(IFNAMSIZ) "s ", "");
print_lluint(PRINT_ANY, "tx_bytes", "TX: %llu bytes",
vstats->tx_bytes);
print_lluint(PRINT_ANY, "tx_packets", " %llu packets\n",
found_vlan = true;
} else {
print_string(PRINT_FP, NULL,
- "%-" __stringify(IFNAMSIZ) "s ", "");
+ "%-" textify(IFNAMSIZ) "s ", "");
}
print_one_vlan_stats(vstats);
}
int rem = RTA_PAYLOAD(rattr);
struct rtattr *i;
- print_string(PRINT_FP, NULL, "%-" __stringify(IFNAMSIZ) "s ", "");
+ print_string(PRINT_FP, NULL, "%-" textify(IFNAMSIZ) "s ", "");
open_json_array(PRINT_ANY, is_json_context() ? "router_ports" :
"router ports: ");
for (i = RTA_DATA(rattr); RTA_OK(i, rem); i = RTA_NEXT(i, rem)) {
print_nl();
/* start: IFNAMSIZ + 4 + strlen("router ports: ") */
print_string(PRINT_FP, NULL,
- "%-" __stringify(IFNAMSIZ) "s "
+ "%-" textify(IFNAMSIZ) "s "
" ",
"");
}
vlan_rtm_cur_ifidx = ifindex;
} else {
open_json_object(NULL);
- print_string(PRINT_FP, NULL, "%-" __stringify(IFNAMSIZ) "s ", "");
+ print_string(PRINT_FP, NULL, "%-" textify(IFNAMSIZ) "s ", "");
}
print_range("vlan", vid, vrange);
print_nl();
- print_string(PRINT_FP, NULL, "%-" __stringify(IFNAMSIZ) "s ", "");
+ print_string(PRINT_FP, NULL, "%-" textify(IFNAMSIZ) "s ", "");
if (vtb[BRIDGE_VLANDB_GOPTS_MCAST_SNOOPING]) {
vattr = vtb[BRIDGE_VLANDB_GOPTS_MCAST_SNOOPING];
print_uint(PRINT_ANY, "mcast_snooping", "mcast_snooping %u ",
vlan_rtm_cur_ifidx = ifindex;
} else {
open_json_object(NULL);
- print_string(PRINT_FP, NULL, "%-" __stringify(IFNAMSIZ) "s ", "");
+ print_string(PRINT_FP, NULL, "%-" textify(IFNAMSIZ) "s ", "");
}
print_range("vlan", vinfo->vid, vrange);
print_vlan_flags(vinfo->flags);
print_nl();
- print_string(PRINT_FP, NULL, "%-" __stringify(IFNAMSIZ) "s ", "");
+ print_string(PRINT_FP, NULL, "%-" textify(IFNAMSIZ) "s ", "");
print_stp_state(state);
if (vtb[BRIDGE_VLANDB_ENTRY_MCAST_ROUTER]) {
vattr = vtb[BRIDGE_VLANDB_ENTRY_MCAST_ROUTER];
}
if (!is_json_context()) {
- printf("%-" __stringify(IFNAMSIZ) "s %-"
- __stringify(VLAN_ID_LEN) "s", "port",
+ printf("%-" textify(IFNAMSIZ) "s %-"
+ textify(VLAN_ID_LEN) "s", "port",
"vlan-id");
printf("\n");
}
}
if (!is_json_context()) {
- printf("%-" __stringify(IFNAMSIZ) "s %-"
- __stringify(VLAN_ID_LEN) "s", "port",
+ printf("%-" textify(IFNAMSIZ) "s %-"
+ textify(VLAN_ID_LEN) "s", "port",
"vlan-id");
if (subject == VLAN_SHOW_TUNNELINFO)
printf(" tunnel-id");
}
if (!is_json_context())
- printf("%-" __stringify(IFNAMSIZ) "s vlan-id\n",
+ printf("%-" textify(IFNAMSIZ) "s vlan-id\n",
"port");
if (rtnl_dump_filter(&rth, print_vlan_stats, stdout) < 0) {
}
if (!is_json_context()) {
- printf("%-" __stringify(IFNAMSIZ) "s %-"
- __stringify(VLAN_ID_LEN) "s", "port",
+ printf("%-" textify(IFNAMSIZ) "s %-"
+ textify(VLAN_ID_LEN) "s", "port",
"vlan-id");
printf("\n");
}
opened = true;
} else {
print_string(PRINT_FP, NULL, "%-"
- __stringify(IFNAMSIZ) "s ", "");
+ textify(IFNAMSIZ) "s ", "");
}
open_json_object(NULL);
/* max len of "<start>-<end>" */
#define VXLAN_ID_LEN 17
-#define __stringify_1(x...) #x
-#define __stringify(x...) __stringify_1(x)
-
static void usage(void)
{
fprintf(stderr,
{
open_json_object(NULL);
print_color_string(PRINT_ANY, COLOR_IFNAME, "ifname",
- "%-" __stringify(IFNAMSIZ) "s ",
+ "%-" textify(IFNAMSIZ) "s ",
ll_index_to_name(ifi_index));
open_json_array(PRINT_JSON, "vnis");
}
RTA_PAYLOAD(stats_attr), NLA_F_NESTED);
print_nl();
- print_string(PRINT_FP, NULL, "%-" __stringify(IFNAMSIZ) "s RX: ",
+ print_string(PRINT_FP, NULL, "%-" textify(IFNAMSIZ) "s RX: ",
"");
if (stb[VNIFILTER_ENTRY_STATS_RX_BYTES]) {
}
print_nl();
- print_string(PRINT_FP, NULL, "%-" __stringify(IFNAMSIZ) "s TX: ",
+ print_string(PRINT_FP, NULL, "%-" textify(IFNAMSIZ) "s TX: ",
"");
if (stb[VNIFILTER_ENTRY_STATS_TX_BYTES]) {
open_vni_port(tmsg->ifindex);
opened = true;
} else {
- print_string(PRINT_FP, NULL, "%-" __stringify(IFNAMSIZ) "s ", "");
+ print_string(PRINT_FP, NULL, "%-" textify(IFNAMSIZ) "s ", "");
}
print_vni(t, tmsg->ifindex);
}
if (!is_json_context())
- printf("%-" __stringify(IFNAMSIZ) "s %-"
- __stringify(VXLAN_ID_LEN) "s group/remote\n", "dev",
+ printf("%-" textify(IFNAMSIZ) "s %-"
+ textify(VXLAN_ID_LEN) "s group/remote\n", "dev",
"vni");
ret = rtnl_dump_filter(&rth, print_vnifilter_rtm, NULL);