]> rtime.felk.cvut.cz Git - lisovros/iproute2_canprio.git/commitdiff
Remove #ifdef's
authorStephen Hemminger <stephen.hemminger@vyatta.com>
Sat, 26 Feb 2011 04:00:54 +0000 (20:00 -0800)
committerStephen Hemminger <stephen.hemminger@vyatta.com>
Sat, 26 Feb 2011 04:00:54 +0000 (20:00 -0800)
The iproute package keeps its own headers so there is no need
of polluting code with #ifdef's

ip/ipaddress.c
ip/iplink.c
ip/ipneigh.c
ip/iproute.c
lib/ll_proto.c

index 524ea0185af0a936f5f7bc0fe9ee5cf6882bb1b5..a7350af42941d7ba0e86118287aea6c3b43dceee 100644 (file)
@@ -278,12 +278,10 @@ int print_linkinfo(const struct sockaddr_nl *who,
                fprintf(fp, "mtu %u ", *(int*)RTA_DATA(tb[IFLA_MTU]));
        if (tb[IFLA_QDISC])
                fprintf(fp, "qdisc %s ", (char*)RTA_DATA(tb[IFLA_QDISC]));
-#ifdef IFLA_MASTER
        if (tb[IFLA_MASTER]) {
                SPRINT_BUF(b1);
                fprintf(fp, "master %s ", ll_idx_n2a(*(int*)RTA_DATA(tb[IFLA_MASTER]), b1));
        }
-#endif
        if (tb[IFLA_OPERSTATE])
                print_operstate(fp, *(__u8 *)RTA_DATA(tb[IFLA_OPERSTATE]));
                
index 8c92bb1c1ed6dc8351fe11e166602cd947c28861..48c025480a786ba5d5d07168521930eac717fe45 100644 (file)
@@ -364,7 +364,6 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req,
                        if (len < 0)
                                return -1;
                        addattr_nest_end(&req->n, vflist);
-#ifdef IFLA_MASTER
                } else if (matches(*argv, "master") == 0) {
                        int ifindex;
                        NEXT_ARG();
@@ -377,8 +376,6 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req,
                        int ifindex = 0;
                        addattr_l(&req->n, sizeof(*req), IFLA_MASTER,
                                  &ifindex, 4);
-#endif
-#ifdef IFF_DYNAMIC
                } else if (matches(*argv, "dynamic") == 0) {
                        NEXT_ARG();
                        req->i.ifi_change |= IFF_DYNAMIC;
@@ -388,7 +385,6 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req,
                                req->i.ifi_flags &= ~IFF_DYNAMIC;
                        } else
                                return on_off("dynamic");
-#endif
                } else if (matches(*argv, "type") == 0) {
                        NEXT_ARG();
                        *type = *argv;
@@ -829,7 +825,6 @@ static int do_set(int argc, char **argv)
                                flags |= IFF_NOARP;
                        } else
                                return on_off("noarp");
-#ifdef IFF_DYNAMIC
                } else if (matches(*argv, "dynamic") == 0) {
                        NEXT_ARG();
                        mask |= IFF_DYNAMIC;
@@ -839,7 +834,6 @@ static int do_set(int argc, char **argv)
                                flags &= ~IFF_DYNAMIC;
                        } else
                                return on_off("dynamic");
-#endif
                } else {
                         if (strcmp(*argv, "dev") == 0) {
                                NEXT_ARG();
index 2d96ab7c61f9d591f3d198a218e417d578dc8972..dff9eb4637c52480cf2ea33ad1577fd64dd5430f 100644 (file)
@@ -277,12 +277,10 @@ int print_neigh(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
                       ci->ndm_confirmed/hz, ci->ndm_updated/hz);
        }
 
-#ifdef NDA_PROBES
        if (tb[NDA_PROBES] && show_stats) {
                __u32 p = *(__u32 *) RTA_DATA(tb[NDA_PROBES]);
                fprintf(fp, " probes %u", p);
        }
-#endif
 
        if (r->ndm_state) {
                int nud = r->ndm_state;
index 06d2507ca035d8bf2da077e8e5435d18eb3a884d..2fef35b767eb275da3aeca2375bd5ab524ca7792 100644 (file)
@@ -478,12 +478,11 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
                                if (ci->rta_lastuse != 0)
                                        fprintf(fp, " age %dsec", ci->rta_lastuse/hz);
                        }
-#ifdef RTNETLINK_HAVE_PEERINFO
                        if (ci->rta_id)
                                fprintf(fp, " ipid 0x%04x", ci->rta_id);
                        if (ci->rta_ts || ci->rta_tsage)
-                               fprintf(fp, " ts 0x%x tsage %dsec", ci->rta_ts, ci->rta_tsage);
-#endif
+                               fprintf(fp, " ts 0x%x tsage %dsec",
+                                       ci->rta_ts, ci->rta_tsage);
                }
        } else if (r->rtm_family == AF_INET6) {
                struct rta_cacheinfo *ci = NULL;
@@ -792,7 +791,6 @@ int iproute_modify(int cmd, unsigned flags, int argc, char **argv)
                        if (get_unsigned(&mtu, *argv, 0))
                                invarg("\"mtu\" value is invalid\n", *argv);
                        rta_addattr32(mxrta, sizeof(mxbuf), RTAX_MTU, mtu);
-#ifdef RTAX_HOPLIMIT
                } else if (strcmp(*argv, "hoplimit") == 0) {
                        unsigned hoplimit;
                        NEXT_ARG();
@@ -803,8 +801,6 @@ int iproute_modify(int cmd, unsigned flags, int argc, char **argv)
                        if (get_unsigned(&hoplimit, *argv, 0))
                                invarg("\"hoplimit\" value is invalid\n", *argv);
                        rta_addattr32(mxrta, sizeof(mxbuf), RTAX_HOPLIMIT, hoplimit);
-#endif
-#ifdef RTAX_ADVMSS
                } else if (strcmp(*argv, "advmss") == 0) {
                        unsigned mss;
                        NEXT_ARG();
@@ -815,8 +811,6 @@ int iproute_modify(int cmd, unsigned flags, int argc, char **argv)
                        if (get_unsigned(&mss, *argv, 0))
                                invarg("\"mss\" value is invalid\n", *argv);
                        rta_addattr32(mxrta, sizeof(mxbuf), RTAX_ADVMSS, mss);
-#endif
-#ifdef RTAX_REORDERING
                } else if (matches(*argv, "reordering") == 0) {
                        unsigned reord;
                        NEXT_ARG();
@@ -827,7 +821,6 @@ int iproute_modify(int cmd, unsigned flags, int argc, char **argv)
                        if (get_unsigned(&reord, *argv, 0))
                                invarg("\"reordering\" value is invalid\n", *argv);
                        rta_addattr32(mxrta, sizeof(mxbuf), RTAX_REORDERING, reord);
-#endif
                } else if (strcmp(*argv, "rtt") == 0) {
                        unsigned rtt;
                        NEXT_ARG();
index cdd1602e35f99a2916a46d817cce2991a07b0869..2277cda384693d2185f83a1a32c2448158bb75db 100644 (file)
@@ -36,19 +36,13 @@ static struct {
 } llproto_names[] = {
 __PF(LOOP,loop)
 __PF(PUP,pup)
-#ifdef ETH_P_PUPAT
 __PF(PUPAT,pupat)
-#endif
 __PF(IP,ip)
 __PF(X25,x25)
 __PF(ARP,arp)
 __PF(BPQ,bpq)
-#ifdef ETH_P_IEEEPUP
 __PF(IEEEPUP,ieeepup)
-#endif
-#ifdef ETH_P_IEEEPUPAT
 __PF(IEEEPUPAT,ieeepupat)
-#endif
 __PF(DEC,dec)
 __PF(DNA_DL,dna_dl)
 __PF(DNA_RC,dna_rc)
@@ -62,19 +56,10 @@ __PF(ATALK,atalk)
 __PF(AARP,aarp)
 __PF(IPX,ipx)
 __PF(IPV6,ipv6)
-#ifdef ETH_P_PPP_DISC
 __PF(PPP_DISC,ppp_disc)
-#endif
-#ifdef ETH_P_PPP_SES
 __PF(PPP_SES,ppp_ses)
-#endif
-#ifdef ETH_P_ATMMPOA
 __PF(ATMMPOA,atmmpoa)
-#endif
-#ifdef ETH_P_ATMFATE
 __PF(ATMFATE,atmfate)
-#endif
-
 __PF(802_3,802_3)
 __PF(AX25,ax25)
 __PF(ALL,all)
@@ -90,9 +75,7 @@ __PF(TR_802_2,tr_802_2)
 __PF(MOBITEX,mobitex)
 __PF(CONTROL,control)
 __PF(IRDA,irda)
-#ifdef ETH_P_ECONET
 __PF(ECONET,econet)
-#endif
 __PF(TIPC,tipc)
 __PF(AOE,aoe)