/*
- * Copyright (c) 2000-2013 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2018 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
*/
#ifndef _NET_IF_GIF_H_
-#define _NET_IF_GIF_H_
+#define _NET_IF_GIF_H_
#include <sys/appleapiopts.h>
#include <netinet/in.h>
struct encaptab;
struct gif_softc {
- ifnet_t gif_if; /* pointer back to the interface */
- struct sockaddr *gif_psrc; /* Physical src addr */
- struct sockaddr *gif_pdst; /* Physical dst addr */
+ ifnet_t gif_if; /* pointer back to the interface */
+ struct sockaddr *gif_psrc; /* Physical src addr */
+ struct sockaddr *gif_pdst; /* Physical dst addr */
#ifdef __APPLE__
protocol_family_t gif_proto; /* dlil protocol attached */
#endif
struct route_in6 gifscr_ro6; /* xxx */
#endif
} gifsc_gifscr;
- int gif_flags;
- int gif_called;
+ int gif_flags;
+#define IFGIF_DETACHING 0x1
+ int gif_called;
const struct encaptab *encap_cookie4;
const struct encaptab *encap_cookie6;
TAILQ_ENTRY(gif_softc) gif_link; /* all gif's are linked */
- bpf_tap_mode tap_mode;
+ bpf_tap_mode tap_mode;
bpf_packet_func tap_callback;
- char gif_ifname[IFNAMSIZ];
- decl_lck_mtx_data(, gif_lock); /* lock for gif softc structure */
+ char gif_ifname[IFNAMSIZ];
+ decl_lck_mtx_data(, gif_lock); /* lock for gif softc structure */
};
-#define GIF_LOCK(_sc) lck_mtx_lock(&(_sc)->gif_lock)
-#define GIF_UNLOCK(_sc) lck_mtx_unlock(&(_sc)->gif_lock)
-#define GIF_LOCK_ASSERT(_sc) lck_mtx_assert(&(_sc)->gif_lock, \
+#define GIF_LOCK(_sc) lck_mtx_lock(&(_sc)->gif_lock)
+#define GIF_UNLOCK(_sc) lck_mtx_unlock(&(_sc)->gif_lock)
+#define GIF_LOCK_ASSERT(_sc) LCK_MTX_ASSERT(&(_sc)->gif_lock, \
LCK_MTX_ASSERT_OWNED)
-#define gif_ro gifsc_gifscr.gifscr_ro
+#define gif_ro gifsc_gifscr.gifscr_ro
#if INET6
-#define gif_ro6 gifsc_gifscr.gifscr_ro6
+#define gif_ro6 gifsc_gifscr.gifscr_ro6
#endif
#endif /* BSD_KERNEL_PRIVATE */
-#define GIF_MTU (1280) /* Default MTU */
-#define GIF_MTU_MIN (1280) /* Minimum MTU */
-#define GIF_MTU_MAX (8192) /* Maximum MTU */
+#define GIF_MTU (1280) /* Default MTU */
+#define GIF_MTU_MIN (1280) /* Minimum MTU */
+#define GIF_MTU_MAX (8192) /* Maximum MTU */
#endif /* _NET_IF_GIF_H_ */