CN116048642A - LLDP (LLDP) enabled state control method, LLDP enabled state control device and LLDP enabled state control medium - Google Patents
LLDP (LLDP) enabled state control method, LLDP enabled state control device and LLDP enabled state control medium Download PDFInfo
- Publication number
- CN116048642A CN116048642A CN202310076343.5A CN202310076343A CN116048642A CN 116048642 A CN116048642 A CN 116048642A CN 202310076343 A CN202310076343 A CN 202310076343A CN 116048642 A CN116048642 A CN 116048642A
- Authority
- CN
- China
- Prior art keywords
- lldp
- network card
- modification
- enabled state
- related information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 53
- 230000004048 modification Effects 0.000 claims abstract description 193
- 238000012986 modification Methods 0.000 claims abstract description 193
- 238000012544 monitoring process Methods 0.000 claims abstract description 29
- 238000004590 computer program Methods 0.000 claims description 12
- 238000004891 communication Methods 0.000 claims description 9
- 230000006870 function Effects 0.000 description 18
- 238000012545 processing Methods 0.000 description 14
- 241001290266 Sciaenops ocellatus Species 0.000 description 6
- 238000010586 diagram Methods 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 238000013473 artificial intelligence Methods 0.000 description 2
- CQIZBIFTOGBKDB-UHFFFAOYSA-N 4-cyclohexyl-1-methyl-3,6-dihydro-2h-pyridine Chemical compound C1N(C)CCC(C2CCCCC2)=C1 CQIZBIFTOGBKDB-UHFFFAOYSA-N 0.000 description 1
- 101100076239 Drosophila melanogaster Mctp gene Proteins 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 239000002184 metal Substances 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
- 230000001052 transient effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/4401—Bootstrapping
- G06F9/4416—Network booting; Remote initial program loading [RIPL]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3003—Monitoring arrangements specially adapted to the computing system or computing system component being monitored
- G06F11/3041—Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is an input/output interface
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3055—Monitoring arrangements for monitoring the status of the computing system or of the computing system component, e.g. monitoring if the computing system is on, off, available, not available
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/4401—Bootstrapping
- G06F9/4418—Suspend and resume; Hibernate and awake
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Computer Security & Cryptography (AREA)
- Quality & Reliability (AREA)
- Mathematical Physics (AREA)
- Small-Scale Networks (AREA)
Abstract
The application relates to the technical field of computers, and discloses a control method, a device and a medium of an LLDP enabled state, which are applied to an LLDP enabled state monitoring thread created by a BMC and comprise the following steps: and when the LLDP enabling state modification request is determined to be received and the network card is determined to meet the LLDP enabling state modification condition, calling the target interface to acquire modification request related information, determining the target network port according to the modification request related information, and after the modification data packet is packaged, sending the modification data packet to the network card so that the network card sets the corresponding LLDP enabling state for the target network port. Therefore, the LLDP enabling state monitoring thread created by the BMC is used for modifying the LLDP enabling state of the network port in an out-of-band mode, an LLDP client is not required to be installed under an operating system to operate, the LLDP enabling state can be modified under a bare machine state, and the LLDP function control diversity is increased.
Description
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method, an apparatus, and a medium for controlling an LLDP enabled state.
Background
The server network card is generally provided with a link layer discovery protocol (Link Layer Discovery Protocol, abbreviated LLDP) function, and the LLDP implements unified management of devices on a link by sending LLDP messages to the switch.
Under different application scenarios, the LLDP needs to be turned on or turned off, and at present, a network port LLDP function is mainly turned on or turned off in an in-band manner, that is, an LLDP client is installed under an operating system, and control over an enabling state of the network port LLDP is achieved through the LLDP client.
However, in some special scenarios, for example, when the user needs to set the LLDP function of the network under the bare computer, the bare computer cannot operate the LLDP function because the bare computer does not install any operating system and corresponding proxy software, which brings bad experience to the user.
Therefore, how to realize the control of the LLDP enabling state under different scenes, increase the control diversity of the LLDP function, meet different requirements of users, and improve the user experience is a problem to be solved by the technicians in the field.
Disclosure of Invention
The purpose of the application is to provide a control method, a device and a medium for an LLDP enabling state, so as to control the LLDP enabling state under different scenes, increase LLDP function control diversity, meet different requirements of users and promote user experience.
In order to solve the above technical problems, the present application provides a control method of an LLDP enabled state, applied to an LLDP enabled state monitoring thread created by a BMC, including:
when the LLDP enabling state modification request is determined to be received and the network card is determined to meet the LLDP enabling state modification condition, a target interface is called to acquire modification request related information;
determining a target portal according to the modification request related information;
after the modification data packet is packaged, the modification data packet is sent to the network card, so that the network card sets the corresponding LLDP enabling state for the target network port.
Preferably, the determining that the LLDP-enabled state modification request is received includes:
judging whether a temporary file for storing the information related to the modification request exists or not; wherein, the modification request related information comprises an LLDP enabling state modification instruction and a target network port MAC address;
if so, determining that the LLDP enabled state modification request is received.
Preferably, the determining that the network card meets the LLDP enabled state modification condition includes:
acquiring prestored network card related information from the EEPROM; the network card related information at least comprises a network card manufacturer, a network card model and whether LLDP enabling state modification mark information is supported;
after establishing communication with the network card, acquiring current network card related information;
judging whether the prestored network card related information is consistent with the current network card related information or not;
if yes, determining whether the network card supports LLDP enabling state modification, if yes, determining that the network card meets the LLDP enabling state modification condition, and if not, recording log information that the network card does not support LLDP enabling state modification;
if the current network card related information is inconsistent with the prestored network card related information, recording the log information of the inconsistent current network card related information and the prestored network card related information.
Preferably, the calling target interface obtains the modification request related information includes:
determining the target interface according to the network card manufacturer;
and acquiring the information related to the modification request from the temporary file through the target interface.
Preferably, the determining the target portal according to the modification request related information includes:
traversing the MAC addresses of all network ports of the network card in sequence;
judging whether the network port MAC address is the same as the target network port MAC address in the temporary file or not by traversing one network port MAC address every time;
if the network ports are the same, determining that the network ports with the same MAC address are the target network ports.
Preferably, the control method of the LLDP enabled state further includes:
judging whether the recorded log information quantity of the network card which does not support LLDP enabling state modification exceeds a preset value or not;
and if the preset value is exceeded, clearing log information with earlier storage time according to the storage time.
Preferably, the network card setting the corresponding LLDP enabling state of the target network card includes:
after receiving the modification data packet, analyzing the modification data packet to determine an LLDP enabled state modification instruction;
and setting the LLDP enabling state of the target network port according to the LLDP enabling state modification instruction.
In order to solve the above technical problem, the present application further provides a control device for an LLDP enabled state, which is applied to an LLDP enabled state monitoring thread created by a BMC, and includes:
the calling module is used for calling the target interface to acquire the relevant information of the modification request when the LLDP enabling state modification request is determined to be received and the network card is determined to meet the LLDP enabling state modification condition;
the determining module is used for determining a target internet access according to the modification request related information;
and the sending module is used for sending the modified data packet to the network card after the modified data packet is packaged, so that the network card sets the corresponding LLDP enabling state for the target network port.
The control device of the LLDP enabled state further includes:
the first processing module is used for judging whether a temporary file for storing the related information of the modification request exists or not; the modification request related information includes an LLDP enabling state modification instruction and a target portal MAC address, and if the modifying request related information exists, it is determined that the LLDP enabling state modification request is received.
The first acquisition module is used for acquiring prestored network card related information from the EEPROM; the network card related information at least comprises a network card manufacturer, a network card model and whether LLDP enabling state modification mark information is supported;
the second acquisition module is used for acquiring the current network card related information after establishing communication with the network card;
and the second processing module is used for judging whether the prestored network card related information is consistent with the current network card related information, if so, determining whether the network card supports LLDP enabling state modification, if so, determining that the network card meets the LLDP enabling state modification condition, if not, recording log information that the network card does not support LLDP enabling state modification, and if not, recording the log information that the current network card related information is inconsistent with the prestored network card related information.
The inquiry module is used for determining the target interface according to the network card manufacturer;
and the third acquisition module is used for acquiring the modification request related information from the temporary file through the target interface.
The traversing module is used for traversing the MAC addresses of all network ports of the network card in sequence;
and the third processing module is used for judging whether the network port MAC address is the same as the target network port MAC address in the temporary file or not by traversing one network port MAC address every time, and if so, determining that the network port with the same MAC address is the target network port.
And the fourth processing module is used for judging whether the recorded quantity of log information which does not support LLDP enabling state modification exceeds a preset value, and if so, clearing the log information with earlier storage time according to the storage time.
The analyzing module is used for analyzing the modified data packet after receiving the modified data packet to determine an LLDP enabling state modification instruction;
and the setting module is used for setting the LLDP enabling state of the target network port according to the LLDP enabling state modification instruction.
In order to solve the above technical problems, the present application further provides a control device for an LLDP enabled state, including a memory for storing a computer program;
and a processor for implementing the control method of the LLDP enabling state when executing the computer program.
In order to solve the above technical problem, the present application further provides a computer readable storage medium, where a computer program is stored, and the computer program when executed by a processor implements the steps of the LLDP enabling state control method.
The control method of the LLDP enabled state provided by the invention is applied to an LLDP enabled state monitoring thread created by a BMC, and comprises the following steps: and when the LLDP enabling state modification request is determined to be received and the network card is determined to meet the LLDP enabling state modification condition, calling the target interface to acquire modification request related information, determining the target network port according to the modification request related information, and after the modification data packet is packaged, sending the modification data packet to the network card so that the network card sets the corresponding LLDP enabling state for the target network port. Therefore, according to the technical scheme provided by the application, the LLDP enabling state of the network port is modified in an out-of-band mode through the LLDP enabling state monitoring thread created by the BMC, an LLDP client is not required to be installed to operate under an operating system, the LLDP enabling state can be modified under a bare machine state, the LLDP function control diversity is increased, different requirements of users are met, and user experience is further improved.
In addition, the present application further provides a control device and a medium for the LLDP enabled state, which correspond to the control method for the LLDP enabled state, and have the same effects.
Drawings
For a clearer description of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described, it being apparent that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a control method of an LLDP enabled state according to an embodiment of the disclosure;
fig. 2 is a block diagram of a control device in an LLDP enabled state according to an embodiment of the disclosure;
fig. 3 is a block diagram of a control device for an LLDP enabled state according to another embodiment of the disclosure.
Detailed Description
The following description of the technical solutions in the embodiments of the present application will be made clearly and completely with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, but not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments herein without making any inventive effort are intended to fall within the scope of the present application.
The core of the application is to provide a control method, a device and a medium for LLDP enabled states, and the LLDP enabled states of network ports are modified in an out-of-band mode through an LLDP enabled state monitoring thread created by a BMC, so that LLDP function control diversity is increased, and user experience is improved.
In order to provide a better understanding of the present application, those skilled in the art will now make further details of the present application with reference to the drawings and detailed description.
The server network card generally has an LLDP function, and the LLDP realizes unified management of devices on the link by sending an LLDP message to the switch. Under different application scenarios, the LLDP needs to be turned on or turned off, and at present, a network port LLDP function is mainly turned on or turned off in an in-band manner, that is, an LLDP client is installed under an operating system, and control over an enabling state of the network port LLDP is achieved through the LLDP client.
However, in some special scenarios, for example, when the user needs to set the LLDP function of the network under the bare computer, the bare computer cannot operate the LLDP function because the bare computer does not install any operating system and corresponding proxy software, which brings bad experience to the user.
In order to solve the above technical problems, to achieve control of the LLDP enabled state in different scenarios, increase the control diversity of the LLDP function, satisfy different needs of users, and promote user experience, the embodiments of the present application provide a control method of the LLDP enabled state, and monitor the LLDP enabled state through an LLDP enabled state monitoring thread created by a baseboard management controller (Baseboard Manager Controller, abbreviated as BMC), that is, when the user needs to modify the LLDP enabled state, modify the LLDP enabled state of a network port in an out-of-band manner based on the BMC, without installing an LLDP client under an operating system to operate, and can implement modification of the LLDP enabled state in a bare machine state, thereby increasing the control diversity of the LLDP function.
Fig. 1 is a flowchart of a control method of an LLDP enabled state, which is provided in an embodiment of the application, and the method is applied to an LLDP enabled state monitoring thread created by a BMC, as shown in fig. 1, and the method includes:
s10: when the LLDP enabling state modification request is determined to be received and the network card is determined to meet the LLDP enabling state modification condition, a target interface is called to acquire modification request related information;
it should be noted that, the technical solution provided in the present application is applied to an LLDP enabled state monitoring thread created by a BMC, where the thread is configured to monitor whether to obtain an LLDP enabled state modification request of a user, and modify the LLDP enabled state according to the request of the user.
In an embodiment, when the user needs to modify the LLDP enabled state and the system does not install the LLDP client under the operating system, the LLDP enabled state modification request may be sent to the Web module in the BMC or to the Redfish through the browser, where the Redfish is a management standard based on HTTPs services. After the LLDP enabling state monitoring thread is established and the Web module or the Redfish receives the LLDP enabling state modification request of the user, judging whether the network card meets the modification condition of the LLDP enabling state, and if the network card meets the condition, calling a target interface to acquire the related information of the modification request.
When judging whether the network card meets the modification condition of the LLDP enabling state, the LLDP enabling state monitoring thread firstly acquires prestored network card related information from the EEPROM, wherein the network card related information at least comprises a network card manufacturer, a network card model and whether LLDP enabling state modification mark information is supported. And then establishing communication with the network card to acquire the current network card related information, judging whether the current network card related information is consistent with the prestored network card related information, and if so, determining that the network card meets the modification condition of the LLDP enabling state.
It is noted that the modification request related information is a result obtained by analyzing the LLDP enabling state modification request after the Web module or the Redfish obtains the LLDP enabling state modification request of the user, and the result is stored in the temporary file after the modification request related information is obtained by analyzing. The modification request related information comprises an LLDP enabled state modification instruction and a target network port MAC address.
It can be appreciated that the LLDP enabled state monitoring thread can directly obtain the modification request related information from the temporary file after determining that the LLDP enabled state modification request is received.
S11: determining a target network port according to the related information of the modification request;
further, after the LLDP enabled state monitoring thread obtains the information related to the modification request from the temporary file, the network port MAC address modified at this time can be determined, that is, the target network port MAC address can be determined. In the implementation, each network port on the network card is traversed in sequence, whether the network port traversed each time is a target network port MAC address is judged, the network port with the same MAC address as the target network port MAC address is used as a target network port, and the target network port is the network port needing LLDP enabling state modification.
S12: after the modification data packet is packaged, the modification data packet is sent to the network card, so that the network card sets the corresponding LLDP enabling state for the target network port.
After determining the target portal, the modified data packet is encapsulated, where the modified data packet may be an MCTP data packet or other types of data packets, which is not limited in this application. And sending the encapsulated modified data packet to the network card. After receiving the modification data packet, the network card analyzes the modification data packet to determine a target network port and an LLDP enabling state modification instruction, and then modifies the LLDP enabling state of the target network port based on the LLDP enabling state modification instruction.
The control method of the LLDP enabled state, provided by the embodiment of the application, is applied to an LLDP enabled state monitoring thread created by a BMC, and comprises the following steps: and when the LLDP enabling state modification request is determined to be received and the network card is determined to meet the LLDP enabling state modification condition, calling the target interface to acquire modification request related information, determining the target network port according to the modification request related information, and after the modification data packet is packaged, sending the modification data packet to the network card so that the network card sets the corresponding LLDP enabling state for the target network port. Therefore, according to the technical scheme provided by the application, the LLDP enabling state of the network port is modified in an out-of-band mode through the LLDP enabling state monitoring thread created by the BMC, an LLDP client is not required to be installed to operate under an operating system, the LLDP enabling state can be modified under a bare machine state, the LLDP function control diversity is increased, different requirements of users are met, and user experience is further improved.
In a specific embodiment, when a user needs to modify an LLDP enabled state, sending an LLDP enabled state modification instruction to a Web module or a Redfish in a BMC through a browser, and analyzing the received LLDP enabled state modification instruction by the Web module or the Redfish to obtain modification request related information, namely, obtaining the LLDP enabled state modification instruction and a target portal MAC address, and storing the modification request related information in a temporary file. Wherein, the LLDP enabled state modification instruction is used for modifying the LLDP enabled state of the network port, for example, the instruction is used for modifying the LLDP enabled state of the network port into open. And the target portal MAC address is used for determining the target portal which needs to be modified by the user from the portals.
It should be noted that, after performing the LLDP enable state modification once, the temporary file storing the information related to the modification request is deleted. Therefore, when determining whether the LLDP enabled state modification request is received, the LLDP enabled state monitoring thread determines that the LLDP enabled state modification request of the user is accepted by judging whether a temporary file for storing modification request related information exists.
According to the LLDP enabling state control method provided by the embodiment of the application, when the LLDP enabling state modification request is received, whether the LLDP enabling state modification request of a user is received is determined according to whether a temporary file for storing modification request related information exists. Therefore, the LLDP enabling state monitoring thread can determine whether a modification request to the LLDP enabling state of a user is received currently according to whether a temporary file exists or not, modify the LLDP enabling state according to a monitoring result, and further modify the LLDP enabling state by a bare metal machine, so that user experience is improved.
On the basis of the above embodiment, after the LLDP enabled state monitoring thread determines that the LLDP enabled state modification request of the user is received through whether the temporary file exists, it is required to determine whether the network card meets the LLDP enabled state modification condition. Therefore, as a preferred embodiment, determining that the network card satisfies the LLDP-enabled state modification condition includes:
acquiring prestored network card related information from the EEPROM; the network card related information at least comprises a network card manufacturer, a network card model and whether LLDP enabling state modification mark information is supported;
after establishing communication with the network card, acquiring current network card related information;
judging whether the prestored network card related information is consistent with the current network card related information;
if yes, determining whether the network card supports LLDP enabling state modification, if yes, determining that the network card meets LLDP enabling state modification conditions, and if not, recording log information that the network card does not support LLDP enabling state modification;
if the current network card related information is inconsistent with the prestored network card related information, recording the log information of the inconsistent current network card related information.
It can be understood that, when the network card leaves the factory, the network card related information such as the network card manufacturer and the network card model is stored in the EEPROM, so when judging whether the current network card meets the LLDP enabling state modification condition, the pre-stored network card related information is acquired from the EEPPROM through the I2C link, communication is established with the current network card, and then the current network card related information is acquired.
It should be noted that, the network card related information at least includes a network card manufacturer, a network card model, and whether to support LLDP enabled status modification flag information, where whether to support LLDP enabled status flag information may be a number, may also be english, or may also be other symbols, which is not limited in this application.
And comparing whether the prestored network card related information is consistent with the current network card related information, if so, further determining whether the network card supports LLDP enabling state modification according to the network card related information, and if so, determining that the network card meets the LLDP enabling state modification condition.
If the prestored network card related information is inconsistent with the current network card related information or the network card does not support LLDP enabling state modification according to the network card related information, determining that the network card does not meet the LLDP enabling state modification condition, and storing the related information of the unsatisfied condition in a log mode at the moment.
According to the LLDP enabling state control method, when the network card is determined to meet the LLDP enabling state modification condition, whether the pre-stored network card related information in the EEPROM is consistent with the current network card related information is determined, after the LLDP enabling state modification condition is determined to be met, the LLDP enabling state is modified, modification reliability is improved, and user experience is further improved.
It can be understood that the network cards of different manufacturers have different corresponding calling interfaces, so when the target interface is called to obtain the relevant information of the modification request on the basis of the embodiment, the target interface needs to be determined according to the vendor information of the network card in the relevant information of the network card, and then the relevant information of the modification request is obtained from the temporary file through the target interface.
According to the LLDP enabling state control method, when the target interface is called to acquire the modification request related information, the target interface is determined according to a network card manufacturer, the modification request related information is acquired from the temporary file through the target interface, the modification request related information in the temporary file is accurately and rapidly acquired according to the interface corresponding to the network card manufacturer, and LLDP enabling state modification efficiency and accuracy are improved.
In a specific embodiment, the network card includes a plurality of ports, when performing the LLDP enabling state modification of a certain port, it is necessary to determine a target port according to the modification request related information, and modify the LLDP enabling state of the target network card, so as a preferred embodiment, determining the target port according to the modification request related information includes:
traversing MAC addresses of all network ports of the network card in sequence;
judging whether the network port MAC address is the same as the target network port MAC address in the temporary file or not by traversing one network port MAC address every time;
if the network ports are the same, determining that the network ports with the same MAC address are target network ports.
In the implementation, each network port of the network card is traversed in turn to acquire the MAC address of each network port, and each time one network port MAC address is acquired, the MAC address is compared with the target network port MAC address acquired in the temporary file, and the network port with the same MAC address as the target network port MAC address is used as the target network port, namely the network port of which the LLDP enabling state is to be modified.
Of course, if the acquired MAC address is different from the MAC address of the target port, the next MAC address is acquired and compared until the target port identical to the MAC address of the target port is found. If all the network ports are found, transmitting a prompt signal to the client.
According to the LLDP enabling state control method provided by the embodiment of the application, whether the MAC address of each network port of the network card is the same as the target MAC address in the temporary file is compared to determine the target network port, so that the LLDP enabling state of the target network port is accurately modified.
It can be understood that if it is determined that the network card does not support the LLDP enabled state modification according to the network card related information, the corresponding log information needs to be stored, however, in order to avoid repeatedly recording multiple pieces of identical log information, excessive resources are occupied, and as a preferred embodiment, the technical scheme provided by the present application further includes:
judging whether the recorded log information quantity of the network card which does not support LLDP enabling state modification exceeds a preset value or not;
if the stored time exceeds the preset value, the log information with the earlier time is cleared according to the stored time.
The LLDP enabling state monitoring thread monitors the stored log information in real time, judges whether the recorded quantity of the log information which does not support LLDP enabling state modification exceeds a preset value, and deletes the log information stored earlier according to the stored time if the quantity of the log information exceeds the preset value, so that the quantity of the log information is prevented from exceeding the preset value. For example, if the preset value is 3, when the number of log information recorded in the network card that does not support LLDP enabled state modification is 4, then deleting one log information recorded earlier.
According to the LLDP enabling state control method, when the recorded network card is determined that the quantity of log information which does not support LLDP enabling state modification exceeds a preset value, log information with earlier storage time is cleared according to the storage time. Therefore, based on the log anti-collision strategy, resources are saved, and the reliability of LLDP enabled state control is improved.
In implementation, after the network card receives the modification data packet sent by the LLDP enabled state monitoring thread, the modification data packet is parsed to determine an LLDP enabled state modification instruction, and the LLDP enabled state of the target portal is set according to the LLDP enabled state modification instruction. For example, when the LLDP enable state modification command is to turn on the LLDP, the network card turns on the LLDP enable state of the target network card after parsing the modification data packet.
According to the LLDP enabling state control method, based on the monitoring of the LLDP enabling state monitoring thread on the user request, the corresponding modification data packet is sent to the network card based on the LLDP enabling state modification request, and therefore the LLDP enabling state of the network card is modified. Therefore, the LLDP enabling state of the network port is modified in an out-of-band mode, an LLDP client is not required to be installed under an operating system to operate, LLDP function control diversity is increased, different requirements of users are met, and user experience is further improved.
In the above embodiments, the control method of the LLDP enabled state is described in detail, and the present application further provides a corresponding embodiment of the control device of the LLDP enabled state. It should be noted that the present application describes an embodiment of the device portion from two angles, one based on the angle of the functional module and the other based on the angle of the hardware structure.
Fig. 2 is a block diagram of an LLDP enabled state control device according to an embodiment of the application, and as shown in fig. 2, the device includes:
a calling module 10, configured to, when it is determined that the LLDP enable state modification request is received and it is determined that the network card meets an LLDP enable state modification condition, call a target interface to obtain modification request related information;
a determining module 11, configured to determine a target portal according to the modification request related information;
and the sending module 12 is configured to send the modified data packet to the network card after the modified data packet is encapsulated, so that the network card sets the corresponding LLDP enabling state for the target network port.
As a preferred embodiment, the control device for an LLDP enabled state provided in the embodiment of the application further includes:
the first processing module is used for judging whether a temporary file for storing the related information of the modification request exists or not; the modification request related information includes an LLDP enabled state modification instruction and a target portal MAC address, and if the modified state modification instruction exists, it is determined that the LLDP enabled state modification request is received.
The first acquisition module is used for acquiring prestored network card related information from the EEPROM; the network card related information at least comprises a network card manufacturer, a network card model and whether LLDP enabling state modification mark information is supported;
the second acquisition module is used for acquiring the current network card related information after establishing communication with the network card;
the second processing module is configured to determine whether the prestored network card related information is consistent with the current network card related information, if so, determine whether the network card supports LLDP enabled state modification, if so, determine that the network card meets the LLDP enabled state modification condition, if not, record log information that the network card does not support LLDP enabled state modification, and if not, record log information that the current network card related information is inconsistent with the prestored network card related information.
The inquiry module is used for determining a target interface according to a network card manufacturer;
and the third acquisition module is used for acquiring the modification request related information from the temporary file through the target interface.
The traversal module is used for traversing the MAC addresses of all network ports of the network card in sequence;
and the third processing module is used for judging whether the MAC address of one network port is the same as the MAC address of the target network port in the temporary file or not by traversing the MAC address of one network port every time, and if so, determining that the network port with the same MAC address is the target network port.
And the fourth processing module is used for judging whether the recorded quantity of log information which does not support LLDP enabling state modification exceeds a preset value, and if so, clearing the log information with earlier storage time according to the storage time.
The analyzing module is used for analyzing the modified data packet after receiving the modified data packet to determine an LLDP enabling state modification instruction;
and the setting module is used for setting the LLDP enabling state of the target network port according to the LLDP enabling state modification instruction.
Since the embodiments of the apparatus portion and the embodiments of the method portion correspond to each other, the embodiments of the apparatus portion are referred to the description of the embodiments of the method portion, and are not repeated herein.
The control device of the LLDP enabled state, provided by the embodiment of the application, is applied to an LLDP enabled state monitoring thread created by a BMC, and comprises: and when the LLDP enabling state modification request is determined to be received and the network card is determined to meet the LLDP enabling state modification condition, calling the target interface to acquire modification request related information, determining the target network port according to the modification request related information, and after the modification data packet is packaged, sending the modification data packet to the network card so that the network card sets the corresponding LLDP enabling state for the target network port. Therefore, according to the technical scheme provided by the application, the LLDP enabling state of the network port is modified in an out-of-band mode through the LLDP enabling state monitoring thread created by the BMC, an LLDP client is not required to be installed to operate under an operating system, the LLDP enabling state can be modified under a bare machine state, the LLDP function control diversity is increased, different requirements of users are met, and user experience is further improved.
Fig. 3 is a block diagram of an LLDP enabled state control device according to another embodiment of the disclosure, where, as shown in fig. 3, the LLDP enabled state control device includes: a memory 20 for storing a computer program;
a processor 21 for implementing the steps of the control method of the LLDP enabled state as mentioned in the above embodiments when executing a computer program.
The control device of the LLDP enabled state provided in the embodiment may include, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, or the like.
Processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 may be implemented in hardware in at least one of a digital signal processor (Digital Signal Processor, abbreviated as DSP), a Field programmable gate array (Field-Programmable Gate Array, abbreviated as FPGA), and a programmable logic array (Programmable Logic Array, abbreviated as PLA). The processor 21 may also include a main processor and a coprocessor, the main processor being a processor for processing data in an awake state, also referred to as a central processor (Central Processing Unit, CPU for short); a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 21 may be integrated with an image processor (Graphics Processing Unit, GPU for short) for rendering and drawing of content required to be displayed by the display screen. In some embodiments, the processor 21 may also include an artificial intelligence (Artificial Intelligence, AI) processor for processing computing operations related to machine learning.
Memory 20 may include one or more computer-readable storage media, which may be non-transitory. Memory 20 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used for storing a computer program 201, where the computer program, after being loaded and executed by the processor 21, can implement the relevant steps of the LLDP enabling state control method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 20 may further include an operating system 202, data 203, and the like, where the storage manner may be transient storage or permanent storage. The operating system 202 may include Windows, unix, linux, among others. The data 203 may include, but is not limited to, related data and the like involved in a control method of the LLDP enabled state.
In some embodiments, the control device of the LLDP enabled state may further include a display 22, an input/output interface 23, a communication interface 24, a power supply 25, and a communication bus 26.
It will be appreciated by those skilled in the art that the structure shown in fig. 3 does not constitute a limitation of the control device of the LLDP enabled state, and may include more or less components than those illustrated.
The control device for the LLDP enabling state provided by the embodiment of the application comprises a memory and a processor, wherein the processor can realize the following method when executing a program stored in the memory: control method of LLDP enabled state.
According to the LLDP enabled state control device provided by the embodiment of the application, the LLDP enabled state of the network port is modified in an out-of-band mode through the LLDP enabled state monitoring thread created by the BMC, an LLDP client is not required to be installed for operation under an operating system, the LLDP enabled state can be modified in a bare machine state, the LLDP function control diversity is increased, different requirements of users are met, and user experience is further improved.
Finally, the present application also provides a corresponding embodiment of the computer readable storage medium. The computer-readable storage medium has stored thereon a computer program which, when executed by a processor, performs the steps as described in the method embodiments above.
It will be appreciated that the methods of the above embodiments, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored on a computer readable storage medium. With such understanding, the technical solution of the present application, or a part contributing to the prior art or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium, performing all or part of the steps of the method described in the various embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The above describes in detail a method, an apparatus and a medium for controlling an LLDP enabled state provided in the present application. In the description, each embodiment is described in a progressive manner, and each embodiment is mainly described by the differences from other embodiments, so that the same similar parts among the embodiments are mutually referred. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section. It should be noted that it would be obvious to those skilled in the art that various improvements and modifications can be made to the present application without departing from the principles of the present application, and such improvements and modifications fall within the scope of the claims of the present application.
It should also be noted that in this specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Claims (10)
1. The control method of the LLDP enabled state is characterized by being applied to an LLDP enabled state monitoring thread created by a BMC and comprising the following steps:
when the LLDP enabling state modification request is determined to be received and the network card is determined to meet the LLDP enabling state modification condition, a target interface is called to acquire modification request related information;
determining a target portal according to the modification request related information;
after the modification data packet is packaged, the modification data packet is sent to the network card, so that the network card sets the corresponding LLDP enabling state for the target network port.
2. The control method of an LLDP enabled state of claim 1, wherein said determining that an LLDP enabled state modification request is received comprises:
judging whether a temporary file for storing the information related to the modification request exists or not; wherein, the modification request related information comprises an LLDP enabling state modification instruction and a target network port MAC address;
if so, determining that the LLDP enabled state modification request is received.
3. The control method of LLDP enabled state of claim 2, wherein determining that the network card satisfies the LLDP enabled state modification condition comprises:
acquiring prestored network card related information from the EEPROM; the network card related information at least comprises a network card manufacturer, a network card model and whether LLDP enabling state modification mark information is supported;
after establishing communication with the network card, acquiring current network card related information;
judging whether the prestored network card related information is consistent with the current network card related information or not;
if yes, determining whether the network card supports LLDP enabling state modification, if yes, determining that the network card meets the LLDP enabling state modification condition, and if not, recording log information that the network card does not support LLDP enabling state modification;
if the current network card related information is inconsistent with the prestored network card related information, recording the log information of the inconsistent current network card related information and the prestored network card related information.
4. The LLDP-enabled state control method of claim 3, wherein said invoking target interface obtaining modification request related information comprises:
determining the target interface according to the network card manufacturer;
and acquiring the information related to the modification request from the temporary file through the target interface.
5. The control method of LLDP enabled state of claim 2, wherein said determining a target portal based on said modification request related information comprises:
traversing the MAC addresses of all network ports of the network card in sequence;
judging whether the network port MAC address is the same as the target network port MAC address in the temporary file or not by traversing one network port MAC address every time;
if the network ports are the same, determining that the network ports with the same MAC address are the target network ports.
6. The LLDP-enabled state control method of claim 3, further comprising:
judging whether the recorded log information quantity of the network card which does not support LLDP enabling state modification exceeds a preset value or not;
and if the preset value is exceeded, clearing log information with earlier storage time according to the storage time.
7. The method of controlling an LLDP enabled state of claim 1, wherein the network card setting the corresponding LLDP enabled state by the target network card comprises:
after receiving the modification data packet, analyzing the modification data packet to determine an LLDP enabled state modification instruction;
and setting the LLDP enabling state of the target network port according to the LLDP enabling state modification instruction.
8. An LLDP enabled state control device, which is applied to an LLDP enabled state monitoring thread created by a BMC, comprising:
the calling module is used for calling the target interface to acquire the relevant information of the modification request when the LLDP enabling state modification request is determined to be received and the network card is determined to meet the LLDP enabling state modification condition;
the determining module is used for determining a target internet access according to the modification request related information;
and the sending module is used for sending the modified data packet to the network card after the modified data packet is packaged, so that the network card sets the corresponding LLDP enabling state for the target network port.
9. A control device of LLDP enabled state, comprising a memory for storing a computer program;
a processor for implementing the steps of the control method of LLDP enabled state according to any one of claims 1 to 7 when executing said computer program.
10. A computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, which when executed by a processor, implements the steps of the LLDP-enabled state control method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310076343.5A CN116048642A (en) | 2023-01-30 | 2023-01-30 | LLDP (LLDP) enabled state control method, LLDP enabled state control device and LLDP enabled state control medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310076343.5A CN116048642A (en) | 2023-01-30 | 2023-01-30 | LLDP (LLDP) enabled state control method, LLDP enabled state control device and LLDP enabled state control medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116048642A true CN116048642A (en) | 2023-05-02 |
Family
ID=86116260
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310076343.5A Pending CN116048642A (en) | 2023-01-30 | 2023-01-30 | LLDP (LLDP) enabled state control method, LLDP enabled state control device and LLDP enabled state control medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116048642A (en) |
-
2023
- 2023-01-30 CN CN202310076343.5A patent/CN116048642A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112861057B (en) | Page rendering method, device, equipment and storage medium based on applet | |
CN108733403B (en) | BIOS setting method and device | |
US10552068B2 (en) | Access method and device for random access memories, control chip and storage medium | |
CN111984561B (en) | IPMI command processing method, system, device and medium for BMC | |
CN112243033B (en) | Method, device and equipment for acquiring memory information and computer readable storage medium | |
CN110187986B (en) | Command management method, system, device and computer readable storage medium | |
CN111181787A (en) | BMC parameter configuration method, device, equipment and medium | |
CN110825425B (en) | Configuration data management method and device, electronic equipment and storage medium | |
CN111954240A (en) | Network fault processing method and device and electronic equipment | |
CN114826749A (en) | Interface access control method, device and medium | |
CN109492181A (en) | Method for page jump, device, computer equipment and storage medium | |
US20070155422A1 (en) | Method for controlling mobile data connection through USB Ethernet management of mobile station | |
CN116932433B (en) | Installation control method based on DPU and related equipment | |
CN115208671B (en) | Firewall configuration method, device, electronic equipment and storage medium | |
CN110365839B (en) | Shutdown method, shutdown device, shutdown medium and electronic equipment | |
CN116048726A (en) | Deployment method, device and medium of containerized storage cluster | |
CN116048642A (en) | LLDP (LLDP) enabled state control method, LLDP enabled state control device and LLDP enabled state control medium | |
CN113726855B (en) | Service aggregation method, device, electronic equipment and computer-readable storage medium | |
CN112910910B (en) | Method, device, equipment and storage medium for processing OPCDA protocol message | |
CN112084099B (en) | Method, device, equipment and storage medium for acquiring alarm state value based on host | |
CN114726905A (en) | Method, device, equipment and storage medium for accessing Tbox network to Android system | |
CN114302055A (en) | Linux-based camera control method, device, equipment and storage medium | |
CN110941484B (en) | Application program calling method and device | |
WO2017096889A1 (en) | Method and device for upgrading and downgrading system | |
CN114281422A (en) | Cloud computer control method, device and medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |