+#ifdef KERNEL_PRIVATE
+/*!
+ * @function mbuf_get_timestamp
+ * @discussion Retrieves the timestamp of the packet.
+ * @param mbuf The mbuf representing the packet.
+ * @param ts A pointer where the value of the timestamp will be copied
+ * to.
+ * @param valid A pointer to a boolean value that indicate if the
+ * timestamp is valid (i.e. the packet timestamp has been set).
+ * If "false" the value of "ts" is undetermined.
+ * @result 0 upon success otherwise the errno error. If the mbuf
+ * packet header does not have valid data bytes, the error
+ * code will be EINVAL
+ */
+extern errno_t mbuf_get_timestamp(mbuf_t mbuf, u_int64_t *ts, boolean_t *valid);
+
+/*!
+ * @function mbuf_set_timestamp
+ * @discussion Set the timestamp of the packet.
+ * @param mbuf The mbuf representing the packet.
+ * @param ts The value of the timestamp to be stored in the mbuf packet
+ * header
+ * @param valid A boolean value that indicate if the timestamp is valid.
+ * Passing false clears any previous timestamp value.
+ * @result 0 upon success otherwise the errno error. If the mbuf
+ * packet header does not have valid data bytes, the error
+ * code will be EINVAL
+ */
+extern errno_t mbuf_set_timestamp(mbuf_t mbuf, u_int64_t ts, boolean_t valid);
+
+/*!
+ * @typedef mbuf_tx_compl_func
+ * @discussion This callback is used to indicate when a driver has
+ * transmitted a packet.
+ * @param pktid The packet indentifier that was returned by
+ * mbuf_set_timestamp_requested()
+ * @param ifp The outgoing interface or NULL if the packet was dropped
+ * before reaching the driver
+ * @param ts The timestamp in nanoseconds when the packet was transmitted
+ * @param tx_compl_arg An argument set by the driver
+ * @param tx_compl_data Additional data set by the driver
+ * @param tx_compl_val The transmission status is expected to be an
+ * IOReturn value -- see <IOKit/IOReturn.h>
+ */
+
+typedef void (*mbuf_tx_compl_func)(uintptr_t pktid, ifnet_t ifp, u_int64_t ts,
+ uintptr_t tx_compl_arg, uintptr_t tx_compl_data, kern_return_t tx_compl_val);
+
+/*!
+ * @function mbuf_register_tx_compl_callback
+ * @discussion Register a transmit completion callback function. The
+ * callback function must be unregistered before the calling
+ * module unloads.
+ * @param callback The completion callback function to register
+ * @result 0 upon success otherwise the errno error. ENOSPC is returned
+ * if too many callbacks are registered. EINVAL is returned when
+ * the function pointer is invalid. EEXIST is returned when
+ * the function pointer is already registered.
+ */
+extern errno_t mbuf_register_tx_compl_callback(
+ mbuf_tx_compl_func callback);
+
+/*!
+ * @function mbuf_unregister_tx_compl_callback
+ * @discussion Unregister a transmit completion callback function. The
+ * callback function must be unregistered before the calling
+ * module unloads.
+ * @param callback The completion callback function to unregister
+ * @result 0 upon success otherwise the errno error. EINVAL is returned
+ * when the function pointer is invalid. ENOENT is returned when
+ * the function pointer is not registered.
+ */
+extern errno_t mbuf_unregister_tx_compl_callback(
+ mbuf_tx_compl_func callback);
+
+/*!
+ * @function mbuf_get_timestamp_requested
+ * @discussion Tell if the packet timestamp needs to be set. This is meant
+ * to be used by a driver on egress packets.
+ * @param mbuf The mbuf representing the packet.
+ * @param requested A pointer to a boolean value that indicate if the
+ * timestamp was requested to be set.
+ * @result 0 upon success otherwise the errno error. If the mbuf
+ * packet header does not have valid data bytes, the error
+ * code will be EINVAL
+ */
+extern errno_t mbuf_get_timestamp_requested(mbuf_t mbuf, boolean_t *requested);
+
+/*!
+ * @function mbuf_set_timestamp_requested
+ * @discussion Indicate the callback is expected to be called with the
+ * transmission complete timestamp. This is meant to be used
+ * on egress packet by the driver.
+ * @param mbuf The mbuf representing the packet.
+ * @param callback A previously registered completion callback function.
+ * @param pktid An output parameter with an opaque value that can be used
+ * to identify the packet.
+ * @result 0 upon success otherwise the errno error. EINVAL is retuned
+ * if the mbuf is not a valid packet or if one of the parameter
+ * is NULL. ENOENT if the callback is not registred.
+ */
+extern errno_t mbuf_set_timestamp_requested(mbuf_t mbuf,
+ uintptr_t *pktid, mbuf_tx_compl_func callback);
+
+/*!
+ * @function mbuf_get_status
+ * @discussion Retrieves the packet completion status.
+ * @param mbuf The mbuf representing the packet.
+ * @param status A pointer where the value of the completion status will
+ * be copied to.
+ * @result 0 upon success otherwise the errno error. If the mbuf
+ * packet header does not have valid data bytes, the error
+ * code will be EINVAL
+ */
+extern errno_t mbuf_get_status(mbuf_t mbuf, kern_return_t *status);
+
+/*!
+ * @function mbuf_set_status
+ * @discussion Store the packet completion status in the mbuf packet
+ * header.
+ * @param mbuf The mbuf representing the packet.
+ * @param status The value of the completion status.
+ * @result 0 upon success otherwise the errno error. If the mbuf
+ * packet header does not have valid data bytes, the error
+ * code will be EINVAL
+ */
+extern errno_t mbuf_set_status(mbuf_t mbuf, kern_return_t status);
+
+/*!
+ * @function mbuf_get_tx_compl_data
+ * @discussion Retrieves the packet completion status.
+ * @param m The mbuf representing the packet.
+ * @result 0 upon success otherwise the errno error. If the mbuf
+ * packet header does not have valid data bytes, the error
+ * code will be EINVAL
+ */
+extern errno_t mbuf_get_tx_compl_data(mbuf_t m, uintptr_t *arg,
+ uintptr_t *data);
+
+/*!
+ * @function mbuf_set_tx_compl_data
+ * @discussion Retrieves the packet completion status.
+ * @param m The mbuf representing the packet.
+ * @result 0 upon success otherwise the errno error. If the mbuf
+ * packet header does not have valid data bytes, the error
+ * code will be EINVAL
+ */
+extern errno_t mbuf_set_tx_compl_data(mbuf_t m, uintptr_t arg,
+ uintptr_t data);
+
+/*!
+ * @function mbuf_get_flowid
+ * @discussion Retrieve the flow ID of the packet .
+ * @param mbuf The mbuf representing the packet.
+ * @param flowid The flow ID of the packet.
+ * @result 0 upon success otherwise the errno error. If the mbuf
+ * packet header does not have valid data bytes, the error
+ * code will be EINVAL
+ */
+extern errno_t mbuf_get_flowid(mbuf_t mbuf, u_int16_t *flowid);
+
+/*!
+ * @function mbuf_set_flowid
+ * @discussion Set the flow ID of the packet .
+ * @param mbuf The mbuf representing the packet.
+ * @param flowid The flow ID to be set.
+ * @result 0 upon success otherwise the errno error. If the mbuf
+ * packet header does not have valid data bytes, the error
+ * code will be EINVAL
+ */
+extern errno_t mbuf_set_flowid(mbuf_t mbuf, u_int16_t flowid);
+
+/*!
+ * @function mbuf_get_keepalive_flag
+ * @discussion Tell if it's a keep alive packet.
+ * @param mbuf The mbuf representing the packet.
+ * @param is_keepalive A pointer that returns the truth value.
+ * @result 0 upon success otherwise the errno error. If the mbuf
+ * packet header does not have valid data bytes, the error
+ * code will be EINVAL
+ */
+extern errno_t mbuf_get_keepalive_flag(mbuf_t mbuf, boolean_t *is_keepalive);
+
+/*!
+ * @function mbuf_set_keepalive_flag
+ * @discussion Set or clear the packet keep alive flag.
+ * @param mbuf The mbuf representing the packet.
+ * @param is_keepalive The boolean value.
+ * @result 0 upon success otherwise the errno error. If the mbuf
+ * packet header does not have valid data bytes, the error
+ * code will be EINVAL
+ */
+extern errno_t mbuf_set_keepalive_flag(mbuf_t mbuf, boolean_t is_keepalive);
+
+#endif /* KERNEL_PRIVATE */
+