]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/netinet6/in6_var.h
xnu-7195.50.7.100.1.tar.gz
[apple/xnu.git] / bsd / netinet6 / in6_var.h
index bd1a424ae04d519c14007aeec541b3279d517c3d..26f61ad7c371c8ce141b393fb6aa1eced371ffc2 100644 (file)
@@ -165,6 +165,9 @@ struct in6_ifaddr {
        TAILQ_ENTRY(in6_ifaddr) ia6_hash; /* hash bucket entry */
        int ia6_flags;
 
+       /* cga collision count */
+       uint8_t   ia6_cga_collision_count;
+
        struct in6_addrlifetime_i ia6_lifetime;
        /*
         * the creation time of this address, which is
@@ -392,50 +395,21 @@ struct in6_cga_nodecfg {
        struct in6_cga_prepare cga_prepare;
 };
 
-/*
- * XXX in6_llstartreq will be removed once
- * configd adopts the more generically named
- * in6_cgareq structure.
- */
-struct in6_llstartreq {
-       char llsr_name[IFNAMSIZ];
-       int llsr_flags;
-       struct in6_cga_prepare llsr_cgaprep;
-       struct in6_addrlifetime llsr_lifetime;
-};
-
 struct in6_cgareq {
        char cgar_name[IFNAMSIZ];
        int cgar_flags;
        struct in6_cga_prepare cgar_cgaprep;
        struct in6_addrlifetime cgar_lifetime;
+       uint8_t cgar_collision_count;
 };
 
 #ifdef BSD_KERNEL_PRIVATE
-/*
- * XXX Corresponding versions of in6_llstartreq
- * will be removed after the new in6_cgareq is
- * adopted by configd
- */
-struct in6_llstartreq_32 {
-       char llsr_name[IFNAMSIZ];
-       int llsr_flags;
-       struct in6_cga_prepare llsr_cgaprep;
-       struct in6_addrlifetime_32 llsr_lifetime;
-};
-
-struct in6_llstartreq_64 {
-       char llsr_name[IFNAMSIZ];
-       int llsr_flags;
-       struct in6_cga_prepare llsr_cgaprep;
-       struct in6_addrlifetime_64 llsr_lifetime;
-};
-
 struct in6_cgareq_32 {
        char cgar_name[IFNAMSIZ];
        int cgar_flags;
        struct in6_cga_prepare cgar_cgaprep;
        struct in6_addrlifetime_32 cgar_lifetime;
+       uint8_t cgar_collision_count;
 };
 
 struct in6_cgareq_64 {
@@ -443,6 +417,7 @@ struct in6_cgareq_64 {
        int cgar_flags;
        struct in6_cga_prepare cgar_cgaprep;
        struct in6_addrlifetime_64 cgar_lifetime;
+       uint8_t cgar_collision_count;
 };
 
 #endif /* !BSD_KERNEL_PRIVATE */
@@ -740,10 +715,37 @@ void in6_post_msg(struct ifnet *, u_int32_t, struct in6_ifaddr *, uint8_t *mac);
 #endif /* BSD_KERNEL_PRIVATE */
 
 /*
- * enable/disable IPv6 router mode on interface.
+ * SIOCSETROUTERMODE_IN6
+ * Set the IPv6 router mode on an interface.
+ *
+ * IPV6_ROUTER_MODE_DISABLED
+ * - disable IPv6 router mode if it is enabled
+ * - if the previous mode was IPV6_ROUTER_MODE_EXCUSIVE,
+ *   scrubs all IPv6 auto-configured addresses
+ *
+ * IPV6_ROUTER_MODE_EXCLUSIVE
+ * - act exclusively as an IPv6 router on the interface
+ * - disables accepting external Router Advertisements
+ * - scrubs all IPv6 auto-configured addresses
+ * - disables optimistic dad
+ * - disables ND6 prefix proxy, if enabled
+ * - used by the internet sharing/personal hotspot feature
+ *
+ * IPV6_ROUTER_MODE_HYBRID
+ * - act as both an IPv6 router and IPv6 client on the interface
+ * - does not modify whether to accept Router Advertisements
+ * - does not scrub any addresses
+ * - used when acting as the gateway/router for an otherwise isolated
+ *   network whose existence is likely advertised via a
+ *   a Route Information Option in a Router Advertisement
  */
+#define IPV6_ROUTER_MODE_DISABLED       0
+#define IPV6_ROUTER_MODE_EXCLUSIVE      1
+#define IPV6_ROUTER_MODE_HYBRID         2
 #define SIOCSETROUTERMODE_IN6   _IOWR('i', 136, struct in6_ifreq)
 
+#define SIOCGETROUTERMODE_IN6   _IOWR('i', 137, struct in6_ifreq)
+
 /*
  * start secure link-local interface addresses
  */
@@ -753,8 +755,17 @@ void in6_post_msg(struct ifnet *, u_int32_t, struct in6_ifaddr *, uint8_t *mac);
 #define SIOCLL_CGASTART_64      _IOW('i', 160, struct in6_cgareq_64)
 #endif
 
+/*
+ * get/set the CGA parameters
+ */
 #define SIOCGIFCGAPREP_IN6      _IOWR('i', 187, struct in6_cgareq)
 #define SIOCSIFCGAPREP_IN6      _IOWR('i', 188, struct in6_cgareq)
+#ifdef BSD_KERNEL_PRIVATE
+#define SIOCGIFCGAPREP_IN6_32   _IOWR('i', 187, struct in6_cgareq_32)
+#define SIOCGIFCGAPREP_IN6_64   _IOWR('i', 187, struct in6_cgareq_64)
+#define SIOCSIFCGAPREP_IN6_32   _IOWR('i', 188, struct in6_cgareq_32)
+#define SIOCSIFCGAPREP_IN6_64   _IOWR('i', 188, struct in6_cgareq_64)
+#endif
 
 #define SIOCCLAT46_START        _IOWR('i', 189, struct in6_ifreq)
 #define SIOCCLAT46_STOP         _IOWR('i', 190, struct in6_ifreq)
@@ -1197,12 +1208,14 @@ extern int in6_cga_stop(void);
 extern ssize_t in6_cga_parameters_prepare(void *, size_t,
     const struct in6_addr *, u_int8_t, const struct in6_cga_modifier *);
 extern int in6_cga_generate(struct in6_cga_prepare *, u_int8_t,
-    struct in6_addr *);
+    struct in6_addr *, struct ifnet *);
 extern int in6_getconninfo(struct socket *, sae_connid_t, uint32_t *,
     uint32_t *, int32_t *, user_addr_t, socklen_t *,
     user_addr_t, socklen_t *, uint32_t *, user_addr_t, uint32_t *);
 extern void in6_ip6_to_sockaddr(const struct in6_addr *ip6, u_int16_t port,
     struct sockaddr_in6 *sin6, u_int32_t maxlen);
+extern void in6_cgareq_copy_from_user(const void *, int,
+    struct in6_cgareq *cgareq);
 
 #endif /* BSD_KERNEL_PRIVATE */
 #endif /* _NETINET6_IN6_VAR_H_ */