/*      $NetBSD: nd6.h,v 1.1 2020/06/12 15:25:26 roy Exp $      */
/*-
* Copyright (c) 2020 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Roy Marples.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
*    notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
*    notice, this list of conditions and the following disclaimer in the
*    documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef _COMPAT_NETINET6_ND6_H_
#define _COMPAT_NETINET6_ND6_H_

struct nd_ifinfo90 {
       u_int32_t linkmtu;              /* LinkMTU */
       u_int32_t maxmtu;               /* Upper bound of LinkMTU */
       u_int32_t basereachable;        /* BaseReachableTime */
       u_int32_t reachable;            /* Reachable Time */
       u_int32_t retrans;              /* Retrans Timer */
       u_int32_t flags;                /* Flags */
       int recalctm;                   /* BaseReacable re-calculation timer */
       u_int8_t chlim;                 /* CurHopLimit */
       u_int8_t initialized; /* Flag to see the entry is initialized */
       /* the following 3 members are for privacy extension for addrconf */
       u_int8_t randomseed0[8]; /* upper 64 bits of MD5 digest */
       u_int8_t randomseed1[8]; /* lower 64 bits (usually the EUI64 IFID) */
       u_int8_t randomid[8];   /* current random ID */
};

struct  in6_ondireq {
       char ifname[IFNAMSIZ];
       struct {
               u_int32_t linkmtu;      /* LinkMTU */
               u_int32_t maxmtu;       /* Upper bound of LinkMTU */
               u_int32_t basereachable; /* BaseReachableTime */
               u_int32_t reachable;    /* Reachable Time */
               u_int32_t retrans;      /* Retrans Timer */
               u_int32_t flags;        /* Flags */
               int recalctm;           /* BaseReacable re-calculation timer */
               u_int8_t chlim;         /* CurHopLimit */
               u_int8_t receivedra;
       } ndi;
};

struct  in6_ndireq90 {
       char ifname[IFNAMSIZ];
       struct nd_ifinfo90 ndi;
};

struct  in6_ndifreq90 {
       char ifname[IFNAMSIZ];
       u_long ifindex;
};

#define DRLSTSIZ 10
#define PRLSTSIZ 10
struct  in6_drlist {
       char ifname[IFNAMSIZ];
       struct {
               struct  in6_addr rtaddr;
               u_char  flags;
               u_short rtlifetime;
               u_long  expire;
               u_short if_index;
       } defrouter[DRLSTSIZ];
};

struct  in6_oprlist {
       char ifname[IFNAMSIZ];
       struct {
               struct  in6_addr prefix;
               struct prf_ra raflags;
               u_char  prefixlen;
               u_char  origin;
               u_long vltime;
               u_long pltime;
               u_long expire;
               u_short if_index;
               u_short advrtrs; /* number of advertisement routers */
               struct  in6_addr advrtr[DRLSTSIZ]; /* XXX: explicit limit */
       } prefix[PRLSTSIZ];
};

struct  in6_prlist {
       char ifname[IFNAMSIZ];
       struct {
               struct  in6_addr prefix;
               struct prf_ra raflags;
               u_char  prefixlen;
               u_char  origin;
               u_int32_t vltime;
               u_int32_t pltime;
               time_t expire;
               u_short if_index;
               u_short advrtrs; /* number of advertisement routers */
               struct  in6_addr advrtr[DRLSTSIZ]; /* XXX: explicit limit */
       } prefix[PRLSTSIZ];
};

#endif /* !_COMPAT_NETINET6_ND6_H_ */