MLD_START(3)

NAME
mld_start, mld_stop - start and stop MLD processing

SYNOPSIS
#include <mld.h>

mld_t *mld_start(mld_t *mld)
void mld_stop(mld_t *mld)

Compile and link with -lmld.

DESCRIPTION
mld_start() starts the MLD listening threads and begins processing MLD events.

mld_stop(3) stops all MLD processing and cancels and joins the MLD threads.

mld can either be a pointer to an mld_t handle returned by mld_init(3) or NULL. If NULL, mld_init(3) will be called to create and return a handle. This will need to be freed by calling mld_free(3) when done (after first calling mld_stop(3)).

There are a number of threads started by mld_start():

NETLINK
    detects interface changes and reports them to STATE.

LISTEN
    listens for MLD traffic and reports events to STATE.

TIMER
    creates jobs for STATE to expire MLD records.

STATE
    handles all reads and writes to MLD cache, notifies WATCH of events.

WATCH
    receives events from STATE and creates callback threads for watchers.

RETURN VALUE
mld_start() returns a pointer to a mld_t handle. On error returns NULL and sets errno to indicate the error.

The mld_stop() function returns no value.

ERRORS
mld_start() can fail with the following errors:

ENOMEM
    Out of memory. Possibly, the application hit the RLIMIT_AS or RLIMIT_DATA limit described in getrlimit(2).

mld_start()canalsofailwiththeerrorsfor sem_post(3).

SEE ALSO
mld_init(3), mld_free(3), mld_filter_grp_add(3), mld_filter_grp_cmp(3), mld_filter_grp_del(3), mld_filter_timer_get(3), mld_filter_timer_set(3), mld_filter_timer_set_s(3), mld_wait(3), mld_watch_add(3), mld_watch_arg(3), mld_watch_del(3), mld_watch_flags(3), mld_watch_grp(3), mld_watch_ifx(3), mld_watch_mld(3), mld_watch_tid(3), sem_post(3)