getipv4sourcefilter
Table of Contents >> Programmer's Reference >> IGMPv3
| #include <trsocket.h> |
| int getipv4sourcefilter | ( |
| int sd, | |
| struct in_addr interfaceAddr, | |
| struct in_addr group, | |
| ttUser32BitPtr fmodePtr, | |
| ttUser32BitPtr numsrcPtr, | |
| struct in_addr * slist | |
| ); |
Function Description
This function API allows the user to retrieve the source address filter list for a given socket, interface, and multicast source address.
Parameters
- sd
- The socket descriptor.
- interfaceAddr
- Local IPv4 address of the corresponding configured interface. Note that a zero ip address is valid if the user has either designated a default multicast interface for the socket via the IP_MULTICAST_IF socket option, or designated a default multicast interface for the system vi atfSetMcastInterface().
- group
- Destination multicast group address.
- fmodePtr
- Points to a 32-bit integer that will contain the filter mode upon a successful return. The value of this field will either be MCAST_INCLUDE or MCAST_EXCLUDE.
- numsrcPtr
- On input, the 'numsrcPtr' argument holds the number of source addresses that will fit in the 'slist' array. On output, the 'numsrcPtr' argument will hold the total number of sources in the filter. If the application does not know the size of the source list beforehand, it can make a reasonable guess (e.g., 0), and if upon completion, 'numsrcPtr' points to a larger value, the operation can be repeated with a large enough buffer.That is, on return, 'numsrcPtr' is always updated to point to the total number of sources in the filter, while 'slist' will hold as many source addresses as will fit, up to the minimum of the array size passed in as the original 'numsrc' value and the total number of sources in the filter.
- slist
- Points to a buffer into which an array of IPv4 addresses of included or excluded (depending on the filter mode) sources will be written. If 'numsrcPtr' points to 0 on input, a NULL pointer may be supplied.
Return Values
- TM_ENOERROR
- Success
- TM_SOCKET_ERROR
- Failure
| TM_SOCKET_ERROR means that this socket call has failed and the errorCode has been set on the socket itself.
To retrieve the socket error the user must call tfGetSocketError(socketDescriptor). |
Possible socket errors
- TM_EBADF
- The socket descriptor is invalid.
- TM_EINVAL
- The operation is not legal on the group. For example 'fmodePtr' points to a value other than MCAST_INCLUDE or MCAST_EXCLUDE.
- TM_EPROTOTYPE
- The socket is not of type SOCK_DGRAM or SOCK_RAW.
- TM_EADDRNOTAVAIL
- Address is invalid. Here are a few examples:
- The interface address is not a valid configured address.
- A source address is invalid.
- The group address is not multicast.
- The group address is not joined.
- TM_ENOBUFS
- No memory for operation, most probably because the maximum number of filters has been reached.