*/
#ifndef _NETINET_MP_PCB_H_
-#define _NETINET_MP_PCB_H_
+#define _NETINET_MP_PCB_H_
#ifdef BSD_KERNEL_PRIVATE
#include <sys/domain.h>
/* Keep in sync with bsd/dev/dtrace/scripts/mptcp.d */
typedef enum mppcb_state {
- MPPCB_STATE_INUSE = 1,
- MPPCB_STATE_DEAD = 2,
+ MPPCB_STATE_INUSE = 1,
+ MPPCB_STATE_DEAD = 2,
} mppcb_state_t;
/*
* Multipath Protocol Control Block
*/
struct mppcb {
- TAILQ_ENTRY(mppcb) mpp_entry; /* glue to all PCBs */
- decl_lck_mtx_data(, mpp_lock); /* per PCB lock */
- struct mppcbinfo *mpp_pcbinfo; /* PCB info */
- struct mptses *mpp_pcbe; /* ptr to MPTCP-session */
- struct socket *mpp_socket; /* back pointer to socket */
- uint32_t mpp_flags; /* PCB flags */
- mppcb_state_t mpp_state; /* PCB state */
+ TAILQ_ENTRY(mppcb) mpp_entry; /* glue to all PCBs */
+ decl_lck_mtx_data(, mpp_lock); /* per PCB lock */
+ struct mppcbinfo *mpp_pcbinfo; /* PCB info */
+ struct mptses *mpp_pcbe; /* ptr to MPTCP-session */
+ struct socket *mpp_socket; /* back pointer to socket */
+ uint32_t mpp_flags; /* PCB flags */
+ mppcb_state_t mpp_state; /* PCB state */
#if NECP
uuid_t necp_client_uuid;
mpsotomppcb(struct socket *mp_so)
{
VERIFY(SOCK_DOM(mp_so) == PF_MULTIPATH);
- return ((struct mppcb *)mp_so->so_pcb);
+ return (struct mppcb *)mp_so->so_pcb;
}
/* valid values for mpp_flags */
-#define MPP_ATTACHED 0x001
-#define MPP_INSIDE_OUTPUT 0x002 /* MPTCP-stack is inside mptcp_subflow_output */
-#define MPP_INSIDE_INPUT 0x004 /* MPTCP-stack is inside mptcp_subflow_input */
-#define MPP_RUPCALL 0x008 /* MPTCP-stack is handling a read upcall */
-#define MPP_WUPCALL 0x010 /* MPTCP-stack is handling a read upcall */
-#define MPP_SHOULD_WORKLOOP 0x020 /* MPTCP-stack should call the workloop function */
-#define MPP_SHOULD_RWAKEUP 0x040 /* MPTCP-stack should call sorwakeup */
-#define MPP_SHOULD_WWAKEUP 0x080 /* MPTCP-stack should call sowwakeup */
-#define MPP_CREATE_SUBFLOWS 0x100 /* This connection needs to create subflows */
-#define MPP_SET_CELLICON 0x200 /* Set the cellicon (deferred) */
-#define MPP_UNSET_CELLICON 0x400 /* Unset the cellicon (deferred) */
+#define MPP_ATTACHED 0x001
+#define MPP_INSIDE_OUTPUT 0x002 /* MPTCP-stack is inside mptcp_subflow_output */
+#define MPP_INSIDE_INPUT 0x004 /* MPTCP-stack is inside mptcp_subflow_input */
+#define MPP_RUPCALL 0x008 /* MPTCP-stack is handling a read upcall */
+#define MPP_WUPCALL 0x010 /* MPTCP-stack is handling a read upcall */
+#define MPP_SHOULD_WORKLOOP 0x020 /* MPTCP-stack should call the workloop function */
+#define MPP_SHOULD_RWAKEUP 0x040 /* MPTCP-stack should call sorwakeup */
+#define MPP_SHOULD_WWAKEUP 0x080 /* MPTCP-stack should call sowwakeup */
+#define MPP_CREATE_SUBFLOWS 0x100 /* This connection needs to create subflows */
+#define MPP_SET_CELLICON 0x200 /* Set the cellicon (deferred) */
+#define MPP_UNSET_CELLICON 0x400 /* Unset the cellicon (deferred) */
static inline boolean_t
mptcp_should_defer_upcall(struct mppcb *mpp)
* Multipath PCB Information
*/
struct mppcbinfo {
- TAILQ_ENTRY(mppcbinfo) mppi_entry; /* glue to all PCB info */
- TAILQ_HEAD(, mppcb) mppi_pcbs; /* list of PCBs */
- uint32_t mppi_count; /* # of PCBs in list */
- struct zone *mppi_zone; /* zone for this PCB */
- uint32_t mppi_size; /* size of PCB structure */
- lck_grp_t *mppi_lock_grp; /* lock grp */
- lck_attr_t *mppi_lock_attr; /* lock attr */
- lck_grp_attr_t *mppi_lock_grp_attr; /* lock grp attr */
- decl_lck_mtx_data(, mppi_lock); /* global PCB lock */
+ TAILQ_ENTRY(mppcbinfo) mppi_entry; /* glue to all PCB info */
+ TAILQ_HEAD(, mppcb) mppi_pcbs; /* list of PCBs */
+ uint32_t mppi_count; /* # of PCBs in list */
+ struct zone *mppi_zone; /* zone for this PCB */
+ uint32_t mppi_size; /* size of PCB structure */
+ lck_grp_t *mppi_lock_grp; /* lock grp */
+ lck_attr_t *mppi_lock_attr; /* lock attr */
+ lck_grp_attr_t *mppi_lock_grp_attr; /* lock grp attr */
+ decl_lck_mtx_data(, mppi_lock); /* global PCB lock */
uint32_t (*mppi_gc)(struct mppcbinfo *); /* garbage collector func */
uint32_t (*mppi_timer)(struct mppcbinfo *); /* timer func */
};