| 1409 | } |
| 1410 | |
| 1411 | static struct rib_subscription * |
| 1412 | allocate_subscription(rib_subscription_cb_t *f, void *arg, |
| 1413 | enum rib_subscription_type type, bool waitok) |
| 1414 | { |
| 1415 | struct rib_subscription *rs; |
| 1416 | int flags = M_ZERO | (waitok ? M_WAITOK : M_NOWAIT); |
| 1417 | |
| 1418 | rs = malloc(sizeof(struct rib_subscription), M_RTABLE, flags); |
| 1419 | if (rs == NULL) |
| 1420 | return (NULL); |
| 1421 | |
| 1422 | rs->func = f; |
| 1423 | rs->arg = arg; |
| 1424 | rs->type = type; |
| 1425 | |
| 1426 | return (rs); |
| 1427 | } |
| 1428 | |
| 1429 | /* |
| 1430 | * Subscribe for the changes in the routing table specified by @fibnum and |
no test coverage detected