Commit 746c46b8 authored by Nawasan Wisitsingkhon's avatar Nawasan Wisitsingkhon

change MatchType (Try to fix BadType)

parent 5353dd2e
...@@ -127,7 +127,7 @@ impl Controller13 { ...@@ -127,7 +127,7 @@ impl Controller13 {
stream: &mut TcpStream, stream: &mut TcpStream,
) { ) {
self.send_msg( self.send_msg(
FlowModEvent::add_flow(10, flow, actions.clone(), table_id, buffer_id), FlowModEvent::add_flow(priority, flow, actions.clone(), table_id, buffer_id),
xid, xid,
stream, stream,
) )
......
...@@ -9,9 +9,9 @@ use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt}; ...@@ -9,9 +9,9 @@ use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt};
use crate::etherparser::MacAddr; use crate::etherparser::MacAddr;
/** /**
* +---------- ----+- -------------+---------------------------+ * +---------------+---------------+---------------------------+
* | Type | Length | OXM Fields | * | Type | Length | OXM Fields |
* +----- ---------+--- -----------+---------------------------+ * +---------------+---------------+---------------------------+
* | (Optional) | (16 bits) | (Array of variable length)| * | (Optional) | (16 bits) | (Array of variable length)|
* |---------------+---------------+---------------------------+ * |---------------+---------------+---------------------------+
*/ */
...@@ -25,7 +25,7 @@ pub struct OfpMatch { ...@@ -25,7 +25,7 @@ pub struct OfpMatch {
impl OfpMatch { impl OfpMatch {
pub fn new() -> Self { pub fn new() -> Self {
Self { Self {
typ: MatchType::OXM, typ: MatchType::Standard,
length: 4, length: 4,
oxm_fields: Vec::new(), oxm_fields: Vec::new(),
} }
...@@ -33,6 +33,7 @@ impl OfpMatch { ...@@ -33,6 +33,7 @@ impl OfpMatch {
pub fn marshal(&self, bytes: &mut Vec<u8>) { pub fn marshal(&self, bytes: &mut Vec<u8>) {
bytes.write_u16::<BigEndian>(self.typ.clone().into()); bytes.write_u16::<BigEndian>(self.typ.clone().into());
bytes.write_u16::<BigEndian>(self.length + (self.oxm_fields.len() as u16)); bytes.write_u16::<BigEndian>(self.length + (self.oxm_fields.len() as u16));
bytes.write_u32::<BigEndian>(0);
bytes.append(&mut self.oxm_fields.clone()); bytes.append(&mut self.oxm_fields.clone());
} }
} }
......
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