The networking_cisco.apps.saf.agent.vdp.lldpad
Module¶
This file contains the implementation of OpenStack component of VDP. VDP is a part of LLDP Agent Daemon (lldpad). For more information on VDP, pls visit http://www.ieee802.org/1/pages/802.1bg.html
-
class
networking_cisco.apps.saf.agent.vdp.lldpad.
LldpadDriver
(port_name, phy_uplink, root_helper, is_ncb=True, is_nb=False)¶ Bases:
object
LLDPad driver class.
-
check_filter_validity
(reply, filter_str)¶ Check for the validify of the filter.
-
check_hints
(reply)¶ Parse the hints to check for errors.
-
clear_oui
(port_uuid)¶ Clears the OUI specific info.
Parameters: uuid – vNIC UUID Currently only one OUI per VSI fixme(padkrish)
-
clear_uplink
()¶
-
clear_vdp_vsi
(port_uuid)¶ Stores the vNIC specific info for VDP Refresh.
Parameters: uuid – vNIC UUID
-
construct_vdp_dict
(mode, mgrid, typeid, typeid_ver, vsiid_frmt, vsiid, filter_frmt, gid, mac, vlan, oui_id, oui_data)¶ Constructs the VDP Message.
Please refer http://www.ieee802.org/1/pages/802.1bg.html VDP Section for more detailed information :param mode: Associate or De-associate :param mgrid: MGR ID :param typeid: Type ID :param typeid_ver: Version of the Type ID :param vsiid_frmt: Format of the following VSI argument :param vsiid: VSI value :param filter_frmt: Filter Format :param gid: Group ID the vNIC belongs to :param mac: MAC Address of the vNIC :param vlan: VLAN of the vNIC :param oui_id: OUI Type :param oui_data: OUI Data :return vdp_keyword_str: Dictionary of VDP arguments and values
-
crosscheck_query_vsiid_mac
(reply, vsiid, mac)¶ Cross Check the reply against the input vsiid,mac for get query.
-
crosscheck_reply_vsiid_mac
(reply, vsiid, mac)¶ Cross Check the reply against the input vsiid,mac for associate.
-
enable_evb
()¶ Function to enable EVB on the interface.
-
enable_gpid
()¶ Function to enable Group ID on the interface.
This is needed to use the MAC, GID, VID Filter.
-
enable_lldp
()¶ Function to enable LLDP on the interface.
-
gen_cisco_vdp_oui
(oui_id, oui_data)¶ Cisco specific handler for constructing OUI arguments.
-
gen_oui_str
(oui_list)¶ Generate the OUI string for vdptool.
-
get_vdp_failure_reason
(reply)¶ Parse the failure reason from VDP.
-
get_vlan_from_associate_reply
(reply, vsiid, mac)¶ Parse the associate reply from VDP daemon to get the VLAN value.
-
get_vlan_from_query_reply
(reply, vsiid, mac)¶ Parse the query reply from VDP daemon to get the VLAN value.
-
read_vdp_cfg
()¶
-
run_lldptool
(args)¶ Function for invoking the lldptool utility.
-
run_vdptool
(args, oui_args=None)¶ Function that runs the vdptool utility.
-
send_vdp_assoc
(vsiid=None, mgrid=None, typeid=None, typeid_ver=None, vsiid_frmt=5, filter_frmt=4, gid=0, mac=”, vlan=0, oui_id=”, oui_data=”, sw_resp=False)¶ Sends the VDP Associate Message.
Please refer http://www.ieee802.org/1/pages/802.1bg.html VDP Section for more detailed information :param vsiid: VSI value, Only UUID supported for now :param mgrid: MGR ID :param typeid: Type ID :param typeid_ver: Version of the Type ID :param vsiid_frmt: Format of the following VSI argument :param filter_frmt: Filter Format. Only <GID,MAC,VID> supported for now :param gid: Group ID the vNIC belongs to :param mac: MAC Address of the vNIC :param vlan: VLAN of the vNIC :param oui_id: OUI Type :param oui_data: OUI Data :param sw_resp: Flag indicating if response is required from the daemon :return vlan: VLAN value returned by vdptool which in turn is given : by Switch
-
send_vdp_deassoc
(vsiid=None, mgrid=None, typeid=None, typeid_ver=None, vsiid_frmt=5, filter_frmt=4, gid=0, mac=”, vlan=0, oui_id=”, oui_data=”, sw_resp=False)¶ Sends the VDP Dis-Associate Message.
Please refer http://www.ieee802.org/1/pages/802.1bg.html VDP Section for more detailed information :param vsiid: VSI value, Only UUID supported for now :param mgrid: MGR ID :param typeid: Type ID :param typeid_ver: Version of the Type ID :param vsiid_frmt: Format of the following VSI argument :param filter_frmt: Filter Format. Only <GID,MAC,VID> supported for now :param gid: Group ID the vNIC belongs to :param mac: MAC Address of the vNIC :param vlan: VLAN of the vNIC :param oui_id: OUI Type :param oui_data: OUI Data :param sw_resp: Flag indicating if response is required from the daemon
-
send_vdp_msg
(mode, mgrid, typeid, typeid_ver, vsiid_frmt, vsiid, filter_frmt, gid, mac, vlan, oui_id, oui_data, sw_resp)¶ Constructs and Sends the VDP Message.
Please refer http://www.ieee802.org/1/pages/802.1bg.html VDP Section for more detailed information :param mode: Associate or De-associate :param mgrid: MGR ID :param typeid: Type ID :param typeid_ver: Version of the Type ID :param vsiid_frmt: Format of the following VSI argument :param vsiid: VSI value :param filter_frmt: Filter Format :param gid: Group ID the vNIC belongs to :param mac: MAC Address of the vNIC :param vlan: VLAN of the vNIC :param oui_id: OUI Type :param oui_data: OUI Data :param sw_resp: Flag indicating if response is required from the daemon :return reply: Reply from vdptool
-
send_vdp_query_msg
(mode, mgrid, typeid, typeid_ver, vsiid_frmt, vsiid, filter_frmt, gid, mac, vlan, oui_id, oui_data)¶ Constructs and Sends the VDP Query Message.
Please refer http://www.ieee802.org/1/pages/802.1bg.html VDP Section for more detailed information :param mode: Associate or De-associate :param mgrid: MGR ID :param typeid: Type ID :param typeid_ver: Version of the Type ID :param vsiid_frmt: Format of the following VSI argument :param vsiid: VSI value :param filter_frmt: Filter Format :param gid: Group ID the vNIC belongs to :param mac: MAC Address of the vNIC :param vlan: VLAN of the vNIC :param oui_id: OUI Type :param oui_data: OUI Data :param sw_resp: Flag indicating if response is required from the daemon :return reply: Reply from vdptool
-
send_vdp_vnic_down
(port_uuid=None, vsiid=None, mgrid=None, typeid=None, typeid_ver=None, vsiid_frmt=5, filter_frmt=4, gid=0, mac=”, vlan=0, oui=”)¶ Interface function to apps, called for a vNIC DOWN.
This currently sends an VDP dis-associate message. Please refer http://www.ieee802.org/1/pages/802.1bg.html VDP Section for more detailed information :param uuid: uuid of the vNIC :param vsiid: VSI value, Only UUID supported for now :param mgrid: MGR ID :param typeid: Type ID :param typeid_ver: Version of the Type ID :param vsiid_frmt: Format of the following VSI argument :param filter_frmt: Filter Format. Only <GID,MAC,VID> supported for now :param gid: Group ID the vNIC belongs to :param mac: MAC Address of the vNIC :param vlan: VLAN of the vNIC :param oui_id: OUI Type :param oui_data: OUI Data :param sw_resp: Flag indicating if response is required from the daemon
-
send_vdp_vnic_up
(port_uuid=None, vsiid=None, mgrid=None, typeid=None, typeid_ver=None, vsiid_frmt=5, filter_frmt=4, gid=0, mac=”, vlan=0, oui=None, new_network=False, vsw_cb_fn=None, vsw_cb_data=None)¶ Interface function to apps, called for a vNIC UP.
This currently sends an VDP associate message. Please refer http://www.ieee802.org/1/pages/802.1bg.html VDP Section for more detailed information :param uuid: uuid of the vNIC :param vsiid: VSI value, Only UUID supported for now :param mgrid: MGR ID :param typeid: Type ID :param typeid_ver: Version of the Type ID :param vsiid_frmt: Format of the following VSI argument :param filter_frmt: Filter Format. Only <GID,MAC,VID> supported for now :param gid: Group ID the vNIC belongs to :param mac: MAC Address of the vNIC :param vlan: VLAN of the vNIC :param oui_id: OUI Type :param oui_data: OUI Data :param sw_resp: Flag indicating if response is required from the daemon :return reply: VLAN reply from vdptool
-
store_oui
(port_uuid, oui_type, oui_data)¶ Function for storing the OUI.
param uuid: UUID of the vNIC param oui_type: OUI ID param oui_data: OUI Opaque Data
-
store_vdp_vsi
(port_uuid, mgrid, typeid, typeid_ver, vsiid_frmt, vsiid, filter_frmt, gid, mac, vlan, new_network, reply, oui_id, oui_data, vsw_cb_fn, vsw_cb_data, reason)¶ Stores the vNIC specific info for VDP Refresh.
Parameters: - uuid – vNIC UUID
- mgrid – MGR ID
- typeid – Type ID
- typeid_ver – Version of the Type ID
- vsiid_frmt – Format of the following VSI argument
- vsiid – VSI value
- filter_frmt – Filter Format
- gid – Group ID the vNIC belongs to
- mac – MAC Address of the vNIC
- vlan – VLAN of the vNIC
- new_network – Is this the first vNIC of this network
- reply – Response from the switch
- oui_id – OUI Type
- oui_data – OUI Data
- vsw_cb_fn – Callback function from the app.
- vsw_cb_data – Callback data for the app.
- reason – Failure Reason
-
-
networking_cisco.apps.saf.agent.vdp.lldpad.
enable_lldp
(self, port_name, is_ncb=True, is_nb=False)¶ Function to enable LLDP on the interface.