#include <FlowSpec_Entry.h>
Public Types | |
enum | Position { TAO_AV_FLOWNAME = 0, TAO_AV_ADDRESS = 1, TAO_AV_FLOW_PROTOCOL = 2, TAO_AV_DIRECTION = 3, TAO_AV_FORMAT = 4 } |
Public Member Functions | |
TAO_Reverse_FlowSpec_Entry (void) | |
TAO_Reverse_FlowSpec_Entry (const char *flowname, const char *direction, const char *format_name, const char *flow_protocol, const char *carrier_protocol, ACE_Addr *address, ACE_Addr *control_address=0) | |
TAO_Reverse_FlowSpec_Entry (const char *flowname, const char *direction, const char *format_name, const char *flow_protocol, const char *address) | |
virtual | ~TAO_Reverse_FlowSpec_Entry (void) |
virtual const char * | entry_to_string (void) |
converts the entry to a string. | |
virtual Role | role (void) |
virtual int | parse (const char *flowSpec_entry) |
construct the entry from a string specified by the flowSpec grammar. |
Definition at line 310 of file FlowSpec_Entry.h.
Definition at line 314 of file FlowSpec_Entry.h.
{TAO_AV_FLOWNAME = 0, TAO_AV_ADDRESS = 1, TAO_AV_FLOW_PROTOCOL = 2, TAO_AV_DIRECTION = 3, TAO_AV_FORMAT = 4};
TAO_Reverse_FlowSpec_Entry::TAO_Reverse_FlowSpec_Entry | ( | void | ) |
Definition at line 828 of file FlowSpec_Entry.cpp.
{
// no-op
}
TAO_Reverse_FlowSpec_Entry::TAO_Reverse_FlowSpec_Entry | ( | const char * | flowname, | |
const char * | direction, | |||
const char * | format_name, | |||
const char * | flow_protocol, | |||
const char * | carrier_protocol, | |||
ACE_Addr * | address, | |||
ACE_Addr * | control_address = 0 | |||
) |
Definition at line 834 of file FlowSpec_Entry.cpp.
:TAO_FlowSpec_Entry (flowname, direction, format_name, flow_protocol, carrier_protocol, address, control_address) { // no-op }
TAO_Reverse_FlowSpec_Entry::TAO_Reverse_FlowSpec_Entry | ( | const char * | flowname, | |
const char * | direction, | |||
const char * | format_name, | |||
const char * | flow_protocol, | |||
const char * | address | |||
) |
Definition at line 853 of file FlowSpec_Entry.cpp.
:TAO_FlowSpec_Entry (flowname, direction, format_name, flow_protocol, address) { // no-op. }
TAO_Reverse_FlowSpec_Entry::~TAO_Reverse_FlowSpec_Entry | ( | void | ) | [virtual] |
Definition at line 867 of file FlowSpec_Entry.cpp.
{
// no-op.
}
const char * TAO_Reverse_FlowSpec_Entry::entry_to_string | ( | void | ) | [virtual] |
converts the entry to a string.
Implements TAO_FlowSpec_Entry.
Definition at line 920 of file FlowSpec_Entry.cpp.
{ if (this->flowname_.length() == 0) return ""; ACE_TCHAR address [BUFSIZ]; ACE_CString address_str; if (this->address_ != 0) { switch (this->protocol_) { case TAO_AV_Core::TAO_AV_RTP_UDP: case TAO_AV_Core::TAO_AV_UDP: case TAO_AV_Core::TAO_AV_QOS_UDP: case TAO_AV_Core::TAO_AV_UDP_MCAST: case TAO_AV_Core::TAO_AV_TCP: case TAO_AV_Core::TAO_AV_SCTP_SEQ: case TAO_AV_Core::TAO_AV_SFP_UDP: case TAO_AV_Core::TAO_AV_USERDEFINED_UDP: { ACE_INET_Addr *inet_addr = dynamic_cast<ACE_INET_Addr*> (this->address_); inet_addr->addr_to_string (address,BUFSIZ); } break; default: break; } ACE_CString cstring (ACE_TEXT_ALWAYS_CHAR(address)); address_str = this->carrier_protocol_; address_str += "="; address_str += cstring; if (this->protocol_ == TAO_AV_Core::TAO_AV_SCTP_SEQ) { for (int i = 0; i < this->num_local_sec_addrs_; i++) { address_str += ";"; address_str += this->local_sec_addr_ [i]; } } } else { address_str = ""; } if (this->control_address_ != 0) { u_short control_port = 0; switch (this->protocol_) { case TAO_AV_Core::TAO_AV_SFP_UDP: case TAO_AV_Core::TAO_AV_SFP_UDP_MCAST: case TAO_AV_Core::TAO_AV_USERDEFINED_UDP: case TAO_AV_Core::TAO_AV_USERDEFINED_UDP_MCAST: case TAO_AV_Core::TAO_AV_RTP_UDP: case TAO_AV_Core::TAO_AV_RTP_UDP_MCAST: case TAO_AV_Core::TAO_AV_UDP: case TAO_AV_Core::TAO_AV_QOS_UDP: case TAO_AV_Core::TAO_AV_UDP_MCAST: case TAO_AV_Core::TAO_AV_TCP: case TAO_AV_Core::TAO_AV_SCTP_SEQ: { ACE_INET_Addr *inet_addr = dynamic_cast<ACE_INET_Addr*> (this->control_address_); control_port = inet_addr->get_port_number(); } break; default: break; } address_str += ";"; char port_str[10]; ACE_OS::sprintf(port_str, "%u", control_port); address_str += port_str; } this->entry_ = this->flowname_; this->entry_ += "\\"; this->entry_ += address_str; this->entry_ += "\\"; this->entry_ += this->flow_protocol_; // this->entry_ += "\\"; // this->entry_ += this->direction_str_; // this->entry_ += "\\"; // this->entry_ += format_; if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"Reverse entry_to_string: entry = %s\n",this->entry_.c_str() )); return this->entry_.c_str(); }
int TAO_Reverse_FlowSpec_Entry::parse | ( | const char * | flowSpec_entry | ) | [virtual] |
construct the entry from a string specified by the flowSpec grammar.
Implements TAO_FlowSpec_Entry.
Definition at line 891 of file FlowSpec_Entry.cpp.
{ TAO_Tokenizer tokenizer (flowSpec_entry,'\\'); this->flowname_ = tokenizer [TAO_AV_FLOWNAME]; if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "TAO_Reverse_FlowSpec_Entry::parse [%s]\n", flowSpec_entry)); if (tokenizer [TAO_AV_ADDRESS] != 0) if (this->parse_address (tokenizer [TAO_AV_ADDRESS], TAO_AV_Core::TAO_AV_BOTH) < 0) return -1; if (tokenizer [TAO_AV_FLOW_PROTOCOL] != 0) if (this->parse_flow_protocol_string (tokenizer [TAO_AV_FLOW_PROTOCOL]) < 0) return -1; // if (tokenizer [TAO_AV_DIRECTION] != 0) // this->set_direction (tokenizer [TAO_AV_DIRECTION]); // if (tokenizer [TAO_AV_FORMAT] != 0) // this->format_ = tokenizer [TAO_AV_FORMAT]; return 0; }
TAO_FlowSpec_Entry::Role TAO_Reverse_FlowSpec_Entry::role | ( | void | ) | [virtual] |
Implements TAO_FlowSpec_Entry.
Definition at line 873 of file FlowSpec_Entry.cpp.
{ if (this->role_ != TAO_AV_INVALID_ROLE) return this->role_; switch (this->direction_) { case TAO_AV_DIR_IN: // Forward IN means we're the Source. return TAO_AV_CONSUMER; case TAO_AV_DIR_OUT: // Forward out means we're the sink. return TAO_AV_PRODUCER; default: return TAO_AV_INVALID_ROLE; } }