Commit 2c52955e authored by Nawasan Wisitsingkhon's avatar Nawasan Wisitsingkhon

packet_out change port_id to in_port

parent 289482a9
...@@ -14,7 +14,7 @@ use super::{flow_mod::SizeCheck, FlowAction, Payload}; ...@@ -14,7 +14,7 @@ use super::{flow_mod::SizeCheck, FlowAction, Payload};
pub struct PacketOutEvent { pub struct PacketOutEvent {
pub payload: Payload, pub payload: Payload,
pub port_id: Option<u16>, pub in_port: Option<u16>,
pub actions: Vec<FlowAction>, pub actions: Vec<FlowAction>,
} }
...@@ -24,7 +24,7 @@ impl MessageMarshal for PacketOutEvent { ...@@ -24,7 +24,7 @@ impl MessageMarshal for PacketOutEvent {
Payload::Buffered(n, _) => n as i32, Payload::Buffered(n, _) => n as i32,
Payload::NoBuffered(_) => -1, Payload::NoBuffered(_) => -1,
}); });
match self.port_id { match self.in_port {
Some(id) => { Some(id) => {
PseudoPort::PhysicalPort(id).marshal(bytes); PseudoPort::PhysicalPort(id).marshal(bytes);
} }
...@@ -53,9 +53,9 @@ impl MessageMarshal for PacketOutEvent { ...@@ -53,9 +53,9 @@ impl MessageMarshal for PacketOutEvent {
} }
impl 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 { Self {
port_id, in_port,
payload, payload,
actions, actions,
} }
...@@ -82,7 +82,7 @@ impl PacketOutEvent { ...@@ -82,7 +82,7 @@ impl PacketOutEvent {
Payload::Buffered(n as u32, bytes.fill_buf().unwrap().to_ascii_lowercase()) Payload::Buffered(n as u32, bytes.fill_buf().unwrap().to_ascii_lowercase())
} }
}, },
port_id: { in_port: {
if in_port == OfpPort::None as u16 { if in_port == OfpPort::None as u16 {
None None
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment