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

Function key_setsadbxsareplay

freebsd/netipsec/key.c:3889–3910  ·  view source on GitHub ↗

* Set data into sadb_x_sa_replay. */

Source from the content-addressed store, hash-verified

3887 * Set data into sadb_x_sa_replay.
3888 */
3889static struct mbuf *
3890key_setsadbxsareplay(u_int32_t replay)
3891{
3892 struct mbuf *m;
3893 struct sadb_x_sa_replay *p;
3894 size_t len;
3895
3896 len = PFKEY_ALIGN8(sizeof(struct sadb_x_sa_replay));
3897 m = m_get2(len, M_NOWAIT, MT_DATA, 0);
3898 if (m == NULL)
3899 return (NULL);
3900 m_align(m, len);
3901 m->m_len = len;
3902 p = mtod(m, struct sadb_x_sa_replay *);
3903
3904 bzero(p, len);
3905 p->sadb_x_sa_replay_len = PFKEY_UNIT64(len);
3906 p->sadb_x_sa_replay_exttype = SADB_X_EXT_SA_REPLAY;
3907 p->sadb_x_sa_replay_replay = (replay << 3);
3908
3909 return m;
3910}
3911
3912/*
3913 * Set a type in sadb_x_nat_t_type.

Callers 2

key_setdumpsaFunction · 0.85
key_expireFunction · 0.85

Calls 3

m_get2Function · 0.85
bzeroFunction · 0.85
m_alignFunction · 0.50

Tested by

no test coverage detected