]> rtime.felk.cvut.cz Git - lisovros/iproute2_canprio.git/commitdiff
Remove trailing whitespace
authorStephen Hemminger <shemminger@osdl.org>
Tue, 5 Dec 2006 18:10:22 +0000 (10:10 -0800)
committerStephen Hemminger <shemminger@osdl.org>
Tue, 5 Dec 2006 18:10:22 +0000 (10:10 -0800)
Go through source files and remove all trailing whitespace

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
75 files changed:
include/ip6tables.h
include/iptables.h
include/iptables_common.h
include/libnetlink.h
include/ll_map.h
include/utils.h
ip/ifcfg
ip/ip.c
ip/ip6tunnel.c
ip/ip_common.h
ip/ipaddress.c
ip/iplink.c
ip/ipmaddr.c
ip/ipmroute.c
ip/ipneigh.c
ip/ipntable.c
ip/ipprefix.c
ip/iproute.c
ip/iprule.c
ip/iptunnel.c
ip/ipxfrm.c
ip/rtmon.c
ip/tunnel.c
ip/tunnel.h
ip/xfrm.h
ip/xfrm_monitor.c
ip/xfrm_policy.c
ip/xfrm_state.c
lib/ipx_ntop.c
lib/ll_map.c
lib/ll_proto.c
lib/utils.c
misc/arpd.c
misc/ifstat.c
misc/lnstat.c
misc/lnstat_util.c
misc/nstat.c
misc/rtacct.c
misc/ss.c
misc/ssfilter.y
tc/em_cmp.c
tc/em_meta.c
tc/em_nbyte.c
tc/em_u32.c
tc/emp_ematch.l
tc/f_basic.c
tc/f_fw.c
tc/f_u32.c
tc/m_action.c
tc/m_ematch.c
tc/m_ematch.h
tc/m_estimator.c
tc/m_gact.c
tc/m_ipt.c
tc/m_mirred.c
tc/m_pedit.c
tc/m_pedit.h
tc/m_police.c
tc/p_icmp.c
tc/p_ip.c
tc/p_tcp.c
tc/p_udp.c
tc/q_cbq.c
tc/q_gred.c
tc/q_hfsc.c
tc/q_htb.c
tc/q_netem.c
tc/q_red.c
tc/q_tbf.c
tc/tc.c
tc/tc_class.c
tc/tc_filter.c
tc/tc_qdisc.c
tc/tc_util.c
tc/tc_util.h

index 8360617c34405a92f304949d54d7f501de0fed94..1050593a94aecda5488ae548ef0ce0be330c06c9 100644 (file)
@@ -65,7 +65,7 @@ struct ip6tables_match
 struct ip6tables_target
 {
        struct ip6tables_target *next;
-       
+
        ip6t_chainlabel name;
 
        const char *version;
@@ -87,7 +87,7 @@ struct ip6tables_target
        int (*parse)(int c, char **argv, int invert, unsigned int *flags,
                     const struct ip6t_entry *entry,
                     struct ip6t_entry_target **target);
-       
+
        /* Final check; exit if not ok. */
        void (*final_check)(unsigned int flags);
 
index 25f36aeb14925e69ef0e3d8cc2a9533daf26b302..dd844c1ec424a9e5379ad9091c57e18c0839bcb6 100644 (file)
@@ -170,7 +170,7 @@ extern struct iptables_match *find_match(const char *name, enum ipt_tryload, str
 
 extern int delete_chain(const ipt_chainlabel chain, int verbose,
                        iptc_handle_t *handle);
-extern int flush_entries(const ipt_chainlabel chain, int verbose, 
+extern int flush_entries(const ipt_chainlabel chain, int verbose,
                        iptc_handle_t *handle);
 extern int for_each_chain(int (*fn)(const ipt_chainlabel, int, iptc_handle_t *),
                int verbose, int builtinstoo, iptc_handle_t *handle);
index ed5b9c060f0002f556a3039c3d4a3b2de6092778..82b0febdc3f8e975d3fdb9299062585b4031e369 100644 (file)
@@ -10,16 +10,16 @@ enum exittype {
 extern void exit_printhelp(void) __attribute__((noreturn));
 extern void exit_tryhelp(int) __attribute__((noreturn));
 int check_inverse(const char option[], int *invert, int *optind, int argc);
-extern int string_to_number(const char *, 
-                           unsigned int, 
+extern int string_to_number(const char *,
+                           unsigned int,
                            unsigned int,
                            unsigned int *);
-extern int string_to_number_l(const char *, 
-                           unsigned long int, 
+extern int string_to_number_l(const char *,
+                           unsigned long int,
                            unsigned long int,
                            unsigned long *);
-extern int string_to_number_ll(const char *, 
-                           unsigned long long int, 
+extern int string_to_number_ll(const char *,
+                           unsigned long long int,
                            unsigned long long int,
                            unsigned long long *);
 extern int iptables_insmod(const char *modname, const char *modprobe);
index 9de3a0bd2a79eb675155dc872d2c9cdd5e0df1cf..49e248eeddd2e94c0f1ca43a4795a6efdfd7e1ce 100644 (file)
@@ -23,7 +23,7 @@ extern void rtnl_close(struct rtnl_handle *rth);
 extern int rtnl_wilddump_request(struct rtnl_handle *rth, int fam, int type);
 extern int rtnl_dump_request(struct rtnl_handle *rth, int type, void *req, int len);
 
-typedef int (*rtnl_filter_t)(const struct sockaddr_nl *, 
+typedef int (*rtnl_filter_t)(const struct sockaddr_nl *,
                             struct nlmsghdr *n, void *);
 extern int rtnl_dump_filter(struct rtnl_handle *rth, rtnl_filter_t filter,
                            void *arg1,
@@ -48,7 +48,7 @@ extern int parse_rtattr_byindex(struct rtattr *tb[], int max, struct rtattr *rta
 #define parse_rtattr_nested(tb, max, rta) \
        (parse_rtattr((tb), (max), RTA_DATA(rta), RTA_PAYLOAD(rta)))
 
-extern int rtnl_listen(struct rtnl_handle *, rtnl_filter_t handler, 
+extern int rtnl_listen(struct rtnl_handle *, rtnl_filter_t handler,
                       void *jarg);
 extern int rtnl_from_file(FILE *, rtnl_filter_t handler,
                       void *jarg);
index d085813fdc3d252e670272e5afd9f2ea31168889..c4d5c6d1b0188a59840648a162d28e472cdc5895 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __LL_MAP_H__
 #define __LL_MAP_H__ 1
 
-extern int ll_remember_index(const struct sockaddr_nl *who, 
+extern int ll_remember_index(const struct sockaddr_nl *who,
                             struct nlmsghdr *n, void *arg);
 extern int ll_init_map(struct rtnl_handle *rth);
 extern unsigned ll_name_to_index(const char *name);
index 0f1d1f615fedc9f7a5574a179f9e544c6d7618d4..a4133c91ed3223ce09b0716bc653af1afcf156c5 100644 (file)
@@ -55,7 +55,7 @@ typedef struct
 #define AF_DECnet 12
 #endif
 
-struct dn_naddr 
+struct dn_naddr
 {
         unsigned short          a_len;
         unsigned char a_addr[DN_MAXADDL];
@@ -89,9 +89,9 @@ extern int get_s8(__s8 *val, const char *arg, int base);
 extern char* hexstring_n2a(const __u8 *str, int len, char *buf, int blen);
 extern __u8* hexstring_a2n(const char *str, __u8 *buf, int blen);
 
-extern const char *format_host(int af, int len, const void *addr, 
+extern const char *format_host(int af, int len, const void *addr,
                               char *buf, int buflen);
-extern const char *rt_addr_n2a(int af, int len, const void *addr, 
+extern const char *rt_addr_n2a(int af, int len, const void *addr,
                               char *buf, int buflen);
 
 void missarg(const char *) __attribute__((noreturn));
index fb0fe51be2990d707a460851d61ba6382e58db85..083d9df36742fe0bd7bdb6b395ace5297aa03709 100644 (file)
--- a/ip/ifcfg
+++ b/ip/ifcfg
@@ -129,7 +129,7 @@ noarp=$?
 ( sleep 2 ;
   arping -q -U -c 1 -I $dev $ipaddr ) >& /dev/null </dev/null &
 
-ip route add unreachable 224.0.0.0/24 >& /dev/null 
+ip route add unreachable 224.0.0.0/24 >& /dev/null
 ip route add unreachable 255.255.255.255 >& /dev/null
 if [ `ip link ls $dev | grep -c MULTICAST` -ge 1 ]; then
   ip route add 224.0.0.0/4 dev $dev scope global >& /dev/null
diff --git a/ip/ip.c b/ip/ip.c
index 091e9ef208cc35f556b9e13a20fcc99f88c6d235..c084292aa957c79b36517f813114b6f830c3bf0f 100644 (file)
--- a/ip/ip.c
+++ b/ip/ip.c
@@ -145,7 +145,7 @@ int main(int argc, char **argv)
                basename = argv[0];
        else
                basename++;
-       
+
        while (argc > 1) {
                char *opt = argv[1];
                if (strcmp(opt,"--") == 0) {
@@ -220,16 +220,16 @@ int main(int argc, char **argv)
 
        _SL_ = oneline ? "\\" : "\n" ;
 
-       if (batch_file) 
+       if (batch_file)
                return batch(batch_file);
-               
+
        if (rtnl_open(&rth, 0) < 0)
                exit(1);
 
-       if (strlen(basename) > 2) 
+       if (strlen(basename) > 2)
                return do_cmd(basename+2, argc, argv);
 
-       if (argc > 1) 
+       if (argc > 1)
                return do_cmd(argv[1], argc-1, argv+1);
 
        rtnl_close(&rth);
index 488afcbc36e06914c023b22cc79c1b121b5f1ee9..6468d99f580958a1025f2879dba80a6722a14cda 100644 (file)
@@ -1,16 +1,16 @@
 /*
  * Copyright (C)2006 USAGI/WIDE Project
- * 
+ *
  * 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; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
@@ -24,7 +24,7 @@
  * Author:
  *     Masahide NAKAMURA @USAGI
  */
+
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -72,7 +72,7 @@ static void print_tunnel(struct ip6_tnl_parm *p)
 {
        char remote[64];
        char local[64];
-       
+
        inet_ntop(AF_INET6, &p->raddr, remote, sizeof(remote));
        inet_ntop(AF_INET6, &p->laddr, local, sizeof(local));
 
@@ -353,8 +353,8 @@ static int do_del(int argc, char **argv)
        return tnl_del_ioctl(p.name[0] ? p.name : "ip6tnl0", p.name, &p);
 }
 
-int do_ip6tunnel(int argc, char **argv) 
-{ 
+int do_ip6tunnel(int argc, char **argv)
+{
        switch (preferred_family) {
        case AF_UNSPEC:
                preferred_family = AF_INET6;
index aeb9994739ee63f24e23805cc6cd6c7dd8a301b0..5bfd9b98295a8beaa77c100704d6178c07e85d24 100644 (file)
@@ -1,8 +1,8 @@
-extern int print_linkinfo(const struct sockaddr_nl *who, 
-                         struct nlmsghdr *n, 
+extern int print_linkinfo(const struct sockaddr_nl *who,
+                         struct nlmsghdr *n,
                          void *arg);
 extern int print_addrinfo(const struct sockaddr_nl *who,
-                         struct nlmsghdr *n, 
+                         struct nlmsghdr *n,
                          void *arg);
 extern int print_neigh(const struct sockaddr_nl *who,
                       struct nlmsghdr *n, void *arg);
@@ -16,7 +16,7 @@ extern void iproute_reset_filter(void);
 extern void ipaddr_reset_filter(int);
 extern void ipneigh_reset_filter(void);
 extern void ipntable_reset_filter(void);
-extern int print_route(const struct sockaddr_nl *who, 
+extern int print_route(const struct sockaddr_nl *who,
                       struct nlmsghdr *n, void *arg);
 extern int print_prefix(const struct sockaddr_nl *who,
                        struct nlmsghdr *n, void *arg);
index 372989205942a4242ec5a6d9f6d157bfc8e1c8c4..cae1fcd7cff7ed2bc6baaf49d09ddea824be8751 100644 (file)
@@ -120,7 +120,7 @@ void print_queuelen(char *name)
 
        memset(&ifr, 0, sizeof(ifr));
        strcpy(ifr.ifr_name, name);
-       if (ioctl(s, SIOCGIFTXQLEN, &ifr) < 0) { 
+       if (ioctl(s, SIOCGIFTXQLEN, &ifr) < 0) {
                perror("SIOCGIFXQLEN");
                close(s);
                return;
@@ -131,7 +131,7 @@ void print_queuelen(char *name)
                printf("qlen %d", ifr.ifr_qlen);
 }
 
-int print_linkinfo(const struct sockaddr_nl *who, 
+int print_linkinfo(const struct sockaddr_nl *who,
                   struct nlmsghdr *n, void *arg)
 {
        FILE *fp = (FILE*)arg;
@@ -195,7 +195,7 @@ int print_linkinfo(const struct sockaddr_nl *who,
 #endif
        if (filter.showqueue)
                print_queuelen((char*)RTA_DATA(tb[IFLA_IFNAME]));
-       
+
        if (!filter.family || filter.family == AF_PACKET) {
                SPRINT_BUF(b1);
                fprintf(fp, "%s", _SL_);
@@ -290,7 +290,7 @@ static int set_lifetime(unsigned int *lifetime, char *argv)
        return 0;
 }
 
-int print_addrinfo(const struct sockaddr_nl *who, struct nlmsghdr *n, 
+int print_addrinfo(const struct sockaddr_nl *who, struct nlmsghdr *n,
                   void *arg)
 {
        FILE *fp = (FILE*)arg;
@@ -474,7 +474,7 @@ int print_selected_addrinfo(int ifindex, struct nlmsg_list *ainfo, FILE *fp)
                if (n->nlmsg_len < NLMSG_LENGTH(sizeof(ifa)))
                        return -1;
 
-               if (ifa->ifa_index != ifindex || 
+               if (ifa->ifa_index != ifindex ||
                    (filter.family && filter.family != ifa->ifa_family))
                        continue;
 
@@ -484,7 +484,7 @@ int print_selected_addrinfo(int ifindex, struct nlmsg_list *ainfo, FILE *fp)
 }
 
 
-static int store_nlmsg(const struct sockaddr_nl *who, struct nlmsghdr *n, 
+static int store_nlmsg(const struct sockaddr_nl *who, struct nlmsghdr *n,
                       void *arg)
 {
        struct nlmsg_list **linfo = (struct nlmsg_list**)arg;
@@ -667,7 +667,7 @@ int ipaddr_list_or_flush(int argc, char **argv, int flush)
                                struct nlmsghdr *n = &a->h;
                                struct ifaddrmsg *ifa = NLMSG_DATA(n);
 
-                               if (ifa->ifa_index != ifi->ifi_index || 
+                               if (ifa->ifa_index != ifi->ifi_index ||
                                    (filter.family && filter.family != ifa->ifa_family))
                                        continue;
                                if ((filter.scope^ifa->ifa_scope)&filter.scopemask)
index ffc9f063200723bb794bbeccfedae0f2aa9f5207..8f82a08bdd989f101a08a5056dfabcd0b9b8ead7 100644 (file)
@@ -140,8 +140,8 @@ static int set_qlen(const char *dev, int qlen)
                return -1;
 
        memset(&ifr, 0, sizeof(ifr));
-       strncpy(ifr.ifr_name, dev, IFNAMSIZ); 
-       ifr.ifr_qlen = qlen; 
+       strncpy(ifr.ifr_name, dev, IFNAMSIZ);
+       ifr.ifr_qlen = qlen;
        if (ioctl(s, SIOCSIFTXQLEN, &ifr) < 0) {
                perror("SIOCSIFXQLEN");
                close(s);
@@ -149,7 +149,7 @@ static int set_qlen(const char *dev, int qlen)
        }
        close(s);
 
-       return 0; 
+       return 0;
 }
 
 static int set_mtu(const char *dev, int mtu)
@@ -162,8 +162,8 @@ static int set_mtu(const char *dev, int mtu)
                return -1;
 
        memset(&ifr, 0, sizeof(ifr));
-       strncpy(ifr.ifr_name, dev, IFNAMSIZ); 
-       ifr.ifr_mtu = mtu; 
+       strncpy(ifr.ifr_name, dev, IFNAMSIZ);
+       ifr.ifr_mtu = mtu;
        if (ioctl(s, SIOCSIFMTU, &ifr) < 0) {
                perror("SIOCSIFMTU");
                close(s);
@@ -171,7 +171,7 @@ static int set_mtu(const char *dev, int mtu)
        }
        close(s);
 
-       return 0; 
+       return 0;
 }
 
 static int get_address(const char *dev, int *htype)
@@ -182,7 +182,7 @@ static int get_address(const char *dev, int *htype)
        int s;
 
        s = socket(PF_PACKET, SOCK_DGRAM, 0);
-       if (s < 0) { 
+       if (s < 0) {
                perror("socket(PF_PACKET)");
                return -1;
        }
@@ -216,7 +216,7 @@ static int get_address(const char *dev, int *htype)
        return me.sll_halen;
 }
 
-static int parse_address(const char *dev, int hatype, int halen, 
+static int parse_address(const char *dev, int hatype, int halen,
                char *lla, struct ifreq *ifr)
 {
        int alen;
@@ -231,7 +231,7 @@ static int parse_address(const char *dev, int hatype, int halen,
                fprintf(stderr, "Wrong address (%s) length: expected %d bytes\n", lla, halen);
                return -1;
        }
-       return 0; 
+       return 0;
 }
 
 static int set_address(struct ifreq *ifr, int brd)
@@ -247,7 +247,7 @@ static int set_address(struct ifreq *ifr, int brd)
                return -1;
        }
        close(s);
-       return 0; 
+       return 0;
 }
 
 
@@ -379,7 +379,7 @@ static int do_set(int argc, char **argv)
                }
                if (newbrd) {
                        if (parse_address(dev, htype, halen, newbrd, &ifr1) < 0)
-                               return -1; 
+                               return -1;
                }
        }
 
@@ -388,18 +388,18 @@ static int do_set(int argc, char **argv)
                        return -1;
                dev = newname;
        }
-       if (qlen != -1) { 
+       if (qlen != -1) {
                if (set_qlen(dev, qlen) < 0)
-                       return -1; 
+                       return -1;
        }
-       if (mtu != -1) { 
+       if (mtu != -1) {
                if (set_mtu(dev, mtu) < 0)
-                       return -1; 
+                       return -1;
        }
        if (newaddr || newbrd) {
                if (newbrd) {
                        if (set_address(&ifr1, 1) < 0)
-                               return -1; 
+                               return -1;
                }
                if (newaddr) {
                        if (set_address(&ifr0, 0) < 0)
index e6bd62541fe94115cd759b042c8b7c75577cd018..1014f8321f9e14cfe3f3ffa077ddb9d8e2ee3b64 100644 (file)
@@ -212,7 +212,7 @@ static void print_maddr(FILE *fp, struct ma_info *list)
                        fprintf(fp, "family %d ", list->addr.family);
                        break;
                }
-               fprintf(fp, "%s", 
+               fprintf(fp, "%s",
                        format_host(list->addr.family,
                                    -1,
                                    list->addr.data,
@@ -298,7 +298,7 @@ int multiaddr_modify(int cmd, int argc, char **argv)
                                usage();
                        if (ifr.ifr_hwaddr.sa_data[0])
                                duparg("address", *argv);
-                       if (ll_addr_a2n(ifr.ifr_hwaddr.sa_data, 
+                       if (ll_addr_a2n(ifr.ifr_hwaddr.sa_data,
                                        14, *argv) < 0) {
                                fprintf(stderr, "Error: \"%s\" is not a legal ll address.\n", *argv);
                                exit(1);
index 951a54f2f9dff2b96f1b87e7cb84d18c4b4924e4..8f4b0612c5d78525f7d54cb2bd2afebc12a89963 100644 (file)
@@ -66,7 +66,7 @@ static void read_viftable(void)
 
                if (sscanf(buf, "%d%s", &vifi, dev) < 2)
                        continue;
-               
+
                if (vifi<0 || vifi>31)
                        continue;
 
@@ -109,7 +109,7 @@ static void read_mroute_list(FILE *ofp)
                if (filter.msrc.family && inet_addr_match(&msrc, &filter.msrc, filter.msrc.bitlen))
                        continue;
 
-               snprintf(obuf, sizeof(obuf), "(%s, %s)", 
+               snprintf(obuf, sizeof(obuf), "(%s, %s)",
                         format_host(AF_INET, 4, &msrc.data[0], sbuf, sizeof(sbuf)),
                         format_host(AF_INET, 4, &maddr.data[0], mbuf, sizeof(mbuf)));
 
index 249ee680b036de267ef6e13933b63e4682fa5fdc..bb1ce353a38db320910add783afb762857db299b 100644 (file)
@@ -197,7 +197,7 @@ int print_neigh(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
        if (n->nlmsg_type != RTM_NEWNEIGH && n->nlmsg_type != RTM_DELNEIGH) {
                fprintf(stderr, "Not RTM_NEWNEIGH: %08x %08x %08x\n",
                        n->nlmsg_len, n->nlmsg_type, n->nlmsg_flags);
-               
+
                return 0;
        }
        len -= NLMSG_LENGTH(sizeof(*r));
@@ -254,7 +254,7 @@ int print_neigh(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
        }
 
        if (tb[NDA_DST]) {
-               fprintf(fp, "%s ", 
+               fprintf(fp, "%s ",
                        format_host(r->ndm_family,
                                    RTA_PAYLOAD(tb[NDA_DST]),
                                    RTA_DATA(tb[NDA_DST]),
index 5655d93cef2e5ac2131550b00420e7ed0b6ef689..141ad425e534f4d4956149e7962e0f6f71f06dfc 100644 (file)
@@ -1,16 +1,16 @@
 /*
  * Copyright (C)2006 USAGI/WIDE Project
- * 
+ *
  * 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; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
index 61d12f911818b55bd36e8b7a509abc4879c37973..cb1f582236c27cd923ff7b8531ed896a38b55abb 100644 (file)
@@ -1,16 +1,16 @@
 /*
  * Copyright (C)2005 USAGI/WIDE Project
- * 
+ *
  * 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; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
@@ -78,7 +78,7 @@ int print_prefix(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
                pfx = (struct in6_addr *)RTA_DATA(tb[PREFIX_ADDRESS]);
 
                memset(abuf, '\0', sizeof(abuf));
-               fprintf(fp, "%s", rt_addr_n2a(family, sizeof(*pfx), pfx, 
+               fprintf(fp, "%s", rt_addr_n2a(family, sizeof(*pfx), pfx,
                                              abuf, sizeof(abuf)));
        }
        fprintf(fp, "/%u ", prefix->prefix_len);
index 16c398ac26788bac877b5a66f287e8c6f26b922b..6fe4a700e8089f4a1e13fb9aced0a88e94942273 100644 (file)
@@ -281,7 +281,7 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
                if ((oif^filter.oif)&filter.oifmask)
                        return 0;
        }
-       if (filter.flushb && 
+       if (filter.flushb &&
            r->rtm_family == AF_INET6 &&
            r->rtm_dst_len == 0 &&
            r->rtm_type == RTN_UNREACHABLE &&
@@ -363,7 +363,7 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
        }
 
        if (tb[RTA_GATEWAY] && filter.rvia.bitlen != host_len) {
-               fprintf(fp, "via %s ", 
+               fprintf(fp, "via %s ",
                        format_host(r->rtm_family,
                                    RTA_PAYLOAD(tb[RTA_GATEWAY]),
                                    RTA_DATA(tb[RTA_GATEWAY]),
@@ -384,7 +384,7 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
                /* Do not use format_host(). It is our local addr
                   and symbolic name will not be useful.
                 */
-               fprintf(fp, " src %s ", 
+               fprintf(fp, " src %s ",
                        rt_addr_n2a(r->rtm_family,
                                    RTA_PAYLOAD(tb[RTA_PREFSRC]),
                                    RTA_DATA(tb[RTA_PREFSRC]),
@@ -557,7 +557,7 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
                        if (nh->rtnh_len > sizeof(*nh)) {
                                parse_rtattr(tb, RTA_MAX, RTNH_DATA(nh), nh->rtnh_len - sizeof(*nh));
                                if (tb[RTA_GATEWAY]) {
-                                       fprintf(fp, " via %s ", 
+                                       fprintf(fp, " via %s ",
                                                format_host(r->rtm_family,
                                                            RTA_PAYLOAD(tb[RTA_GATEWAY]),
                                                            RTA_DATA(tb[RTA_GATEWAY]),
@@ -1020,7 +1020,7 @@ static int iproute_flush_cache(void)
        }
 
        len = strlen (buffer);
-               
+
        if ((write (flush_fd, (void *)buffer, len)) < len) {
                fprintf (stderr, "Cannot flush routing cache\n");
                return -1;
@@ -1292,7 +1292,7 @@ int iproute_get(int argc, char **argv)
        req.r.rtm_src_len = 0;
        req.r.rtm_dst_len = 0;
        req.r.rtm_tos = 0;
-       
+
        while (argc > 0) {
                if (strcmp(*argv, "tos") == 0 ||
                    matches(*argv, "dsfield") == 0) {
@@ -1434,7 +1434,7 @@ int do_iproute(int argc, char **argv)
 {
        if (argc < 1)
                return iproute_list_or_flush(0, NULL, 0);
-       
+
        if (matches(*argv, "add") == 0)
                return iproute_modify(RTM_NEWROUTE, NLM_F_CREATE|NLM_F_EXCL,
                                      argc-1, argv+1);
index c584b18f6b14e760eca153fd83cd92228c0ceab5..591112ec4cbb1d1a1b833e5e3389c1b69e11a47f 100644 (file)
@@ -155,7 +155,7 @@ int print_rule(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
 
        if (r->rtm_type == RTN_NAT) {
                if (tb[RTA_GATEWAY]) {
-                       fprintf(fp, "map-to %s ", 
+                       fprintf(fp, "map-to %s ",
                                format_host(r->rtm_family,
                                            RTA_PAYLOAD(tb[RTA_GATEWAY]),
                                            RTA_DATA(tb[RTA_GATEWAY]),
index 57a6ab0021e4cba33c17d9abd2ed8ec59c0ef772..828d80a97025887efa0799b972bb2205eca66e51 100644 (file)
@@ -262,7 +262,7 @@ static int do_add(int cmd, int argc, char **argv)
                return tnl_add_ioctl(cmd, "gre0", p.name, &p);
        case IPPROTO_IPV6:
                return tnl_add_ioctl(cmd, "sit0", p.name, &p);
-       default:        
+       default:
                fprintf(stderr, "cannot determine tunnel mode (ipip, gre or sit)\n");
                return -1;
        }
@@ -283,7 +283,7 @@ static int do_del(int argc, char **argv)
                return tnl_del_ioctl("gre0", p.name, &p);
        case IPPROTO_IPV6:
                return tnl_del_ioctl("sit0", p.name, &p);
-       default:        
+       default:
                return tnl_del_ioctl(p.name, p.name, &p);
        }
        return -1;
@@ -318,7 +318,7 @@ static void print_tunnel(struct ip_tunnel_parm *p)
                printf(" ttl %d ", p->iph.ttl);
        else
                printf(" ttl inherit ");
-       
+
        if (p->iph.tos) {
                SPRINT_BUF(b1);
                printf(" tos");
@@ -427,7 +427,7 @@ static int do_show(int argc, char **argv)
                return -1;
 
        switch (p.iph.protocol) {
-       case IPPROTO_IPIP:      
+       case IPPROTO_IPIP:
                err = tnl_get_ioctl(p.name[0] ? p.name : "tunl0", &p);
                break;
        case IPPROTO_GRE:
index 9c8b4bd8d591be3d4cf9bf549ddf8507935878f2..0f322d486b6bc7cea37644b367474188d1681a9b 100644 (file)
@@ -2,17 +2,17 @@
 
 /*
  * Copyright (C)2004 USAGI/WIDE Project
- * 
+ *
  * 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; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
@@ -59,7 +59,7 @@ static void usage(void) __attribute__((noreturn));
 
 static void usage(void)
 {
-       fprintf(stderr, 
+       fprintf(stderr,
                "Usage: ip xfrm XFRM_OBJECT { COMMAND | help }\n"
                "where  XFRM_OBJECT := { state | policy | monitor }\n");
        exit(-1);
@@ -349,7 +349,7 @@ static const char *strxf_time(__u64 time)
                time_t t;
                struct tm *tp;
 
-               /* XXX: treat time in the same manner of kernel's 
+               /* XXX: treat time in the same manner of kernel's
                 * net/xfrm/xfrm_{user,state}.c
                 */
                t = (long)time;
@@ -690,7 +690,7 @@ void xfrm_xfrma_print(struct rtattr *tb[], __u16 family,
 
                memset(abuf, '\0', sizeof(abuf));
                fprintf(fp, "%s",
-                       rt_addr_n2a(family, sizeof(*coa), coa, 
+                       rt_addr_n2a(family, sizeof(*coa), coa,
                                    abuf, sizeof(abuf)));
                fprintf(fp, "%s", _SL_);
        }
index 5ce7731784d8f084efe163825ac1043e5eea5540..8c464cbdd9b0ca3c01b07e6768ceb3476f7a27d7 100644 (file)
@@ -46,7 +46,7 @@ static void write_stamp(FILE *fp)
        fwrite((void*)n1, 1, NLMSG_ALIGN(n1->nlmsg_len), fp);
 }
 
-static int dump_msg(const struct sockaddr_nl *who, struct nlmsghdr *n, 
+static int dump_msg(const struct sockaddr_nl *who, struct nlmsghdr *n,
                    void *arg)
 {
        FILE *fp = (FILE*)arg;
index 92b234ba4512cb390f6e9f30af7a1dfbdab979bb..5fede2c1ba4a31517f0f939b533b86163bc97521 100644 (file)
@@ -1,16 +1,16 @@
 /*
  * Copyright (C)2006 USAGI/WIDE Project
- * 
+ *
  * 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; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
index 72512e8fcb149772d77253edd2e2f4d5c09195f7..1b5883448fa2019abe5d2a16685bd45e66bb4bf1 100644 (file)
@@ -1,16 +1,16 @@
 /*
  * Copyright (C)2006 USAGI/WIDE Project
- * 
+ *
  * 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; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
index 03db37bf97e7747df9a06b78c6147445609e05aa..d1959bbffe4fed6dd4d543e632f1cfc39228423b 100644 (file)
--- a/ip/xfrm.h
+++ b/ip/xfrm.h
@@ -2,17 +2,17 @@
 
 /*
  * Copyright (C)2004 USAGI/WIDE Project
- * 
+ *
  * 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; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
index b4fda02a875aa5f99e369f33b5901a7708a067f3..154bbee01bb020eee5d37048d8315950fa1a08a7 100644 (file)
@@ -2,17 +2,17 @@
 
 /*
  * Copyright (C)2005 USAGI/WIDE Project
- * 
+ *
  * 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; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
index 44aff796971b5aa552733ef18be4409d270bee23..ddbda78683e63a83cd94663fc57873937b20fe54 100644 (file)
@@ -2,17 +2,17 @@
 
 /*
  * Copyright (C)2004 USAGI/WIDE Project
- * 
+ *
  * 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; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
index 57dc4b5231b7b411911c111283fe37fc22cf54bf..42e39499cdc647a7b9e6ca0c7ecae7cf3d2020ec 100644 (file)
@@ -2,17 +2,17 @@
 
 /*
  * Copyright (C)2004 USAGI/WIDE Project
- * 
+ *
  * 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; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
@@ -82,7 +82,7 @@ static void usage(void)
 
        fprintf(stderr, "FLAG-LIST := [ FLAG-LIST ] FLAG\n");
        fprintf(stderr, "FLAG := [ noecn | decap-dscp | wildrecv ]\n");
+
         fprintf(stderr, "ENCAP := ENCAP-TYPE SPORT DPORT OADDR\n");
         fprintf(stderr, "ENCAP-TYPE := espinudp | espinudp-nonike\n");
 
@@ -669,7 +669,7 @@ int xfrm_state_print(const struct sockaddr_nl *who, struct nlmsghdr *n,
                rta = XFRMSID_RTA(xsid);
        else if (n->nlmsg_type == XFRM_MSG_EXPIRE)
                rta = XFRMEXP_RTA(xexp);
-       else 
+       else
                rta = XFRMS_RTA(xsinfo);
 
        parse_rtattr(tb, XFRMA_MAX, rta, len);
index b2d67902546fb4352a6f517a8afcb1a2925086cb..7b6d728d938c133a0839a323152988b94cda9774 100644 (file)
@@ -38,7 +38,7 @@ static const char *ipx_ntop1(const struct ipx_addr *addr, char *str, size_t len)
 
        *(str + pos) = '.';
        pos++;
-       
+
        for(i = 0; i < 6; i++) {
                if (do_digit(str + pos, addr->ipx_node[i], 1, &pos, len))
                        return str;
index 1acbf8f862ac19f62727b4e9e35cec870262fb4f..dee498f7e09476fe189ca1458e029b74afc63272 100644 (file)
@@ -36,7 +36,7 @@ struct idxmap
 
 static struct idxmap *idxmap[16];
 
-int ll_remember_index(const struct sockaddr_nl *who, 
+int ll_remember_index(const struct sockaddr_nl *who,
                      struct nlmsghdr *n, void *arg)
 {
        int h;
index 98c67fe5fe174cfaf67ea5b8f72702645ad2fe19..e61763c58e3d511a801458bbee4d26e44acd461e 100644 (file)
@@ -35,63 +35,63 @@ static struct {
        const char *name;
 } llproto_names[] = {
 __PF(LOOP,loop)
-__PF(PUP,pup)  
+__PF(PUP,pup)
 #ifdef ETH_P_PUPAT
 __PF(PUPAT,pupat)
-#endif    
+#endif
 __PF(IP,ip)
 __PF(X25,x25)
 __PF(ARP,arp)
 __PF(BPQ,bpq)
 #ifdef ETH_P_IEEEPUP
 __PF(IEEEPUP,ieeepup)
-#endif  
+#endif
 #ifdef ETH_P_IEEEPUPAT
 __PF(IEEEPUPAT,ieeepupat)
-#endif  
-__PF(DEC,dec)       
-__PF(DNA_DL,dna_dl)    
-__PF(DNA_RC,dna_rc)    
-__PF(DNA_RT,dna_rt)    
-__PF(LAT,lat)       
-__PF(DIAG,diag)      
-__PF(CUST,cust)      
-__PF(SCA,sca)       
-__PF(RARP,rarp)      
-__PF(ATALK,atalk)     
-__PF(AARP,aarp)      
-__PF(IPX,ipx)       
-__PF(IPV6,ipv6)      
+#endif
+__PF(DEC,dec)
+__PF(DNA_DL,dna_dl)
+__PF(DNA_RC,dna_rc)
+__PF(DNA_RT,dna_rt)
+__PF(LAT,lat)
+__PF(DIAG,diag)
+__PF(CUST,cust)
+__PF(SCA,sca)
+__PF(RARP,rarp)
+__PF(ATALK,atalk)
+__PF(AARP,aarp)
+__PF(IPX,ipx)
+__PF(IPV6,ipv6)
 #ifdef ETH_P_PPP_DISC
 __PF(PPP_DISC,ppp_disc)
-#endif      
+#endif
 #ifdef ETH_P_PPP_SES
 __PF(PPP_SES,ppp_ses)
-#endif      
+#endif
 #ifdef ETH_P_ATMMPOA
 __PF(ATMMPOA,atmmpoa)
 #endif
 #ifdef ETH_P_ATMFATE
 __PF(ATMFATE,atmfate)
-#endif      
+#endif
 
-__PF(802_3,802_3)     
-__PF(AX25,ax25)      
-__PF(ALL,all)       
-__PF(802_2,802_2)     
-__PF(SNAP,snap)      
-__PF(DDCMP,ddcmp)     
-__PF(WAN_PPP,wan_ppp)   
-__PF(PPP_MP,ppp_mp)    
-__PF(LOCALTALK,localtalk) 
-__PF(PPPTALK,ppptalk)   
-__PF(TR_802_2,tr_802_2)  
-__PF(MOBITEX,mobitex)   
-__PF(CONTROL,control)   
-__PF(IRDA,irda)      
+__PF(802_3,802_3)
+__PF(AX25,ax25)
+__PF(ALL,all)
+__PF(802_2,802_2)
+__PF(SNAP,snap)
+__PF(DDCMP,ddcmp)
+__PF(WAN_PPP,wan_ppp)
+__PF(PPP_MP,ppp_mp)
+__PF(LOCALTALK,localtalk)
+__PF(PPPTALK,ppptalk)
+__PF(TR_802_2,tr_802_2)
+__PF(MOBITEX,mobitex)
+__PF(CONTROL,control)
+__PF(IRDA,irda)
 #ifdef ETH_P_ECONET
 __PF(ECONET,econet)
-#endif      
+#endif
 
 { 0x8100, "802.1Q" },
 { ETH_P_IP, "ipv4" },
index 773e9590c665f67c72c02c7bf2a26a94a1fa374d..4f35a60f60d9952e198dc9978811afe777f2b8ea 100644 (file)
@@ -582,15 +582,15 @@ size_t getcmdline(char **linep, size_t *lenp, FILE *in)
 {
        size_t cc;
        char *cp;
-               
+
        if ((cc = getline(linep, lenp, in)) < 0)
                return cc;      /* eof or error */
        ++cmdlineno;
 
        cp = strchr(*linep, '#');
-       if (cp) 
+       if (cp)
                *cp = '\0';
-       
+
        while ((cp = strstr(*linep, "\\\n")) != NULL) {
                char *line1 = NULL;
                size_t len1 = 0;
@@ -605,7 +605,7 @@ size_t getcmdline(char **linep, size_t *lenp, FILE *in)
                *cp = 0;
 
                cp = strchr(line1, '#');
-               if (cp) 
+               if (cp)
                        *cp = '\0';
 
                *linep = realloc(*linep, strlen(*linep) + strlen(line1) + 1);
index 4fd226ec85c748a2b82be2ee2c1787a03df63f26..71cd082e6856330a21d059c70e8dc00513d09b68 100644 (file)
@@ -42,7 +42,7 @@ int resolve_hosts;
 DB     *dbase;
 char   *dbname = "/var/lib/arpd/arpd.db";
 
-int    ifnum;  
+int    ifnum;
 int    *ifvec;
 char   **ifnames;
 
@@ -53,7 +53,7 @@ struct dbkey
 };
 
 #define IS_NEG(x)      (((__u8*)(x))[0] == 0xFF)
-#define NEG_TIME(x)    (((x)[2]<<24)|((x)[3]<<16)|((x)[4]<<8)|(x)[5]) 
+#define NEG_TIME(x)    (((x)[2]<<24)|((x)[3]<<16)|((x)[4]<<8)|(x)[5])
 #define NEG_AGE(x)     ((__u32)time(NULL) - NEG_TIME((__u8*)x))
 #define NEG_VALID(x)   (NEG_AGE(x) < negative_timeout)
 #define NEG_CNT(x)     (((__u8*)(x))[1])
@@ -485,7 +485,7 @@ void get_arp_pkt(void)
        DBT dbkey, dbdat;
        int n;
 
-       n = recvfrom(pset[0].fd, buf, sizeof(buf), MSG_DONTWAIT, 
+       n = recvfrom(pset[0].fd, buf, sizeof(buf), MSG_DONTWAIT,
                     (struct sockaddr*)&sll, &sll_len);
        if (n < 0) {
                if (errno != EINTR && errno != EAGAIN)
@@ -510,7 +510,7 @@ void get_arp_pkt(void)
        key.iface = sll.sll_ifindex;
        memcpy(&key.addr, (char*)(a+1) + a->ar_hln, 4);
 
-       /* DAD message, ignore. */ 
+       /* DAD message, ignore. */
        if (key.addr == 0)
                return;
 
@@ -538,7 +538,7 @@ void catch_signal(int sig, void (*handler)(int))
        sa.sa_handler = handler;
 #ifdef SA_INTERRUPT
        sa.sa_flags = SA_INTERRUPT;
-#endif 
+#endif
        sigaction(sig, &sa, NULL);
 }
 
@@ -728,7 +728,7 @@ int main(int argc, char **argv)
                DBT dbkey, dbdat;
                printf("%-8s %-15s %s\n", "#Ifindex", "IP", "MAC");
                while (dbase->seq(dbase, &dbkey, &dbdat, R_NEXT) == 0) {
-                       struct dbkey *key = dbkey.data; 
+                       struct dbkey *key = dbkey.data;
                        if (handle_if(key->iface)) {
                                if (!IS_NEG(dbdat.data)) {
                                        char b1[18];
index 4b879940ec3d3af59847481b124d7e7c419efb22..68dfdeeedb777c504c82f206a91f49164b8c4149 100644 (file)
@@ -77,7 +77,7 @@ static int match(const char *id)
        return 0;
 }
 
-static int get_nlmsg(const struct sockaddr_nl *who, 
+static int get_nlmsg(const struct sockaddr_nl *who,
                     struct nlmsghdr *m, void *arg)
 {
        struct ifinfomsg *ifi = NLMSG_DATA(m);
@@ -442,11 +442,11 @@ void update_db(int interval)
                                int i;
                                for (i = 0; i < MAXS; i++) {
                                        if ((long)(h1->ival[i] - n->ival[i]) < 0) {
-                                               memset(n->ival, 0, sizeof(n->ival)); 
+                                               memset(n->ival, 0, sizeof(n->ival));
                                                break;
                                        }
                                }
-                               for (i = 0; i < MAXS; i++) { 
+                               for (i = 0; i < MAXS; i++) {
                                        double sample;
                                        unsigned long incr = h1->ival[i] - n->ival[i];
                                        n->val[i] += incr;
index 460540e8252d0466e3b8bb81fdac8764d92b45be..4dc10722f898c80d81926849cedfab7ba016179b 100644 (file)
@@ -119,7 +119,7 @@ static int map_field_params(struct lnstat_file *lnstat_files,
                                fps->params[j].lf->file->interval.tv_sec =
                                                                interval;
                                if (!fps->params[j].print.width)
-                                       fps->params[j].print.width = 
+                                       fps->params[j].print.width =
                                                        FIELD_WIDTH_DEFAULT;
                                j++;
                        }
@@ -204,7 +204,7 @@ static int print_hdr(FILE *of, struct table_hdr *th)
        }
        return 0;
 }
-               
+
 
 int main(int argc, char **argv)
 {
@@ -222,10 +222,10 @@ int main(int argc, char **argv)
        static struct field_params fp;
        int num_req_files = 0;
        char *req_files[LNSTAT_MAX_FILES];
-       
+
        /* backwards compatibility mode for old tools */
        basename = strrchr(argv[0], '/');
-       if (basename) 
+       if (basename)
                basename += 1;    /* name after slash */
        else
                basename = argv[0]; /* no slash */
@@ -240,7 +240,7 @@ int main(int argc, char **argv)
                num_req_files = 1;
        }
 
-       while ((c = getopt_long(argc, argv,"Vc:df:h?i:k:s:w:", 
+       while ((c = getopt_long(argc, argv,"Vc:df:h?i:k:s:w:",
                                opts, NULL)) != -1) {
                int i, len = 0;
                char *tmp, *tok;
@@ -256,7 +256,7 @@ int main(int argc, char **argv)
                                req_files[num_req_files++] = strdup(optarg);
                                break;
                        case '?':
-                       case 'h':       
+                       case 'h':
                                usage(argv[0], 0);
                                break;
                        case 'i':
@@ -315,12 +315,12 @@ int main(int argc, char **argv)
 
                if (!map_field_params(lnstat_files, &fp, interval))
                        exit(1);
-       
+
                header = build_hdr_string(lnstat_files, &fp, 80);
                if (!header)
                        exit(1);
 
-               if (interval < 1 ) 
+               if (interval < 1 )
                        interval=1;
 
                for (i = 0; i < count; i++) {
index 59c5e9648adb30ebfc090a060e4a0db45bff9fac..9492baf025973d290bfc2180c5b6b79d655a8c68 100644 (file)
@@ -49,12 +49,12 @@ static int scan_lines(struct lnstat_file *lf, int i)
 
                num_lines++;
 
-               fgets(buf, sizeof(buf)-1, lf->fp); 
+               fgets(buf, sizeof(buf)-1, lf->fp);
                gettimeofday(&lf->last_read, NULL);
 
                for (j = 0; j < lf->num_fields; j++) {
                        unsigned long f = strtoul(ptr, &ptr, 16);
-                       if (j == 0) 
+                       if (j == 0)
                                lf->fields[j].values[i] = f;
                        else
                                lf->fields[j].values[i] += f;
@@ -63,8 +63,8 @@ static int scan_lines(struct lnstat_file *lf, int i)
        return num_lines;
 }
 
-static int time_after(struct timeval *last, 
-                     struct timeval *tout, 
+static int time_after(struct timeval *last,
+                     struct timeval *tout,
                      struct timeval *now)
 {
        if (now->tv_sec > last->tv_sec + tout->tv_sec)
@@ -98,7 +98,7 @@ int lnstat_update(struct lnstat_file *lnstat_files)
                        }
                        scan_lines(lf, 1);
 
-                       for (i = 0, lfi = &lf->fields[i]; 
+                       for (i = 0, lfi = &lf->fields[i];
                             i < lf->num_fields; i++, lfi = &lf->fields[i]) {
                                if (i == 0)
                                        lfi->result = lfi->values[1];
@@ -211,7 +211,7 @@ struct lnstat_file *lnstat_scan_dir(const char *path, const int num_req_files,
 
        if (!path)
                path = PROC_NET_STAT;
-       
+
        dir = opendir(path);
        if (!dir) {
                struct lnstat_file *lf;
@@ -307,7 +307,7 @@ struct lnstat_field *lnstat_find_field(struct lnstat_file *lnstat_files,
                file = NULL;
                field = name;
        }
-               
+
        for (lf = lnstat_files; lf; lf = lf->next) {
                int i;
 
index fc4b03bd66bb10f329eb38db77e3cbeba6ab585f..228bce22a612fee1d87d1b8006e7b30ca424915d 100644 (file)
@@ -373,7 +373,7 @@ void server_loop(int fd)
        struct pollfd p;
        p.fd = fd;
        p.events = p.revents = POLLIN;
-       
+
        sprintf(info_source, "%d.%lu sampling_interval=%d time_const=%d",
                getpid(), (unsigned long)random(), scan_interval/1000, time_constant/1000);
 
index 0d8ff7b9d5d78c75d5cd80ffeb550b2a4434bf84..e6399d00d36e71a712595f6d0522482d341c1687 100644 (file)
@@ -168,7 +168,7 @@ void dump_abs_db(FILE *fp)
 "%-10s "
 "%-10s "
 "\n"
-                      , "Realm", "BytesTo", "PktsTo", "BytesFrom", "PktsFrom"); 
+                      , "Realm", "BytesTo", "PktsTo", "BytesFrom", "PktsFrom");
                fprintf(fp,
 "%-10s "
 "%-10s "
@@ -176,7 +176,7 @@ void dump_abs_db(FILE *fp)
 "%-10s "
 "%-10s "
 "\n"
-                      , "", "BPSTo", "PPSTo", "BPSFrom", "PPSFrom"); 
+                      , "", "BPSTo", "PPSTo", "BPSFrom", "PPSFrom");
 
        }
 
@@ -207,10 +207,10 @@ void dump_abs_db(FILE *fp)
 
                fprintf(fp, "%-10s", rtnl_rtrealm_n2a(realm, b1, sizeof(b1)));
                for (i = 0; i < 4; i++)
-                       format_count(fp, val[i]); 
+                       format_count(fp, val[i]);
                fprintf(fp, "\n%-10s", "");
                for (i = 0; i < 4; i++)
-                       format_rate(fp, rate[i]); 
+                       format_rate(fp, rate[i]);
                fprintf(fp, "\n");
        }
 }
@@ -230,7 +230,7 @@ void dump_incr_db(FILE *fp)
 "%-10s "
 "%-10s "
 "\n"
-                      , "Realm", "BytesTo", "PktsTo", "BytesFrom", "PktsFrom"); 
+                      , "Realm", "BytesTo", "PktsTo", "BytesFrom", "PktsFrom");
                fprintf(fp,
 "%-10s "
 "%-10s "
@@ -238,7 +238,7 @@ void dump_incr_db(FILE *fp)
 "%-10s "
 "%-10s "
 "\n"
-                      , "", "BPSTo", "PPSTo", "BPSFrom", "PPSFrom"); 
+                      , "", "BPSTo", "PPSTo", "BPSFrom", "PPSFrom");
        }
 
        for (realm=0; realm<256; realm++) {
@@ -282,10 +282,10 @@ void dump_incr_db(FILE *fp)
 
                fprintf(fp, "%-10s", rtnl_rtrealm_n2a(realm, b1, sizeof(b1)));
                for (i = 0; i < 4; i++)
-                       format_count(fp, rval[i]); 
+                       format_count(fp, rval[i]);
                fprintf(fp, "\n%-10s", "");
                for (i = 0; i < 4; i++)
-                       format_rate(fp, rate[i]); 
+                       format_rate(fp, rate[i]);
                fprintf(fp, "\n");
        }
 }
@@ -297,7 +297,7 @@ void sigchild(int signo)
 {
 }
 
-/* Server side only: read kernel data, update tables, calculate rates. */ 
+/* Server side only: read kernel data, update tables, calculate rates. */
 
 void update_db(int interval)
 {
@@ -368,9 +368,9 @@ void server_loop(int fd)
        p.fd = fd;
        p.events = p.revents = POLLIN;
 
-       sprintf(kern_db->signature, 
+       sprintf(kern_db->signature,
                "%u.%lu sampling_interval=%d time_const=%d",
-               (unsigned) getpid(), (unsigned long)random(), 
+               (unsigned) getpid(), (unsigned long)random(),
                scan_interval/1000, time_constant/1000);
 
        pad_kern_table(kern_db, read_kern_table(kern_db->ival));
index f902560aa165a0f9ba7fa8aca879d1a7617e5f50..ec272f442798ae2a81d922c2596eb0ee3eef2653 100644 (file)
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -296,7 +296,7 @@ struct slabstat
 
 struct slabstat slabstat;
 
-static const char *slabstat_ids[] = 
+static const char *slabstat_ids[] =
 {
        "sock",
        "tcp_bind_bucket",
@@ -480,7 +480,7 @@ static int is_ephemeral(int port)
        if (!ip_local_port_min) {
                FILE *f = fdopen(ephemeral_ports_open(), "r");
                if (f) {
-                       fscanf(f, "%d %d", 
+                       fscanf(f, "%d %d",
                               &ip_local_port_min, &ip_local_port_max);
                        fclose(f);
                } else {
@@ -508,7 +508,7 @@ const char *__resolve_service(int port)
                if (!notfirst) {
                        setservent(1);
                        notfirst = 1;
-               } 
+               }
                se = getservbyport(htons(port), dg_proto);
                if (se)
                        return se->s_name;
@@ -537,7 +537,7 @@ const char *resolve_service(int port)
                        const char *res;
                        int hash = (port^(((unsigned long)dg_proto)>>2))&255;
 
-                       for (c = &cache[hash]; c; c = c->next) { 
+                       for (c = &cache[hash]; c; c = c->next) {
                                if (c->port == port &&
                                    c->proto == dg_proto) {
                                        if (c->name)
@@ -647,7 +647,7 @@ int run_ssfilter(struct ssfilter *f, struct tcpstat *s)
                        char *p;
                        memcpy(&p, s->local.data, sizeof(p));
                        return p == NULL || (p[0] == '@' && strlen(p) == 6 &&
-                                            strspn(p+1, "0123456789abcdef") == 5); 
+                                            strspn(p+1, "0123456789abcdef") == 5);
                }
                if (s->local.family == AF_PACKET)
                        return s->lport == 0 && s->local.data == 0;
@@ -690,7 +690,7 @@ int run_ssfilter(struct ssfilter *f, struct tcpstat *s)
                        do {
                                if (!inet2_addr_match(&s->local, &a->addr, a->addr.bitlen))
                                        return 1;
-                       } while ((a = a->next) != NULL); 
+                       } while ((a = a->next) != NULL);
                        return 0;
                }
                return 1;
@@ -728,7 +728,7 @@ int run_ssfilter(struct ssfilter *f, struct tcpstat *s)
        }
 }
 
-/* Relocate external jumps by reloc. */ 
+/* Relocate external jumps by reloc. */
 static void ssfilter_patch(char *a, int len, int reloc)
 {
        while (len > 0) {
@@ -868,7 +868,7 @@ static int ssfilter_bytecompile(struct ssfilter *f, char **bytecode)
 
 static int remember_he(struct aafilter *a, struct hostent *he)
 {
-       char **ptr = he->h_addr_list; 
+       char **ptr = he->h_addr_list;
        int cnt = 0;
        int len;
 
@@ -1110,28 +1110,28 @@ static int tcp_show_line(char *line, struct filter *f, int family)
        char opt[256];
        int n;
        char *p;
-       
+
        if ((p = strchr(line, ':')) == NULL)
                return -1;
        loc = p+2;
-       
+
        if ((p = strchr(loc, ':')) == NULL)
                return -1;
        p[5] = 0;
        rem = p+6;
-       
+
        if ((p = strchr(rem, ':')) == NULL)
                return -1;
        p[5] = 0;
        data = p+6;
-       
+
        do {
                int state = (data[1] >= 'A') ? (data[1] - 'A' + 10) : (data[1] - '0');
 
                if (!(f->states & (1<<state)))
                        return 0;
        } while (0);
-       
+
        s.local.family = s.remote.family = family;
        if (family == AF_INET) {
                sscanf(loc, "%x:%x", s.local.data, (unsigned*)&s.lport);
@@ -1152,37 +1152,37 @@ static int tcp_show_line(char *line, struct filter *f, int family)
                       &s.rport);
                s.local.bytelen = s.remote.bytelen = 16;
        }
-       
+
        if (f->f && run_ssfilter(f->f, &s) == 0)
                return 0;
-       
+
        opt[0] = 0;
        n = sscanf(data, "%x %x:%x %x:%x %x %d %d %d %d %llx %d %d %d %d %d %[^\n]\n",
                   &s.state, &s.wq, &s.rq,
                   &s.timer, &s.timeout, &s.retrs, &s.uid, &s.probes, &s.ino,
                   &s.refcnt, &s.sk, &s.rto, &s.ato, &s.qack,
                   &s.cwnd, &s.ssthresh, opt);
-       
+
        if (n < 17)
                opt[0] = 0;
-       
+
        if (n < 12) {
                s.rto = 0;
                s.cwnd = 2;
                s.ssthresh = -1;
                s.ato = s.qack = 0;
        }
-       
+
        if (netid_width)
                printf("%-*s ", netid_width, "tcp");
        if (state_width)
                printf("%-*s ", state_width, sstate_name[s.state]);
-       
+
        printf("%-6d %-6d ", s.rq, s.wq);
-       
+
        formatted_print(&s.local, s.lport);
        formatted_print(&s.remote, s.rport);
-       
+
        if (show_options) {
                if (s.timer) {
                        if (s.timer > 4)
@@ -1288,10 +1288,10 @@ outwrongformat:
 outerr:
        return -1;
 }
-                       
+
 static char *sprint_bw(char *buf, double bw)
 {
-       if (bw > 1000000.) 
+       if (bw > 1000000.)
                sprintf(buf,"%.1fM", bw / 1000000.);
        else if (bw > 1000.)
                sprintf(buf,"%.1fK", bw / 1000.);
@@ -1344,7 +1344,7 @@ static void tcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r)
                if (tb[INET_DIAG_CONG])
                        printf("%s", (char *) RTA_DATA(tb[INET_DIAG_CONG]));
 
-               if (info->tcpi_options & TCPI_OPT_WSCALE) 
+               if (info->tcpi_options & TCPI_OPT_WSCALE)
                        printf(" wscale:%d,%d", info->tcpi_snd_wscale,
                               info->tcpi_rcv_wscale);
                if (info->tcpi_rto && info->tcpi_rto != 3000000)
@@ -1364,7 +1364,7 @@ static void tcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r)
                        const struct tcpvegas_info *vinfo
                                = RTA_DATA(tb[INET_DIAG_VEGASINFO]);
 
-                       if (vinfo->tcpv_enabled && 
+                       if (vinfo->tcpv_enabled &&
                            vinfo->tcpv_rtt && vinfo->tcpv_rtt != 0x7fffffff)
                                rtt =  vinfo->tcpv_rtt;
                }
@@ -1477,7 +1477,7 @@ int tcp_show_netlink(struct filter *f, FILE *dump_fp, int socktype)
        req.r.idiag_family = AF_INET;
        req.r.idiag_states = f->states;
        if (show_mem)
-               req.r.idiag_ext |= (1<<(INET_DIAG_MEMINFO-1)); 
+               req.r.idiag_ext |= (1<<(INET_DIAG_MEMINFO-1));
 
        if (show_tcpinfo) {
                req.r.idiag_ext |= (1<<(INET_DIAG_INFO-1));
@@ -1485,9 +1485,9 @@ int tcp_show_netlink(struct filter *f, FILE *dump_fp, int socktype)
                req.r.idiag_ext |= (1<<(INET_DIAG_CONG-1));
        }
 
-       iov[0] = (struct iovec){ 
-               .iov_base = &req, 
-               .iov_len = sizeof(req) 
+       iov[0] = (struct iovec){
+               .iov_base = &req,
+               .iov_len = sizeof(req)
        };
        if (f->f) {
                bclen = ssfilter_bytecompile(f->f, &bc);
@@ -1499,18 +1499,18 @@ int tcp_show_netlink(struct filter *f, FILE *dump_fp, int socktype)
        }
 
        msg = (struct msghdr) {
-               .msg_name = (void*)&nladdr, 
+               .msg_name = (void*)&nladdr,
                .msg_namelen = sizeof(nladdr),
-               .msg_iov = iov, 
+               .msg_iov = iov,
                .msg_iovlen = f->f ? 3 : 1,
        };
 
        if (sendmsg(fd, &msg, 0) < 0)
                return -1;
 
-       iov[0] = (struct iovec){ 
-               .iov_base = buf, 
-               .iov_len = sizeof(buf) 
+       iov[0] = (struct iovec){
+               .iov_base = buf,
+               .iov_len = sizeof(buf)
        };
 
        while (1) {
@@ -1938,13 +1938,13 @@ void unix_list_print(struct unixstat *list, struct filter *f)
                        if (strcmp(peer, "*") == 0)
                                memset(tst.remote.data, 0, sizeof(peer));
                        else
-                               memcpy(tst.remote.data, &peer, sizeof(peer));  
+                               memcpy(tst.remote.data, &peer, sizeof(peer));
                        if (run_ssfilter(f->f, &tst) == 0)
                                continue;
                }
 
                if (netid_width)
-                       printf("%-*s ", netid_width, 
+                       printf("%-*s ", netid_width,
                               s->type == SOCK_STREAM ? "u_str" : "u_dgr");
                if (state_width)
                        printf("%-*s ", state_width, sstate_name[s->state]);
@@ -1974,7 +1974,7 @@ int unix_show(struct filter *f)
                return -1;
        fgets(buf, sizeof(buf)-1, fp);
 
-       if (memcmp(buf, "Peer", 4) == 0) 
+       if (memcmp(buf, "Peer", 4) == 0)
                newformat = 1;
        cnt = 0;
 
@@ -2085,7 +2085,7 @@ int packet_show(struct filter *f)
                }
 
                if (netid_width)
-                       printf("%-*s ", netid_width, 
+                       printf("%-*s ", netid_width,
                               type == SOCK_RAW ? "p_raw" : "p_dgr");
                if (state_width)
                        printf("%-*s ", state_width, "UNCONN");
@@ -2094,7 +2094,7 @@ int packet_show(struct filter *f)
                        printf("%*s:", addr_width, "*");
                } else {
                        char tb[16];
-                       printf("%*s:", addr_width, 
+                       printf("%*s:", addr_width,
                               ll_proto_n2a(htons(prot), tb, sizeof(tb)));
                }
                if (iface == 0) {
@@ -2153,7 +2153,7 @@ int netlink_show(struct filter *f)
                }
 
                if (netid_width)
-                       printf("%-*s ", netid_width, "nl"); 
+                       printf("%-*s ", netid_width, "nl");
                if (state_width)
                        printf("%-*s ", state_width, "UNCONN");
                printf("%-6d %-6d ", rq, wq);
@@ -2179,7 +2179,7 @@ int netlink_show(struct filter *f)
                                        getenv("PROC_ROOT") ? : "/proc", pid);
                                if ((fp = fopen(procname, "r")) != NULL) {
                                        if (fscanf(fp, "%*d (%[^)])", procname) == 1) {
-                                               sprintf(procname+strlen(procname), "/%d", pid);  
+                                               sprintf(procname+strlen(procname), "/%d", pid);
                                                printf("%-*s ", serv_width, procname);
                                                done = 1;
                                        }
@@ -2353,7 +2353,7 @@ int print_summary(void)
        printf("RAW       %-9d %-9d %-9d\n", s.raw4+s.raw6, s.raw4, s.raw6);
        printf("UDP       %-9d %-9d %-9d\n", s.udp4+s.udp6, s.udp4, s.udp6);
        printf("TCP       %-9d %-9d %-9d\n", s.tcp4_hashed+s.tcp6_hashed, s.tcp4_hashed, s.tcp6_hashed);
-       printf("INET      %-9d %-9d %-9d\n", 
+       printf("INET      %-9d %-9d %-9d\n",
               s.raw4+s.udp4+s.tcp4_hashed+
               s.raw6+s.udp6+s.tcp6_hashed,
               s.raw4+s.udp4+s.tcp4_hashed,
@@ -2459,7 +2459,7 @@ static const struct option long_opts[] = {
        { "version", 0, 0, 'V' },
        { "help", 0, 0, 'h' },
        { 0 }
-       
+
 };
 
 int main(int argc, char *argv[])
@@ -2565,7 +2565,7 @@ int main(int argc, char *argv[])
                        p = p1 = optarg;
                        do {
                                if ((p1 = strchr(p, ',')) != NULL)
-                                       *p1 = 0; 
+                                       *p1 = 0;
                                if (strcmp(p, "all") == 0) {
                                        current_filter.dbs = ALL_DB;
                                } else if (strcmp(p, "inet") == 0) {
@@ -2788,7 +2788,7 @@ int main(int argc, char *argv[])
        if (addrp_width < 15+serv_width+1)
                addrp_width = 15+serv_width+1;
 
-       addr_width = addrp_width - serv_width - 1; 
+       addr_width = addrp_width - serv_width - 1;
 
        if (netid_width)
                printf("%-*s ", netid_width, "Netid");
index 8be53680897a1c42e94d3967566e7f9e268da3da..2e9d9626a30ae70fde510749d03c19fee3cfcedf 100644 (file)
@@ -55,7 +55,7 @@ expr: DCOND HOSTCOND
                $$ = alloc_node(SSF_DCOND, $2);
         }
         | SCOND HOSTCOND
-        { 
+        {
                $$ = alloc_node(SSF_SCOND, $2);
         }
         | DPORT GEQ HOSTCOND
index c636c53ad5b69c467afca80dfac55252bc3e5c5a..b8f9b467bc9f8ca5f09dce223f6d1d7de1d8110a 100644 (file)
@@ -63,7 +63,7 @@ static int cmp_parse_eopt(struct nlmsghdr *n, struct tcf_ematch_hdr *hdr,
                align = TCF_EM_ALIGN_U32;
        else
                return PARSE_ERR(args, "cmp: invalid alignment");
-       
+
        for (a = bstr_next(args); a; a = bstr_next(a)) {
                if (!bstrcmp(a, "at")) {
                        if (a->next == NULL)
@@ -111,7 +111,7 @@ static int cmp_parse_eopt(struct nlmsghdr *n, struct tcf_ematch_hdr *hdr,
                                opnd = TCF_EM_OPND_GT;
                        else if (!bstrcmp(a, "lt"))
                                opnd = TCF_EM_OPND_LT;
-                       
+
                        if (a->next == NULL)
                                return PARSE_ERR(a, "cmp: missing argument");
                        a = bstr_next(a);
index bd1e15128e0e927393e2aa3d7643ab1ecf949392..5fc0c597cbbd2dd7c9b1c5e4b3b40ad1ee420d21 100644 (file)
@@ -131,7 +131,7 @@ static struct meta_entry * lookup_meta_entry(struct bstr *kind)
                if (!bstrcmp(kind, meta_table[i].kind) &&
                    meta_table[i].id != 0)
                        return &meta_table[i];
-       
+
        return NULL;
 }
 
@@ -142,7 +142,7 @@ static struct meta_entry * lookup_meta_entry_byid(int id)
        for (i = 0; i < (sizeof(meta_table)/sizeof(meta_table[0])); i++)
                if (meta_table[i].id == id)
                        return &meta_table[i];
-       
+
        return NULL;
 }
 
@@ -171,12 +171,12 @@ static inline int is_compatible(struct tcf_meta_val *what,
 {
        char *p;
        struct meta_entry *entry;
-       
+
        entry = lookup_meta_entry_byid(TCF_META_ID(what->kind));
 
        if (entry == NULL)
                return 0;
-       
+
        for (p = entry->mask; p; p++)
                if (map_type(*p) == TCF_META_TYPE(needed->kind))
                        return 1;
@@ -244,7 +244,7 @@ static inline int overwrite_type(struct tcf_meta_val *src,
 {
        return (TCF_META_TYPE(dst->kind) << 12) | TCF_META_ID(src->kind);
 }
-       
+
 
 static inline struct bstr *
 parse_object(struct bstr *args, struct bstr *arg, struct tcf_meta_val *obj,
@@ -280,7 +280,7 @@ parse_object(struct bstr *args, struct bstr *arg, struct tcf_meta_val *obj,
 
        if (left) {
                struct tcf_meta_val *right = obj;
-               
+
                if (TCF_META_TYPE(right->kind) == TCF_META_TYPE(left->kind))
                        goto compatible;
 
@@ -301,7 +301,7 @@ parse_object(struct bstr *args, struct bstr *arg, struct tcf_meta_val *obj,
                                right->kind = overwrite_type(right, left);
                        else
                                goto not_compatible;
-               } else 
+               } else
                        goto not_compatible;
        }
 
@@ -318,7 +318,7 @@ compatible:
                                return PARSE_FAILURE;
                        }
                        a = bstr_next(a);
-                       
+
                        shift = bstrtoul(a);
                        if (shift == LONG_MAX) {
                                PARSE_ERR(a, "meta: invalid shift, must " \
@@ -336,7 +336,7 @@ compatible:
                                return PARSE_FAILURE;
                        }
                        a = bstr_next(a);
-                       
+
                        mask = bstrtoul(a);
                        if (mask == LONG_MAX) {
                                PARSE_ERR(a, "meta: invalid mask, must be " \
@@ -400,7 +400,7 @@ static int meta_parse_eopt(struct nlmsghdr *n, struct tcf_ematch_hdr *hdr,
                return -1;
        else if (a != NULL)
                return PARSE_ERR(a, "meta: unexpected trailer");
-       
+
 
        addraw_l(n, MAX_MSG, hdr, sizeof(*hdr));
 
index e0ed5baf55dd8baabfe84d7f642ad3f055e138aa..98f988371ae02c4300a0c0c2a96ba12b2e8c2dcb 100644 (file)
@@ -92,7 +92,7 @@ static int nbyte_parse_eopt(struct nlmsghdr *n, struct tcf_ematch_hdr *hdr,
 
        if (offset_present == 0)
                return PARSE_ERR(a, "nbyte: offset required");
-       
+
        nb.len = needle->len;
        nb.layer = (__u8) layer;
        nb.off = (__u16) offset;
@@ -131,7 +131,7 @@ static int nbyte_print_eopt(FILE *fd, struct tcf_ematch_hdr *hdr, void *data,
        for (i = 0; i < nb->len; i++)
                fprintf(fd, "%c", isprint(needle[i]) ? needle[i] : '.');
        fprintf(fd, "\" at %d layer %d", nb->off, nb->layer);
-       
+
        return 0;
 }
 
index b8857f16da1da6e6ac2a4253f38224b4c9166125..402bea0e1493b76099942512ee3ed10373421610 100644 (file)
@@ -96,7 +96,7 @@ static int u32_parse_eopt(struct nlmsghdr *n, struct tcf_ematch_hdr *hdr,
                offset = bstrtoul(a);
        } else
                offset = bstrtoul(a);
-               
+
        if (offset == ULONG_MAX)
                return PARSE_ERR(a, "u32: invalid offset");
 
index 09d535d0510cfc34c91c8dc59226b46081795fe8..0184753aa3475870ab12441197d373ada34cd99e 100644 (file)
@@ -77,7 +77,7 @@
                                                                return ERROR;
                                                }
                                                strbuf_index = 0;
-                                               
+
                                                BEGIN(str);
                                        }
 
@@ -90,7 +90,7 @@
 
 <str>\\[0-7]{1,3}                      { /* octal escape sequence */
                                                int res;
-                                               
+
                                                sscanf(yytext + 1, "%o", &res);
                                                if (res > 0xFF) {
                                                        fprintf(stderr, "error: octal escape sequence" \
 
 <str>\\x[0-9a-fA-F]{1,2}               {
                                                int res;
-                                               
+
                                                sscanf(yytext + 2, "%x", &res);
-                                               
+
                                                if (res > 0xFF) {
                                                        fprintf(stderr, "error: hexadecimal escape " \
                                                        "sequence out of range\n");
index 264f35840b0594744bab37c19ef6cc5664546b1a..19a7edf2f8d3fe0e639a13b337334dae682293e7 100644 (file)
@@ -52,7 +52,7 @@ static int basic_parse_opt(struct filter_util *qu, char *handle,
                        return -1;
                }
        }
-               
+
        t->tcm_handle = h;
 
        tail = (struct rtattr*)(((void*)n)+NLMSG_ALIGN(n->nlmsg_len));
index 5a56098623fd0895eb0b2d456af1a11e6f083fb2..046f61468c041cd8176cf7d4a15e089cb59edd31 100644 (file)
--- a/tc/f_fw.c
+++ b/tc/f_fw.c
@@ -125,7 +125,7 @@ static int fw_print_opt(struct filter_util *qu, FILE *f, struct rtattr *opt, __u
                struct rtattr *idev = tb[TCA_FW_INDEV];
                fprintf(f, "input dev %s ",(char *)RTA_DATA(idev));
        }
-       
+
        if (tb[TCA_FW_ACT]) {
                fprintf(f, "\n");
                tc_print_action(f, tb[TCA_FW_ACT]);
index 9d527fc0744ca4e4f2fca62bebf043d0beb51338..aa83ba08131c79656b6ee6075c040e442b64f1eb 100644 (file)
@@ -833,7 +833,7 @@ static int u32_parse_opt(struct filter_util *qu, char *handle, int argc, char **
                } else if (matches(*argv, "divisor") == 0) {
                        unsigned divisor;
                        NEXT_ARG();
-                       if (get_unsigned(&divisor, *argv, 0) || 
+                       if (get_unsigned(&divisor, *argv, 0) ||
                            divisor == 0 ||
                            divisor > 0x100 || ((divisor - 1) & divisor)) {
                                fprintf(stderr, "Illegal \"divisor\"\n");
index 3808a860aa6bbecc467bb8343a9d807f2c637645..9f2402289b2b21ed810b08138bc4ed20862661e2 100644 (file)
@@ -6,8 +6,8 @@
  *             as published by the Free Software Foundation; either version
  *             2 of the License, or (at your option) any later version.
  *
- * Authors:  J Hadi Salim (hadi@cyberus.ca) 
- * 
+ * Authors:  J Hadi Salim (hadi@cyberus.ca)
+ *
  * TODO:
  * - parse to be passed a filedescriptor for logging purposes
  *
@@ -65,7 +65,7 @@ void act_usage(void)
 static int print_noaopt(struct action_util *au, FILE *f, struct rtattr *opt)
 {
        if (opt && RTA_PAYLOAD(opt))
-               fprintf(f, "[Unknown action, optlen=%u] ", 
+               fprintf(f, "[Unknown action, optlen=%u] ",
                        (unsigned) RTA_PAYLOAD(opt));
        return 0;
 }
@@ -139,7 +139,7 @@ noexist:
 }
 
 int
-new_cmd(char **argv) 
+new_cmd(char **argv)
 {
        if ((matches(*argv, "change") == 0) ||
                (matches(*argv, "replace") == 0)||
@@ -203,7 +203,7 @@ done0:
                                        goto done;
                        }
 
-                       if (NULL == a) { 
+                       if (NULL == a) {
                                goto bad_val;
                        }
 
@@ -235,7 +235,7 @@ done:
        *argv_p = argv;
        return 0;
 bad_val:
-       /* no need to undo things, returning from here should 
+       /* no need to undo things, returning from here should
         * cause enough pain */
        fprintf(stderr, "parse_action: bad value (%d:%s)!\n",argc,*argv);
        return -1;
@@ -337,11 +337,11 @@ int print_action(const struct sockaddr_nl *who,
                if (n->nlmsg_type != RTM_GETACTION)
                        fprintf(stderr, "print_action: NULL kind\n");
                return -1;
-       }     
+       }
 
        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 ");
@@ -403,7 +403,7 @@ int tc_action_gd(int cmd, unsigned flags, int *argc_p, char ***argv_p)
 
                strncpy(k, *argv, sizeof (k) - 1);
                a = get_action_kind(k);
-               if (NULL == a) { 
+               if (NULL == a) {
                        fprintf(stderr, "Error: non existent action: %s\n",k);
                        ret = -1;
                        goto bad_val;
@@ -536,7 +536,7 @@ int tc_act_list_or_flush(int argc, char **argv, int event)
        }
 #endif
        a = get_action_kind(k);
-       if (NULL == a) { 
+       if (NULL == a) {
                fprintf(stderr,"bad action %s\n",k);
                goto bad_val;
        }
@@ -553,7 +553,7 @@ int tc_act_list_or_flush(int argc, char **argv, int event)
 
        msg_size = NLMSG_ALIGN(req.n.nlmsg_len) - NLMSG_ALIGN(sizeof(struct nlmsghdr));
 
-       if (event == RTM_GETACTION) { 
+       if (event == RTM_GETACTION) {
                if (rtnl_dump_request(&rth, event, (void *)&req.t, msg_size) < 0) {
                        perror("Cannot send dump request");
                        return 1;
@@ -561,7 +561,7 @@ int tc_act_list_or_flush(int argc, char **argv, int event)
                ret = rtnl_dump_filter(&rth, print_action, stdout, NULL, NULL);
        }
 
-       if (event == RTM_DELACTION) { 
+       if (event == RTM_DELACTION) {
                req.n.nlmsg_len = NLMSG_ALIGN(req.n.nlmsg_len);
                req.n.nlmsg_type = RTM_DELACTION;
                req.n.nlmsg_flags |= NLM_F_ROOT;
index 44c621bc6fa866f6aaa29ae9d7e602312ce7bf67..da4f22b256b8e8fcbdf027f868c91a138250a964 100644 (file)
@@ -45,7 +45,7 @@ static inline void map_warning(int num, char *kind)
            "Error: Unable to find ematch \"%s\" in %s\n" \
            "Please assign a unique ID to the ematch kind the suggested " \
            "entry is:\n" \
-           "\t%d\t%s\n", 
+           "\t%d\t%s\n",
            kind, EMATCH_MAP, num, kind);
 }
 
@@ -66,7 +66,7 @@ static int lookup_map(__u16 num, char *dst, int len, const char *file)
                        p++;
                if (*p == '#' || *p == '\n' || *p == 0)
                        continue;
-       
+
                if (sscanf(p, "%d %s", &id, namebuf) != 2) {
                        fprintf(stderr, "ematch map %s corrupted at %s\n",
                            file, p);
@@ -104,7 +104,7 @@ static int lookup_map_id(char *kind, int *dst, const char *file)
                        p++;
                if (*p == '#' || *p == '\n' || *p == 0)
                        continue;
-       
+
                if (sscanf(p, "%d %s", &id, namebuf) != 2) {
                        fprintf(stderr, "ematch map %s corrupted at %s\n",
                            file, p);
@@ -185,7 +185,7 @@ static int parse_tree(struct nlmsghdr *n, struct ematch *tree)
 
                if (t->inverted)
                        hdr.flags |= TCF_EM_INVERT;
-               
+
                addattr_l(n, MAX_MSG, index++, NULL, 0);
 
                if (t->child) {
@@ -278,7 +278,7 @@ int em_parse_error(int err, struct bstr *args, struct bstr *carg,
                begin_argv++;
                begin_argc--;
        }
-       
+
        fprintf(stderr, "...\n");
 
        if (args) {
@@ -437,7 +437,7 @@ static int print_ematch_seq(FILE *fd, struct rtattr **tb, int start,
 
                i++;
        }
-       
+
        return 0;
 }
 
index ed98446168da4bf2babf43f51df41b7e3d1ae567..2b5d29386298e9cfdff662bc41c27fa66621c3eb 100644 (file)
@@ -68,7 +68,7 @@ static inline unsigned long bstrtoul(struct bstr *b)
 
        memcpy(buf, b->data, b->len);
        buf[b->len] = '\0';
-       
+
        l = strtol(buf, &inv, 0);
        if (l == ULONG_MAX || inv == buf)
                return LONG_MAX;
index 78eda7a8a074333f739a9f79da675983f0bc2768..d931551acc21664d1b2a099eb818708db5365449 100644 (file)
@@ -39,7 +39,7 @@ int parse_estimator(int *p_argc, char ***p_argv, struct tc_estimator *est)
        int argc = *p_argc;
        char **argv = *p_argv;
        unsigned A, time_const;
-       
+
        NEXT_ARG();
        if (est->ewma_log)
                duparg("estimator", *argv);
index cfbaf874dea7959740903d53120c05bbf20f9cb3..9f07851a6dab9e9b03bd4f43f27f9397472c29cf 100644 (file)
@@ -1,13 +1,13 @@
 /*
- * m_gact.c            generic actions module 
+ * m_gact.c            generic actions module
  *
  *             This program is free software; you can distribute 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.
  *
- * Authors:  J Hadi Salim (hadi@cyberus.ca) 
- * 
+ * Authors:  J Hadi Salim (hadi@cyberus.ca)
+ *
  */
 
 #include <stdio.h>
@@ -27,7 +27,7 @@
 /* define to turn on probablity stuff */
 
 #ifdef CONFIG_GACT_PROB
-static const char *prob_n2a(int p) 
+static const char *prob_n2a(int p)
 {
        if (p == PGACT_NONE)
                return "none";
index ca3955513a1f7e79b25174b8e3b960b37332c500..e1f68b33f48cafb7c79f92fd8f7a33b58a864422 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * m_ipt.c     iptables based targets 
+ * m_ipt.c     iptables based targets
  *             utilities mostly ripped from iptables <duh, its the linux way>
  *
  *             This program is free software; you can distribute it and/or
@@ -7,8 +7,8 @@
  *             as published by the Free Software Foundation; either version
  *             2 of the License, or (at your option) any later version.
  *
- * Authors:  J Hadi Salim (hadi@cyberus.ca) 
- * 
+ * Authors:  J Hadi Salim (hadi@cyberus.ca)
+ *
  * TODO: bad bad hardcoding IPT_LIB_DIR and PROC_SYS_MODPROBE
  *
 */
@@ -126,7 +126,7 @@ addr_to_dotted(const struct in_addr *addrp)
        return buf;
 }
 
-int string_to_number_ll(const char *s, unsigned long long min, 
+int string_to_number_ll(const char *s, unsigned long long min,
                        unsigned long long max,
                 unsigned long long *ret)
 {
@@ -341,7 +341,7 @@ static void set_revision(char *name, u_int8_t revision)
        name[IPT_FUNCTION_MAXNAMELEN - 1] = revision;
 }
 
-/* 
+/*
  * we may need to check for version mismatch
 */
 int
@@ -372,7 +372,7 @@ build_st(struct iptables_target *target, struct ipt_entry_target *t)
        return -1;
 }
 
-static int parse_ipt(struct action_util *a,int *argc_p, 
+static int parse_ipt(struct action_util *a,int *argc_p,
                     char ***argv_p, int tca_id, struct nlmsghdr *n)
 {
        struct iptables_target *m = NULL;
@@ -503,7 +503,7 @@ static int parse_ipt(struct action_util *a,int *argc_p,
        argv += optind;
        *argc_p = rargc - iargc;
        *argv_p = argv;
-       
+
        optind = 1;
        free_opts(opts);
 
@@ -578,7 +578,7 @@ print_ipt(struct action_util *au,FILE * f, struct rtattr *arg)
                                struct tcf_t *tm = RTA_DATA(tb[TCA_IPT_TM]);
                                print_tm(f,tm);
                        }
-               } 
+               }
                fprintf(f, " \n");
 
        }
index ed87c81839b7ca9699abc05f314356c72d350cda..226df4d29281154ca0a14cc6208c38681bddfcdc 100644 (file)
@@ -1,13 +1,13 @@
 /*
- * m_egress.c          ingress/egress packet mirror/redir actions module 
+ * m_egress.c          ingress/egress packet mirror/redir actions module
  *
  *             This program is free software; you can distribute 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.
  *
- * Authors:  J Hadi Salim (hadi@cyberus.ca) 
- * 
+ * Authors:  J Hadi Salim (hadi@cyberus.ca)
+ *
  * TODO: Add Ingress support
  *
  */
@@ -247,7 +247,7 @@ parse_mirred(struct action_util *a, int *argc_p, char ***argv_p, int tca_id, str
        }
 
        return -1;
-       
+
 }
 
 int
index 5ac84a58f4eae84b57a1752b3b3b53a5624125b9..7499846310ac33366e82ad353c4ffe4582f3e283 100644 (file)
@@ -1,18 +1,18 @@
 /*
- * m_pedit.c           generic packet editor actions module 
+ * m_pedit.c           generic packet editor actions module
  *
  *             This program is free software; you can distribute 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.
  *
- * Authors:  J Hadi Salim (hadi@cyberus.ca) 
- * 
- * TODO: 
+ * Authors:  J Hadi Salim (hadi@cyberus.ca)
+ *
+ * TODO:
  *     1) Big endian broken in some spots
  *     2) A lot of this stuff was added on the fly; get a big double-double
  *     and clean it up at some point.
- *     
+ *
  */
 
 #include <stdio.h>
@@ -37,7 +37,7 @@ explain(void)
 {
        fprintf(stderr, "Usage: ... pedit munge <MUNGE>\n");
        fprintf(stderr,
-               "Where: MUNGE := <RAW>|<LAYERED>\n" 
+               "Where: MUNGE := <RAW>|<LAYERED>\n"
                "\t<RAW>:= <OFFSETC>[ATC]<CMD>\n "
                "\t\tOFFSETC:= offset <offval> <u8|u16|u32>\n "
                "\t\tATC:= at <atval> offmask <maskval> shift <shiftval>\n "
@@ -58,8 +58,8 @@ usage(void)
        exit(-1);
 }
 
-static int 
-pedit_parse_nopopt (int *argc_p, char ***argv_p,struct tc_pedit_sel *sel,struct tc_pedit_key *tkey) 
+static int
+pedit_parse_nopopt (int *argc_p, char ***argv_p,struct tc_pedit_sel *sel,struct tc_pedit_key *tkey)
 {
        int argc = *argc_p;
        char **argv = *argv_p;
@@ -73,7 +73,7 @@ pedit_parse_nopopt (int *argc_p, char ***argv_p,struct tc_pedit_sel *sel,struct
 
 }
 
-struct m_pedit_util 
+struct m_pedit_util
 *get_pedit_kind(char *str)
 {
        static void *pBODY;
@@ -227,7 +227,7 @@ pack_key8(__u32 retain,struct tc_pedit_sel *sel,struct tc_pedit_key *tkey)
        retain <<= stride;
        tkey->mask = retain|m[ind];
        tkey->off &= ~3;
-       
+
        if (pedit_debug)
                printf("pack_key8: Final word off %d  val %08x mask %08x \n",tkey->off , tkey->val,tkey->mask);
        return pack_key(sel,tkey);
@@ -293,7 +293,7 @@ parse_cmd(int *argc_p, char ***argv_p, __u32 len, int type,__u32 retain,struct t
        } else if (matches(*argv, "preserve") == 0) {
                retain = mask = o;
        } else {
-               if (matches(*argv, "clear") != 0) 
+               if (matches(*argv, "clear") != 0)
                        return -1;
        }
 
@@ -390,7 +390,7 @@ done:
                tkey->at = atv;
 
                NEXT_ARG();
-               
+
                if (get_u32(&offmask, *argv, 16))
                        return -1;
                tkey->offmask = offmask;
@@ -595,7 +595,7 @@ print_pedit(struct action_util *au,FILE * f, struct rtattr *arg)
        return 0;
 }
 
-int 
+int
 pedit_print_xstats(struct action_util *au, FILE *f, struct rtattr *xstats)
 {
        return 0;
index 0a6d24e0bf2fa901c1827f8b415d9726a2bcdf67..1698c954e999e7d593eb6e683c515fb84c6a365f 100644 (file)
@@ -1,13 +1,13 @@
 /*
- * m_pedit.h           generic packet editor actions module 
+ * m_pedit.h           generic packet editor actions module
  *
  *             This program is free software; you can distribute 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.
  *
- * Authors:  J Hadi Salim (hadi@cyberus.ca) 
- * 
+ * Authors:  J Hadi Salim (hadi@cyberus.ca)
+ *
  */
 
 #ifndef _ACT_PEDIT_H_
index 7b803672ab520f43e8f904409bbdc3bcede10530..93f317c06dbea16f20d5a6637ec53fc899818545 100644 (file)
@@ -7,8 +7,8 @@
  *             2 of the License, or (at your option) any later version.
  *
  * Authors:    Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
- * FIXES:       19990619 - J Hadi Salim (hadi@cyberus.ca) 
- *             simple addattr packaging fix.            
+ * FIXES:       19990619 - J Hadi Salim (hadi@cyberus.ca)
+ *             simple addattr packaging fix.
  *             2002: J Hadi Salim - Add tc action extensions syntax
  *
  */
@@ -37,8 +37,8 @@ static void usage(void)
        fprintf(stderr, "Usage: ... police rate BPS burst BYTES[/BYTES] [ mtu BYTES[/BYTES] ]\n");
        fprintf(stderr, "                [ peakrate BPS ] [ avrate BPS ]\n");
        fprintf(stderr, "                [ ACTIONTERM ]\n");
-       fprintf(stderr, "Old Syntax ACTIONTERM := action <EXCEEDACT>[/NOTEXCEEDACT] \n"); 
-       fprintf(stderr, "New Syntax ACTIONTERM := conform-exceed <EXCEEDACT>[/NOTEXCEEDACT] \n"); 
+       fprintf(stderr, "Old Syntax ACTIONTERM := action <EXCEEDACT>[/NOTEXCEEDACT] \n");
+       fprintf(stderr, "New Syntax ACTIONTERM := conform-exceed <EXCEEDACT>[/NOTEXCEEDACT] \n");
        fprintf(stderr, "Where: *EXCEEDACT := pipe | ok | reclassify | drop | continue \n");
        fprintf(stderr, "Where:  pipe is only valid for new syntax \n");
        exit(-1);
@@ -133,7 +133,7 @@ int act_parse_police(struct action_util *a,int *argc_p, char ***argv_p, int tca_
        __u32 avrate = 0;
        int presult = 0;
        unsigned buffer=0, mtu=0, mpu=0;
-       int Rcell_log=-1, Pcell_log = -1; 
+       int Rcell_log=-1, Pcell_log = -1;
        struct rtattr *tail;
 
        memset(&p, 0, sizeof(p));
@@ -304,7 +304,7 @@ int parse_police(int *argc_p, char ***argv_p, int tca_id, struct nlmsghdr *n)
        return act_parse_police(NULL,argc_p,argv_p,tca_id,n);
 }
 
-int 
+int
 print_police(struct action_util *a, FILE *f, struct rtattr *arg)
 {
        SPRINT_BUF(b1);
@@ -350,7 +350,7 @@ print_police(struct action_util *a, FILE *f, struct rtattr *arg)
        return 0;
 }
 
-int 
+int
 tc_print_police(FILE *f, struct rtattr *arg) {
        return print_police(&police_action_util,f,arg);
 }
index f9ddbe337aeaac5be4a140b84408fdf415447cd1..a4b80c2c1bb94036c961bfcb250c283f15b7d3c9 100644 (file)
@@ -6,8 +6,8 @@
  *             as published by the Free Software Foundation; either version
  *             2 of the License, or (at your option) any later version.
  *
- * Authors:  J Hadi Salim (hadi@cyberus.ca) 
- * 
+ * Authors:  J Hadi Salim (hadi@cyberus.ca)
+ *
  */
 
 #include <stdio.h>
index 1b2a44012ce6c4548d4a03a037f8f31ea7bb84ce..08fdbaa41fbf41346dccca3bcf4ca9161648c9b5 100644 (file)
--- a/tc/p_ip.c
+++ b/tc/p_ip.c
@@ -1,13 +1,13 @@
 /*
- * m_pedit.c           packet editor: IPV4/6 header 
+ * m_pedit.c           packet editor: IPV4/6 header
  *
  *             This program is free software; you can distribute 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.
  *
- * Authors:  J Hadi Salim (hadi@cyberus.ca) 
- * 
+ * Authors:  J Hadi Salim (hadi@cyberus.ca)
+ *
  */
 
 #include <stdio.h>
index aab37a602d56826d9dfd7167c0c6126dd92bbbf5..7f4b6f4ac10df23a414f520096fe40426e2742b9 100644 (file)
@@ -6,8 +6,8 @@
  *             as published by the Free Software Foundation; either version
  *             2 of the License, or (at your option) any later version.
  *
- * Authors:  J Hadi Salim (hadi@cyberus.ca) 
- * 
+ * Authors:  J Hadi Salim (hadi@cyberus.ca)
+ *
  */
 
 #include <stdio.h>
index 95ed993a878776040c5b5efd2d364d3aa92c6dbf..177628961a52666893ec2f4f5b5ab5ebccf2632a 100644 (file)
@@ -6,8 +6,8 @@
  *             as published by the Free Software Foundation; either version
  *             2 of the License, or (at your option) any later version.
  *
- * Authors:  J Hadi Salim (hadi@cyberus.ca) 
- * 
+ * Authors:  J Hadi Salim (hadi@cyberus.ca)
+ *
  */
 
 #include <stdio.h>
index a456eda968cde13c18711d3d5955ae1515705ab5..bc7e8ba75b8a1848e683d3c20cf8b9fd18a8ec90 100644 (file)
@@ -53,7 +53,7 @@ static int cbq_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nl
        struct tc_cbq_lssopt lss;
        __u32 rtab[256];
        unsigned mpu=0, avpkt=0, allot=0;
-       int cell_log=-1; 
+       int cell_log=-1;
        int ewma_log=-1;
        struct rtattr *tail;
 
@@ -176,7 +176,7 @@ static int cbq_parse_class_opt(struct qdisc_util *qu, int argc, char **argv, str
        struct tc_cbq_ovl ovl;
        __u32 rtab[256];
        unsigned mpu=0;
-       int cell_log=-1; 
+       int cell_log=-1;
        int ewma_log=-1;
        unsigned bndw = 0;
        unsigned minburst=0, maxburst=0;
@@ -451,7 +451,7 @@ static int cbq_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
        if (tb[TCA_CBQ_OVL_STRATEGY]) {
                if (RTA_PAYLOAD(tb[TCA_CBQ_OVL_STRATEGY]) < sizeof(*ovl))
                        fprintf(stderr, "CBQ: too short overlimit strategy %u/%u\n",
-                               (unsigned) RTA_PAYLOAD(tb[TCA_CBQ_OVL_STRATEGY]), 
+                               (unsigned) RTA_PAYLOAD(tb[TCA_CBQ_OVL_STRATEGY]),
                                (unsigned) sizeof(*ovl));
                else
                        ovl = RTA_DATA(tb[TCA_CBQ_OVL_STRATEGY]);
index 0526c75aad23fe21cf7980c1cb1fdccf4828d6bf..4aaa29b713f14ddcb9cdaa045927154480190bcf 100644 (file)
@@ -6,9 +6,9 @@
  *             as published by the Free Software Foundation; either version
  *             2 of the License, or (at your option) any later version.
  *
- * Authors:    J Hadi Salim(hadi@nortelnetworks.com)   
- *             code ruthlessly ripped from 
- *            Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> 
+ * Authors:    J Hadi Salim(hadi@nortelnetworks.com)
+ *             code ruthlessly ripped from
+ *            Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
  *
  */
 
@@ -140,7 +140,7 @@ static int gred_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct n
                                return -1;
                        }
                return init_gred(qu,argc-1, argv+1,n);
-                       
+
                } else if (strcmp(*argv, "min") == 0) {
                        NEXT_ARG();
                        if (get_size(&opt.qth_min, *argv)) {
@@ -276,7 +276,7 @@ static int gred_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
                fprintf(f,"\n GRED received message smaller than expected\n");
                return -1;
                }
-         
+
 /* Bad hack! should really return a proper message as shown above*/
 
        for (i=0;i<MAX_DPs;i++, qopt++) {
index f09c60672a33dd00e35033f8c72658dceea97db8..4e8c09b7c13b05e26091549ebe250b957534906f 100644 (file)
@@ -260,7 +260,7 @@ hfsc_print_class_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
                        usc = RTA_DATA(tb[TCA_HFSC_USC]);
        }
 
-       
+
        if (rsc != NULL && fsc != NULL &&
            memcmp(rsc, fsc, sizeof(*rsc)) == 0)
                hfsc_print_sc(f, "sc", rsc);
@@ -275,7 +275,7 @@ hfsc_print_class_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
 
        return 0;
 }
+
 struct qdisc_util hfsc_qdisc_util = {
        .id             = "hfsc",
        .parse_qopt     = hfsc_parse_opt,
index 828d4b1ae2b5d40b07728a46467002b57421ceed..d5f85c37355754500ab0142940bf75d621244f9f 100644 (file)
@@ -216,7 +216,7 @@ static int htb_parse_class_opt(struct qdisc_util *qu, int argc, char **argv, str
        }
        opt.buffer = tc_calc_xmittime(opt.rate.rate, buffer);
        opt.rate.cell_log = cell_log;
-       
+
        if ((ccell_log = tc_calc_rtable(opt.ceil.rate, ctab, cell_log, mtu, mpu)) < 0) {
                fprintf(stderr, "htb: failed to calculate ceil rate table.\n");
                return -1;
@@ -279,14 +279,14 @@ static int htb_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
                fprintf(f, "cburst %s ", sprint_size(cbuffer, b1));
            }
            if (show_raw)
-               fprintf(f, "buffer [%08x] cbuffer [%08x] ", 
+               fprintf(f, "buffer [%08x] cbuffer [%08x] ",
                        hopt->buffer,hopt->cbuffer);
        }
        if (tb[TCA_HTB_INIT]) {
            gopt = RTA_DATA(tb[TCA_HTB_INIT]);
            if (RTA_PAYLOAD(tb[TCA_HTB_INIT])  < sizeof(*gopt)) return -1;
 
-           fprintf(f, "r2q %d default %x direct_packets_stat %u", 
+           fprintf(f, "r2q %d default %x direct_packets_stat %u",
                    gopt->rate2quantum,gopt->defcls,gopt->direct_pkts);
                if (show_details)
                        fprintf(f," ver %d.%d",gopt->version >> 16,gopt->version & 0xffff);
@@ -304,7 +304,7 @@ static int htb_print_xstats(struct qdisc_util *qu, FILE *f, struct rtattr *xstat
                return -1;
 
        st = RTA_DATA(xstats);
-       fprintf(f, " lended: %u borrowed: %u giants: %u\n", 
+       fprintf(f, " lended: %u borrowed: %u giants: %u\n",
                st->lends,st->borrows,st->giants);
        fprintf(f, " tokens: %d ctokens: %d\n", st->tokens,st->ctokens);
        return 0;
index 7fbc771c7e8a7455a18206bacf0589060c7e1c37..a3ae71c12406848d38f6d83372d8782db76d479b 100644 (file)
@@ -27,7 +27,7 @@
 
 static void explain(void)
 {
-       fprintf(stderr, 
+       fprintf(stderr,
 "Usage: ... netem [ limit PACKETS ] \n" \
 "                 [ delay TIME [ JITTER [CORRELATION]]]\n" \
 "                 [ distribution {uniform|normal|pareto|paretonormal} ]\n" \
@@ -62,11 +62,11 @@ static int get_distribution(const char *type, __s16 *data)
 
        snprintf(name, sizeof(name), "/usr/lib/tc/%s.dist", type);
        if ((f = fopen(name, "r")) == NULL) {
-               fprintf(stderr, "No distribution data for %s (%s: %s)\n", 
+               fprintf(stderr, "No distribution data for %s (%s: %s)\n",
                        type, name, strerror(errno));
                return -1;
        }
-       
+
        n = 0;
        while (getline(&line, &len, f) != -1) {
                char *p, *endp;
@@ -75,7 +75,7 @@ static int get_distribution(const char *type, __s16 *data)
 
                for (p = line; ; p = endp) {
                        x = strtol(p, &endp, 0);
-                       if (endp == p) 
+                       if (endp == p)
                                break;
 
                        if (n >= MAXDIST) {
@@ -93,7 +93,7 @@ static int get_distribution(const char *type, __s16 *data)
        return n;
 }
 
-static int isnumber(const char *arg) 
+static int isnumber(const char *arg)
 {
        char *p;
        (void) strtod(arg, &p);
@@ -102,7 +102,7 @@ static int isnumber(const char *arg)
 
 #define NEXT_IS_NUMBER() (NEXT_ARG_OK() && isnumber(argv[1]))
 
-/* Adjust for the fact that psched_ticks aren't always usecs 
+/* Adjust for the fact that psched_ticks aren't always usecs
    (based on kernel PSCHED_CLOCK configuration */
 static int get_ticks(__u32 *ticks, const char *str)
 {
@@ -110,7 +110,7 @@ static int get_ticks(__u32 *ticks, const char *str)
 
        if(get_usecs(&t, str))
                return -1;
-       
+
        if (tc_core_usec2big(t)) {
                fprintf(stderr, "Illegal %d usecs (too large)\n", t);
                return -1;
@@ -126,7 +126,7 @@ static char *sprint_ticks(__u32 ticks, char *buf)
 }
 
 
-static int netem_parse_opt(struct qdisc_util *qu, int argc, char **argv, 
+static int netem_parse_opt(struct qdisc_util *qu, int argc, char **argv,
                           struct nlmsghdr *n)
 {
        size_t dist_size = 0;
@@ -167,7 +167,7 @@ static int netem_parse_opt(struct qdisc_util *qu, int argc, char **argv,
 
                                if (NEXT_IS_NUMBER()) {
                                        NEXT_ARG();
-                                       if (get_percent(&cor.delay_corr, 
+                                       if (get_percent(&cor.delay_corr,
                                                        *argv)) {
                                                explain1("latency");
                                                return -1;
@@ -317,7 +317,7 @@ static int netem_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
                struct rtattr *tb[TCA_NETEM_MAX+1];
                parse_rtattr(tb, TCA_NETEM_MAX, RTA_DATA(opt) + sizeof(qopt),
                             len);
-               
+
                if (tb[TCA_NETEM_CORR]) {
                        if (RTA_PAYLOAD(tb[TCA_NETEM_CORR]) < sizeof(*cor))
                                return -1;
@@ -359,20 +359,20 @@ static int netem_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
                if (cor && cor->dup_corr)
                        fprintf(f, " %s", sprint_percent(cor->dup_corr, b1));
        }
-                       
+
        if (reorder && reorder->probability) {
-               fprintf(f, " reorder %s", 
+               fprintf(f, " reorder %s",
                        sprint_percent(reorder->probability, b1));
                if (reorder->correlation)
-                       fprintf(f, " %s", 
+                       fprintf(f, " %s",
                                sprint_percent(reorder->correlation, b1));
        }
 
        if (corrupt && corrupt->probability) {
-               fprintf(f, " corrupt %s", 
+               fprintf(f, " corrupt %s",
                        sprint_percent(corrupt->probability, b1));
                if (corrupt->correlation)
-                       fprintf(f, " %s", 
+                       fprintf(f, " %s",
                                sprint_percent(corrupt->correlation, b1));
        }
 
index 1743f6cf548b164c4eebd409522d370a6bfac774..6f93b26abf3c58a02b99d4207c7f68794f89942f 100644 (file)
@@ -205,7 +205,7 @@ static int red_print_xstats(struct qdisc_util *qu, FILE *f, struct rtattr *xstat
        fprintf(f, "  marked %u early %u pdrop %u other %u",
                st->marked, st->early, st->pdrop, st->other);
        return 0;
-       
+
 #endif
        return 0;
 }
index 6ed5e0bd8032c724437abda705750f620bb078a3..b8251cb3accebcdb4674aff8af957f6ca70cfe33 100644 (file)
@@ -44,7 +44,7 @@ static int tbf_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nl
        __u32 rtab[256];
        __u32 ptab[256];
        unsigned buffer=0, mtu=0, mpu=0, latency=0;
-       int Rcell_log=-1, Pcell_log = -1; 
+       int Rcell_log=-1, Pcell_log = -1;
        struct rtattr *tail;
 
        memset(&opt, 0, sizeof(opt));
diff --git a/tc/tc.c b/tc/tc.c
index 789f6f628423fab0df8ad56d75b8a13e673140a6..6672e189f75e48c30ee7ed10a8a220768a9414e7 100644 (file)
--- a/tc/tc.c
+++ b/tc/tc.c
@@ -42,11 +42,11 @@ static void *BODY = NULL;   /* cached handle dlopen(NULL) */
 static struct qdisc_util * qdisc_list;
 static struct filter_util * filter_list;
 
-static int print_noqopt(struct qdisc_util *qu, FILE *f, 
+static int print_noqopt(struct qdisc_util *qu, FILE *f,
                        struct rtattr *opt)
 {
        if (opt && RTA_PAYLOAD(opt))
-               fprintf(f, "[Unknown qdisc, optlen=%u] ", 
+               fprintf(f, "[Unknown qdisc, optlen=%u] ",
                        (unsigned) RTA_PAYLOAD(opt));
        return 0;
 }
@@ -63,7 +63,7 @@ static int parse_noqopt(struct qdisc_util *qu, int argc, char **argv, struct nlm
 static int print_nofopt(struct filter_util *qu, FILE *f, struct rtattr *opt, __u32 fhandle)
 {
        if (opt && RTA_PAYLOAD(opt))
-               fprintf(f, "fh %08x [Unknown filter, optlen=%u] ", 
+               fprintf(f, "fh %08x [Unknown filter, optlen=%u] ",
                        fhandle, (unsigned) RTA_PAYLOAD(opt));
        else if (fhandle)
                fprintf(f, "fh %08x ", fhandle);
@@ -206,8 +206,8 @@ static int do_cmd(int argc, char **argv)
                usage();
                return 0;
        }
-       
-       fprintf(stderr, "Object \"%s\" is unknown, try \"tc help\".\n", 
+
+       fprintf(stderr, "Object \"%s\" is unknown, try \"tc help\".\n",
                *argv);
        return -1;
 }
index 049584e13ee1e290474fdfd692e65271865edb27..fb0b6b2eec27274696c25411e084bb1ac612bc55 100644 (file)
@@ -147,7 +147,7 @@ int tc_class_modify(int cmd, unsigned flags, int argc, char **argv)
 int filter_ifindex;
 __u32 filter_qdisc;
 
-int print_class(const struct sockaddr_nl *who, 
+int print_class(const struct sockaddr_nl *who,
                       struct nlmsghdr *n, void *arg)
 {
        FILE *fp = (FILE*)arg;
@@ -213,7 +213,7 @@ int print_class(const struct sockaddr_nl *who,
        fprintf(fp, "\n");
        if (show_stats) {
                struct rtattr *xstats = NULL;
-               
+
                if (tb[TCA_STATS] || tb[TCA_STATS2]) {
                        print_tcstats_attr(fp, tb, " ", &xstats);
                        fprintf(fp, "\n");
index 3341b13ff22677521c4039c6d939e25888863dbb..3e102cdd6b99fcf326bf947d77df73808cbd58e8 100644 (file)
@@ -177,7 +177,7 @@ static __u32 filter_prio;
 static __u32 filter_protocol;
 
 int print_filter(const struct sockaddr_nl *who,
-                       struct nlmsghdr *n, 
+                       struct nlmsghdr *n,
                        void *arg)
 {
        FILE *fp = (FILE*)arg;
index 76c78f2ef8607371a15dce24276d146a1717e1e2..0b169232e60d99d2835e99c07d86a1190d038b29 100644 (file)
@@ -154,7 +154,7 @@ int tc_qdisc_modify(int cmd, unsigned flags, int argc, char **argv)
                req.t.tcm_ifindex = idx;
        }
 
-       if (rtnl_talk(&rth, &req.n, 0, 0, NULL, NULL, NULL) < 0) 
+       if (rtnl_talk(&rth, &req.n, 0, 0, NULL, NULL, NULL) < 0)
                return 2;
 
        return 0;
@@ -162,8 +162,8 @@ int tc_qdisc_modify(int cmd, unsigned flags, int argc, char **argv)
 
 static int filter_ifindex;
 
-int print_qdisc(const struct sockaddr_nl *who, 
-                      struct nlmsghdr *n, 
+int print_qdisc(const struct sockaddr_nl *who,
+                      struct nlmsghdr *n,
                       void *arg)
 {
        FILE *fp = (FILE*)arg;
@@ -209,13 +209,13 @@ int print_qdisc(const struct sockaddr_nl *who,
        if (t->tcm_info != 1) {
                fprintf(fp, "refcnt %d ", t->tcm_info);
        }
-       /* pfifo_fast is generic enough to warrant the hardcoding --JHS */      
-               
+       /* pfifo_fast is generic enough to warrant the hardcoding --JHS */
+
        if (0 == strcmp("pfifo_fast", RTA_DATA(tb[TCA_KIND])))
                q = get_qdisc_kind("prio");
        else
                q = get_qdisc_kind(RTA_DATA(tb[TCA_KIND]));
-       
+
        if (tb[TCA_OPTIONS]) {
                if (q)
                        q->print_qopt(q, fp, tb[TCA_OPTIONS]);
@@ -249,7 +249,7 @@ int tc_qdisc_list(int argc, char **argv)
        memset(&t, 0, sizeof(t));
        t.tcm_family = AF_UNSPEC;
        memset(&d, 0, sizeof(d));
-       
+
        while (argc > 0) {
                if (strcmp(*argv, "dev") == 0) {
                        NEXT_ARG();
index 9cde14416e7fbf89cbf2d8528ed9d9038dece963..8cdb9a1df3c03dde0d0fb534fba2f09274861b7a 100644 (file)
@@ -450,7 +450,7 @@ void print_tcstats2_attr(FILE *fp, struct rtattr *rta, char *prefix, struct rtat
                fprintf(fp, " (dropped %u, overlimits %u requeues %u) ",
                        q.drops, q.overlimits, q.requeues);
        }
-                       
+
        if (tbs[TCA_STATS_RATE_EST]) {
                struct gnet_stats_rate_est re = {0};
                memcpy(&re, RTA_DATA(tbs[TCA_STATS_RATE_EST]), MIN(RTA_PAYLOAD(tbs[TCA_STATS_RATE_EST]), sizeof(re)));
@@ -490,7 +490,7 @@ void print_tcstats_attr(FILE *fp, struct rtattr *tb[], char *prefix, struct rtat
                memcpy(&st, RTA_DATA(tb[TCA_STATS]), MIN(RTA_PAYLOAD(tb[TCA_STATS]), sizeof(st)));
 
                fprintf(fp, "%sSent %llu bytes %u pkts (dropped %u, overlimits %u) ",
-                       prefix, (unsigned long long)st.bytes, st.packets, st.drops, 
+                       prefix, (unsigned long long)st.bytes, st.packets, st.drops,
                        st.overlimits);
 
                if (st.bps || st.pps || st.qlen || st.backlog) {
index 1aa1bdafb6923653e87316eabaafecd27671eead..0778693acf08e7151c93df59b1c47664c4706ede 100644 (file)
@@ -23,7 +23,7 @@ struct filter_util
 {
        struct filter_util *next;
        char    id[16];
-       int     (*parse_fopt)(struct filter_util *qu, char *fhandle, int argc, 
+       int     (*parse_fopt)(struct filter_util *qu, char *fhandle, int argc,
                              char **argv, struct nlmsghdr *n);
        int     (*print_fopt)(struct filter_util *qu, FILE *f, struct rtattr *opt, __u32 fhandle);
 };
@@ -32,7 +32,7 @@ struct action_util
 {
        struct  action_util *next;
        char    id[16];
-       int     (*parse_aopt)(struct action_util *a, int *argc, char ***argv, 
+       int     (*parse_aopt)(struct action_util *a, int *argc, char ***argv,
                              int code, struct nlmsghdr *n);
        int     (*print_aopt)(struct action_util *au, FILE *f, struct rtattr *opt);
        int     (*print_xstats)(struct action_util *au, FILE *f, struct rtattr *xstats);
@@ -72,9 +72,9 @@ extern int parse_police(int *, char ***, int, struct nlmsghdr *);
 extern char *action_n2a(int action, char *buf, int len);
 extern int  action_a2n(char *arg, int *result);
 extern int  act_parse_police(struct action_util *a,int *, char ***, int, struct nlmsghdr *);
-extern int  print_police(struct action_util *a, FILE *f, 
+extern int  print_police(struct action_util *a, FILE *f,
                         struct rtattr *tb);
-extern int  police_print_xstats(struct action_util *a,FILE *f, 
+extern int  police_print_xstats(struct action_util *a,FILE *f,
                                struct rtattr *tb);
 extern int  tc_print_action(FILE *f, const struct rtattr *tb);
 extern int  tc_print_ipt(FILE *f, const struct rtattr *tb);