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

Function key_sp2mbuf

freebsd/netipsec/key.c:1756–1773  ·  view source on GitHub ↗

* copy secpolicy struct to sadb_x_policy structure indicated. */

Source from the content-addressed store, hash-verified

1754 * copy secpolicy struct to sadb_x_policy structure indicated.
1755 */
1756static struct mbuf *
1757key_sp2mbuf(struct secpolicy *sp)
1758{
1759 struct mbuf *m;
1760 size_t tlen;
1761
1762 tlen = key_getspreqmsglen(sp);
1763 m = m_get2(tlen, M_NOWAIT, MT_DATA, 0);
1764 if (m == NULL)
1765 return (NULL);
1766 m_align(m, tlen);
1767 m->m_len = tlen;
1768 if (key_sp2msg(sp, m->m_data, &tlen) != 0) {
1769 m_freem(m);
1770 return (NULL);
1771 }
1772 return (m);
1773}
1774
1775int
1776key_sp2msg(struct secpolicy *sp, void *request, size_t *len)

Callers 2

key_setdumpspFunction · 0.85
key_spdexpireFunction · 0.85

Calls 5

key_getspreqmsglenFunction · 0.85
m_get2Function · 0.85
key_sp2msgFunction · 0.85
m_alignFunction · 0.50
m_freemFunction · 0.50

Tested by

no test coverage detected