Cisco Packet Tracer Extensions API 8.1.0
API for communication between Cisco Packet Tracer application and its extension applications and modules.
Public Member Functions | List of all members
HostPort Class Reference

HostPort handles and manipulates the port configurations on end devices. More...

Inheritance diagram for HostPort:
Port Process RouterPort FRSubInterface RoutedSwitchPort VirtualTemplateInterface

Public Member Functions

void setIpSubnetMask (ip, ip)
 Configures a static IP address and subnet mask on the port. More...
 
void setDefaultArpTimeout ()
 Sets the default timer time for ARP. More...
 
void setDhcpClientFlag (bool)
 Enables or disables the DHCP client on the port. More...
 
bool isDhcpClientOn ()
 Returns true if the DHCP client is enabled, otherwise false. More...
 
ip getIpAddress ()
 Returns the IP address configured on the port. More...
 
ip getSubnetMask ()
 Returns the subnet mask configured on the port. More...
 
void ipChanged (ip, ip, ip, ip)
 This event is emitted when the IP address or subnet mask changes. More...
 
void setIpv6Enabled (bool)
 Enables or disables IPv6 on the port. More...
 
bool isIpv6Enabled ()
 Returns true if IPv6 is enabled on the port, otherwise false. More...
 
void setIpv6AddressAutoConfig (bool)
 Enables or disables IPv6 auto config. More...
 
bool isIpv6AddressAutoConfig ()
 Returns true if IPv6 auto config is enabled, otherwise false. More...
 
bool isSetToDhcpv6 ()
 Returns true if port is set to DHCP v6, otherwise false. More...
 
void setIpv6LinkLocal (ipv6)
 Sets the IPv6 link-local address. More...
 
ipv6 getIpv6LinkLocal ()
 Returns the IPv6 link-local address. More...
 
void ipv6LinkLocalChanged (ipv6, ipv6)
 This event is emitted when the IPv6 link-local address changes. More...
 
bool addIpv6Address (ipv6, int, Ipv6AddressType, bool)
 Configures a static IPv6 address and network prefix on the port. More...
 
void ipv6AddressAdded (ipv6, int, Ipv6AddressType)
 This event is emitted when the IPv6 address changes. More...
 
bool removeIpv6Address (ipv6, int, Ipv6AddressType)
 Removes the IPv6 configuration from the port. More...
 
void ipv6AddressRemoved (ipv6, int, Ipv6AddressType)
 This event is emitted when the IPv6 address configuration is removed. More...
 
void removeAllIpv6Addresses ()
 Removes all IPv6 address configurations. More...
 
bool hasIpv6Address (ipv6)
 Returns true if the specified IPv6 address is configured on the port, otherwise false. More...
 
Ipv6AddressConfig getIpv6Address (ipv6)
 Returns the Ipv6AddressConfig object of the specified IPv6 address. More...
 
ipv6 getUnicastIpv6Address () const
 Returns a list of Ipv6AddressConfig objects associated to the port. More...
 
int getUnicastIpv6Prefix ()
 Returns the port's Unicast Ipv6 Prefix. More...
 
vector< Ipv6AddressConfiggetIpv6Addresses ()
 Returns a list of Ipv6AddressConfig objects associated to the port. More...
 
bool isInIpv6Multicast (ipv6)
 Returns true if specified IPv6 address is a multicast address, otherwise false. More...
 
vector< ipv6 > getIpv6Multicast ()
 Returns a list of IPv6 multicast addresses configured on the port. More...
 
void setMtu (int)
 Sets the maximum transmission unit (MTU) value on the port. More...
 
int getMtu ()
 Returns the maximum transmission unit (MTU) value configured on the port. More...
 
void setIpMtu (int)
 Sets the IP maximum transmission unit (MTU) value on the port. More...
 
int getIpMtu ()
 Returns the IP maximum transmission unit (MTU) value configured on the port. More...
 
void setIpv6Mtu (int)
 Sets the IPv6 maximum transmission unit (MTU) value on the port. More...
 
int getIpv6Mtu ()
 Returns the IPv6 maximum transmission unit (MTU) value configured on the port. More...
 
void setDefaultGateway (ip)
 Sets the default gateway for this port. More...
 
void setDnsServerIp (ip)
 Sets the DNS server gateway for this port. More...
 
void setv6ServerIp (ipv6)
 Sets the DNS Server IPv6 gateway for this port. More...
 
void setv6DefaultGateway (ipv6)
 Sets the default IPv6 gateway for this port. More...
 
bool isInboundFirewallOn ()
 Returns true if the IPv4 inbound firewall is enabled, otherwise false. More...
 
void setInboundFirewallService (bool)
 Enables or disables the IPv4 inbound firewall. More...
 
bool isInboundIpv6FirewallOn ()
 Returns true if the IPv6 inbound firewall is enabled, otherwise false. More...
 
void setInboundIpv6FirewallService (bool)
 Enables or disables the IPv6 inbound firewall. More...
 
- Public Member Functions inherited from Port
string getName ()
 Returns the name of the port. More...
 
int getChannel ()
 Returns the channel of the port. More...
 
void setChannel (int)
 Sets the channel of the port. More...
 
string getTerminalTypeShortString ()
 Returns the name of the port shortened, without number. More...
 
string getPortNameNumber ()
 Returns the port number. Can have something like 0/0/0, etc. More...
 
PortType getType ()
 Returns the type of the port. More...
 
void setDescription (string)
 Sets the description for the port. More...
 
string getDescription ()
 Returns the description of the port. More...
 
void setPower (bool)
 Sets the power state for the port. More...
 
bool getPower ()
 Returns true if the port is on, false if the port is off. More...
 
void powerChanged (bool)
 This event is emitted when the power state of the port changes. More...
 
bool isStraightPins ()
 Returns true if the pins are straight, for ethernet. More...
 
bool isAutoCross ()
 Returns true if the port is configured for auto crossover, for ethernet. More...
 
void setBandwidth (int)
 Sets the bandwidth for the port. More...
 
int getBandwidth ()
 Returns the bandwidth of the port. More...
 
void setBandwidthAutoNegotiate (bool)
 Enables or disables bandwidth auto negotiation. More...
 
bool isBandwidthAutoNegotiate ()
 Returns true if bandwidth auto negotiation is enabled, otherwise false. More...
 
void setFullDuplex (bool)
 Enables or disables full duplex mode. More...
 
bool isFullDuplex ()
 Returns true if full duplex mode is enabled, otherwise false. More...
 
void setDuplexAutoNegotiate (bool)
 Enables or disables duplex auto negotiation. More...
 
bool isDuplexAutoNegotiate ()
 Returns true if duplex auto negotiation is enabled, otherwise false. More...
 
void setMacAddress (mac)
 Sets the MAC address on the port. More...
 
mac getMacAddress ()
 Returns the MAC address set on the port. More...
 
void macChanged (mac, mac)
 This event is emitted when the MAC address on the port changes. More...
 
mac getBia ()
 Returns the burned-in address of the port. More...
 
void setClockRate (int)
 Sets the clock rate on the port. More...
 
int getClockRate ()
 Returns the clock rate on the port. More...
 
Link getLink ()
 Returns the link connected to the port. More...
 
bool isProtocolUp ()
 Returns true if the line protocol is up on the port, otherwise false. More...
 
bool isPortUp ()
 Returns true if the status is up on the port, otherwise false. More...
 
Process getEncapProcess ()
 Returns the encapsulation process. More...
 
Process getKeepAliveProcess ()
 Returns the keepalive process. More...
 
QString getRemotePortName ()
 Returns the name of the remote port. More...
 
LightStatus getLightStatus ()
 Returns the link light status. More...
 
void lightStatusChanged (LightStatus)
 This event is emitted when the link light changes. More...
 
void lightBlinked ()
 This event is emitted when the link light blinks. More...
 
void portStatusChanged (bool)
 This event is emitted when the port status changes. More...
 
void lineProtocolChanged (bool)
 This event is emitted when the line protocol status changes. More...
 
void packetReceived (string, int)
 This event is emitted when the port receives a packet. More...
 
void packetSent (string, int)
 This event is emitted when the port sends a packet. More...
 
void packetReceivedWithDetails (Signal, int)
 This event is emitted when the port receives a packet with details. More...
 
void packetSentWithDetails (Signal, int)
 This event is emitted when the port sends a packet with details. More...
 
int getHigherProcessCount ()
 Returns the higher process count. More...
 
HardwareQueue getHardwareQueue ()
 Returns the hardware queue. More...
 
QueueProcess getQosQueue ()
 Returns the qos queue. More...
 
bool isEthernetPort ()
 Returns true if it is a ethernet port, false if not. More...
 
bool isWirelessPort ()
 Returns true if it is a wireless port, false if not. More...
 
bool isPowerOn ()
 Returns true if the power is on, false if not. More...
 
void deleteLink ()
 
- Public Member Functions inherited from Process
Device getOwnerDevice ()
 Returns the device for this process. More...
 

Detailed Description

HostPort handles and manipulates the port configurations on end devices.

Member Function Documentation

◆ addIpv6Address()

bool HostPort::addIpv6Address ( ipv6  ,
int  ,
Ipv6AddressType  ,
bool   
)

Configures a static IPv6 address and network prefix on the port.

Parameters
ipAddress,theIPv6 address.
prefix,thenetwork prefix.
type,theIPv6 address type. IPv6 address types: eUnicast = 0, eAnycast = 1, eEui64 = 2, eNdAssigned = 3, eDhcpAssigned = 4
bAllowDup,trueto allow duplicate IPv6 addresses, false to disallow duplicate IPv6 addresses.

◆ getIpAddress()

ip HostPort::getIpAddress ( )

Returns the IP address configured on the port.

Returns
ip, the IP address configured on the port.

◆ getIpMtu()

int HostPort::getIpMtu ( )

Returns the IP maximum transmission unit (MTU) value configured on the port.

Returns
int, the IP MTU value.

◆ getIpv6Address()

Ipv6AddressConfig HostPort::getIpv6Address ( ipv6  )

Returns the Ipv6AddressConfig object of the specified IPv6 address.

Parameters
ipAddress,theIPv6 address of interest.
Returns
Ipv6AddressConfig, the Ipv6AddressConfig object of the specified IPv6 address.

◆ getIpv6Addresses()

vector< Ipv6AddressConfig > HostPort::getIpv6Addresses ( )

Returns a list of Ipv6AddressConfig objects associated to the port.

Returns
vector<Ipv6AddressConfig>, a list of Ipv6AddressConfig objects associated to the port.

◆ getIpv6LinkLocal()

ipv6 HostPort::getIpv6LinkLocal ( )

Returns the IPv6 link-local address.

Returns
ipv6, the IPv6 link-local address.

◆ getIpv6Mtu()

int HostPort::getIpv6Mtu ( )

Returns the IPv6 maximum transmission unit (MTU) value configured on the port.

Returns
int, the IPv6 MTU value.

◆ getIpv6Multicast()

vector< ipv6 > HostPort::getIpv6Multicast ( )

Returns a list of IPv6 multicast addresses configured on the port.

Returns
vector<ipv6>, a list of IPv6 multicast addresses configured on the port.

◆ getMtu()

int HostPort::getMtu ( )

Returns the maximum transmission unit (MTU) value configured on the port.

Returns
int, the MTU value.

◆ getSubnetMask()

ip HostPort::getSubnetMask ( )

Returns the subnet mask configured on the port.

Returns
ip, the subnet mask configured on the port.

◆ getUnicastIpv6Address()

ipv6 HostPort::getUnicastIpv6Address ( ) const

Returns a list of Ipv6AddressConfig objects associated to the port.

Returns
vector<Ipv6AddressConfig>, a list of Ipv6AddressConfig objects associated to the port.

◆ getUnicastIpv6Prefix()

int HostPort::getUnicastIpv6Prefix ( )

Returns the port's Unicast Ipv6 Prefix.

Returns
int, the port's Unicast Ipv6 Prefix.

◆ hasIpv6Address()

bool HostPort::hasIpv6Address ( ipv6  )

Returns true if the specified IPv6 address is configured on the port, otherwise false.

Parameters
ipAddress,theIPv6 address of interest.
Returns
bool, true if the specified IPv6 address is configured on the port, otherwise false.

◆ ipChanged()

void HostPort::ipChanged ( ip  ,
ip  ,
ip  ,
ip   
)

This event is emitted when the IP address or subnet mask changes.

  • newIp, the new IP address.
  • newMask, the new subnet mask.
  • oldIp, the old IP address.
  • oldMask, the old subnet mask.

IPC event.

◆ ipv6AddressAdded()

void HostPort::ipv6AddressAdded ( ipv6  ,
int  ,
Ipv6AddressType   
)

This event is emitted when the IPv6 address changes.

Parameters
ipAddress,theIPv6 address.
prefix,thenetwork prefix.
type,theIPv6 address type. IPv6 address types: eUnicast = 0, eAnycast = 1, eEui64 = 2, eNdAssigned = 3, eDhcpAssigned = 4

IPC event.

◆ ipv6AddressRemoved()

void HostPort::ipv6AddressRemoved ( ipv6  ,
int  ,
Ipv6AddressType   
)

This event is emitted when the IPv6 address configuration is removed.

Parameters
ipAddress,theIPv6 address.
prefix,thenetwork prefix.
type,theIPv6 address type. IPv6 address types: eUnicast = 0, eAnycast = 1, eEui64 = 2, eNdAssigned = 3, eDhcpAssigned = 4

IPC event.

◆ ipv6LinkLocalChanged()

void HostPort::ipv6LinkLocalChanged ( ipv6  ,
ipv6   
)

This event is emitted when the IPv6 link-local address changes.

  • newIp, the new IPv6 link-local address.
  • oldIp, the old IPv6 link-local address.

IPC event.

◆ isDhcpClientOn()

bool HostPort::isDhcpClientOn ( )

Returns true if the DHCP client is enabled, otherwise false.

Returns
bool, true if the DHCP client is enabled, otherwise false.

◆ isInboundFirewallOn()

bool HostPort::isInboundFirewallOn ( )

Returns true if the IPv4 inbound firewall is enabled, otherwise false.

Returns
bool, true if the IPv4 inbound firewall is enabled, otherwise false.

◆ isInboundIpv6FirewallOn()

bool HostPort::isInboundIpv6FirewallOn ( )

Returns true if the IPv6 inbound firewall is enabled, otherwise false.

Returns
bool, true if the IPv6 inbound firewall is enabled, otherwise false.

◆ isInIpv6Multicast()

bool HostPort::isInIpv6Multicast ( ipv6  )

Returns true if specified IPv6 address is a multicast address, otherwise false.

Parameters
ipAddress,theIPv6 address of interest.
Returns
bool, true if specified IPv6 address is a multicast address, otherwise false.

◆ isIpv6AddressAutoConfig()

bool HostPort::isIpv6AddressAutoConfig ( )

Returns true if IPv6 auto config is enabled, otherwise false.

Returns
bool, true if IPv6 auto config is enabled, otherwise false.

◆ isIpv6Enabled()

bool HostPort::isIpv6Enabled ( )

Returns true if IPv6 is enabled on the port, otherwise false.

Returns
bool, true if IPv6 is enabled on the port, otherwise false.

◆ isSetToDhcpv6()

bool HostPort::isSetToDhcpv6 ( )

Returns true if port is set to DHCP v6, otherwise false.

Returns
bool, true if port is set to DHCP v6, otherwise false.

◆ removeAllIpv6Addresses()

void HostPort::removeAllIpv6Addresses ( )

Removes all IPv6 address configurations.

◆ removeIpv6Address()

bool HostPort::removeIpv6Address ( ipv6  ,
int  ,
Ipv6AddressType   
)

Removes the IPv6 configuration from the port.

Parameters
ipAddress,theIPv6 address.
prefix,thenetwork prefix.
type,theIPv6 address type. IPv6 address types: eUnicast = 0, eAnycast = 1, eEui64 = 2, eNdAssigned = 3, eDhcpAssigned = 4

◆ setDefaultArpTimeout()

void HostPort::setDefaultArpTimeout ( )

Sets the default timer time for ARP.

◆ setDefaultGateway()

void HostPort::setDefaultGateway ( ip  )

Sets the default gateway for this port.

Parameters
gateway,theIP address of the default gateway.

◆ setDhcpClientFlag()

void HostPort::setDhcpClientFlag ( bool  )

Enables or disables the DHCP client on the port.

Parameters
bFlag,trueto enable the DHCP client, false to disable it.

◆ setDnsServerIp()

void HostPort::setDnsServerIp ( ip  )

Sets the DNS server gateway for this port.

Parameters
gateway,theIP address of the DNS gateway.

◆ setInboundFirewallService()

void HostPort::setInboundFirewallService ( bool  )

Enables or disables the IPv4 inbound firewall.

Parameters
bEnable,trueto enable the IPv4 inbound firewall, false to disable it.

◆ setInboundIpv6FirewallService()

void HostPort::setInboundIpv6FirewallService ( bool  )

Enables or disables the IPv6 inbound firewall.

Parameters
bEnable,trueto enable the IPv6 inbound firewall, false to disable it.

◆ setIpMtu()

void HostPort::setIpMtu ( int  )

Sets the IP maximum transmission unit (MTU) value on the port.

Parameters
mtu,theIP MTU value.

◆ setIpSubnetMask()

void HostPort::setIpSubnetMask ( ip  ,
ip   
)

Configures a static IP address and subnet mask on the port.

Parameters
newIpAddress,theIP address.
newMask,thesubnet mask.

◆ setIpv6AddressAutoConfig()

void HostPort::setIpv6AddressAutoConfig ( bool  )

Enables or disables IPv6 auto config.

Parameters
bAutoConfig,trueto enable IPv6 auto config, false to disable it.

◆ setIpv6Enabled()

void HostPort::setIpv6Enabled ( bool  )

Enables or disables IPv6 on the port.

Parameters
bEnable,trueto enable IPv6, false to disable it.

◆ setIpv6LinkLocal()

void HostPort::setIpv6LinkLocal ( ipv6  )

Sets the IPv6 link-local address.

Parameters
ipAddress,theIPv6 link-local address.

◆ setIpv6Mtu()

void HostPort::setIpv6Mtu ( int  )

Sets the IPv6 maximum transmission unit (MTU) value on the port.

Parameters
mtu,theIP MTU value.

◆ setMtu()

void HostPort::setMtu ( int  )

Sets the maximum transmission unit (MTU) value on the port.

Parameters
mtu,theMTU value.

◆ setv6DefaultGateway()

void HostPort::setv6DefaultGateway ( ipv6  )

Sets the default IPv6 gateway for this port.

Parameters
gateway,theIPv6 address of the default gateway.

◆ setv6ServerIp()

void HostPort::setv6ServerIp ( ipv6  )

Sets the DNS Server IPv6 gateway for this port.

Parameters
gateway,theIPv6 address of the DNS gateway.

The documentation for this class was generated from the following file: