PortSecurity handles and manipulates port security on switch ports.
More...
PortSecurity handles and manipulates port security on switch ports.
◆ addSecureMacEntry()
bool PortSecurity::addSecureMacEntry |
( |
mac |
, |
|
|
bool |
|
|
) |
| |
Adds a secure MAC address entry.
- Parameters
-
macAddress,the | MAC address to add. |
isSticky,true | for sticky, false for not sticky. |
- Returns
- bool, true if successful, otherwise false.
◆ getLastSourceMacVlan()
pair< mac, int > PortSecurity::getLastSourceMacVlan |
( |
| ) |
|
Returns the last source MAC address and VLAN number.
- Returns
- pair<mac, int>, the last source MAC address and VLAN number.
◆ getMaxMacNumber()
int PortSecurity::getMaxMacNumber |
( |
| ) |
|
Returns the port security max-mac-count.
- Returns
- int, the port security max-mac-count value.
◆ getPort()
Port PortSecurity::getPort |
( |
| ) |
|
Returns the switch port.
- Returns
- Port, the Port object.
◆ getSecureMacCount()
int PortSecurity::getSecureMacCount |
( |
| ) |
|
Returns the number of secure MAC addresses.
- Returns
- int, the number of secure MAC addresses.
◆ getTotalMac()
int PortSecurity::getTotalMac |
( |
| ) |
|
Returns the total number of MAC addresses.
- Returns
- int, the total number of MAC addresses.
◆ getViolationCount()
int PortSecurity::getViolationCount |
( |
| ) |
|
Returns the number of violations.
- Returns
- int, the number of violations.
◆ isEnabled()
bool PortSecurity::isEnabled |
( |
| ) |
|
Returns true if port security is enabled, otherwise false.
- Returns
- bool, true if port security is enabled, otherwise false.
◆ isStickyOn()
bool PortSecurity::isStickyOn |
( |
| ) |
|
Returns true if sticky is enabled, otherwise false.
- Returns
- bool, true if sticky is enabled, otherwise false.
◆ removeSecureMacEntry()
bool PortSecurity::removeSecureMacEntry |
( |
mac |
| ) |
|
Removes the specified secure MAC address entry.
- Parameters
-
macAddress,the | MAC address to remove. |
- Returns
- bool, true if successful, otherwise false.
◆ secureMacExist()
bool PortSecurity::secureMacExist |
( |
mac |
| ) |
|
Returns true if the specified secure MAC address exists, otherwise false.
- Parameters
-
macAddress,the | MAC address of interest. |
- Returns
- bool, true if the specified secure MAC address exists, otherwise false.
◆ setEnabled()
void PortSecurity::setEnabled |
( |
bool |
| ) |
|
Enables or disables port security.
- Parameters
-
bEnable,true | to enable port security, false to disable it. |
◆ setMaxMacNumber()
bool PortSecurity::setMaxMacNumber |
( |
int |
| ) |
|
Sets the port security max-mac-count.
- Parameters
-
max,the | port security max-mac-count value. |
- Returns
- bool, true if successful, otherwise false.
◆ setStickyflag()
void PortSecurity::setStickyflag |
( |
bool |
| ) |
|
Enables or disables sticky.
- Parameters
-
isSticky,true | to enable sticky, false to disable it. |
◆ setViolationMode()
void PortSecurity::setViolationMode |
( |
PortViolation |
| ) |
|
Sets the violation mode.
- Parameters
-
type,the | violation mode. Violation modes: eShutdown = 0, eProtect = 1, eRestrict = 2 |
The documentation for this class was generated from the following file: