| 8198 | } |
| 8199 | |
| 8200 | struct spdcache_entry * |
| 8201 | spdcache_entry_alloc(const struct secpolicyindex *spidx, struct secpolicy *sp) |
| 8202 | { |
| 8203 | struct spdcache_entry *entry; |
| 8204 | |
| 8205 | entry = malloc(sizeof(struct spdcache_entry), |
| 8206 | M_IPSEC_SPDCACHE, M_NOWAIT|M_ZERO); |
| 8207 | if (entry == NULL) |
| 8208 | return NULL; |
| 8209 | |
| 8210 | if (sp != NULL) |
| 8211 | SP_ADDREF(sp); |
| 8212 | |
| 8213 | entry->spidx = *spidx; |
| 8214 | entry->sp = sp; |
| 8215 | |
| 8216 | return (entry); |
| 8217 | } |
| 8218 | |
| 8219 | void |
| 8220 | spdcache_entry_free(struct spdcache_entry *entry) |