The OpteAdm object provides two constructors.
One for the control node:
|
pub fn open_ctl() -> Result<Self, Error> { |
|
Ok(OpteAdm { |
|
device: OpenOptions::new() |
|
.read(true) |
|
.write(true) |
|
.open(Self::OPTE_CTL)?, |
|
}) |
|
} |
One for a particular VNIC:
|
pub fn open_port(name: &str) -> Result<Self, Error> { |
|
let path = format!("{}{}", Self::OPTE_PORT_PREFIX, name); |
|
Ok(OpteAdm { |
|
device: OpenOptions::new().read(true).write(true).open(path)?, |
|
}) |
|
} |
These interfaces expose distinct functionality, and should likely be refactored into two separate objects (as an example, is it even possible to set the IP configuration on the control node?).
The OpteAdm object provides two constructors.
One for the control node:
opte/opteadm/src/lib.rs
Lines 71 to 78 in 709ccaa
One for a particular VNIC:
opte/opteadm/src/lib.rs
Lines 81 to 86 in 709ccaa
These interfaces expose distinct functionality, and should likely be refactored into two separate objects (as an example, is it even possible to set the IP configuration on the control node?).