Deleted Added
sdiff udiff text old ( 166956 ) new ( 194799 )
full compact
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 $";
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>

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

53#include <netdb.h>
54
55#include <netinet6/nd6.h> /* Define ND6_INFINITE_LIFETIME */
56
57#include "ifconfig.h"
58
59static struct in6_ifreq in6_ridreq;
60static struct in6_aliasreq in6_addreq =
61 { .ifra_flags = 0,
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
70static char addr_buf[MAXHOSTNAMELEN *2 + 1]; /*for getnameinfo()*/

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

513 .af_addreq = &in6_addreq,
514};
515
516static void
517in6_Lopt_cb(const char *optarg __unused)
518{
519 ip6lifetime++; /* print IPv6 address lifetime */
520}
521static struct option in6_Lopt = { .opt = "L", .opt_usage = "[-L]", .cb = in6_Lopt_cb };
522
523static __constructor void
524inet6_ctor(void)
525{
526#define N(a) (sizeof(a) / sizeof(a[0]))
527 size_t i;
528
529 for (i = 0; i < N(inet6_cmds); i++)
530 cmd_register(&inet6_cmds[i]);
531 af_register(&af_inet6);
532 opt_register(&in6_Lopt);
533#undef N
534}