separate bsn_port_counter from bsn_vlan_counter
diff --git a/c_gen/c_test_gen.py b/c_gen/c_test_gen.py
index 83fa4a3..67f4a02 100644
--- a/c_gen/c_test_gen.py
+++ b/c_gen/c_test_gen.py
@@ -132,7 +132,11 @@
classes = ["of_bsn_lacp_stats_request",
"of_bsn_lacp_stats_reply",
"of_bsn_switch_pipeline_stats_request",
- "of_bsn_switch_pipeline_stats_reply"]
+ "of_bsn_switch_pipeline_stats_reply",
+ "of_bsn_port_counter_stats_request",
+ "of_bsn_port_counter_stats_reply",
+ "of_bsn_vlan_counter_stats_request",
+ "of_bsn_vlan_counter_stats_reply",]
if (cls in classes and (
m_name == "experimenter" or
diff --git a/c_gen/c_type_maps.py b/c_gen/c_type_maps.py
index 43cd4a8..84fba41 100644
--- a/c_gen/c_type_maps.py
+++ b/c_gen/c_type_maps.py
@@ -1076,6 +1076,16 @@
of_message_stats_experimenter_id_set(msg, OF_EXPERIMENTER_ID_BSN);
of_message_stats_experimenter_subtype_set(msg, 6);
break;
+ case OF_BSN_PORT_COUNTER_STATS_REQUEST:
+ case OF_BSN_PORT_COUNTER_STATS_REPLY:
+ of_message_stats_experimenter_id_set(msg, OF_EXPERIMENTER_ID_BSN);
+ of_message_stats_experimenter_subtype_set(msg, 7);
+ break;
+ case OF_BSN_VLAN_COUNTER_STATS_REQUEST:
+ case OF_BSN_VLAN_COUNTER_STATS_REPLY:
+ of_message_stats_experimenter_id_set(msg, OF_EXPERIMENTER_ID_BSN);
+ of_message_stats_experimenter_subtype_set(msg, 8);
+ break;
default:
break;
}
diff --git a/c_gen/templates/loci_show.h b/c_gen/templates/loci_show.h
index 70f18d5..6885d4e 100644
--- a/c_gen/templates/loci_show.h
+++ b/c_gen/templates/loci_show.h
@@ -236,7 +236,13 @@
#define LOCI_SHOW_u32_supported(writer, cookie, val) LOCI_SHOW_x32(writer, cookie, val)
#define LOCI_SHOW_u32_peer(writer, cookie, val) LOCI_SHOW_x32(writer, cookie, val)
#define LOCI_SHOW_u64_rx_packets(writer, cookie, val) LOCI_SHOW_u64(writer, cookie, val)
+#define LOCI_SHOW_u64_rx_packets_unicast(writer, cookie, val) LOCI_SHOW_u64(writer, cookie, val)
+#define LOCI_SHOW_u64_rx_packets_multicast(writer, cookie, val) LOCI_SHOW_u64(writer, cookie, val)
+#define LOCI_SHOW_u64_rx_packets_broadcast(writer, cookie, val) LOCI_SHOW_u64(writer, cookie, val)
#define LOCI_SHOW_u64_tx_packets(writer, cookie, val) LOCI_SHOW_u64(writer, cookie, val)
+#define LOCI_SHOW_u64_tx_packets_unicast(writer, cookie, val) LOCI_SHOW_u64(writer, cookie, val)
+#define LOCI_SHOW_u64_tx_packets_multicast(writer, cookie, val) LOCI_SHOW_u64(writer, cookie, val)
+#define LOCI_SHOW_u64_tx_packets_broadcast(writer, cookie, val) LOCI_SHOW_u64(writer, cookie, val)
#define LOCI_SHOW_u64_rx_bytes(writer, cookie, val) LOCI_SHOW_u64(writer, cookie, val)
#define LOCI_SHOW_u64_tx_bytes(writer, cookie, val) LOCI_SHOW_u64(writer, cookie, val)
#define LOCI_SHOW_u64_rx_dropped(writer, cookie, val) LOCI_SHOW_u64(writer, cookie, val)
@@ -365,4 +371,6 @@
#define LOCI_SHOW_u16_partner_key(writer, cookie, val) LOCI_SHOW_u16(writer, cookie, val)
#define LOCI_SHOW_u64_time_ms(writer, cookie, val) LOCI_SHOW_u64(writer, cookie, val)
+
+
#endif /* _LOCI_SHOW_H_ */
diff --git a/c_gen/templates/of_type_maps.c b/c_gen/templates/of_type_maps.c
index fa3e05c..634376e 100644
--- a/c_gen/templates/of_type_maps.c
+++ b/c_gen/templates/of_type_maps.c
@@ -871,6 +871,8 @@
switch (subtype) {
case 1: return OF_BSN_LACP_STATS_REQUEST;
case 6: return OF_BSN_SWITCH_PIPELINE_STATS_REQUEST;
+ case 7: return OF_BSN_PORT_COUNTER_STATS_REQUEST;
+ case 8: return OF_BSN_VLAN_COUNTER_STATS_REQUEST;
}
}
return OF_OBJECT_INVALID;
@@ -884,6 +886,8 @@
switch (subtype) {
case 1: return OF_BSN_LACP_STATS_REPLY;
case 6: return OF_BSN_SWITCH_PIPELINE_STATS_REPLY;
+ case 7: return OF_BSN_PORT_COUNTER_STATS_REPLY;
+ case 8: return OF_BSN_VLAN_COUNTER_STATS_REPLY;
}
}
return OF_OBJECT_INVALID;
diff --git a/c_gen/type_maps.py b/c_gen/type_maps.py
index 14e7048..6ae0b11 100644
--- a/c_gen/type_maps.py
+++ b/c_gen/type_maps.py
@@ -269,7 +269,9 @@
port_desc = 13,
experimenter = 0xffff,
bsn_lacp = 0xffff,
- bsn_switch_pipeline = 0xffff
+ bsn_switch_pipeline = 0xffff,
+ bsn_port_counter = 0xffff,
+ bsn_vlan_counter = 0xffff
)
}
@@ -458,6 +460,8 @@
"of_bsn_stats_reply",
"of_bsn_lacp_stats_reply",
"of_bsn_switch_pipeline_stats_reply",
+ "of_bsn_port_counter_stats_reply",
+ "of_bsn_vlan_counter_stats_reply",
]
stats_request_list = [
@@ -479,6 +483,8 @@
"of_bsn_stats_request",
"of_bsn_lacp_stats_request",
"of_bsn_switch_pipeline_stats_request",
+ "of_bsn_port_counter_stats_request",
+ "of_bsn_vlan_counter_stats_request",
]
flow_mod_list = [
diff --git a/openflow_input/bsn_counter b/openflow_input/bsn_port_counter
similarity index 62%
rename from openflow_input/bsn_counter
rename to openflow_input/bsn_port_counter
index 45242b1..f9ebaa7 100644
--- a/openflow_input/bsn_counter
+++ b/openflow_input/bsn_port_counter
@@ -34,10 +34,6 @@
of_port_no_t port_no;
};
-struct of_bsn_vlan_entry {
- uint16_t vlan_id;
-};
-
struct of_bsn_port_counter_stats_request : of_bsn_stats_request {
uint8_t version;
uint8_t type == 18;
@@ -51,41 +47,21 @@
list(of_bsn_port_entry_t) port_entries; //if port_entries is empty, reply counters of all ports.
};
-struct of_bsn_vlan_counter_stats_request : of_bsn_stats_request {
- uint8_t version;
- uint8_t type == 18;
- uint16_t length;
- uint32_t xid;
- uint16_t stats_type == 0xffff;
- enum ofp_stats_request_flags flags;
- pad(4);
- uint32_t experimenter == 0x5c16c7;
- uint32_t subtype == 9;
- list(of_bsn_vlan_entry_t) vlan_entries; //if vlan_entries is empty, reply counters of all vlans.
-};
-
struct of_bsn_port_counter_stats_entry {
of_port_no_t port_no;
- uint32_t rx_bytes;
- uint32_t rx_packets_unicast;
- uint32_t rx_packets_broadcast;
- uint32_t rx_packets_multicast;
- uint32_t rx_drops;
- uint32_t rx_errors;
- uint32_t tx_bytes;
- uint32_t tx_packets_unicast;
- uint32_t tx_packets_broadcast;
- uint32_t tx_packets_multicast;
- uint32_t tx_drops;
- uint32_t tx_errors;
-};
-
-struct of_bsn_vlan_counter_stats_entry {
- uint16_t vlan_id;
- uint32_t rx_bytes;
- uint32_t rx_packets;
- uint32_t tx_bytes;
- uint32_t tx_packets;
+ pad(4);
+ uint64_t rx_bytes;
+ uint64_t rx_packets_unicast;
+ uint64_t rx_packets_broadcast;
+ uint64_t rx_packets_multicast;
+ uint64_t rx_dropped;
+ uint64_t rx_errors;
+ uint64_t tx_bytes;
+ uint64_t tx_packets_unicast;
+ uint64_t tx_packets_broadcast;
+ uint64_t tx_packets_multicast;
+ uint64_t tx_dropped;
+ uint64_t tx_errors;
};
struct of_bsn_port_counter_stats_reply : of_bsn_stats_reply {
@@ -100,16 +76,3 @@
uint32_t subtype == 8;
list(of_bsn_port_counter_stats_entry_t) port_counter_entries;
};
-
-struct of_bsn_vlan_counter_stats_reply : of_bsn_stats_reply {
- uint8_t version;
- uint8_t type == 19;
- uint16_t length;
- uint32_t xid;
- uint16_t stats_type == 0xffff;
- enum ofp_stats_reply_flags flags;
- pad(4);
- uint32_t experimenter == 0x5c16c7;
- uint32_t subtype == 9;
- list(of_bsn_vlan_counter_stats_entry_t) vlan_counter_entries;
-};
diff --git a/openflow_input/bsn_counter b/openflow_input/bsn_vlan_counter
similarity index 61%
copy from openflow_input/bsn_counter
copy to openflow_input/bsn_vlan_counter
index 45242b1..b775df4 100644
--- a/openflow_input/bsn_counter
+++ b/openflow_input/bsn_vlan_counter
@@ -30,25 +30,8 @@
#version 4
-struct of_bsn_port_entry {
- of_port_no_t port_no;
-};
-
struct of_bsn_vlan_entry {
- uint16_t vlan_id;
-};
-
-struct of_bsn_port_counter_stats_request : of_bsn_stats_request {
- uint8_t version;
- uint8_t type == 18;
- uint16_t length;
- uint32_t xid;
- uint16_t stats_type == 0xffff;
- enum ofp_stats_request_flags flags;
- pad(4);
- uint32_t experimenter == 0x5c16c7;
- uint32_t subtype == 8;
- list(of_bsn_port_entry_t) port_entries; //if port_entries is empty, reply counters of all ports.
+ uint16_t vlan_vid;
};
struct of_bsn_vlan_counter_stats_request : of_bsn_stats_request {
@@ -64,41 +47,14 @@
list(of_bsn_vlan_entry_t) vlan_entries; //if vlan_entries is empty, reply counters of all vlans.
};
-struct of_bsn_port_counter_stats_entry {
- of_port_no_t port_no;
- uint32_t rx_bytes;
- uint32_t rx_packets_unicast;
- uint32_t rx_packets_broadcast;
- uint32_t rx_packets_multicast;
- uint32_t rx_drops;
- uint32_t rx_errors;
- uint32_t tx_bytes;
- uint32_t tx_packets_unicast;
- uint32_t tx_packets_broadcast;
- uint32_t tx_packets_multicast;
- uint32_t tx_drops;
- uint32_t tx_errors;
-};
-
struct of_bsn_vlan_counter_stats_entry {
- uint16_t vlan_id;
- uint32_t rx_bytes;
- uint32_t rx_packets;
- uint32_t tx_bytes;
- uint32_t tx_packets;
-};
-
-struct of_bsn_port_counter_stats_reply : of_bsn_stats_reply {
- uint8_t version;
- uint8_t type == 19;
- uint16_t length;
- uint32_t xid;
- uint16_t stats_type == 0xffff;
- enum ofp_stats_reply_flags flags;
- pad(4);
- uint32_t experimenter == 0x5c16c7;
- uint32_t subtype == 8;
- list(of_bsn_port_counter_stats_entry_t) port_counter_entries;
+ uint16_t vlan_vid;
+ pad(2);
+ pad(4);
+ uint64_t rx_bytes;
+ uint64_t rx_packets;
+ uint64_t tx_bytes;
+ uint64_t tx_packets;
};
struct of_bsn_vlan_counter_stats_reply : of_bsn_stats_reply {