summaryrefslogtreecommitdiffstats
path: root/src/flow_stat_parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/flow_stat_parser.cpp')
-rw-r--r--src/flow_stat_parser.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/flow_stat_parser.cpp b/src/flow_stat_parser.cpp
index 602ef310..deae7062 100644
--- a/src/flow_stat_parser.cpp
+++ b/src/flow_stat_parser.cpp
@@ -119,6 +119,20 @@ int CFlowStatParser::set_ip_id(uint32_t new_id) {
return -1;
}
+int CFlowStatParser::get_l3_proto(uint16_t &proto) {
+ if (m_ipv4) {
+ proto = EthernetHeader::Protocol::IP;
+ return 0;
+ }
+
+ if (m_ipv6) {
+ proto = EthernetHeader::Protocol::IPv6;
+ return 0;
+ }
+
+ return -1;
+}
+
int CFlowStatParser::get_l4_proto(uint8_t &proto) {
if (m_ipv4) {
proto = m_ipv4->getProtocol();