Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
roc::packet::Address Class Reference

Network address. More...

#include <address.h>

Public Member Functions

 Address ()
 Construct invalid address. More...
 
bool valid () const
 Check if the address was properly initialized. More...
 
bool set_saddr (const sockaddr *sa)
 Set address from sockaddr struct. More...
 
bool set_ipv4 (const char *ip, int port)
 Set IPv4 address. More...
 
bool set_ipv6 (const char *ip, int port)
 Set IPv6 address. More...
 
sockaddr * saddr ()
 Get sockaddr struct. More...
 
const sockaddr * saddr () const
 Get sockaddr struct. More...
 
socklen_t slen () const
 Get sockaddr struct length. More...
 
int version () const
 Get IP version (4 or 6). More...
 
int port () const
 Get address port. More...
 
bool multicast () const
 Check whether this is multicast address. More...
 
bool get_ip (char *buf, size_t bufsz) const
 Get IP address. More...
 
bool operator== (const Address &other) const
 Compare addresses. More...
 
bool operator!= (const Address &other) const
 Compare addresses. More...
 

Detailed Description

Network address.

Definition at line 24 of file address.h.

Constructor & Destructor Documentation

roc::packet::Address::Address ( )

Construct invalid address.

Member Function Documentation

bool roc::packet::Address::get_ip ( char *  buf,
size_t  bufsz 
) const

Get IP address.

bool roc::packet::Address::multicast ( ) const

Check whether this is multicast address.

bool roc::packet::Address::operator!= ( const Address other) const

Compare addresses.

bool roc::packet::Address::operator== ( const Address other) const

Compare addresses.

int roc::packet::Address::port ( ) const

Get address port.

sockaddr* roc::packet::Address::saddr ( )

Get sockaddr struct.

const sockaddr* roc::packet::Address::saddr ( ) const

Get sockaddr struct.

bool roc::packet::Address::set_ipv4 ( const char *  ip,
int  port 
)

Set IPv4 address.

bool roc::packet::Address::set_ipv6 ( const char *  ip,
int  port 
)

Set IPv6 address.

bool roc::packet::Address::set_saddr ( const sockaddr *  sa)

Set address from sockaddr struct.

socklen_t roc::packet::Address::slen ( ) const

Get sockaddr struct length.

bool roc::packet::Address::valid ( ) const

Check if the address was properly initialized.

int roc::packet::Address::version ( ) const

Get IP version (4 or 6).


The documentation for this class was generated from the following file: