summaryrefslogtreecommitdiffstats
path: root/src/flow_stat_parser.h
diff options
context:
space:
mode:
authorIdo Barnea <ibarnea@cisco.com>2016-03-24 16:28:31 +0200
committerIdo Barnea <ibarnea@cisco.com>2016-03-27 17:18:30 +0300
commit4099c61aa62c699abbb2769472862d088381db85 (patch)
tree6cfd428293f9b5443b5f1e7ff82702df2ff5db69 /src/flow_stat_parser.h
parent3804a5dd52975a9a6fd3ff094ae16593bfeb2303 (diff)
Added flow parser for 82599 10G card. Added exceptions for flow stat
errors
Diffstat (limited to 'src/flow_stat_parser.h')
-rw-r--r--src/flow_stat_parser.h36
1 files changed, 25 insertions, 11 deletions
diff --git a/src/flow_stat_parser.h b/src/flow_stat_parser.h
index 606a1bec..8c9e1418 100644
--- a/src/flow_stat_parser.h
+++ b/src/flow_stat_parser.h
@@ -19,19 +19,33 @@
limitations under the License.
*/
-class Cxl710Parser {
+#ifndef __FLOW_STAT_PARSER_H__
+#define __FLOW_STAT_PARSER_H__
+
+// Basic flow stat parser. Relevant for xl710/x710/x350 cards
+#include "common/Network/Packet/IPHeader.h"
+
+class CFlowStatParser {
public:
- Cxl710Parser();
- void reset();
- int parse(uint8_t *pkt, uint16_t len);
- bool is_fdir_supported() {return m_fdir_supported == true;};
- int get_ip_id(uint16_t &ip_id);
- int set_ip_id(uint16_t ip_id);
- int get_l4_proto(uint8_t &proto);
- int test();
+ virtual ~CFlowStatParser() {};
+ virtual void reset();
+ virtual int parse(uint8_t *pkt, uint16_t len);
+ virtual bool is_stat_supported() {return m_stat_supported == true;};
+ virtual int get_ip_id(uint16_t &ip_id);
+ virtual int set_ip_id(uint16_t ip_id);
+ virtual int get_l4_proto(uint8_t &proto);
+ virtual int test();
- private:
+ protected:
IPHeader *m_ipv4;
- bool m_fdir_supported;
+ bool m_stat_supported;
uint8_t m_l4_proto;
};
+
+class C82599Parser : public CFlowStatParser {
+ public:
+ ~C82599Parser() {};
+ int parse(uint8_t *pkt, uint16_t len);
+};
+
+#endif