]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/net/flowadv.h
xnu-7195.101.1.tar.gz
[apple/xnu.git] / bsd / net / flowadv.h
index 96e6e9e9c1e80fea10a36b2fd9da58afbdef6705..cc5e6c97899e8385dd38adaea580676db8680ff1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012 Apple Inc. All rights reserved.
+ * Copyright (c) 2012-2020 Apple Inc. All rights reserved.
  *
  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  *
  */
 
 #ifndef _NET_FLOWADV_H_
-#define        _NET_FLOWADV_H_
+#define _NET_FLOWADV_H_
 
+#ifdef KERNEL_PRIVATE
 #include <sys/types.h>
+#include <sys/queue.h>
 
-#ifdef  __cplusplus
-extern "C" {
-#endif
 
-#define        FADV_SUCCESS            0       /* success */
-#define        FADV_FLOW_CONTROLLED    1       /* regular flow control */
-#define        FADV_SUSPENDED          2       /* flow control due to suspension */
+#define FADV_SUCCESS            0       /* success */
+#define FADV_FLOW_CONTROLLED    1       /* regular flow control */
+#define FADV_SUSPENDED          2       /* flow control due to suspension */
 
 struct flowadv {
-       int32_t         code;           /* FADV advisory code */
+       int32_t         code;           /* FADV advisory code */
 };
 
-#ifdef  __cplusplus
-}
-#endif
+#ifdef BSD_KERNEL_PRIVATE
+struct flowadv_fcentry {
+       STAILQ_ENTRY(flowadv_fcentry) fce_link;
+       u_int32_t       fce_flowsrc_type;       /* FLOWSRC values */
+       u_int32_t       fce_flowid;
+};
+
+STAILQ_HEAD(flowadv_fclist, flowadv_fcentry);
+
+__BEGIN_DECLS
+
+extern void flowadv_init(void);
+extern struct flowadv_fcentry *flowadv_alloc_entry(int);
+extern void flowadv_free_entry(struct flowadv_fcentry *);
+extern void flowadv_add(struct flowadv_fclist *);
+extern void flowadv_add_entry(struct flowadv_fcentry *);
+extern void flowadv_reap_caches(boolean_t);
+
+__END_DECLS
 
+#endif /* BSD_KERNEL_PRIVATE */
+#endif /* KERNEL_PRIVATE */
 #endif /* _NET_FLOWADV_H_ */