-/**
- * @brief Create an IP reassembly queue label
- * @param fragment First received IP fragment
- * @param fragmentlabel Policy label for fragment
- * @param ipq IP reassembly queue to be labeled
- * @param ipqlabel Policy label to be filled in for ipq
- *
- * Set the label on a newly created IP reassembly queue from
- * the mbuf header of the first received fragment.
- */
-typedef void mpo_ipq_label_associate_t(
- struct mbuf *fragment,
- struct label *fragmentlabel,
- struct ipq *ipq,
- struct label *ipqlabel
- );
-/**
- * @brief Compare an mbuf header label to an ipq label
- * @param fragment IP datagram fragment
- * @param fragmentlabel Policy label for fragment
- * @param ipq IP fragment reassembly queue
- * @param ipqlabel Policy label for ipq
- *
- * Compare the label of the mbuf header containing an IP datagram
- * (fragment) fragment with the label of the passed IP fragment
- * reassembly queue (ipq). Return (1) for a successful match, or (0)
- * for no match. This call is made when the IP stack attempts to
- * find an existing fragment reassembly queue for a newly received
- * fragment; if this fails, a new fragment reassembly queue may be
- * instantiated for the fragment. Policies may use this entry point
- * to prevent the reassembly of otherwise matching IP fragments if
- * policy does not permit them to be reassembled based on the label
- * or other information.
- */
-typedef int mpo_ipq_label_compare_t(
- struct mbuf *fragment,
- struct label *fragmentlabel,
- struct ipq *ipq,
- struct label *ipqlabel
- );
-/**
- * @brief Destroy IP reassembly queue label
- * @param label The label to be destroyed
- *
- * Destroy the label on an IP fragment queue. In this entry point, a
- * policy module should free any internal storage associated with
- * label so that it may be destroyed.
- */
-typedef void mpo_ipq_label_destroy_t(
- struct label *label
- );
-/**
- * @brief Initialize IP reassembly queue label
- * @param label New label to initialize
- * @param flag M_WAITOK or M_NOWAIT
- *
- * Initialize the label on a newly instantiated IP fragment reassembly
- * queue. The flag field may be one of M_WAITOK and M_NOWAIT, and
- * should be employed to avoid performing a sleeping malloc(9) during
- * this initialization call. IP fragment reassembly queue allocation
- * frequently occurs in performance sensitive environments, and the
- * implementation should be careful to avoid sleeping or long-lived
- * operations. This entry point is permitted to fail resulting in
- * the failure to allocate the IP fragment reassembly queue.
- */
-typedef int mpo_ipq_label_init_t(
- struct label *label,
- int flag
- );
-/**
- * @brief Update the label on an IP fragment reassembly queue
- * @param fragment IP fragment
- * @param fragmentlabel Policy label for fragment
- * @param ipq IP fragment reassembly queue
- * @param ipqlabel Policy label to be updated for ipq
- *
- * Update the label on an IP fragment reassembly queue (ipq) based
- * on the acceptance of the passed IP fragment mbuf header (fragment).
- */
-typedef void mpo_ipq_label_update_t(
- struct mbuf *fragment,
- struct label *fragmentlabel,
- struct ipq *ipq,
- struct label *ipqlabel
- );
-/**
- * @brief Assign a label to a new mbuf
- * @param bpf_d BPF descriptor
- * @param b_label Policy label for bpf_d
- * @param m Object; mbuf
- * @param m_label Policy label to fill in for m
- *
- * Set the label on the mbuf header of a newly created datagram
- * generated using the passed BPF descriptor. This call is made when
- * a write is performed to the BPF device associated with the passed
- * BPF descriptor.
- */
-typedef void mpo_mbuf_label_associate_bpfdesc_t(
- struct bpf_d *bpf_d,
- struct label *b_label,
- struct mbuf *m,
- struct label *m_label
- );
-/**
- * @brief Assign a label to a new mbuf
- * @param ifp Interface descriptor
- * @param i_label Existing label of ifp
- * @param m Object; mbuf
- * @param m_label Policy label to fill in for m
- *
- * Label an mbuf based on the interface from which it was received.
- */
-typedef void mpo_mbuf_label_associate_ifnet_t(
- struct ifnet *ifp,
- struct label *i_label,
- struct mbuf *m,
- struct label *m_label
- );
-/**
- * @brief Assign a label to a new mbuf
- * @param inp inpcb structure
- * @param i_label Existing label of inp
- * @param m Object; mbuf
- * @param m_label Policy label to fill in for m
- *
- * Label an mbuf based on the inpcb from which it was derived.
- */
-typedef void mpo_mbuf_label_associate_inpcb_t(
- struct inpcb *inp,
- struct label *i_label,
- struct mbuf *m,
- struct label *m_label
- );
-/**
- * @brief Set the label on a newly reassembled IP datagram
- * @param ipq IP fragment reassembly queue
- * @param ipqlabel Policy label for ipq
- * @param mbuf IP datagram to be labeled
- * @param mbuflabel Policy label to be filled in for mbuf
- *
- * Set the label on a newly reassembled IP datagram (mbuf) from the IP
- * fragment reassembly queue (ipq) from which it was generated.
- */
-typedef void mpo_mbuf_label_associate_ipq_t(
- struct ipq *ipq,
- struct label *ipqlabel,
- struct mbuf *mbuf,
- struct label *mbuflabel
- );
-/**
- * @brief Assign a label to a new mbuf
- * @param ifp Subject; network interface
- * @param i_label Existing label of ifp
- * @param m Object; mbuf
- * @param m_label Policy label to fill in for m
- *
- * Set the label on the mbuf header of a newly created datagram
- * generated for the purposes of a link layer response for the passed
- * interface. This call may be made in a number of situations, including
- * for ARP or ND6 responses in the IPv4 and IPv6 stacks.
- */
-typedef void mpo_mbuf_label_associate_linklayer_t(
- struct ifnet *ifp,
- struct label *i_label,
- struct mbuf *m,
- struct label *m_label
- );
-/**
- * @brief Assign a label to a new mbuf
- * @param oldmbuf mbuf headerder for existing datagram for existing datagram
- * @param oldmbuflabel Policy label for oldmbuf
- * @param ifp Network interface
- * @param ifplabel Policy label for ifp
- * @param newmbuf mbuf header to be labeled for new datagram
- * @param newmbuflabel Policy label for newmbuf
- *
- * Set the label on the mbuf header of a newly created datagram
- * generated from the existing passed datagram when it is processed
- * by the passed multicast encapsulation interface. This call is made
- * when an mbuf is to be delivered using the virtual interface.
- */
-typedef void mpo_mbuf_label_associate_multicast_encap_t(
- struct mbuf *oldmbuf,
- struct label *oldmbuflabel,
- struct ifnet *ifp,
- struct label *ifplabel,
- struct mbuf *newmbuf,
- struct label *newmbuflabel
- );
-/**
- * @brief Assign a label to a new mbuf
- * @param oldmbuf Received datagram
- * @param oldmbuflabel Policy label for oldmbuf
- * @param newmbuf Newly created datagram
- * @param newmbuflabel Policy label for newmbuf
- *
- * Set the label on the mbuf header of a newly created datagram generated
- * by the IP stack in response to an existing received datagram (oldmbuf).
- * This call may be made in a number of situations, including when responding
- * to ICMP request datagrams.
- */
-typedef void mpo_mbuf_label_associate_netlayer_t(
- struct mbuf *oldmbuf,
- struct label *oldmbuflabel,
- struct mbuf *newmbuf,
- struct label *newmbuflabel
- );
-/**
- * @brief Assign a label to a new mbuf
- * @param so Socket to label
- * @param so_label Policy label for socket
- * @param m Object; mbuf
- * @param m_label Policy label to fill in for m
- *
- * An mbuf structure is used to store network traffic in transit.
- * When an application sends data to a socket or a pipe, it is wrapped
- * in an mbuf first. This function sets the label on a newly created mbuf header
- * based on the socket sending the data. The contents of the label should be
- * suitable for performing an access check on the receiving side of the
- * communication.
- *
- * Only labeled MBUFs will be presented to the policy via this entrypoint.
- */
-typedef void mpo_mbuf_label_associate_socket_t(
- socket_t so,
- struct label *so_label,
- struct mbuf *m,
- struct label *m_label
- );
-/**
- * @brief Copy a mbuf label
- * @param src Source label
- * @param dest Destination label
- *
- * Copy the mbuf label information in src into dest.
- *
- * Only called when both source and destination mbufs have labels.
- */
-typedef void mpo_mbuf_label_copy_t(
- struct label *src,
- struct label *dest
- );
-/**
- * @brief Destroy mbuf label
- * @param label The label to be destroyed
- *
- * Destroy a mbuf label. Since the
- * object is going out of scope, policy modules should free any
- * internal storage associated with the label so that it may be
- * destroyed.
- */
-typedef void mpo_mbuf_label_destroy_t(
- struct label *label
- );
-/**
- * @brief Initialize mbuf label
- * @param label New label to initialize
- * @param flag Malloc flags
- *
- * Initialize the label for a newly instantiated mbuf.
- *
- * @warning Since it is possible for the flags to be set to
- * M_NOWAIT, the malloc operation may fail.
- *
- * @return On success, 0, otherwise, an appropriate errno return value.
- */
-typedef int mpo_mbuf_label_init_t(
- struct label *label,
- int flag
- );