libmctProgrammer’s Manual

mct_session_affinity(3)

Name

mct_session_affinity — Set multicast affinity for a MCT session

Synopsis

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

#include <mct/session.h>

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

Description

Set affinity to a particular network interface for outgoing multicast packets for the given session.

The ifindex argument identifies the network interface 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_affinity() function returns 0 on success. On failure this function returns -1 and errno is set accordingly.

Errors

The mct_session_affinity() function may fail for any of the reasons the socket API may produce.

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

In addition, mct_session_affinity() 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 setting multicast affinity 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.