summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpctl/parser.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2009-06-12 16:44:03 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2009-06-12 16:44:03 +0000
commitf90ff286153c91e2c33a026841e33cfacbbcd1cb (patch)
treee5b1aca3fac586cd4f394b2c6e695734621c9091 /usr.sbin/bgpctl/parser.c
parent66fbd863110e4a15f0f9ed66a4bbdd88f88f3931 (diff)
Kill copies of prefixlen2mask and inet6applymask their now in util.c
Diffstat (limited to 'usr.sbin/bgpctl/parser.c')
-rw-r--r--usr.sbin/bgpctl/parser.c29
1 files changed, 1 insertions, 28 deletions
diff --git a/usr.sbin/bgpctl/parser.c b/usr.sbin/bgpctl/parser.c
index 5e5340e1dbb..bc6d0783e5a 100644
--- a/usr.sbin/bgpctl/parser.c
+++ b/usr.sbin/bgpctl/parser.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parser.c,v 1.53 2009/06/06 06:05:41 claudio Exp $ */
+/* $OpenBSD: parser.c,v 1.54 2009/06/12 16:44:02 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -876,33 +876,6 @@ parse_nexthop(const char *word, struct parse_result *r)
return (1);
}
-/* XXX local copies from kroute.c, should go to a shared file */
-in_addr_t
-prefixlen2mask(u_int8_t prefixlen)
-{
- if (prefixlen == 0)
- return (0);
-
- return (0xffffffff << (32 - prefixlen));
-}
-
-void
-inet6applymask(struct in6_addr *dest, const struct in6_addr *src, int prefixlen)
-{
- struct in6_addr mask;
- int i;
-
- bzero(&mask, sizeof(mask));
- for (i = 0; i < prefixlen / 8; i++)
- mask.s6_addr[i] = 0xff;
- i = prefixlen % 8;
- if (i)
- mask.s6_addr[prefixlen / 8] = 0xff00 >> i;
-
- for (i = 0; i < 16; i++)
- dest->s6_addr[i] = src->s6_addr[i] & mask.s6_addr[i];
-}
-
int
bgpctl_getopt(int *argc, char **argv[], int type)
{