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

change MatchType (Try to fix BadType)

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