#include <FlowSpec_Entry.h>
Inheritance diagram for TAO_Reverse_FlowSpec_Entry:
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 314 of file FlowSpec_Entry.h.
00314 {TAO_AV_FLOWNAME = 0, 00315 TAO_AV_ADDRESS = 1, 00316 TAO_AV_FLOW_PROTOCOL = 2, 00317 TAO_AV_DIRECTION = 3, 00318 TAO_AV_FORMAT = 4}; |
|
Definition at line 830 of file FlowSpec_Entry.cpp.
00831 {
00832 // no-op
00833 }
|
|
Definition at line 836 of file FlowSpec_Entry.cpp.
00843 :TAO_FlowSpec_Entry (flowname, 00844 direction, 00845 format_name, 00846 flow_protocol, 00847 carrier_protocol, 00848 address, 00849 control_address) 00850 { 00851 // no-op 00852 } |
|
Definition at line 855 of file FlowSpec_Entry.cpp.
00860 :TAO_FlowSpec_Entry (flowname, 00861 direction, 00862 format_name, 00863 flow_protocol, 00864 address) 00865 { 00866 // no-op. 00867 } |
|
Definition at line 869 of file FlowSpec_Entry.cpp.
00870 {
00871 // no-op.
00872 }
|
|
converts the entry to a string.
Implements TAO_FlowSpec_Entry. Definition at line 922 of file FlowSpec_Entry.cpp. References ACE_CString, ACE_DEBUG, LM_DEBUG, and TAO_debug_level. Referenced by TAO_AV_Core::init_forward_flows().
00923 { 00924 if (this->flowname_.length() == 0) 00925 return ""; 00926 00927 char address [BUFSIZ]; 00928 ACE_CString address_str; 00929 if (this->address_ != 0) 00930 { 00931 switch (this->protocol_) 00932 { 00933 case TAO_AV_Core::TAO_AV_RTP_UDP: 00934 case TAO_AV_Core::TAO_AV_UDP: 00935 case TAO_AV_Core::TAO_AV_QOS_UDP: 00936 case TAO_AV_Core::TAO_AV_UDP_MCAST: 00937 case TAO_AV_Core::TAO_AV_TCP: 00938 case TAO_AV_Core::TAO_AV_SCTP_SEQ: 00939 case TAO_AV_Core::TAO_AV_SFP_UDP: 00940 case TAO_AV_Core::TAO_AV_USERDEFINED_UDP: 00941 { 00942 ACE_INET_Addr *inet_addr = dynamic_cast<ACE_INET_Addr*> (this->address_); 00943 inet_addr->addr_to_string (address,BUFSIZ); 00944 } 00945 break; 00946 default: 00947 break; 00948 } 00949 ACE_CString cstring (address); 00950 00951 address_str = this->carrier_protocol_; 00952 address_str += "="; 00953 address_str += cstring; 00954 00955 if (this->protocol_ == TAO_AV_Core::TAO_AV_SCTP_SEQ) 00956 { 00957 for (int i = 0; i < this->num_local_sec_addrs_; i++) 00958 { 00959 address_str += ";"; 00960 address_str += this->local_sec_addr_ [i]; 00961 } 00962 } 00963 00964 } 00965 else 00966 { 00967 address_str = ""; 00968 } 00969 00970 if (this->control_address_ != 0) 00971 { 00972 u_short control_port = 0; 00973 00974 00975 switch (this->protocol_) 00976 { 00977 case TAO_AV_Core::TAO_AV_SFP_UDP: 00978 case TAO_AV_Core::TAO_AV_SFP_UDP_MCAST: 00979 case TAO_AV_Core::TAO_AV_USERDEFINED_UDP: 00980 case TAO_AV_Core::TAO_AV_USERDEFINED_UDP_MCAST: 00981 case TAO_AV_Core::TAO_AV_RTP_UDP: 00982 case TAO_AV_Core::TAO_AV_RTP_UDP_MCAST: 00983 case TAO_AV_Core::TAO_AV_UDP: 00984 case TAO_AV_Core::TAO_AV_QOS_UDP: 00985 case TAO_AV_Core::TAO_AV_UDP_MCAST: 00986 case TAO_AV_Core::TAO_AV_TCP: 00987 case TAO_AV_Core::TAO_AV_SCTP_SEQ: 00988 { 00989 ACE_INET_Addr *inet_addr = dynamic_cast<ACE_INET_Addr*> (this->control_address_); 00990 control_port = inet_addr->get_port_number(); 00991 } 00992 break; 00993 default: 00994 break; 00995 } 00996 00997 address_str += ";"; 00998 char port_str[10]; 00999 sprintf(port_str, "%u", control_port); 01000 address_str += port_str; 01001 01002 } 01003 01004 this->entry_ = this->flowname_; 01005 this->entry_ += "\\"; 01006 this->entry_ += address_str; 01007 this->entry_ += "\\"; 01008 this->entry_ += this->flow_protocol_; 01009 // this->entry_ += "\\"; 01010 // this->entry_ += this->direction_str_; 01011 // this->entry_ += "\\"; 01012 // this->entry_ += format_; 01013 01014 if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"Reverse entry_to_string: entry = %s\n",this->entry_.c_str() )); 01015 return this->entry_.c_str(); 01016 } |
|
construct the entry from a string specified by the flowSpec grammar.
Implements TAO_FlowSpec_Entry. Definition at line 893 of file FlowSpec_Entry.cpp. References ACE_DEBUG, LM_DEBUG, TAO_FlowSpec_Entry::parse_address(), TAO_FlowSpec_Entry::parse_flow_protocol_string(), and TAO_debug_level.
00894 { 00895 TAO_Tokenizer tokenizer (flowSpec_entry,'\\'); 00896 this->flowname_ = tokenizer [TAO_AV_FLOWNAME]; 00897 00898 if (TAO_debug_level > 0) 00899 ACE_DEBUG ((LM_DEBUG, 00900 "TAO_Reverse_FlowSpec_Entry::parse [%s]\n", 00901 flowSpec_entry)); 00902 00903 if (tokenizer [TAO_AV_ADDRESS] != 0) 00904 if (this->parse_address (tokenizer [TAO_AV_ADDRESS], TAO_AV_Core::TAO_AV_BOTH) < 0) 00905 return -1; 00906 00907 if (tokenizer [TAO_AV_FLOW_PROTOCOL] != 0) 00908 if (this->parse_flow_protocol_string (tokenizer [TAO_AV_FLOW_PROTOCOL]) < 0) 00909 return -1; 00910 00911 // if (tokenizer [TAO_AV_DIRECTION] != 0) 00912 // this->set_direction (tokenizer [TAO_AV_DIRECTION]); 00913 00914 // if (tokenizer [TAO_AV_FORMAT] != 0) 00915 // this->format_ = tokenizer [TAO_AV_FORMAT]; 00916 00917 return 0; 00918 } |
|
Implements TAO_FlowSpec_Entry. Definition at line 875 of file FlowSpec_Entry.cpp.
00876 { 00877 if (this->role_ != TAO_AV_INVALID_ROLE) 00878 return this->role_; 00879 switch (this->direction_) 00880 { 00881 case TAO_AV_DIR_IN: 00882 // Forward IN means we're the Source. 00883 return TAO_AV_CONSUMER; 00884 case TAO_AV_DIR_OUT: 00885 // Forward out means we're the sink. 00886 return TAO_AV_PRODUCER; 00887 default: 00888 return TAO_AV_INVALID_ROLE; 00889 } 00890 } |