mirror of
https://github.com/outbackdingo/sysadm.git
synced 2026-01-27 10:20:26 +00:00
Add in the ability to close or open multiple ports at once, by passing
in a QVector<PortInfo> to the OpenPort and ClosePort functions,
This commit is contained in:
@@ -84,12 +84,30 @@ void Firewall::OpenPort(int port, QString type)
|
||||
SaveOpenPorts();
|
||||
}
|
||||
|
||||
void Firewall::OpenPort(QVector<PortInfo> ports)
|
||||
{
|
||||
for(PortInfo port : ports)
|
||||
{
|
||||
openports.append(port);
|
||||
}
|
||||
SaveOpenPorts();
|
||||
}
|
||||
|
||||
void Firewall::ClosePort(int port, QString type)
|
||||
{
|
||||
openports.removeAll(LookUpPort(port,type));
|
||||
SaveOpenPorts();
|
||||
}
|
||||
|
||||
void Firewall::ClosePort(QVector<PortInfo> ports)
|
||||
{
|
||||
for(PortInfo port : ports)
|
||||
{
|
||||
openports.removeAll(port);
|
||||
}
|
||||
SaveOpenPorts();
|
||||
}
|
||||
|
||||
QVector<PortInfo> Firewall::OpenPorts()
|
||||
{
|
||||
return openports;
|
||||
|
||||
@@ -54,6 +54,12 @@ public:
|
||||
*/
|
||||
void OpenPort(int number, QString type);
|
||||
|
||||
/**
|
||||
* @brief Opens a set of ports
|
||||
* @param ports a vector of ports to open
|
||||
*/
|
||||
void OpenPort(QVector<PortInfo> ports);
|
||||
|
||||
/**
|
||||
* @brief ClosePort closes a port
|
||||
* @param number a port number between 0 and 2^16 -1
|
||||
@@ -61,6 +67,12 @@ public:
|
||||
*/
|
||||
void ClosePort(int number, QString type);
|
||||
|
||||
/**
|
||||
* @brief ClosePort closes a set of ports
|
||||
* @param ports a vector of ports to close
|
||||
*/
|
||||
void ClosePort(QVector<PortInfo> ports);
|
||||
|
||||
/**
|
||||
* @brief finds a list of ports that are open gets the info about them
|
||||
* and returns them
|
||||
|
||||
Reference in New Issue
Block a user