| 8513 | */ |
| 8514 | |
| 8515 | static struct mbuf * |
| 8516 | key_setlifetime(struct seclifetime *src, uint16_t exttype) |
| 8517 | { |
| 8518 | struct mbuf *m = NULL; |
| 8519 | struct sadb_lifetime *p; |
| 8520 | int len = PFKEY_ALIGN8(sizeof(struct sadb_lifetime)); |
| 8521 | |
| 8522 | if (src == NULL) |
| 8523 | return NULL; |
| 8524 | |
| 8525 | m = m_get2(len, M_NOWAIT, MT_DATA, 0); |
| 8526 | if (m == NULL) |
| 8527 | return m; |
| 8528 | m_align(m, len); |
| 8529 | m->m_len = len; |
| 8530 | p = mtod(m, struct sadb_lifetime *); |
| 8531 | |
| 8532 | bzero(p, len); |
| 8533 | p->sadb_lifetime_len = PFKEY_UNIT64(len); |
| 8534 | p->sadb_lifetime_exttype = exttype; |
| 8535 | p->sadb_lifetime_allocations = src->allocations; |
| 8536 | p->sadb_lifetime_bytes = src->bytes; |
| 8537 | p->sadb_lifetime_addtime = src->addtime; |
| 8538 | p->sadb_lifetime_usetime = src->usetime; |
| 8539 | |
| 8540 | return m; |
| 8541 | |
| 8542 | } |
| 8543 | |
| 8544 | const struct enc_xform * |
| 8545 | enc_algorithm_lookup(int alg) |
no test coverage detected