Skip to content

OpteADM: Overloaded? #14

Description

@smklein

The OpteAdm object provides two constructors.

One for the control node:

opte/opteadm/src/lib.rs

Lines 71 to 78 in 709ccaa

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:

opte/opteadm/src/lib.rs

Lines 81 to 86 in 709ccaa

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?).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions