| 955 | static struct callback *callbacks = NULL; |
| 956 | |
| 957 | void |
| 958 | callback_register(callback_func *func, void *arg) |
| 959 | { |
| 960 | struct callback *cb; |
| 961 | |
| 962 | cb = malloc(sizeof(struct callback)); |
| 963 | if (cb == NULL) |
| 964 | errx(1, "unable to allocate memory for callback"); |
| 965 | cb->cb_func = func; |
| 966 | cb->cb_arg = arg; |
| 967 | cb->cb_next = callbacks; |
| 968 | callbacks = cb; |
| 969 | } |
| 970 | |
| 971 | /* specially-handled commands */ |
| 972 | static void setifaddr(const char *, int, int, const struct afswtch *); |
no test coverage detected