| 171 | #define XFORMS_UNLOCK() mtx_unlock(&xforms_lock) |
| 172 | |
| 173 | void |
| 174 | xform_attach(void *data) |
| 175 | { |
| 176 | struct xformsw *xsp, *entry; |
| 177 | |
| 178 | xsp = (struct xformsw *)data; |
| 179 | XFORMS_LOCK(); |
| 180 | LIST_FOREACH(entry, &xforms, chain) { |
| 181 | if (entry->xf_type == xsp->xf_type) { |
| 182 | XFORMS_UNLOCK(); |
| 183 | printf("%s: failed to register %s xform\n", |
| 184 | __func__, xsp->xf_name); |
| 185 | return; |
| 186 | } |
| 187 | } |
| 188 | LIST_INSERT_HEAD(&xforms, xsp, chain); |
| 189 | xsp->xf_cntr = IPSEC_MODULE_ENABLED; |
| 190 | XFORMS_UNLOCK(); |
| 191 | } |
| 192 | |
| 193 | void |
| 194 | xform_detach(void *data) |
no test coverage detected