Deleted Added
full compact
af_inet6.c (194799) af_inet6.c (197138)
1/*
2 * Copyright (c) 1983, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 15 unchanged lines hidden (view full) ---

24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30#ifndef lint
31static const char rcsid[] =
1/*
2 * Copyright (c) 1983, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 15 unchanged lines hidden (view full) ---

24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30#ifndef lint
31static const char rcsid[] =
32 "$FreeBSD: head/sbin/ifconfig/af_inet6.c 194799 2009-06-23 23:49:52Z delphij $";
32 "$FreeBSD: head/sbin/ifconfig/af_inet6.c 197138 2009-09-12 22:08:20Z hrs $";
33#endif /* not lint */
34
35#include <sys/param.h>
36#include <sys/ioctl.h>
37#include <sys/socket.h>
38#include <net/if.h>
39
40#include <err.h>

--- 21 unchanged lines hidden (view full) ---

62 .ifra_lifetime = { 0, 0, ND6_INFINITE_LIFETIME, ND6_INFINITE_LIFETIME } };
63static int ip6lifetime;
64
65static void in6_fillscopeid(struct sockaddr_in6 *sin6);
66static int prefix(void *, int);
67static char *sec2str(time_t);
68static int explicit_prefix = 0;
69
33#endif /* not lint */
34
35#include <sys/param.h>
36#include <sys/ioctl.h>
37#include <sys/socket.h>
38#include <net/if.h>
39
40#include <err.h>

--- 21 unchanged lines hidden (view full) ---

62 .ifra_lifetime = { 0, 0, ND6_INFINITE_LIFETIME, ND6_INFINITE_LIFETIME } };
63static int ip6lifetime;
64
65static void in6_fillscopeid(struct sockaddr_in6 *sin6);
66static int prefix(void *, int);
67static char *sec2str(time_t);
68static int explicit_prefix = 0;
69
70extern void setnd6flags(const char *, int, int, const struct afswtch *);
71extern void setnd6defif(const char *, int, int, const struct afswtch *);
72
70static char addr_buf[MAXHOSTNAMELEN *2 + 1]; /*for getnameinfo()*/
71
72static void
73setifprefixlen(const char *addr, int dummy __unused, int s,
74 const struct afswtch *afp)
75{
76 if (afp->af_getprefix != NULL)
77 afp->af_getprefix(addr, MASK);

--- 410 unchanged lines hidden (view full) ---

488 DEF_CMD_ARG("prefixlen", setifprefixlen),
489 DEF_CMD("anycast", IN6_IFF_ANYCAST, setip6flags),
490 DEF_CMD("tentative", IN6_IFF_TENTATIVE, setip6flags),
491 DEF_CMD("-tentative", -IN6_IFF_TENTATIVE, setip6flags),
492 DEF_CMD("deprecated", IN6_IFF_DEPRECATED, setip6flags),
493 DEF_CMD("-deprecated", -IN6_IFF_DEPRECATED, setip6flags),
494 DEF_CMD("autoconf", IN6_IFF_AUTOCONF, setip6flags),
495 DEF_CMD("-autoconf", -IN6_IFF_AUTOCONF, setip6flags),
73static char addr_buf[MAXHOSTNAMELEN *2 + 1]; /*for getnameinfo()*/
74
75static void
76setifprefixlen(const char *addr, int dummy __unused, int s,
77 const struct afswtch *afp)
78{
79 if (afp->af_getprefix != NULL)
80 afp->af_getprefix(addr, MASK);

--- 410 unchanged lines hidden (view full) ---

491 DEF_CMD_ARG("prefixlen", setifprefixlen),
492 DEF_CMD("anycast", IN6_IFF_ANYCAST, setip6flags),
493 DEF_CMD("tentative", IN6_IFF_TENTATIVE, setip6flags),
494 DEF_CMD("-tentative", -IN6_IFF_TENTATIVE, setip6flags),
495 DEF_CMD("deprecated", IN6_IFF_DEPRECATED, setip6flags),
496 DEF_CMD("-deprecated", -IN6_IFF_DEPRECATED, setip6flags),
497 DEF_CMD("autoconf", IN6_IFF_AUTOCONF, setip6flags),
498 DEF_CMD("-autoconf", -IN6_IFF_AUTOCONF, setip6flags),
499 DEF_CMD("accept_rtadv", ND6_IFF_ACCEPT_RTADV, setnd6flags),
500 DEF_CMD("-accept_rtadv",-ND6_IFF_ACCEPT_RTADV, setnd6flags),
501 DEF_CMD("defaultif", 1, setnd6defif),
502 DEF_CMD("-defaultif", -1, setnd6defif),
503 DEF_CMD("ifdisabled", ND6_IFF_IFDISABLED, setnd6flags),
504 DEF_CMD("-ifdisabled", -ND6_IFF_IFDISABLED, setnd6flags),
505 DEF_CMD("nud", ND6_IFF_PERFORMNUD, setnd6flags),
506 DEF_CMD("-nud", -ND6_IFF_PERFORMNUD, setnd6flags),
507 DEF_CMD("prefer_source",ND6_IFF_PREFER_SOURCE, setnd6flags),
508 DEF_CMD("-prefer_source",-ND6_IFF_PREFER_SOURCE,setnd6flags),
509 DEF_CMD("auto_linklocal",ND6_IFF_AUTO_LINKLOCAL,setnd6flags),
510 DEF_CMD("-auto_linklocal",-ND6_IFF_AUTO_LINKLOCAL,setnd6flags),
496 DEF_CMD_ARG("pltime", setip6pltime),
497 DEF_CMD_ARG("vltime", setip6vltime),
498 DEF_CMD("eui64", 0, setip6eui64),
499};
500
501static struct afswtch af_inet6 = {
502 .af_name = "inet6",
503 .af_af = AF_INET6,

--- 31 unchanged lines hidden ---
511 DEF_CMD_ARG("pltime", setip6pltime),
512 DEF_CMD_ARG("vltime", setip6vltime),
513 DEF_CMD("eui64", 0, setip6eui64),
514};
515
516static struct afswtch af_inet6 = {
517 .af_name = "inet6",
518 .af_af = AF_INET6,

--- 31 unchanged lines hidden ---