Commit ca6a9548 authored by Phil Blundell's avatar Phil Blundell

Rename utils.c to util-ank.c to avoid confusion with util.c.

Remove the traffic-class-related stuff; it doesn't seem to be
used and was causing compiles to fail on old systems.
parent b7afac50
......@@ -21,7 +21,7 @@ AFOBJS = unix.o inet.o inet6.o ax25.o ipx.o ddp.o ipx.o netrom.o af.o rose.o ec
AFGROBJS = inet_gr.o inet6_gr.o ipx_gr.o ddp_gr.o netrom_gr.o ax25_gr.o rose_gr.o getroute.o
AFSROBJS = inet_sr.o inet6_sr.o netrom_sr.o ipx_sr.o setroute.o
ACTOBJS = slip_ac.o ppp_ac.o activate.o
VARIA = getargs.o masq_info.o proc.o util.o nstrcmp.o interface.o sockets.o utils.o
VARIA = getargs.o masq_info.o proc.o util.o nstrcmp.o interface.o sockets.o util-ank.o
OBJS = $(sort $(VARIA) $(AFOBJS) $(HWOBJS) \
$(AFGROBJS) $(AFSROBJS) $(ACTOBJS))
......
......@@ -26,7 +26,6 @@
#include <arpa/inet.h>
#include <resolv.h>
#include <asm/types.h>
#include <linux/pkt_sched.h>
#include "utils.h"
......@@ -142,61 +141,6 @@ int get_s8(__s8 *val, char *arg, int base)
return 0;
}
int get_tc_classid(__u32 *h, char *str)
{
__u32 maj, min;
char *p;
maj = TC_H_ROOT;
if (strcmp(str, "root") == 0)
goto ok;
maj = TC_H_UNSPEC;
if (strcmp(str, "none") == 0)
goto ok;
maj = strtoul(str, &p, 16);
if (p == str) {
maj = 0;
if (*p != ':')
return -1;
}
if (*p == ':') {
maj <<= 16;
str = p+1;
min = strtoul(str, &p, 16);
if (*p != 0)
return -1;
maj |= min;
} else if (*p != 0)
return -1;
ok:
*h = maj;
return 0;
}
int print_tc_classid(char *buf, int len, __u32 h)
{
if (h == TC_H_ROOT)
sprintf(buf, "root");
else if (h == TC_H_UNSPEC)
snprintf(buf, len, "none");
else if (TC_H_MAJ(h) == 0)
snprintf(buf, len, ":%x", TC_H_MIN(h));
else if (TC_H_MIN(h) == 0)
snprintf(buf, len, "%x:", TC_H_MAJ(h)>>16);
else
snprintf(buf, len, "%x:%x", TC_H_MAJ(h)>>16, TC_H_MIN(h));
return 0;
}
char * sprint_tc_classid(__u32 h, char *buf)
{
if (print_tc_classid(buf, SPRINT_BSIZE-1, h))
strcpy(buf, "???");
return buf;
}
int get_addr_1(inet_prefix *addr, char *name, int family)
{
char *cp;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment