mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-02 03:37:55 +00:00
mcast updates
This commit is contained in:
102
py-json/realm.py
102
py-json/realm.py
@@ -493,24 +493,12 @@ class Realm(LFCliBase):
|
||||
|
||||
class MULTICASTProfile(LFCliBase):
|
||||
def __init__(self, lfclient_host, lfclient_port, local_realm,
|
||||
side_a_min_bps=None, side_b_min_bps=None,
|
||||
side_a_max_bps=0, side_b_max_bps=0,
|
||||
side_a_min_pdu=-1, side_b_min_pdu=-1,
|
||||
side_a_max_pdu=0, side_b_max_pdu=0,
|
||||
report_timer_=3000, name_prefix_="Unset", number_template_="00000", debug_=False):
|
||||
"""
|
||||
|
||||
:param lfclient_host:
|
||||
:param lfclient_port:
|
||||
:param local_realm:
|
||||
:param side_a_min_bps:
|
||||
:param side_b_min_bps:
|
||||
:param side_a_max_bps:
|
||||
:param side_b_max_bps:
|
||||
:param side_a_min_pdu:
|
||||
:param side_b_min_pdu:
|
||||
:param side_a_max_pdu:
|
||||
:param side_b_max_pdu:
|
||||
:param name_prefix: prefix string for connection
|
||||
:param number_template_: how many zeros wide we padd, possibly a starting integer with left padding
|
||||
:param debug_:
|
||||
@@ -519,14 +507,6 @@ class MULTICASTProfile(LFCliBase):
|
||||
self.lfclient_url = "http://%s:%s" % (lfclient_host, lfclient_port)
|
||||
self.debug = debug_
|
||||
self.local_realm = local_realm
|
||||
self.side_a_min_pdu = side_a_min_pdu
|
||||
self.side_b_min_pdu = side_b_min_pdu
|
||||
self.side_a_max_pdu = side_a_max_pdu
|
||||
self.side_b_max_pdu = side_b_max_pdu
|
||||
self.side_a_min_bps = side_a_min_bps
|
||||
self.side_b_min_bps = side_b_min_bps
|
||||
self.side_a_max_bps = side_a_max_bps
|
||||
self.side_b_max_bps = side_b_max_bps
|
||||
self.report_timer = report_timer_
|
||||
self.created_mc = {}
|
||||
self.name_prefix = name_prefix_
|
||||
@@ -538,7 +518,7 @@ class MULTICASTProfile(LFCliBase):
|
||||
def refresh_mc(self):
|
||||
pass
|
||||
|
||||
def start_mc_tx(self, side_b, suppress_related_commands=None, debug_ = False ):
|
||||
def start_mc_tx(self, side_tx, suppress_related_commands=None, debug_ = False ):
|
||||
if self.debug:
|
||||
debut_=True
|
||||
|
||||
@@ -555,17 +535,17 @@ class MULTICASTProfile(LFCliBase):
|
||||
self.local_realm.json_post(url, json_data)
|
||||
|
||||
|
||||
def start_mc_rx(self,side_a, suppress_related_commands=None, debug_ = False):
|
||||
def start_mc_rx(self,side_rx, suppress_related_commands=None, debug_ = False):
|
||||
if self.debug:
|
||||
debug_=True
|
||||
|
||||
for port_name in side_a:
|
||||
side_a_info = self.local_realm.name_to_eid(port_name)
|
||||
side_a_resource = side_a_info[2]
|
||||
side_a_name = "%s%s"%(self.name_prefix, side_a_info[2])
|
||||
for port_name in side_rx:
|
||||
side_rx_info = self.local_realm.name_to_eid(port_name)
|
||||
side_rx_resource = side_rx_info[2]
|
||||
side_rx_name = "%s%s"%(self.name_prefix, side_rx_info[2])
|
||||
|
||||
json_data = {
|
||||
"endp_name":side_a_resource
|
||||
"endp_name":side_rx_resource
|
||||
}
|
||||
url = "cli-json/start_endp"
|
||||
self.local_realm.json_post(url, json_data, debug_=debug_, suppress_related_commands_=suppress_related_commands)
|
||||
@@ -578,24 +558,20 @@ class MULTICASTProfile(LFCliBase):
|
||||
def cleanup(self):
|
||||
pass
|
||||
|
||||
def create_mc_tx(self, side_b, suppress_related_commands=None, debug_ = False ):
|
||||
def create_mc_tx(self, side_tx, suppress_related_commands=None, debug_ = False ):
|
||||
if self.debug:
|
||||
debug_=True
|
||||
|
||||
json_data = []
|
||||
|
||||
# need to eventually us this
|
||||
#mc_tx_name = "%s%s" % (self.name_prefix, side_b)
|
||||
|
||||
# hard code for now
|
||||
# hard code for now
|
||||
endp_name = 'mcast-xmit-sta'
|
||||
# add end point
|
||||
#add_endp mcast-xmit-sta 1 1 eth1 mc_udp -1 NO 4000000 0 NO 1472 0 INCREASING NO 32 0 0
|
||||
#add_endp mcast-xmit-sta 1 1 side_tx mc_udp -1 NO 4000000 0 NO 1472 0 INCREASING NO 32 0 0
|
||||
json_data = {
|
||||
'alias':endp_name,
|
||||
'shelf':1,
|
||||
'resource':1,
|
||||
'port':side_b,
|
||||
'port':side_tx,
|
||||
'type':'mc_udp',
|
||||
'ip_port':-1,
|
||||
'is_rate_bursty':
|
||||
@@ -610,24 +586,10 @@ class MULTICASTProfile(LFCliBase):
|
||||
'send_bad_crc_per_million':0,
|
||||
'multi_conn':0
|
||||
}
|
||||
|
||||
|
||||
url = "/cli-json/add_endp"
|
||||
self.local_realm.json_post(url, json_data, debug_=debug_, suppress_related_commands_=suppress_related_commands)
|
||||
|
||||
|
||||
#set_endp_addr mcast-xmit-sta '0c c4 7a e1 ff b1 ' AUTO 0 0
|
||||
json_data = {
|
||||
'name':endp_name,
|
||||
"mac":"xx:xx:xx:xx:*:xx", #'mac':'0c:c4:7a:e1:ff:b1'
|
||||
'ip':'AUTO',
|
||||
'min_port':0,
|
||||
'max_port':0
|
||||
}
|
||||
|
||||
url = "cli-json/set_endp_addr"
|
||||
#self.local_realm.json_post(url, json_data, debug_=debug_, suppress_related_commands_=suppress_related_commands)
|
||||
|
||||
#set_mc_endp mcast-xmit-sta 32 224.9.9.9 9999 No # critical
|
||||
json_data = {
|
||||
'name':endp_name,
|
||||
@@ -639,24 +601,21 @@ class MULTICASTProfile(LFCliBase):
|
||||
url = "cli-json/set_mc_endp"
|
||||
self.local_realm.json_post(url, json_data, debug_=debug_, suppress_related_commands_=suppress_related_commands)
|
||||
|
||||
|
||||
|
||||
|
||||
def create_mc_rx(self,side_a, suppress_related_commands=None, debug_ = False):
|
||||
def create_mc_rx(self,side_rx, suppress_related_commands=None, debug_ = False):
|
||||
if self.debug:
|
||||
debug_=True
|
||||
|
||||
for port_name in side_a:
|
||||
side_a_info = self.local_realm.name_to_eid(port_name)
|
||||
side_a_shelf = side_a_info[1]
|
||||
side_a_resource = side_a_info[2]
|
||||
side_a_name = "%s%s"%(self.name_prefix, side_a_info[2])
|
||||
for port_name in side_rx:
|
||||
side_rx_info = self.local_realm.name_to_eid(port_name)
|
||||
side_rx_shelf = side_rx_info[1]
|
||||
side_rx_resource = side_rx_info[2]
|
||||
side_rx_name = "%s%s"%(self.name_prefix, side_rx_info[2])
|
||||
# add_endp mcast-rcv-sta-001 1 1 sta0002 mc_udp 9999 NO 0 0 NO 1472 0 INCREASING NO 32 0 0
|
||||
json_data = {
|
||||
'alias':side_a_resource,
|
||||
'shelf':side_a_shelf,
|
||||
'alias':side_rx_resource,
|
||||
'shelf':side_rx_shelf,
|
||||
'resource':1,
|
||||
'port':side_a_resource,
|
||||
'port':side_rx_resource,
|
||||
'type':'mc_udp',
|
||||
'ip_port':9999,
|
||||
'is_rate_bursty':
|
||||
@@ -675,21 +634,8 @@ class MULTICASTProfile(LFCliBase):
|
||||
url = "cli-json/add_endp"
|
||||
self.local_realm.json_post(url, json_data, debug_=debug_, suppress_related_commands_=suppress_related_commands)
|
||||
|
||||
#set_endp_addr mcast-rcv-sta-001 '00 0e 8e 5b 9d 44 ' AUTO 9999 0
|
||||
#json_data = {
|
||||
# 'name':side_a_resource,
|
||||
# 'mac':'xx:xx:xx:xx:*:xx',
|
||||
# 'ip':'AUTO',
|
||||
# 'min_port':9999,
|
||||
# 'max_port':0
|
||||
# }
|
||||
#
|
||||
#url = "cli-json/set_endp_addr"
|
||||
#self.local_realm.json_post(url, json_data, debug_=debug_, suppress_related_commands_=suppress_related_commands)
|
||||
|
||||
# set_mc_endp mcast-rcv-sta-001 32 224.9.9.9 9999 Yes
|
||||
json_data = {
|
||||
'name':side_a_resource,
|
||||
'name':side_rx_resource,
|
||||
'ttl':32,
|
||||
'mcast_group':'224.9.9.9',
|
||||
'mcast_dest_port':9999,
|
||||
@@ -698,12 +644,6 @@ class MULTICASTProfile(LFCliBase):
|
||||
url = "cli-json/set_mc_endp"
|
||||
self.local_realm.json_post(url, json_data, debug_=debug_, suppress_related_commands_=suppress_related_commands)
|
||||
|
||||
'''json_data = {
|
||||
"endp_name":side_a_resource
|
||||
}
|
||||
url = "cli-json/start_endp"
|
||||
self.local_realm.json_post(url, json_data, debug_=debug_, suppress_related_commands_=suppress_related_commands)
|
||||
'''
|
||||
|
||||
def to_string(self):
|
||||
pprint.pprint(self)
|
||||
|
||||
Reference in New Issue
Block a user