/*
- * Copyright (c) 2000-2013 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2016 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
#define BIOCSETFNR64 _IOW('B',126, struct bpf_program64)
#define BIOCSETFNR32 _IOW('B',126, struct bpf_program32)
#endif /* KERNEL_PRIVATE */
-
+#ifdef PRIVATE
+#define BIOCGWANTPKTAP _IOR('B', 127, u_int)
+#define BIOCSWANTPKTAP _IOWR('B', 127, u_int)
+#define BIOCSHEADDROP _IOW('B', 128, int)
+#define BIOCGHEADDROP _IOR('B', 128, int)
+#endif /* PRIVATE */
/*
* Structure prepended to each packet.
*/
#define BPF_HDR_EXT_FLAGS_DIR_OUT 0x0001
pid_t bh_pid; /* process PID */
char bh_comm[MAXCOMLEN+1]; /* process command */
- u_char _bh_pad2[2];
+ u_char _bh_pad2[1];
+ u_char bh_pktflags;
+#define BPF_PKTFLAGS_TCP_REXMT 0x0001
+#define BPF_PKTFLAGS_START_SEQ 0x0002
+#define BPF_PKTFLAGS_LAST_PKT 0x0004
u_char bh_proto; /* kernel reserved; 0 in userland */
bpf_u_int32 bh_svc; /* service class */
bpf_u_int32 bh_flowid; /* kernel reserved; 0 in userland */
+ bpf_u_int32 bh_unsent_bytes; /* unsent bytes at interface */
+ bpf_u_int32 bh_unsent_snd; /* unsent bytes at socket buffer */
};
#define BPF_CONTROL_NAME "com.apple.net.bpf"
/*
* For Apple private usage
*/
+#define DLT_USER0_APPLE_INTERNAL DLT_USER0 /* rdar://12019509 */
+#define DLT_USER1_APPLE_INTERNAL DLT_USER1 /* rdar://12019509 */
#define DLT_PKTAP DLT_USER2 /* rdar://11779467 */
+#define DLT_USER3_APPLE_INTERNAL DLT_USER3 /* rdar://19614531 */
+#define DLT_USER4_APPLE_INTERNAL DLT_USER4 /* rdar://19614531 */
#endif /* PRIVATE */
/*
link type are specified. The callback is responsible for
releasing the mbuf whether or not it returns an error.
@param interface The interface the packet is being sent on.
- @param dlt The data link type the bpf device is attached to.
+ @param data_link_type The data link type the bpf device is attached to.
@param packet The packet to be sent.
*/
typedef errno_t (*bpf_send_func)(ifnet_t interface, u_int32_t data_link_type,
decreasing (tap in or out is stopping), the error will be
ignored.
@param interface The interface being tapped.
- @param dlt The data link type being tapped.
+ @param data_link_type The data link type being tapped.
@param direction The direction of the tap.
*/
typedef errno_t (*bpf_tap_func)(ifnet_t interface, u_int32_t data_link_type,
@param dlt The data link type of the packet.
@param packet The packet received.
@param header An optional pointer to a header that will be prepended.
- @param headerlen If the header was specified, the length of the header.
+ @param header_len If the header was specified, the length of the header.
*/
extern void bpf_tap_in(ifnet_t interface, u_int32_t dlt, mbuf_t packet,
void *header, size_t header_len);
@param dlt The data link type of the packet.
@param packet The packet received.
@param header An optional pointer to a header that will be prepended.
- @param headerlen If the header was specified, the length of the header.
+ @param header_len If the header was specified, the length of the header.
*/
extern void bpf_tap_out(ifnet_t interface, u_int32_t dlt, mbuf_t packet,
void *header, size_t header_len);