Changed action labels to [action ] format
Subsystems (2)
PATCH 1/1 Changed action labels to [action ] format
The reasons for this change were:
- different ip utils uses different labels for action: Deleted/delete
- make an action labels to be easy found in logs
ip monitor:
[DELETED] 192.168.2.0/24 dev winbr0 proto kernel scope link src 192.168.2.100 metric 205 [DELETED] default via 192.168.2.1 dev winbr0 metric 205
[DELETED] 5: winbr0 inet 192.168.2.100/24 brd 192.168.2.255 scope global winbr0
valid_lft forever preferred_lft forever
[DELETED] broadcast 192.168.2.255 dev winbr0 table local proto kernel scope link src 192.168.2.100 [DELETED] broadcast 192.168.2.0 dev winbr0 table local proto kernel scope link src 192.168.2.100 [DELETED] local 192.168.2.100 dev winbr0 table local proto kernel scope host src 192.168.2.100 [DELETED] 224.0.0.251 dev winbr0 lladdr XX:XX:XX:XX:XX:XX NOARP
[DELETED] 224.0.0.22 dev winbr0 lladdr XX:XX:XX:XX:XX:XX NOARP
[DELETED] 192.168.2.1 dev winbr0 lladdr XX:XX:XX:XX:XX:XX REACHABLE
tc monitor:
[DELETED] qdisc dsmark 10: dev lo root indices 0x0040 default_index 0x0001 set_tc_index qdisc cbq 10: dev lo root rate 100Mbit (bounded,isolated) prio no-transmit class cbq 10:12 dev lo parent 10: rate 100Mbit (bounded) prio 3
[DELETED] qdisc cbq 10: dev lo root rate 100Mbit (bounded,isolated) prio no-transmit qdisc htb 10: dev lo root r2q 10 default 0 direct_packets_stat 0 direct_qlen 2 class htb 10:12 dev lo root prio 0 rate 100Mbit ceil 100Mbit burst 1600b cburst 1600b [DELETED] qdisc htb 10: dev lo root r2q 10 default 0 direct_packets_stat 0 direct_qlen 2 qdisc dsmark 20: dev lo root indices 0x0040 default_index 0x0001 set_tc_index class dsmark 20:12 dev lo parent 20: mask 0xff value 0x02
[DELETED] qdisc pfifo 0: dev lo parent 20: limit 1p
qdisc prio 10: dev lo parent 20: bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
--- bridge/fdb.c | 2 +- bridge/link.c | 2 +- ip/ipaddress.c | 4 ++-- ip/ipaddrlabel.c | 2 +- ip/ipmroute.c | 2 +- ip/ipneigh.c | 4 ++-- ip/ipnetns.c | 4 ++-- ip/iproute.c | 2 +- ip/iprule.c | 2 +- ip/tcp_metrics.c | 2 +- ip/xfrm_policy.c | 6 +++--- ip/xfrm_state.c | 6 +++--- tc/m_action.c | 6 +++--- tc/tc_class.c | 2 +- tc/tc_filter.c | 2 +- tc/tc_qdisc.c | 2 +- 16 files changed, 25 insertions(+), 25 deletions(-)
bridge/fdb.c +1 -1
@@ -88,7 +88,7 @@ int print_fdb(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg) n->nlmsg_len - NLMSG_LENGTH(sizeof(*r)));if (n->nlmsg_type ==RTM_DELNEIGH ) -fprintf (fp,"Deleted " ); +fprintf (fp,"[DELETED] " );if (tb[NDA_LLADDR ]) {SPRINT_BUF (b1);
bridge/link.c +1 -1
@@ -125,7 +125,7 @@ int print_linkinfo(const struct sockaddr_nl *who, }if (n->nlmsg_type ==RTM_DELLINK ) -fprintf (fp,"Deleted " ); +fprintf (fp,"[DELETED] " );fprintf (fp,"%d: %s " , ifi->ifi_index, tb[IFLA_IFNAME ] ?rta_getattr_str (tb[IFLA_IFNAME ]) :"<nil>" );
ip/ipaddress.c +2 -2
@@ -481,7 +481,7 @@ int print_linkinfo(const struct sockaddr_nl *who, }if (n->nlmsg_type ==RTM_DELLINK ) -fprintf (fp,"Deleted " ); +fprintf (fp,"[DELETED] " );fprintf (fp,"%d: %s" , ifi->ifi_index, tb[IFLA_IFNAME ] ?rta_getattr_str (tb[IFLA_IFNAME ]) :"<nil>" );
@@ -694,7 +694,7 @@ int print_addrinfo(const struct sockaddr_nl *who, struct nlmsghdr *n, }if (n->nlmsg_type ==RTM_DELADDR ) -fprintf (fp,"Deleted " ); +fprintf (fp,"[DELETED] " );if (filter.oneline || filter.flushb)fprintf (fp,"%u: %s" , ifa->ifa_index,ll_index_to_name (ifa->ifa_index));
ip/ipaddrlabel.c +1 -1
@@ -71,7 +71,7 @@ int print_addrlabel(const struct sockaddr_nl *who, struct nlmsghdr *n, void *argparse_rtattr (tb,IFAL_MAX ,IFAL_RTA (ifal), len);if (n->nlmsg_type ==RTM_DELADDRLABEL ) -fprintf (fp,"Deleted " ); +fprintf (fp,"[DELETED] " );if (tb[IFAL_ADDRESS ]) { fprintf(fp, "prefix %s/%u ",
ip/ipmroute.c +1 -1
@@ -111,7 +111,7 @@ int print_mroute(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg) family = r->rtm_family ==RTNL_FAMILY_IPMR ?AF_INET :AF_INET6 ;if (n->nlmsg_type ==RTM_DELROUTE ) -fprintf (fp,"Deleted " ); +fprintf (fp,"[DELETED] " );if (tb[RTA_SRC ]) len = snprintf(obuf, sizeof(obuf),
ip/ipneigh.c +2 -2
@@ -251,9 +251,9 @@ int print_neigh(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg) }if (n->nlmsg_type ==RTM_DELNEIGH ) -fprintf (fp,"delete " ); +fprintf (fp,"[DELETED] " );else if (n->nlmsg_type ==RTM_GETNEIGH ) -fprintf (fp,"miss " ); +fprintf (fp,"[MISS] " );if (tb[NDA_DST ]) { fprintf(fp, "%s ", format_host(r->ndm_family,
ip/ipnetns.c +2 -2
@@ -504,9 +504,9 @@ static int netns_monitor(int argc, char **argv) (char *)event < &buf[len]; event = (struct inotify_event *)((char *)event + sizeof(*event) + event->len)) {if (event->mask &IN_CREATE ) -printf ("add %s\n" , event->name); +printf ("[NEW] %s\n" , event->name);if (event->mask &IN_DELETE ) -printf ("delete %s\n" , event->name); +printf ("[DELETED] %s\n" , event->name); } }return 0 ;
ip/iproute.c +1 -1
@@ -331,7 +331,7 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg) }if (n->nlmsg_type ==RTM_DELROUTE ) -fprintf (fp,"Deleted " ); +fprintf (fp,"[DELETED] " );if ((r->rtm_type !=RTN_UNICAST || show_details >0 ) && !filter.type)fprintf (fp,"%s " ,rtnl_rtntype_n2a (r->rtm_type, b1,sizeof (b1)));
ip/iprule.c +1 -1
@@ -76,7 +76,7 @@ int print_rule(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg) host_len =80 ;if (n->nlmsg_type ==RTM_DELRULE ) -fprintf (fp,"Deleted " ); +fprintf (fp,"[DELETED] " );if (tb[FRA_PRIORITY ])fprintf (fp,"%u:\t" , *(unsigned *)RTA_DATA (tb[FRA_PRIORITY ]));
ip/tcp_metrics.c +1 -1
@@ -190,7 +190,7 @@ static int process_msg(const struct sockaddr_nl *who, struct nlmsghdr *n, }if (f.cmd & (CMD_DEL |CMD_FLUSH )) -fprintf (fp,"Deleted " ); +fprintf (fp,"[DELETED] " );fprintf (fp,"%s" ,format_host (family, dlen, &daddr.data, abuf,sizeof (abuf)));
ip/xfrm_policy.c +3 -3
@@ -519,11 +519,11 @@ int xfrm_policy_print(const struct sockaddr_nl *who, struct nlmsghdr *n,return 0 ;if (n->nlmsg_type ==XFRM_MSG_DELPOLICY ) -fprintf (fp,"Deleted " ); +fprintf (fp,"[DELETED] " );else if (n->nlmsg_type ==XFRM_MSG_UPDPOLICY ) -fprintf (fp,"Updated " ); +fprintf (fp,"[UPDATED] " );else if (n->nlmsg_type ==XFRM_MSG_POLEXPIRE ) -fprintf (fp,"Expired " ); +fprintf (fp,"[EXPIRED] " );if (n->nlmsg_type ==XFRM_MSG_DELPOLICY ) {//xfrm_policy_id_print();
ip/xfrm_state.c +3 -3
@@ -864,11 +864,11 @@ int xfrm_state_print(const struct sockaddr_nl *who, struct nlmsghdr *n,return 0 ;if (n->nlmsg_type ==XFRM_MSG_DELSA ) -fprintf (fp,"Deleted " ); +fprintf (fp,"[DELETED] " );else if (n->nlmsg_type ==XFRM_MSG_UPDSA ) -fprintf (fp,"Updated " ); +fprintf (fp,"[UPDATED] " );else if (n->nlmsg_type ==XFRM_MSG_EXPIRE ) -fprintf (fp,"Expired " ); +fprintf (fp,"[EXPIRED] " );if (n->nlmsg_type ==XFRM_MSG_DELSA ) rta =XFRMSID_RTA (xsid);
tc/m_action.c +3 -3
@@ -362,15 +362,15 @@ int print_action(const struct sockaddr_nl *who,if (n->nlmsg_type ==RTM_DELACTION ) {if (n->nlmsg_flags &NLM_F_ROOT ) { -fprintf (fp,"Flushed table " ); +fprintf (fp,"[FLUSHED] table " ); tab_flush =1 ; }else { -fprintf (fp,"deleted action " ); +fprintf (fp,"[DELETED] action " ); } }if (n->nlmsg_type ==RTM_NEWACTION ) -fprintf (fp,"Added action " ); +fprintf (fp,"[NEW] action " );tc_print_action (fp, tb[TCA_ACT_TAB ]);return 0 ;
tc/tc_class.c +1 -1
@@ -182,7 +182,7 @@ int print_class(const struct sockaddr_nl *who, }if (n->nlmsg_type ==RTM_DELTCLASS ) -fprintf (fp,"deleted " ); +fprintf (fp,"[DELETED] " ); abuf[0 ] =0 ;if (t->tcm_handle) {
tc/tc_filter.c +1 -1
@@ -211,7 +211,7 @@ int print_filter(const struct sockaddr_nl *who, }if (n->nlmsg_type ==RTM_DELTFILTER ) -fprintf (fp,"deleted " ); +fprintf (fp,"[DELETED] " );fprintf (fp,"filter " );if (!filter_ifindex || filter_ifindex != t->tcm_ifindex)
tc/tc_qdisc.c +1 -1
@@ -228,7 +228,7 @@ int print_qdisc(const struct sockaddr_nl *who, }if (n->nlmsg_type ==RTM_DELQDISC ) -fprintf (fp,"deleted " ); +fprintf (fp,"[DELETED] " );fprintf (fp,"qdisc %s %x: " ,rta_getattr_str (tb[TCA_KIND ]), t->tcm_handle>>16 );if (filter_ifindex ==0 )
Signature · 1 line
2.1.0
Quoted 3 lines · On Fri, 10 Oct 2014 19:51:56 +0300 Vadim Kochan <[email protected]> wrote:
The reasons for this change were:
- different ip utils uses different labels for action: Deleted/delete
- make an action labels to be easy found in logs
Fine in concept. But people do stupid things like parse the output of commands. I am loathe to make cosmetic change.
But the scripts can be easy rewritten ?
Quoted 10 lines · Stephen Hemminger
Quoted 3 lines · On Fri, 10 Oct 2014 19:51:56 +0300 Vadim Kochan <[email protected]> wrote:
The reasons for this change were:
- different ip utils uses different labels for action: Deleted/delete
- make an action labels to be easy found in logsFine in concept. But people do stupid things like parse the output of commands. I am loathe to make cosmetic change.