Changeset View
Changeset View
Standalone View
Standalone View
sys/netipsec/ipsec_accel.c
Show First 20 Lines • Show All 983 Lines • ▼ Show 20 Lines | if (tag == NULL) | ||||
return (false); | return (false); | ||||
tag->drv_spi = drv_spi; | tag->drv_spi = drv_spi; | ||||
m_tag_prepend(m, &tag->tag); | m_tag_prepend(m, &tag->tag); | ||||
return (true); | return (true); | ||||
} | } | ||||
bool | bool | ||||
ipsec_accel_output(struct ifnet *ifp, struct mbuf *m, struct inpcb *inp, | ipsec_accel_output(struct ifnet *ifp, struct mbuf *m, struct inpcb *inp, | ||||
struct secpolicy *sp, struct secasvar *sav, int af, int mtu) | struct secpolicy *sp, struct secasvar *sav, int af, int mtu, int *hwassist) | ||||
{ | { | ||||
struct ifp_handle_sav *i; | struct ifp_handle_sav *i; | ||||
struct ip *ip; | struct ip *ip; | ||||
u_long ip_len, skip; | u_long ip_len, skip; | ||||
*hwassist = 0; | |||||
if (ifp == NULL) | if (ifp == NULL) | ||||
return (false); | return (false); | ||||
M_ASSERTPKTHDR(m); | M_ASSERTPKTHDR(m); | ||||
NET_EPOCH_ASSERT(); | NET_EPOCH_ASSERT(); | ||||
if (sav == NULL) | if (sav == NULL) | ||||
return (ipsec_accel_output_tag(m, IPSEC_ACCEL_DRV_SPI_BYPASS)); | return (ipsec_accel_output_tag(m, IPSEC_ACCEL_DRV_SPI_BYPASS)); | ||||
Show All 24 Lines | ipsec_accel_output(struct ifnet *ifp, struct mbuf *m, struct inpcb *inp, | ||||
if (!ipsec_accel_output_tag(m, i->drv_spi)) | if (!ipsec_accel_output_tag(m, i->drv_spi)) | ||||
return (false); | return (false); | ||||
ipsec_accel_sa_recordxfer(sav, m); | ipsec_accel_sa_recordxfer(sav, m); | ||||
key_freesav(&sav); | key_freesav(&sav); | ||||
if (sp != NULL) | if (sp != NULL) | ||||
key_freesp(&sp); | key_freesp(&sp); | ||||
*hwassist = ifp->if_ipsec_accel_m->if_hwassist(ifp, sav, | |||||
i->drv_spi, i->ifdata); | |||||
return (true); | return (true); | ||||
} | } | ||||
struct ipsec_accel_in_tag * | struct ipsec_accel_in_tag * | ||||
ipsec_accel_input_tag_lookup(const struct mbuf *m) | ipsec_accel_input_tag_lookup(const struct mbuf *m) | ||||
{ | { | ||||
struct ipsec_accel_in_tag *tag; | struct ipsec_accel_in_tag *tag; | ||||
struct m_tag *xtag; | struct m_tag *xtag; | ||||
▲ Show 20 Lines • Show All 201 Lines • Show Last 20 Lines |