Skip to content

Commit

Permalink
packet_out change port_id to in_port
Browse files Browse the repository at this point in the history
  • Loading branch information
Arikato111 committed May 19, 2024
1 parent 289482a commit 2c52955
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/openflow/events/packet_out.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use super::{flow_mod::SizeCheck, FlowAction, Payload};

pub struct PacketOutEvent {
pub payload: Payload,
pub port_id: Option<u16>,
pub in_port: Option<u16>,
pub actions: Vec<FlowAction>,
}

Expand All @@ -24,7 +24,7 @@ impl MessageMarshal for PacketOutEvent {
Payload::Buffered(n, _) => n as i32,
Payload::NoBuffered(_) => -1,
});
match self.port_id {
match self.in_port {
Some(id) => {
PseudoPort::PhysicalPort(id).marshal(bytes);
}
Expand Down Expand Up @@ -53,9 +53,9 @@ impl MessageMarshal for PacketOutEvent {
}

impl PacketOutEvent {
pub fn new(port_id: Option<u16>, payload: Payload, actions: Vec<FlowAction>) -> Self {
pub fn new(in_port: Option<u16>, payload: Payload, actions: Vec<FlowAction>) -> Self {
Self {
port_id,
in_port,
payload,
actions,
}
Expand All @@ -82,7 +82,7 @@ impl PacketOutEvent {
Payload::Buffered(n as u32, bytes.fill_buf().unwrap().to_ascii_lowercase())
}
},
port_id: {
in_port: {
if in_port == OfpPort::None as u16 {
None
} else {
Expand Down

0 comments on commit 2c52955

Please sign in to comment.