+/* Creates an nln handle which may be used to manage change notifications. The
+ * created handle will listen for netlink messages on 'multicast_group' using
+ * netlink protocol 'protocol' (e.g. NETLINK_ROUTE, NETLINK_GENERIC, ...).
+ * Incoming messages will be parsed with 'parse' which will be passed 'change'
+ * as an argument. */
+struct nln *
+nln_create(int protocol, int multicast_group, nln_parse_func *parse,
+ void *change)
+{
+ struct nln *nln;
+
+ nln = xzalloc(sizeof *nln);
+ nln->notify_sock = NULL;
+ nln->protocol = protocol;
+ nln->multicast_group = multicast_group;
+ nln->parse = parse;
+ nln->change = change;
+ nln->has_run = false;
+
+ list_init(&nln->all_notifiers);
+ return nln;