diff options
Diffstat (limited to 'src/main/java')
| -rw-r--r-- | src/main/java/org/openslx/libvirt/domain/device/Interface.java | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/src/main/java/org/openslx/libvirt/domain/device/Interface.java b/src/main/java/org/openslx/libvirt/domain/device/Interface.java index b09c7da..dae3c11 100644 --- a/src/main/java/org/openslx/libvirt/domain/device/Interface.java +++ b/src/main/java/org/openslx/libvirt/domain/device/Interface.java @@ -59,16 +59,16 @@ public class Interface extends Device { return Type.fromString( this.getXmlElementAttributeValue( "type" ) ); } - + /** * Sets type of the network device. * * @return type of the network device. */ - public void setType(Type type) + public void setType( Type type ) { String source = this.getSource(); - + // change type and set source again this.setXmlElementAttributeValue( "type", type.toString() ); this.setSource( source ); @@ -119,6 +119,26 @@ public class Interface extends Device } /** + * Returns MAC address of the network device. + * + * @return MAC address of the network device. + */ + public String getMacAddress() + { + return this.getXmlElementAttributeValue( "mac", "address" ); + } + + /** + * Sets MAC address of the network device. + * + * @param macAddress MAC address for the network device. + */ + public void setMacAddress( String macAddress ) + { + this.setXmlElementAttributeValue( "mac", "address", macAddress ); + } + + /** * Removes boot oder entry of the network interface device. */ public void removeBootOrder() @@ -135,6 +155,14 @@ public class Interface extends Device } /** + * Removes MAC address of the network interface device. + */ + public void removeMacAddress() + { + this.removeXmlElement( "mac" ); + } + + /** * Creates a non-existent network interface device as Libvirt XML device element. * * @param iface network device that is created. |
