Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/mbuf.h
Show First 20 Lines • Show All 295 Lines • ▼ Show 20 Lines | struct { | ||||
struct m_ext m_ext; /* M_EXT set */ | struct m_ext m_ext; /* M_EXT set */ | ||||
char m_pktdat[0]; | char m_pktdat[0]; | ||||
}; | }; | ||||
}; | }; | ||||
char m_dat[0]; /* !M_PKTHDR, !M_EXT */ | char m_dat[0]; /* !M_PKTHDR, !M_EXT */ | ||||
}; | }; | ||||
}; | }; | ||||
struct ktls_session; | |||||
struct socket; | struct socket; | ||||
/* | /* | ||||
* TLS records for TLS 1.0-1.2 can have the following header lengths: | * TLS records for TLS 1.0-1.2 can have the following header lengths: | ||||
* - 5 (AES-CBC with implicit IV) | * - 5 (AES-CBC with implicit IV) | ||||
* - 21 (AES-CBC with explicit IV) | * - 21 (AES-CBC with explicit IV) | ||||
* - 13 (AES-GCM with 8 byte explicit IV) | * - 13 (AES-GCM with 8 byte explicit IV) | ||||
*/ | */ | ||||
Show All 27 Lines | struct mbuf_ext_pgs { | ||||
uint8_t npgs; /* Number of attached pages */ | uint8_t npgs; /* Number of attached pages */ | ||||
uint8_t nrdy; /* Pages with I/O pending */ | uint8_t nrdy; /* Pages with I/O pending */ | ||||
uint8_t hdr_len; /* TLS header length */ | uint8_t hdr_len; /* TLS header length */ | ||||
uint8_t trail_len; /* TLS trailer length */ | uint8_t trail_len; /* TLS trailer length */ | ||||
uint16_t first_pg_off; /* Offset into 1st page */ | uint16_t first_pg_off; /* Offset into 1st page */ | ||||
uint16_t last_pg_len; /* Length of last page */ | uint16_t last_pg_len; /* Length of last page */ | ||||
vm_paddr_t pa[MBUF_PEXT_MAX_PGS]; /* phys addrs of pages */ | vm_paddr_t pa[MBUF_PEXT_MAX_PGS]; /* phys addrs of pages */ | ||||
char hdr[MBUF_PEXT_HDR_LEN]; /* TLS header */ | char hdr[MBUF_PEXT_HDR_LEN]; /* TLS header */ | ||||
void *tls; /* TLS session */ | struct ktls_session *tls; /* TLS session */ | ||||
#if defined(__i386__) || \ | #if defined(__i386__) || \ | ||||
(defined(__powerpc__) && !defined(__powerpc64__) && defined(BOOKE)) | (defined(__powerpc__) && !defined(__powerpc64__) && defined(BOOKE)) | ||||
/* | /* | ||||
* i386 and Book-E PowerPC have 64-bit vm_paddr_t, so there is | * i386 and Book-E PowerPC have 64-bit vm_paddr_t, so there is | ||||
* a 4 byte remainder from the space allocated for pa[]. | * a 4 byte remainder from the space allocated for pa[]. | ||||
*/ | */ | ||||
uint32_t pad; | uint32_t pad; | ||||
#endif | #endif | ||||
union { | union { | ||||
char trail[MBUF_PEXT_TRAIL_LEN]; /* TLS trailer */ | char trail[MBUF_PEXT_TRAIL_LEN]; /* TLS trailer */ | ||||
struct { | struct { | ||||
struct socket *so; | struct socket *so; | ||||
void *mbuf; | struct mbuf *mbuf; | ||||
uint64_t seqno; | uint64_t seqno; | ||||
STAILQ_ENTRY(mbuf_ext_pgs) stailq; | STAILQ_ENTRY(mbuf_ext_pgs) stailq; | ||||
int enc_cnt; | |||||
}; | }; | ||||
}; | }; | ||||
}; | }; | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
static inline int | static inline int | ||||
mbuf_ext_pg_len(struct mbuf_ext_pgs *ext_pgs, int pidx, int pgoff) | mbuf_ext_pg_len(struct mbuf_ext_pgs *ext_pgs, int pidx, int pgoff) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 1,128 Lines • ▼ Show 20 Lines | |||||
#endif | #endif | ||||
#ifdef NETDUMP | #ifdef NETDUMP | ||||
/* Invoked from the netdump client code. */ | /* Invoked from the netdump client code. */ | ||||
void netdump_mbuf_drain(void); | void netdump_mbuf_drain(void); | ||||
void netdump_mbuf_dump(void); | void netdump_mbuf_dump(void); | ||||
void netdump_mbuf_reinit(int nmbuf, int nclust, int clsize); | void netdump_mbuf_reinit(int nmbuf, int nclust, int clsize); | ||||
#endif | #endif | ||||
static inline bool | |||||
mbuf_has_tls_session(struct mbuf *m) | |||||
{ | |||||
if (m->m_flags & M_NOMAP) { | |||||
MBUF_EXT_PGS_ASSERT(m); | |||||
if (m->m_ext.ext_pgs->tls != NULL) { | |||||
return (true); | |||||
} | |||||
} | |||||
return (false); | |||||
} | |||||
#endif /* _KERNEL */ | #endif /* _KERNEL */ | ||||
#endif /* !_SYS_MBUF_H_ */ | #endif /* !_SYS_MBUF_H_ */ |