MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ipsec4_capability

Function ipsec4_capability

freebsd/netipsec/ipsec.c:649–671  ·  view source on GitHub ↗

* IPSEC_CAP() method implementation for IPv4. */

Source from the content-addressed store, hash-verified

647 * IPSEC_CAP() method implementation for IPv4.
648 */
649int
650ipsec4_capability(struct mbuf *m, u_int cap)
651{
652
653 switch (cap) {
654 case IPSEC_CAP_BYPASS_FILTER:
655 /*
656 * Bypass packet filtering for packets previously handled
657 * by IPsec.
658 */
659 if (!V_ip4_filtertunnel &&
660 m_tag_find(m, PACKET_TAG_IPSEC_IN_DONE, NULL) != NULL)
661 return (1);
662 return (0);
663 case IPSEC_CAP_OPERABLE:
664 /* Do we have active security policies? */
665 if (key_havesp(IPSEC_DIR_INBOUND) != 0 ||
666 key_havesp(IPSEC_DIR_OUTBOUND) != 0)
667 return (1);
668 return (0);
669 };
670 return (EOPNOTSUPP);
671}
672
673#endif /* INET */
674

Callers

nothing calls this directly

Calls 2

key_havespFunction · 0.85
m_tag_findFunction · 0.50

Tested by

no test coverage detected