]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/net/route.h
xnu-3789.31.2.tar.gz
[apple/xnu.git] / bsd / net / route.h
index d382013dad9183952e6848f00a1ac1f3a4c1a0e4..4ceed51bfa612419516223039695cb574b27c218 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2013 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2016 Apple Inc. All rights reserved.
  *
  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  *
@@ -168,6 +168,7 @@ struct route {
  * gateway rather than the ultimate destination.
  */
 
+#define        NRTT_HIST       10
 /*
  * Kernel routing entry structure.
  */
@@ -193,6 +194,7 @@ struct rtentry {
            (struct rtentry *, struct ifnet_llreach_info *);
        void (*rt_llinfo_purge)(struct rtentry *); /* llinfo purge fn */
        void (*rt_llinfo_free)(void *); /* link level info free function */
+       void (*rt_llinfo_refresh) (struct rtentry *); /* expedite llinfo refresh */
        struct rt_metrics rt_rmx;       /* metrics used by rx'ing protocols */
 #define        rt_use rt_rmx.rmx_pksent
        struct rtentry *rt_gwroute;     /* implied entry for gatewayed routes */
@@ -204,6 +206,10 @@ struct rtentry {
        uint64_t rt_expire;             /* expiration time in uptime seconds */
        uint64_t base_calendartime;     /* calendar time upon entry creation */
        uint64_t base_uptime;           /* uptime upon entry creation */
+       u_int32_t rtt_hist[NRTT_HIST];  /* RTT history sample by TCP connections */
+       u_int32_t rtt_min;              /* minimum RTT computed from history */
+       u_int32_t rtt_expire_ts;        /* RTT history expire timestamp */
+       u_int8_t rtt_index;             /* Index into RTT history */
 };
 
 /*
@@ -307,6 +313,11 @@ struct rt_msghdr2 {
 };
 
 #ifdef PRIVATE
+struct kev_netevent_apnfallbk_data {
+       pid_t           epid;           /* effective PID */
+       uuid_t          euuid;          /* effective UUID */
+};
+
 /*
  * Route reachability info.
  */
@@ -350,7 +361,8 @@ struct rt_msghdr_ext {
 #define        RTM_DELETE      0x2     /* Delete Route */
 #define        RTM_CHANGE      0x3     /* Change Metrics or flags */
 #define        RTM_GET         0x4     /* Report Metrics */
-#define        RTM_LOSING      0x5     /* Kernel Suspects Partitioning */
+#define        RTM_LOSING      0x5     /* RTM_LOSING is no longer generated by xnu
+                                  and is deprecated */
 #define        RTM_REDIRECT    0x6     /* Told to use different route */
 #define        RTM_MISS        0x7     /* Lookup failed on this address */
 #define        RTM_LOCK        0x8     /* fix specified metrics */
@@ -383,6 +395,9 @@ struct rt_msghdr_ext {
 #define        RTV_SSTHRESH    0x20    /* init or lock _ssthresh */
 #define        RTV_RTT         0x40    /* init or lock _rtt */
 #define        RTV_RTTVAR      0x80    /* init or lock _rttvar */
+#ifdef PRIVATE
+#define        RTV_REFRESH_HOST        0x100   /* init host route to expedite refresh */
+#endif
 
 /*
  * Bitmask values for rtm_addrs.
@@ -575,5 +590,8 @@ extern void rt_str(struct rtentry *, char *, uint32_t, char *, uint32_t);
 extern const char *rtm2str(int);
 extern void route_copyin(struct route *, struct route *, size_t);
 extern void route_copyout(struct route *, const struct route *, size_t);
+extern boolean_t rt_ifa_is_dst(struct sockaddr *, struct ifaddr *);
+extern struct sockaddr *sa_copy(struct sockaddr *, struct sockaddr_storage *,
+    unsigned int *);
 #endif /* BSD_KERNEL_PRIVATE */
 #endif /* _NET_ROUTE_H_ */