libmctProgrammer’s Manual

mct_session_add/drop(3)

Name

mct_session_add, mct_session_drop — Add multicast membership to an MCT session

Synopsis

#include <sys/types.h>
#include <sys/socket.h>

#include <mct/session.h>

int mct_session_add(struct mct *mct, int s,
	int ifindex, const struct sockaddr *sa, socklen_t salen);

int mct_session_drop(struct mct *mct, int s,
	int ifindex, const struct sockaddr *sa, socklen_t salen);

Description

Request that mctd add or drop multicast membership for a session to the given group.

The ifindex argument identifies the network interface for multicast membership as per if_nametoindex, or 0 to indicate any interface.

The multicast address given must be of the same address family as the session when created by mct_bridge.

Return Value

The mct_session_add() and mct_session-drop() functions return 0 on success. On failure these functions returns -1 and errno is set accordingly.

Errors

The mct_session_add() and mct_session_drop() functions may fail for any of the reasons the socket API may produce.

In addition, mct_session_add() and mct_session_drop() may fail for any of the reasons documented by mct_ipc.

In addition, mct_session_add() and mct_session_drop() may fail for the following reasons:

EINVAL

The given session ID is not valid.

EAFNOSUPPORT

An unsupported address family was given. See caveats below.

Caveats

Currently the only address families supported for multicast membership are AF_INET and AF_INET6.

Non-zero ifindex values are silently ignored for AF_INET on systems which do not provide struct ip_mreqn, and the behaviour is as if ifindex is 0. Currently Linux is the only system for which struct ip_mreqn is supported; see ip for details.

See Also

mctd, mct, mct_ipc, mct_bridge, if_nametoindex, ip.