-
-
Notifications
You must be signed in to change notification settings - Fork 570
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved Netflow timeout to external header file as we use it for IPFIX
- Loading branch information
1 parent
f914ba7
commit 4e710fd
Showing
2 changed files
with
18 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,14 @@ | ||
// ISC license header | ||
|
||
/* | ||
* Copyright (c) 2004,2005 Damien Miller <[email protected]> | ||
* | ||
* Permission to use, copy, modify, and distribute this software for any | ||
* purpose with or without fee is hereby granted, provided that the above | ||
* copyright notice and this permission notice appear in all copies. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
*/ | ||
|
||
// Netflow packet definitions | ||
|
||
#pragma once | ||
|
||
#include <string> | ||
#include <cstdint> | ||
#include <optional> | ||
#include <string> | ||
|
||
enum class netflow_protocol_version_t { netflow_v5, netflow_v9, ipfix }; | ||
|
||
/* | ||
* These are Cisco Netflow(tm) packet formats | ||
* Based on: | ||
* http://www.cisco.com/univercd/cc/td/doc/product/rtrmgmt/nfc/nfc_3_0/nfc_ug/nfcform.htm | ||
*/ | ||
|
||
/* Common header fields */ | ||
// Common header fields | ||
class __attribute__((__packed__)) netflow_header_common_t { | ||
public: | ||
uint16_t version = 0; | ||
|
@@ -44,3 +21,18 @@ class interface_id_to_name_t { | |
uint32_t interface_id = 0; | ||
std::string interface_description{}; | ||
}; | ||
|
||
// Active timeout for IPFIX | ||
class device_timeouts_t { | ||
public: | ||
// Both values use seconds | ||
std::optional<uint32_t> active_timeout = 0; | ||
std::optional<uint32_t> inactive_timeout = 0; | ||
|
||
bool operator!=(const device_timeouts_t& rhs) const { | ||
return !(*this == rhs); | ||
} | ||
|
||
// We generate default == operator which compares each field in class using standard compare operators for each class | ||
bool operator==(const device_timeouts_t& rhs) const = default; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters