af_inet6.c (166956) | af_inet6.c (194799) |
---|---|
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 166956 2007-02-24 23:55:46Z sam $"; | 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 = | 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 { { 0 }, 62 { 0 }, 63 { 0 }, 64 { 0 }, 65 0, 66 { 0, 0, ND6_INFINITE_LIFETIME, ND6_INFINITE_LIFETIME } }; | 61 { .ifra_flags = 0, 62 .ifra_lifetime = { 0, 0, ND6_INFINITE_LIFETIME, ND6_INFINITE_LIFETIME } }; |
67static int ip6lifetime; 68 69static void in6_fillscopeid(struct sockaddr_in6 *sin6); 70static int prefix(void *, int); 71static char *sec2str(time_t); 72static int explicit_prefix = 0; 73 74static char addr_buf[MAXHOSTNAMELEN *2 + 1]; /*for getnameinfo()*/ --- 442 unchanged lines hidden (view full) --- 517 .af_addreq = &in6_addreq, 518}; 519 520static void 521in6_Lopt_cb(const char *optarg __unused) 522{ 523 ip6lifetime++; /* print IPv6 address lifetime */ 524} | 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} |
525static struct option in6_Lopt = { "L", "[-L]", in6_Lopt_cb }; | 521static struct option in6_Lopt = { .opt = "L", .opt_usage = "[-L]", .cb = in6_Lopt_cb }; |
526 527static __constructor void 528inet6_ctor(void) 529{ 530#define N(a) (sizeof(a) / sizeof(a[0])) | 522 523static __constructor void 524inet6_ctor(void) 525{ 526#define N(a) (sizeof(a) / sizeof(a[0])) |
531 int i; | 527 size_t i; |
532 533 for (i = 0; i < N(inet6_cmds); i++) 534 cmd_register(&inet6_cmds[i]); 535 af_register(&af_inet6); 536 opt_register(&in6_Lopt); 537#undef N 538} | 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} |