[ Previous | Next | Contents | Glossary | Home | Search ]
Ultimedia Services Version 2 for AIX: Programmer's Guide and Reference

UMSMulticastSniffer Object

The UMSMulticastSniffer object gathers information about multicast streams that are available to the machine. The object reports only multicast addresses. It does not report non-multicast addresses or reserved port numbers (port numbers less than IPPORT_RESERVED as defined in netinet/in.h).

This object does filtering of Real-time Transport Protocol (RTP) packets. RTP is described in Request For Comments number 1889 (RFC 1889).

This object requires the tcpdump command, which is part of the package bos.net.tcp.server. If this command is not installed, the methods return the ServiceUnavailable code.

To learn more about the UMSMulticastSniffer object, see:

For introductory information, see Multicast Sniffer Objects.

Enumeration Lists

To avoid name collision on defines, integer values have been captured as enumerated lists. The set of valid values from an enumerated list can vary with the application. The detailed method descriptions describe the valid or possible values for the specific use. The enumerated lists that are defined for this object include:

enum ReturnCode {
   Success,      // No errors were encountered.
   Failure,      // An error not covered by the other return codes occured.
   ServiceUnavailable,   // tcpdump is not installed.
   ServiceFailure,   // tcpdump returned an error.
   NullPointer,   // A null pointer was passed to a method.
   InvalidArgument,   // A method argument is out of range.
   OutOfMemory   // The object was unable to allocate memory.
};

Method Descriptions

ReturnCode set_network_interface(in string i)

Description

Sets the network interface to use. An example would be the string "tr0".

Arguments
in string i The name of the network interface.
Return Values

Success

Failure

ServiceUnavailable

NullPointer

ReturnCode listen_basic_multicast(in unsigned long seconds, out sequence<string> result)

Description

This method listens for multicast packets for a number of seconds and returns a list of addresses and port numbers. The returned values are strings of the form "%d.%d.%d.%d.%d" where the first four numbers form a dotted decimal address and the last number is the port.

Arguments
in unsigned long seconds The number of seconds to listen for packets. The actual time that the method call takes is longer because of start and stop overhead.
out sequence<string> result The list of addresses and port numbers. The list can contain zero or more items. The strings are allocated by the object and must be freed by the caller.
Return Values

Success

Failure

ServiceUnavailable

ServiceFailure

NullPointer

ReturnCode listen_RTP_multicast(in unsigned long seconds, out sequence<string> result)

Description

This method listens for multicast packets for a number of seconds and returns a list of addresses and port numbers. The returned values are strings of the form "%d.%d.%d.%d.%d" where the first four numbers form a dotted decimal address and the last number is the port. The port numbers are filtered so that for the RTP pair of even and odd port numbers only the even are returned. Note that the object returns non-RTP activity from time to time because of the possibility that a random packet can look like an RTP packet.

Arguments
in unsigned long seconds The number of seconds to listen for packets. The actual time that the method call takes is longer because of start and stop overhead.
out sequence<string> result The list of addresses and port numbers. The list can contain zero or more items. The strings are allocated by the object and must be freed by the caller.
Return Values

Success

Failure

ServiceUnavailable

ServiceFailure

NullPointer

ReturnCode listen_RTP_multicast_with_names(in unsigned long seconds, out sequence<string> result)

Description

This method listens for multicast packets for a number of seconds and returns a list of addresses, port numbers, and possibly names. The returned values are strings of two forms. The default form is "%d.%d.%d.%d.%d" where the first four numbers form a dotted decimal address and the last number is the port. The second form is the same but includes the name information after a colon "%d.%d.%d.%d.%d:%s". Port numbers are filtered so that for the RTP pair of even and odd port numbers only the even are returned. Note that the object returns non-RTP activity from time to time because of the possibility that a random packet can look like an RTP packet.

The name information consists of the contents of RTP Source description (SDES) packets and information about the address and port. The text from each unique packet is separated by a comma. Note that the SDES text may contain commas. The SDES text is not converted into the codeset of the program calling this method. If the multicast address has a name associated with it (from a name server for example), then that name is returned. If the port number has a name associated with it (from /etc/services for example), then that name is returned.

Arguments
in unsigned long seconds The number of seconds to listen for packets. The actual time that the method call takes is longer because of start and stop overhead.
out sequence<string> result The list of addresses and port numbers. The list can contain zero or more items. The strings are allocated by the object and must be freed by the caller.
Return Values

Success

Failure

ServiceUnavailable

ServiceFailure

NullPointer

ReturnCode free_sequence(inout sequence<string> freeme)

Description

This method is provided as a convenience. It can free the sequences of strings returned by the other methods. The method frees all non-null pointers in the sequence, frees the _buffer, and sets the length values to zero. The pointers are set to NULL after what they point to has been freed. The method does not free the sequence structure itself.

Arguments
inout sequence<string> freeme The sequence to be freed.
Return Values

Success

Failure

NullPointer

For introductory information, see Multicast Sniffer Objects.


[ Previous | Next | Contents | Glossary | Home | Search ]