python ancp(rfc 6320)客户端和库
PyANC的Python项目详细描述
Pyancp
python ancp(rfc 6320)客户端和库。 Pyancp需要Python2.7或更高版本,或者Python3.2或更高版本。
状态:beta
ancp库示例
fromancp.clientimportClientfromancp.subscriberimportSubscriber# setup ancp sessionclient=Client(address="1.2.3.4")ifclient.connect():# create ancp subscribersS1=Subscriber(aci="0.0.0.0 eth 1",up=1024,down=16000)S2=Subscriber(aci="0.0.0.0 eth 2",up=2048,down=32000)# send port-up for ancp subscribersclient.port_up([S1,S2])# keep session activetry:whileclient.established.is_set():time.sleep(1)exceptKeyboardInterrupt:# send port-down for ancp subscribersclient.port_down([S1,S2])client.disconnect()
作者:Christian Giese和Wolfgang Beck
贡献者: -伊斯特凡·鲁兹曼